04 January 2015

Playing with Oracle 12c

Parameters - Oracle 12c container database has some changes when we talk about parameters. For example, there is no SPFILE for a pluggable database!

[oracle@prac12c dbs]$ cd $ORACLE_HOME/dbs
[oracle@prac12c dbs]$ ls
  hc_FUSCDB.dat  initFUSCDB.ora  init.ora  lkFUSCDB  orapwFUSCDB  spfileFUSCDB.ora


Trying to change the parameter open_cursors within PDB, this change will have no impact in the CDB -

Logon to CDB and verify the value:

SQL> sho con_name  

CON_NAME
------------------------------
CDB$ROOT
SQL> sho parameter open_cursors

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
open_cursors                         integer     300


Logging into PDB -

SQL> conn sys@PDB01 as sysdba
Enter password: 
Connected.
SQL> 
SQL> sho con_name

CON_NAME
------------------------------
PDB01
SQL> sho parameter open_cursor

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
open_cursors                         integer     300
SQL> 


Try changing this value in PDB at SPfile and Memory level and you will notice that value at root will still be the original value. However the question remains as to where the changed value is stored as there is no SPfile for PDB.

SQL> alter system set open_cursors=800 scope=BOTH;

System altered.

SQL> sho con_name

CON_NAME
------------------------------
PDB01

SQL> sho parameter open_cursor

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
open_cursors                         integer     800
SQL> conn / as sysdba
Connected.
SQL> sho con_name

CON_NAME
------------------------------
CDB$ROOT
SQL> sho parameter open_cursor

NAME                                 TYPE        VALUE
------------------------------------ ----------- -------
open_cursors                         integer     300


Changed values are stored in v$system_parameter -

SQL> select name, con_id, value from v$system_parameter where name='open_cursors';

NAME                                                                                 CON_ID
-------------------------------------------------------------------------------- ----------
VALUE
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
open_cursors                                                                              0
300

open_cursors                                                                              3
800

07 December 2014

Install Oracle Fusion Middleware on Oracle 12C Container database


How to install FMW on 12c -

1. Limitation - Cannot run RCU directly on CDB database, may receive below error and the RCU creation will fail with the below error in rcu log: 


ORA-65096 invalid common user or role name with RCU

File:/…/…/rcuHome/rcu/integration/../mds_user.sql


Cause - cannot Run RCU on CDB database directly. Create PDB for running Fusion Middleware separately.

Solution -Create separate PDB for FMW install as shown below:

    CON_ID       DBID    CON_UID GUID
---------- ---------- ---------- --------------------------------
NAME                           OPEN_MODE  RES
------------------------------ ---------- ---
OPEN_TIME
---------------------------------------------------------------------------
CREATE_SCN TOTAL_SIZE
---------- ----------
         3 3925402302 3925402302 0815A8F30BE5186FE0538C02A8C0712E
PDB01                          MOUNTED

   1910872          0


SQL> alter pluggable database PDB01 open read write;

Pluggable database altered.



SQL> SELECT name, open_mode FROM v$pdbs;

NAME                           OPEN_MODE
------------------------------ ----------
PDB$SEED                       READ ONLY
PDB01                          READ WRITE



Issue 2 - 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Error:  XATRANS Views are not installed on this Database. This is required by the OIM Schema
  Action: Install view XAVIEWS as SYS user on this Database.
          Refer to the Oracle Database Release Documentation for installation details.


Solution - Fix the issue by installing the package on the PDB database as shown below - 

[oracle@prac12c admin]$ sqlplus /nolog

SQL*Plus: Release 12.1.0.1.0 Production on Sun Dec 7 21:10:57 2014

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

SQL> connect SYS@PDB01 as sysdba
Enter password: 
Connected.
SQL> @?/rdbms/admin/xaview.sql
DROP VIEW d$xatrans$
*
ERROR at line 1:
ORA-00942: table or view does not exist


DROP VIEW d$pending_xatrans$
*
ERROR at line 1:
ORA-00942: table or view does not exist



View created.


Synonym created.


View created.


Synonym created.


Issue 3 -

The 'Secure Files' option is not set in the target database.  Please set the db_securefile parmater to 'PERMITTED' before continuing.


Solution -

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_securefile                        string      PREFERRED
SQL> alter system set db_securefile=PERMITTED scope=BOTH;

System altered.

SQL> sho parameter db_securefile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_securefile                        string      PERMITTED










20 November 2013

Oracle 11gR2 Real Application testing (RAT) using SPA


In todays post, we explain how to create SQL Plan Analyzer using API ( we could use OEM as well ) SQLPA is very useful to analyze various performance data before and after a change for example an upgrade or an addition of index etc.
The broad overview of steps would be:
1. Create User for SPA on 10g:
2. Run the SQL Qs on 10g Database:
3. Create SQL Tuning set:
4. Start the capture using cursor (We can do it with AWR as well )
5. To run the Advisor on SQL tuning sets owned by other users, you must have the ADMINISTER ANY SQL TUNING SET privilege.
6. Create Staging table on 10g database used for storing SQL Tuning Sets as SPA_TRIAL.
7. Use PACK_STGTAB_SQLSET procedure to export SQL tuning sets into the staging table. 8. Export and import the Table to 11g database
9. Copy and Import onto 11g database.
10. Use the UNPACK_STGTAB_SQLSET procedure to import SQL Tuning Sets from the staging table
11. Create SPA and associate this with STS ( Imported earlier ):
12. Create a public database link from 11g to 10g:
13. Test Execution in 10g using DB_Link to 10g database from 11g DB
14. Test Execution in 11g locally for same tuning set
15. Execute the Comparison report based on some metric (ex Elapsed_time)
16. Generate the SPA Report
Detail Steps are below: Please note that we could use this 1. Create User for SPA on 10g:

SQL> create user spa_spatrial identified by XXXX default tablespace users;

User created.


SQL> grant connect,resource,dba to spa_spatrial;

Grant succeeded.

SQL> grant create session, create any table to spa_spatrial;


Grant succeeded.



2. Run the SQL Qs on 10g Database:


SQL> select inst_id, sid, serial# from gv$session where username='USER01';



INST_ID SID SERIAL#

---------- ---------- ----------

1 249 39887

1 254 49671

1 272 25686

1 255 41876

1 236 39118


3. Create Tuning set:


BEGIN

DBMS_SQLTUNE.CREATE_SQLSET(

sqlset_name => 'SPATrial01_vij',

description => 'SQL tuning set for 10g Processing Trial - Vij');

END;

/



SQL> BEGIN

DBMS_SQLTUNE.CREATE_SQLSET(

sqlset_name => 'SPATrial01_vij',

description => 'SQL tuning set for 10g Processing Trial - Vij');

END;

/ 2 3 4 5 6



PL/SQL procedure successfully completed.



4. Start the capture using cursor, we could using other options


EXEC DBMS_SQLTUNE.CAPTURE_CURSOR_CACHE_SQLSET(sqlset_name => 'SPATrial01_vij', time_limit => 3600, repeat_interval => 300);



PL/SQL procedure successfully completed.


SQL> select name, owner, statement_count from dba_sqlset;



NAME OWNER STATEMENT_COUNT

------------------------------ ------------------------------ ---------------

SPATrial01_vij SYS 451

SPATrial01 SYS 426



5. To run the Advisor on SQL tuning sets owned by other users, you must have the ADMINISTER ANY SQL TUNING SET privilege.



SQL> grant ADMINISTER ANY SQL TUNING SET to SPA_spatrial;



Grant succeeded.


6. Create Staging table on 10g database used for storing SQL Tuning Sets as SPA_spatrial.

BEGIN

DBMS_SQLTUNE.CREATE_STGTAB_SQLSET( table_name => 'STSTAB' );

END;

/


SQL> sho user

USER is "SPA_spatrial"



SQL>

SQL> BEGIN

DBMS_SQLTUNE.CREATE_STGTAB_SQLSET( table_name => 'STSTAB' );

END;

/ 2 3 4



PL/SQL procedure successfully completed.


7. Use PACK_STGTAB_SQLSET procedure to export SQL tuning sets into the staging table.



BEGIN

DBMS_SQLTUNE.PACK_STGTAB_SQLSET(

sqlset_name => 'SPATrial01_vij',

staging_table_name => 'STSTAB',

sqlset_owner => 'SYS');

END;

/

SQL> sho user

USER is "SPA_spatrial"

SQL> BEGIN

DBMS_SQLTUNE.PACK_STGTAB_SQLSET(

sqlset_name => 'SPATrial01_vij',

staging_table_name => 'STSTAB',

sqlset_owner => 'SYS');

END;

/

2 3 4 5 6 7



PL/SQL procedure successfully completed.


Verify:
SQL> SQL> select count(*) from STSTAB;

COUNT(*)

----------

451





8. Export and import the Table to 11g database



expdp parfile=SQL_TUNINGSET_EXP.par


9. Copy and Import onto 11g database.



10. Use the UNPACK_STGTAB_SQLSET procedure to import SQL Tuning Sets from the staging table



BEGIN

DBMS_SQLTUNE.UNPACK_STGTAB_SQLSET(

sqlset_name => 'SPATrial01_vij',

replace => TRUE,

staging_table_name => 'STSTAB');

END;

/


SQL> sho user

USER is "SYS"

SQL> BEGIN

DBMS_SQLTUNE.UNPACK_STGTAB_SQLSET(

sqlset_name => 'SPATrial01_vij',

replace => TRUE,

staging_table_name => 'STSTAB');

END;

/

2 3 4 5 6 7



PL/SQL procedure successfully completed.


Verify on 11g:



SQL> SQL> select count(*) from STSTAB;



COUNT(*)

----------

451



SQL>

SQL> select name, owner, statement_count from dba_sqlset;



NAME OWNER STATEMENT_COUNT

------------------------------ ------------------------------ ---------------

SPATrial01 SYS 426

SPATrial01_vij SYS 451




11. Create SPA and associate this with STS ( Imported earlier ):



SQL> VARIABLE t_name VARCHAR2(100);

SQL> EXEC :t_name := DBMS_SQLPA.CREATE_ANALYSIS_TASK(sqlset_name => 'SPATrial01_vij', task_name => 'spatrial_spa1');



PL/SQL procedure successfully completed.





12. Create a public database link from 11g to 10g:


create public database link SPA_11G_10G connect to SPA_spatrial identified by SPA_spatrial using

'(DESCRIPTION = (ADDRESS_LIST = (LOAD_BALANCE = yes) (FAILOVER = on) (ADDRESS = (PROTOCOL = TCP)(HOST = pracdba.blog.com)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = pracdba2.blog.com)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = PRAC_PRIM) (FAILOVER_MODE= (TYPE=SESSION) (METHOD=BASIC))))';



SQL> create public database link SPA_11G_10G connect to SPA_spatrial identified by SPA_spatrial using

'(DESCRIPTION = (ADDRESS_LIST = (LOAD_BALANCE = yes) (FAILOVER = on) (ADDRESS = (PROTOCOL = TCP)(HOST = pracdba.blog.com)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = pracdba2.blog.com)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = TSE1DWHS_PRIM) (FAILOVER_MODE= (TYPE=SESSION) (METHOD=BASIC))))'; 2



Database link created.


13. Test Execution in 10g

begin

DBMS_SQLPA.EXECUTE_ANALYSIS_TASK(

task_name => 'spatrial_spa1',

execution_type => 'TEST EXECUTE',

execution_name => 'spatrial_10g',

execution_params => dbms_advisor.arglist('DATABASE_LINK', 'SPA_11G_10G'));

end;

/


SQL> grant execute on SYS.DBMS_SQLPA to SPA_spatrial;



Grant succeeded.



SQL> begin

DBMS_SQLPA.EXECUTE_ANALYSIS_TASK(

task_name => 'spatrial_spa1',

execution_type => 'TEST EXECUTE',

execution_name => 'spatrial_10g',

execution_params => dbms_advisor.arglist('DATABASE_LINK', 'SPA_11G_10G'));

end; 2 3 4 5 6 7

8 /


14. Test Execution in 11g



begin

DBMS_SQLPA.EXECUTE_ANALYSIS_TASK(

task_name => 'spatrial_spa1',

execution_type => 'TEST EXECUTE',

execution_name => 'spatrial_11g');

end;

/


SQL> begin

DBMS_SQLPA.EXECUTE_ANALYSIS_TASK(

task_name => 'spatrial_spa1',

execution_type => 'TEST EXECUTE',

execution_name => 'spatrial_11g');

end;

/ 2 3 4 5 6 7



PL/SQL procedure successfully completed.



15. Execute the Comparison report


begin

DBMS_SQLPA.EXECUTE_ANALYSIS_TASK(

task_name => 'spatrial_spa1',

execution_type => 'COMPARE PERFORMANCE',

execution_name => 'Compare_elapsed_time',

execution_params => dbms_advisor.arglist('execution_name1', 'spatrial_10g', 'execution_name2', 'spatrial_11g', 'comparison_metric', 'elapsed_time') );

end;

/



SQL> begin

2 DBMS_SQLPA.EXECUTE_ANALYSIS_TASK(

3 task_name => 'spatrial_spa1',

4 execution_type => 'COMPARE PERFORMANCE',

5 execution_name => 'Compare_elapsed_time',

6 execution_params => dbms_advisor.arglist('execution_name1', 'spatrial_10g', 'execution_name2', 'spatrial_11g', 'comparison_metric', 'elapsed_time') );

7 end;

8 /



PL/SQL procedure successfully completed.



16. Generate the SPA Report


set long 100000 longchunksize 100000 linesize 200 head off feedback off echo off

spool spa_report_elapsed_time.html

SELECT dbms_sqlpa.report_analysis_task('spatrial_spa1', 'HTML', 'ALL','ALL', execution_name=>'Compare_elapsed_time') FROM dual;

spool off


Building Pre-Upgrade ( 10g ) SQL Trial from 11g database:


Sample report shows the performance differences between 10g and 11g.


Limitations:

The only limitation i found was with Unsupported SQLs, We cannot view any performance data for these. Working to get around this.


11 August 2012

Import Bulk SSO Users


Please note that I have used this approach to import users from a different OID environment. You will have to replace the exact server details for your export/import commands below

1. Export the users from a different environment:

ldapsearch -h SOURCEHOST -p PORT -D cn=orcladmin -w PASSWORD -L -b "ou=production,cn=users,dc=org" -s sub "objectclass=*" >exp_OU.ldif

2. Get the count of users is Source environment

grep "cn=users" exp_OU.ldif
wc -l


3. Remove the authentication rows from the file

grep -v "authpassword" exp_OU.ldif > PROD_OU.ldif

4. SCP the final export file to the destination

Use SCP or SFTP

5. Import the users using bulk approach

ldapadd -h TARGETHOST -p PORT -D "cn=orcladmin" -w PASSWORD -c -v -f PROD_OU.ldif

You may schedule this in background if numbers of users are high.

Put the above command in a shell script and run it:

nohup "bulkadd.sh" > oidadd.log &

6. Verify the count of Users imported.

grep "cn=users" exp_OU.ldif
wc –l

7. Login as a specific OID user and confirm you can login through OIDDAS

15 July 2012

Agent 's Target Host unavailable

Symptoms:

After the agent install, Agent's target host is not listed in the OEM Console

Reason: Agent is out-of-sync with OMS and several trials of uploading doesn't help/ Agent was reinstalled/moved

Re-synchronization of the agent fails with the error below:

Agent Operation completed with errors. For those targets that could not be saved, please go to the target's monitoring configuration page to save them. All other targets have been saved successfully. Agent has not been unblocked.


Internal Repository Error Message: SQL Exception occured while syncing pdp settings
Exception: java.sql.SQLException: ORA-20206: Target does not exist: agentmachine.domain:host ORA-06512: at "SYSMAN.MGMT_TARGET", line 571 ORA-06512: at "SYSMAN.MGMT_CREDENTIALS_UI", line 303 ORA-06512: at line 1

 
 
Solution:
 
1. Shutdown the agent from the terminal: AGENT_HOME/bin emctl stop agent
 
2. Logon the OEM Console as SYSMAN or the user with Super User privileges.
 
3. Delete the Agent from OEM Console, ( Make sure all the targets monitored by this agent is deleted before-hand)
 
    Home Page --> Targets --> All Targets --> Select Agent from search box --> Agent --> GO
 
     Click the radio button next to the Agent you wish to delete and then select Remove
 
 
4. Confirm that the agent is deleted:
 
   Home Page --> setup --> Management Services and Repository
 
  Scroll down and select Deleted Targets
 
 
5. Re-create the targets.xml
 
  cd $AGENT_HOME/sysman/emd/
 
  cp -p targets.xml targets_old.xml
 
  touch targets.xml
 
 
6. Copy the AgenSeed and WMD_URL from emd.properties file:
 
   cd $AGENT_HOME/emd/config
 
   cat emd.properties | grep agentSeed
 
   agentSeed=207388776
 
  cat emd.properties | grep EMD_URL
 
  EMD_URL=http://pracdbadb033:3872/emd/main/
 
 
7. Fill the targets.xml with the values obtained from emd.props file
 
Targets AGENT_SEED="207388776"


Target TYPE="oracle_emd" NAME="pracdbadb033:3872"/

Target TYPE="host" NAME="pracdbadb033"/>/Targets 







8. Run Agentca from AGENT_HOME/bin

   cd $AGENT_HOME/bin

   agentca -d

  ###################################################


The action configuration is performing

------------------------------------------------------

The plug-in Agent Configuration Assistant is running


9. Secure and start the agent

   cd $AGENT_HOME/bin
    emctl secure agent
 
     emctl start agent

    emctl upload agent


10. Now you should see the Host displayed in the Console.
Performing free port detection on host=pracdbadb033
Performing targets discovery and agent configuration

Starting the agent

AgentPlugIn:agent configuration finished with status = true



The plug-in Agent Configuration Assistant has successfully been performed

------------------------------------------------------

The action configuration has successfully completed

###################################################

 
 

20 March 2012

User unable to login in SSO

OID to FND Sync Issue

If the user is successfully created in OID (Oracle Internet Directory) and is not getting updated in FND(E-business suite) ...

It may be one of the following:

1. Check if the user is not end dated in E-Business suite.

2. Make sure the user information is correct in OID

3. Identify the issue with the link between OID and FND

  A.  On the SSO middle tier, run the ldap command to identify the users GUID:

ldapsearch -v -h -p -D "cn=" -w "" -b "DC" -s sub "uid= *"  uid  orclguid orclactivestartdate orclactiveenddate orclisenabled
You will get the ORCL GUID

B. Get onto the Middle tier of Oracle E-business suite as applmgr(OWNER)
sqlplus apps/
SELECT USER_GUID FROM FND_USER WHERE USER_NAME = '';

C. Compare the GUID from step A and B, if they are different then run the link script below which resets the GUID of the user in FND to NULL
sqlplus apps/

@$FND_TOP/patch/115/sql/fndssouu.sql

PL/SQL procedure successfully completed.


Commit complete.


D. Make sure that the following profile option (in E-Business Suite) is set to Enabled:  Application_SSO_AUTO_LINK_USER

E. Ask the user to relogin and this time the same GUID will be populated.








 

16 March 2012

Trace user(concurrent req) session in oracle(one of the ways)



1. Identify the SID from gv$session and fnd_concurrent req:

SELECT sid,serial# FROM gv$session WHERE paddr LIKE (SELECT addr FROM gv$process WHERE spid=(SELECT oracle_process_id FROM apps.fnd_concurrent_requests WHERE request_id = TO_NUMBER()));


2. Identify the PID of the SID(s) from previous step:

select p.spid from gv$session s, gv$process p where s.sid= and s.paddr=p.addr;


3. Enable Trace using Oradebug.

sqlplus / as sysdba
SQL> oradebug setospid

SQL> oradebug event 10046 trace name context forever, level 12
SQL> oradebug tracefile_name


Leave it for 15-20 (Depends on DBAs decision) mins to fill the trace file.

SQL> oradebug event 10046 trace name context off

4. Take the TKPROF of the trace file genereated in Step 3

tkprof TRACE_FILE_NAME OUTPUT_FILE explain=apps/pass
 
5. Analyze trace file

Gather Stats in Oracle 10g/11g

STATISTICS GATHERING ON DATABASE(ORACLE)

---------------------------------------

Gather statistics on table:
---------------------------

exec fnd_stats.gather_table_stats('SCHEMA',’TABLE’,estimate_percent => 15);


Gather Statistics on the Schema:
-------------------------------
EXEC DBMS_STATS.gather_schema_stats('SCHEMA', estimate_percent => 15);


Gather Statistics on the Index:
-------------------------------
EXEC DBMS_STATS.gather_index_stats('SCOTT', 'EMPLOYEES_PK', estimate_percent => 15);


Gather Statistics on Dictionary:
--------------------------------
EXEC DBMS_STATS.gather_dictionary_stats;


GATHER STATS FOR E-BUSINESS SUITE:
----------------------------------
exec fnd_stats.gather_schema_statistics('SCHEMA') --- For a specific schema

exec fnd_stats.gather_schema_statistics('ALL') --- For all schemas



Verify Stats:
-------------
exec fnd_stats.verify_stats('SCHEMA', 'OBJECT');

Concurrent manager issues - 11i / R12

Inactive/No manager

A concurrent request has a life cycle consisting of the following phases: Pending, Running, and Completed. During each phase, a request has a specific status. Listed below are the possible statuses for each phase:




•Pending Phase - Normal, Standby, Scheduled, Waiting

•Running Phase - Normal, Paused, Resuming, Terminating

•Completed Phase - Normal, Error, Warning, Cancelled, Terminated

•Inactive Phase - Disabled, On Hold, No Manager

If a concurrent request is on hold or unable to run when there are no active manager processes that can run the request, the request is placed in an Inactive phase.



Review the following points when the concurrent request is in Inactive phase with No Manager status.



1. Verify that Internal Concurrent Manager(ICM) is up and running. Use any one navigation mentioned below to check the status details of Internal Manager.

i. Oracle Applications Manager(OAM) > Site Map > Monitoring > Availability > Internal Concurrent Manager > View Status.

OR


ii. System Administrator Responsibility > Concurrent > Manager > Administer

2. Verify that there is at least one active concurrent manager with/without specialization rules that allow the concurrent program to run.



i. Run the following query to check whether any specialization rule defined for any concurrent manager that includes/excludes the concurrent program in question. Query returns 'no rows selected' when there are no Include/Exclude specialization rules of Program type for the given concurrent program.

select 'Concurrent program '

fcp.concurrent_program_name

' is '

decode(fcqc.include_flag,'I','included in ','E','excluded from ')

fcqv.user_concurrent_queue_name specialization_rule_details from fnd_concurrent_queues_vl fcqv,fnd_concurrent_queue_content fcqc,fnd_concurrent_programs fcp where fcqv.concurrent_queue_id=fcqc.concurrent_queue_id and fcqc.type_id=fcp.concurrent_program_id and fcp.concurrent_program_name='';

Note: Program Short Name is visible when the program is queried in concurrent program definition form.

Example:

SQL> select 'Concurrent program '

fcp.concurrent_program_name

' is '

decode(fcqc.include_flag,'I','included in ','E','excluded from ')

fcqv.user_concurrent_queue_name specialization_rule_details from fnd_concurrent_queues_vl fcqv,fnd_concurrent_queue_content fcqc,fnd_concurrent_programs fcp where fcqv.concurrent_queue_id=fcqc.concurrent_queue_id and fcqc.type_id=fcp.concurrent_program_id and fcp.concurrent_program_name='XXRFG3041A';



SPECIALIZATION_RULE_DETAILS

-----------------------------------------------------------------------------

Concurrent program OKCRAQE is included in Contracts Core Concurrent Manager

Concurrent program OKCRAQE is excluded from Standard Manager

From the sample output above, it shows that the OKCRAQE(Listener for Events Queue) concurrent program has been excluded from the Standard Manager and included in Contracts Core Concurrent Manager. That means the concurrent request OKCRAQE can be run only by the Contracts Core Concurrent Manager which should be up and running to run and complete the OKCRAQE concurrent request.
Make sure that Concurrent Manager whose specialization rule includes the concurrent program is up and running.

ii. Ensure that standard concurrent manager is up and running.


Follow the below step only when you have confirmed the previous points and the issue is still remaining as there may be an issue with concurrent request queue view.

3. Manually re-create the concurrent request queue view for concurrent managers by entering the following command as an applmgr user at operating system prompt.

FNDLIBR FND FNDCPBWV apps/pass SYSADMIN 'System Administrator' SYSADMIN
 
 
------------------------------------------------------------------------------------------------------------
 
Pending Standby
 
Check CRM queue,
 
Click on Application developer Responsibility --> Concurrent --> Program
 
Check for incompatibilities by clicking on Incompatibilities button.
 
If scheduled program has a conflict with other program then CRM will make sure to run the pending requests once the conflicting requests are completed

05 December 2011

Performance improvement techniques

Here are the few performance improvement techniques for your oracle database(There are many ways to do the improvement and it depends on the database size, usage, clustering etc..)

1. Implement Parallel degree:


Overview and Benefits of using PX:

Using parallel operations enables multiple processes to work together simultaneously to resolve a single SQL statement.

Consider a full table scan, rather than having a single process to execute it (serially), Oracle can create multiple processes to scan the table in parallel.

Degree of Parallelism (DOP) is the number of processes used to perform the task on a table. The degree can be set while creating the table or while writing the query using hints.

As an example, if we use DOP as 4 for a particular table, then Oracle uses 4 processes to run and 1 process to coordinate the query. This case differs, if we use some type of sort in the query. Oracle will then use 4 more processes to sort them as well.

Oracle supports parallelization for both DDL and DMLs.

Oracle can parallelize the following operations on a table:

1. Select

2. Insert, Update, Delete (with an exception Parallelized only for partitions)

3. Merge

4. Create table as select * ….

5. Create and Rebuild Index

The following operations can also be parallelized:

1. Select distinct

2. Group by

3. Order by

4. Not in

5. Union/Union All

6. Aggregate functions

7. Nested Loops

Parallel execution is enabled by default, Oracle Database computes defaults for these parameters based on the value at database startup of CPU_COUNT and PARALLEL_THREADS_PER_CPU

Starting Oracle 10g onwards, we have a few oracle parameters deprecated with reference to the Parallel execution: PARALLEL_AUTOMATIC_TUNING

Steps needed to implement

1. From the AWR snapshots we can gether information about parallel execution:

PARALLEL_EXECUTION_MESSAGE_SIZE

PARALLEL_MAX_SERVERS

The parameter PARALLEL_MAX_SERVER Specifies the maximum number of parallel execution processes and parallel recovery processes

PARALLEL_MAX_SERVERS is calculated with the following formula:

= CPU_COUNT X PARALLEL_THREADS_PER_CPU X (2 if PGA_AGGREGATE_TARGET > 1 OR 1) X 5

For ex:
= 48 X 2 X 2 X 5

= 960


2. PARALLEL_ADAPTIVE_MULTIUSER parameter is set to TRUE (by default) from 10g onwards; indicate whether the DOP should change with the load. I couldn’t gather this information from the snapshots. Not sure if this is set to false?

3. If parallelism is used then we can set the DOP based on the query complexity

4. We may use NOLOGGING clause to generate less redos? (If the redo generation isn’t that important)

5. Once these parameters are set, we can implement DOP using following methods:

• At the statement level with hints and with the PARALLEL clause

INSERT /*+ PARALLEL(tbl_ins,2) */ INTO tbl_ins

SELECT /*+ PARALLEL(tbl_sel,4) */ * FROM tbl_sel;

• At the session level by issuing the ALTER SESSION FORCE PARALLEL statement

ALTER SESSION FORCE PARALLEL QUERY;

• At the table level in the table's definition

Create table ORDER_LINE_ITEMS

(Invoice_Number NUMBER (12) not null,

Invoice_date DATE not null) parallel 4;

Create table ORDER_LINE_ITEMS

(Invoice_Number NUMBER (12) not null,

Invoice_date DATE not null) parallel 4

as

select /*+parallel (OLD_ORDER_LINE_ITEM,4) */*

From OLD_TABLE_ITEMS;



At the index level in the index's definition

Create index ORDER_KEY on ORDER_LINE_ITEMS (Order_Id, Item_Id)

tablespace idx1

storage (initial 10m next 1m pctincrease 0)

parallel (parallel 5 ) NOLOGGING;

6. If DOP is not specified while running the query, then Oracle takes this value based on CPU_COUNT and PARALLEL_THREADS_PER_CPU as well as makes sure that number of processes does not exceed PARALLEL_MAX_SERVERS.

7. Hence if we have ample number of parallel processes then more queries can be used for parallelism.

8. We need to consider sizing of SHARE_POOL_SIZE since parallel execution needs more memory compared to the serial execution and hence appropriate sizing of Shared pool is very necessary. In our system, we have SGA_TARGET and SGA_MAX_SIZE set which means AUTOMATIC SHARED MEMORY MANAGEMENT is in place. ASMM will take care of the sizing of the memory parameters internally, Appropriate sizes of SGA_TARGET is very critical.

2. Reduce SQL*Net round-trip

Overview and Benefits of using SDU:

DBA can change the frequency and size of network packets using the following (In oracle 10g):

1. SDU, QUEUE_SIZE in tnsnames.ora and listener.ora

2. DEFAULT_SDU_SIZE, tcp.nodelay in sqlnet.ora

Number of round trips can also be reduced by setting ARRAYSIZE in SQL*Plus.

SDU is a buffer that Oracle Net uses to place data before transmitting it across the network. Oracle Net sends the data in the buffer either when requested or when it is full.

The idea of SDU is to resize the network packets sent over network, thereby accommodating more data at once and eventually reducing number of trips.

The ARRAYSIZE gives the amount of records your application fetches at once (like SQL*Plus), using which more rows can be fetched from the database at one time.

Steps needed to implement

1. Increase SDU if it hasn’t been tuned already. The value ranges from 512 to 32767 bytes

SDU needs to be configured at both Client and the Server. SDU can be configured for particular service using tnsnames.ora and listener.ora as explained below:

To configure the client, set the SDU size in the following places:

sqlnet.ora File

For global configuration on the client side, configure the DEFAULT_SDU_SIZE parameter in the sqlnet.ora file:

DEFAULT_SDU_SIZE=32767

Connect Descriptors

For a particular connect descriptor, you can override the current settings in the client side sqlnet.ora file. In a connect descriptor, you specify the SDU parameter for a description.

sales.us.acme.com=

(DESCRIPTION=

(SDU=11280)

(ADDRESS=(PROTOCOL=tcp)(HOST=sales-server)(PORT=1521))

(CONNECT_DATA=

(SERVICE_NAME=sales.us.acme.com))

)

SDU size applies to all Oracle Net protocols.

To configure the database server, set the SDU size in the following places:

sqlnet.ora File

Configure the DEFAULT_SDU_SIZE parameter in the sqlnet.ora file:

DEFAULT_SDU_SIZE=32767

If using shared server processes, set the SDU size in the DISPATCHERS parameter as follows:

DISPATCHERS="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp))(SDU=8192))"

If using dedicated server processes for a database that is registered with the listener through static configuration in the listener.ora file, you can override the current setting in sqlnet.ora:

SID_LIST_listener_name=

(SID_LIST=

(SID_DESC=

(SDU=8192)

(SID_NAME=sales)))

Reference: http://download.oracle.com/docs/cd/B13789_01/network.101/b10775/performance.htm

2. Set the value of DEFAULT_SDU_SIZE in sqlnet.ora . If the DEFAULT_SDU_SIZE parameter is not configured in the sqlnet.ora file, then the default SDU for the client and a dedicated server is 2048 bytes, while for a shared server the default SDU is 32767 bytes

3. ARRAYSIZE – Number of rows fetched per network trip. Default is 15 and valid values are 1 to 5000.

SQL> set arraysize 100;

11 November 2011

Migrate Database from NON-ASM to ASM

Pre Reqs:
1. Make Sure Grid Infra Home is installed and the ASM instance is running on the node
2. Take backup of your database

RMAN\> backup database plus archivelog;
Starting backup at 09-NOV-11
current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=32 device type=DISK
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=4 RECID=1 STAMP=756911083
input archived log thread=1 sequence=5 RECID=2 STAMP=756911271
input archived log thread=1 sequence=6 RECID=3 STAMP=756911547
input archived log thread=1 sequence=7 RECID=4 STAMP=756911661
input archived log thread=1 sequence=8 RECID=5 STAMP=756911790
input archived log thread=1 sequence=9 RECID=6 STAMP=756911976
input archived log thread=1 sequence=10 RECID=7 STAMP=756912183

…………..

………………………….

…………………………………..
piece handle=/u01/app/oracle/flash_recovery_area/PRIM/backupset/2011_11_09/o1_mf_annnn_TAG20111109T202834_7cormmow_.bkp tag=TAG20111109T202834 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 09-NOV-11

Starting Control File and SPFILE Autobackup at 09-NOV-11

piece handle=/u01/app/oracle/flash_recovery_area/PRIM/autobackup/2011_11_09/o1_mf_s_766787318_7cormq6v_.bkp comment=NONE

Finished Control File and SPFILE Autobackup at 09-NOV-11

3. Detemine the names of Current Datafiles and the Controlfiles:

SQL> select file_name from dba_data_files;

FILE_NAME

--------------------------------------------------------------------------------

/u01/app/oracle/oradata/prim/users01.dbf

/u01/app/oracle/oradata/prim/undotbs01.dbf

/u01/app/oracle/oradata/prim/sysaux01.dbf

/u01/app/oracle/oradata/prim/system01.dbf

/u01/app/oracle/oradata/prim/example01.dbf


SQL> select member from v$logfile;
MEMBER

--------------------------------------------------------------------------------

/u01/app/oracle/oradata/prim/redo03.log

/u01/app/oracle/oradata/prim/redo02.log

/u01/app/oracle/oradata/prim/redo01.log



SQL> sho parameter CONTROL
NAME TYPE VALUE

------------------------------------ ----------- ------------------------------

control_file_record_keep_time integer 7

control_files string /u01/app/oracle/oradata/prim/c

ontrol01.ctl, /u01/app/oracle/

flash_recovery_area/prim/contr

ol02.ctl

4. Disk Based Migration
To perform the migration, carry out the following steps:
A. Back up your database files as copies to the ASM disk group.

BACKUP DATABASE
FORMAT '+DATA01' TAG 'ORA_ASM_MIGRATION';

You can perform this backup with multiple channels to improve performance, depending upon your hardware configuration. For example:
run {
Allocate channel prm01 type disk;
Allocate channel prm02 type disk;
Allocate channel prm03 type disk;
BACKUP AS COPY INCREMENTAL LEVEL 0 DATABASE FORMAT '+DATA' TAG 'ORACLE_TO_ASM_MIGRATION';
}

[oracle@dba clust]$ rman target /
Connected to target database: PRIM (DBID=4049196380)

RMAN> run {

Allocate channel prm01 type disk;

Allocate channel prm02 type disk;

Allocate channel prm03 type disk;

BACKUP AS COPY INCREMENTAL LEVEL 0 DATABASE FORMAT '+DATA' TAG 'ORACLE_TO_ASM_MIGRATION';

2> 3> 4> 5> 6> }

using target database control file instead of recovery catalog

allocated channel: prm01

channel prm01: SID=34 device type=DISK



allocated channel: prm02

channel prm02: SID=36 device type=DISK



allocated channel: prm03

channel prm03: SID=30 device type=DISK



Starting backup at 10-DEC-11

channel prm01: starting datafile copy

input datafile file number=00001 name=/u01/app/oracle/oradata/prim/system01.dbf

channel prm02: starting datafile copy

input datafile file number=00002 name=/u01/app/oracle/oradata/prim/sysaux01.dbf

channel prm03: starting datafile copy

input datafile file number=00003 name=/u01/app/oracle/oradata/prim/undotbs01.dbf

output file name=+DATA/prim/datafile/undotbs1.258.769546347 tag=ORACLE_TO_ASM_MIGRATION RECID=14 STAMP=769546368

channel prm03: datafile copy complete, elapsed time: 00:00:45

channel prm03: starting datafile copy

input datafile file number=00005 name=/u01/app/oracle/oradata/prim/example01.dbf

channel prm03: datafile copy complete, elapsed time: 00:00:10

channel prm03: starting datafile copy

input datafile file number=00004 name=/u01/app/oracle/oradata/prim/users01.dbf

output file name=+DATA/prim/datafile/users.260.769546397 tag=ORACLE_TO_ASM_MIGRATION RECID=16 STAMP=769546399

channel prm03: datafile copy complete, elapsed time: 00:00:03

hannel prm03: datafile copy complete, elapsed time: 00:00:45

channel prm03: starting datafile copy

input datafile file number=00005 name=/u01/app/oracle/oradata/prim/example01.dbf

output file name=+DATA/prim/datafile/example.259.769546387 tag=ORACLE_TO_ASM_MIGRATION RECID=15 STAMP=769546393

channel prm03: datafile copy complete, elapsed time: 00:00:10

channel prm03: starting datafile copy

input datafile file number=00004 name=/u01/app/oracle/oradata/prim/users01.dbf

output file name=+DATA/prim/datafile/users.260.769546397 tag=ORACLE_TO_ASM_MIGRATION RECID=16 STAMP=769546399

channel prm03: datafile copy complete, elapsed time: 00:00:03

output file name=+DATA/prim/datafile/sysaux.257.769546345 tag=ORACLE_TO_ASM_MIGRATION RECID=17 STAMP=769546406

channel prm02: datafile copy complete, elapsed time: 00:01:10

output file name=+DATA/prim/datafile/system.256.769546345 tag=ORACLE_TO_ASM_MIGRATION RECID=18 STAMP=769546413

channel prm01: datafile copy complete, elapsed time: 00:01:20

Finished backup at 10-DEC-11



Starting Control File and SPFILE Autobackup at 10-DEC-11

piece handle=/u01/app/oracle/flash_recovery_area/PRIM/autobackup/2011_12_10/o1_mf_s_769546416_7g7bokb6_.bkp comment=NONE

Finished Control File and SPFILE Autobackup at 10-DEC-11

Finished Control File and SPFILE Autobackup at 10-DEC-11

released channel: prm01

released channel: prm02

released channel: prm03


B. Take backup of SPFILE:

run {

BACKUP AS BACKUPSET SPFILE;

RESTORE SPFILE TO "+DATA/spfile";

}

RMAN> run {

BACKUP AS BACKUPSET SPFILE;

RESTORE SPFILE TO "+DATA/spfile";

}2> 3> 4>

Starting backup at 10-DEC-11

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=34 device type=DISK

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

including current SPFILE in backup set

channel ORA_DISK_1: starting piece 1 at 10-DEC-11

channel ORA_DISK_1: finished piece 1 at 10-DEC-11

piece handle=/u01/app/oracle/flash_recovery_area/PRIM/backupset/2011_12_10/o1_mf_nnsnf_TAG20111210T190101_7g7c3gdf_.bkp tag=TAG20111210T190101 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01

Finished backup at 10-DEC-11

Starting Control File and SPFILE Autobackup at 10-DEC-11

piece handle=/u01/app/oracle/flash_recovery_area/PRIM/autobackup/2011_12_10/o1_mf_s_769546864_7g7c3jvv_.bkp comment=NONE

Finished Control File and SPFILE Autobackup at 10-DEC-11
arting restore at 10-DEC-11

using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backup set restore

channel ORA_DISK_1: restoring SPFILE

output file name=+DATA/spfile

channel ORA_DISK_1: reading from backup piece /u01/app/oracle/flash_recovery_area/PRIM/autobackup/2011_12_10/o1_mf_s_769546864_7g7c3jvv_.bkp

channel ORA_DISK_1: piece handle=/u01/app/oracle/flash_recovery_area/PRIM/autobackup/2011_12_10/o1_mf_s_769546864_7g7c3jvv_.bkp tag=TAG20111210T190104

channel ORA_DISK_1: restored backup piece 1

channel ORA_DISK_1: restore complete, elapsed time: 00:00:04

Finished restore at 10-DEC-11

C. Create an init.ora specifying the location of the new SPFILE, and start the instance with it. For example, create ORACLE_HOME/dbs/initprim.ora with the following contents:

SPFILE=+DATA/spfile

D. Shutdown and startup to make sure CONTROL_FILES has taken the latest value.

Before Restart:

SQL> sho parameter CONTROL_FILES;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_files string /u01/app/oracle/oradata/prim/c
ontrol01.ctl, /u01/app/oracle/
flash_recovery_area/prim/contr
ol02.ctl
SQL> startup nomount pfile='/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initprim.ora'
ORACLE instance started.
Total System Global Area 401743872 bytes

Fixed Size 1336820 bytes

Variable Size 343935500 bytes

Database Buffers 50331648 bytes

Redo Buffers 6139904 bytes

SQL> alter system set control_files='+DATA/control01.ctl','+DATA/control02.ctl' scope=spfile sid='*';
System altered.

SQL> startup nomount pfile='/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initprim.ora'

ORACLE instance started.
otal System Global Area 401743872 bytes

Fixed Size 1336820 bytes

Variable Size 343935500 bytes

Database Buffers 50331648 bytes

Redo Buffers 6139904 bytes

E. Create controlfile(On ASM DISK) using RMAN using your current controlfile(On Unix File System):

[oracle@dba dbs]$ rman target /
Recovery Manager: Release 11.2.0.1.0 - Production on Sat Dec 10 19:41:35 2011
connected to target database: PRIM (not mounted)
RMAN> restore controlfile from '/u01/app/oracle/oradata/prim/control01.ctl'

2> ;
Starting restore at 10-DEC-11

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=23 device type=DISK
channel ORA_DISK_1: copied control file copy

output file name=+DATA/control01.ctl

output file name=+DATA/control02.ctl

Finished restore at 10-DEC-11

F. Mount the database and switch the database to copy:

RMAN> restore controlfile from '/u01/app/oracle/oradata/prim/control01.ctl'

2> ;
Starting restore at 10-DEC-11

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=23 device type=DISK

channel ORA_DISK_1: copied control file copy

output file name=+DATA/control01.ctl

output file name=+DATA/control02.ctl

Finished restore at 10-DEC-11

RMAN> alter database mount;

database mounted

released channel: ORA_DISK_1

RMAN> switch database to copy;

using target database control file instead of recovery catalog

datafile 1 switched to datafile copy "+DATA/prim/datafile/system.256.769546345"

datafile 2 switched to datafile copy "+DATA/prim/datafile/sysaux.257.769546345"

datafile 3 switched to datafile copy "+DATA/prim/datafile/undotbs1.258.769546347"

datafile 4 switched to datafile copy "+DATA/prim/datafile/users.260.769546397"

datafile 5 switched to datafile copy "+DATA/prim/datafile/example.259.769546387"

G. Recover the Database

RMAN> recover database;

Starting recover at 10-DEC-11

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=23 device type=DISK

starting media recovery

media recovery complete, elapsed time: 00:00:04

Finished recover at 10-DEC-11

H. The change tracking file cannot be migrated. You can only disable change tracking, then re-enable it, specifying an ASM disk location for the change tracking file:

SQL> alter database disable block change tracking;
alter database disable block change tracking
*
ERROR at line 1:

ORA-19759: block change tracking is not enabled

SQL> ALTER DATABASE ENABLE BLOCK CHANGE TRACKING USING FILE '+DATA';
Database altered.

Info: Block change tracking causes the changed database blocks to be flagged in a file. As the data blocks gets dirty (changed), the Change Tracking Writer (CTWR) background process tracks the changed blocks in a private area of memory. When a commit is issued against the data block, the block change tracking information is copied to a shared area in Large Pool called the CTWR buffer. During the checkpoint, the CTWR process writes the information from the CTWR RAM buffer to the change-tracking file.To achieve this we need to enable the block change tracking in our database


Confirmation:

SQL> select file_name from dba_data_files;
FILE_NAME

--------------------------------------------------------------------------------

+DATA/prim/datafile/users.260.769546397

+DATA/prim/datafile/undotbs1.258.769546347

+DATA/prim/datafile/sysaux.257.769546345

+DATA/prim/datafile/system.256.769546345

+DATA/prim/datafile/example.259.769546387

I. Migrate Online Redologs of Primary database to ASM

declare

cursor rlc is

select group# grp, thread# thr, bytes/1024 bytes_k, 'NO' srl

from v$log

union

select group# grp, thread# thr, bytes/1024 bytes_k, 'YES' srl

from v$standby_log

order by 1;

stmt varchar2(2048);

swtstmt varchar2(1024) := 'alter system switch logfile';

ckpstmt varchar2(1024) := 'alter system checkpoint global';

begin

for rlcRec in rlc loop

if (rlcRec.srl = 'YES') then

stmt := 'alter database add standby logfile thread '



rlcRec.thr

' ''+DATA'' size '



rlcRec.bytes_k

'K';

execute immediate stmt;

stmt := 'alter database drop standby logfile group '

rlcRec.grp;

execute immediate stmt;

else

stmt := 'alter database add logfile thread '



rlcRec.thr

' ''+DATA'' size '



rlcRec.bytes_k

'K';

execute immediate stmt;

begin

stmt := 'alter database drop logfile group '

rlcRec.grp;

dbms_output.put_line(stmt);

execute immediate stmt;

exception

when others then

execute immediate swtstmt;

execute immediate ckpstmt;

execute immediate stmt;

end;

end if;

end loop;

end;

PL/SQL procedure successfully completed.

L> select * from v$logfile;

GROUP# STATUS TYPE

---------- ------- -------

MEMBER

--------------------------------------------------------------------------------

IS_

---

3 STANDBY

+DATA/prim/onlinelog/group_3.268.769550357

NO


2 ONLINE

+DATA/prim/onlinelog/group_2.267.769550355

NO
GROUP# STATUS TYPE

---------- ------- -------

MEMBER

--------------------------------------------------------------------------------

IS_

---

1 ONLINE

+DATA/prim/onlinelog/group_1.266.769550347

NO


4 STANDBY

+DATA/prim/onlinelog/group_4.269.769550359
GROUP# STATUS TYPE

---------- ------- -------

MEMBER

--------------------------------------------------------------------------------

IS_

---

NO


5 STANDBY

+DATA/prim/onlinelog/group_5.270.769550361

NO
 ONLINE
GROUP# STATUS TYPE

---------- ------- -------

MEMBER

--------------------------------------------------------------------------------

IS_

---

+DATA/prim/onlinelog/group_7.265.769550345

NO

28 October 2011

Clone Oracle Apps R12 (Hot)

Prepare Source System (Usually Production)


Prepare the source system database for cloning:

• Log on to the source system database node as the database software owner

• cd to the $ORACLE_HOME/appsutil/scripts/ directory

• execute the perl script adpreclone.pl

$ perl adpreclone.pl dbTier

Prepare the source system application nodes for cloning (this step must be run on all application nodes):

• Log on to the source system application nodes as the application software owner
• cd to the $INST_TOP/admin/scripts directory
• execute the perl script adpreclone.pl

$ perl adpreclone.pl appsTier

2. Take a backup of Database:

You may do this usuing RMAN or conventional Hot backup(alter tablespace begin backup;)

Take the controlfile backup using the following:

SQL>alter database backup controlfile to trace as '/tmp/control.sql';

3. Take a backup of Apps Tier:


Tar the apps_st and tech_st directories of Source system.

4. Copy/Restore Source System to the Target System

    You may use SCP or sfftp to do it if it's on unix based OS.
5. Hot Backup DB Clone:

Make sure that the directories needed for oracle files are created already.

Make sure ORACLE_HOME, PATH and LD_LIBRARY_PATH and ORACLE_SID are set appropriately.

Start the database in nomount state.

exit;

Create the controlfile from previously taken trace backup from source system(Refer Step 2)
Change the necessary sections of the controlfile based on the target database requirements.

CREATE CONTROLFILE SET DATABASE "TEST" RESETLOGS FORCE LOGGING NOARCHIVELOG

MAXLOGFILES 16
MAXLOGMEMBERS 4
MAXDATAFILES 512
MAXINSTANCES 8
MAXLOGHISTORY 15000
LOGFILE
GROUP 1 (
'/u01/app/oracle/TEST/db/apps_st/data/log01a.log',
'/u01/app/oracle/TEST/db/apps_st/data/log01b.log'
) SIZE 2000M BLOCKSIZE 512,

GROUP 2 (
'/u01/app/oracle/TEST/db/apps_st/data/log02a.log',
'/u01/app/oracle/TEST/db/apps_st/data/log02b.log'
) SIZE 2000M BLOCKSIZE 512

DATAFILE
'/u01/app/oracle/TEST/db/apps_st/data/system01.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/system02.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/system03.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/system04.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/system05.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/ctxd01.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/owad01.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/a_queue02.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/odm.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/olap.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/sysaux01.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/apps_ts_tools01.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/system12.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/a_txn_data04.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/a_txn_ind06.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/a_ref03.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/a_int02.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/sysaux02.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/a_ref04.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/a_txn_data05.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/sysaux03.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/a_txn_data06.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/a_txn_ind07.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/a_ref05.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/a_txn_data07.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/system10.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/system06.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/portal01.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/system07.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/system09.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/system08.dbf',

'/u01/app/oracle/TEST/db/apps_st/data/undo01.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/a_txn_data01.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/a_txn_ind01.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/a_ref01.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/a_int01.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/a_summ01.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/a_archive01.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/a_queue01.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/a_media01.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/a_txn_data02.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/a_txn_data03.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/a_txn_ind02.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/a_txn_ind03.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/a_txn_ind04.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/a_txn_ind05.dbf',
'/u01/app/oracle/TEST/db/apps_st/data/a_ref02.dbf'
CHARACTER SET UTF8
;
add_temp.sql (extract the TEMP creation section):
ALTER TABLESPACE TEMP1 ADD TEMPFILE '/u01/app/oracle/TEST/db/apps_st/data/temp01.dbf'
SIZE 5120M REUSE AUTOEXTEND OFF;
ALTER TABLESPACE TEMP2 ADD TEMPFILE '/u01/app/oracle/TEST/db/apps_st/data/temp02.dbf'
SIZE 4096M REUSE AUTOEXTEND OFF;


• Log on to the target system database node as the database software owner
• cd to the $ORACLE_HOME/appsutil/clone/bin directory
• execute the perl script adcfgclone.pl

$ perl adcfgclone.pl dbTechStack

• Below is the adcfgclone.pl dialogue and example responses:

$ perl adcfgclone.pl dbTechStack
Copyright (c) 2002 Oracle Corporation
Redwood Shores, California, USA
Oracle Applications Rapid Clone
Version 12.0.0
adcfgclone Version 120.20.12000000.11

Enter the APPS password :

Target System Hostname (virtual or normal) [prod1] : test01
Target Instance is RAC (y/n) [n] : n
Target System Database SID : TEST
Target System Base Directory : /u01/app/oracle/TEST
Target System utl_file_dir Directory List : /usr/tmp
Number of DATA_TOP's on the Target System [1] : 1

Target System DATA_TOP Directory 1 [/u01/app/oracle/PROD/db/apps_st/data] : /u01/app/oracle/TEST/db/apps_st/data

Target System RDBMS ORACLE_HOME Directory [/u01/app/oracle/TEST/db/tech_st/11.1.0] : /u01/app/oracle/TEST/db/tech_st/11.2.0

Do you want to preserve the Display [null] (y/n) ? : n
Target System Display [prod1:0.0] : test1:0.0
Do you want the target system to have the same port values as the source system (y/n) [y] ? : n
Target System Port Pool [0-99] : 2


• Edit the following two parameters in the init.ora file on the target system with the correct path and format for the archivelogs

log_archive_dest_1='LOCATION=<>’ -- location of archive logs on destination server for the the specific instance
log_archive_dest_1=’LOCATION=/u03/oracle/TEST/oradata/archive’
log_archive_format='TEST%t_%s_%r.log'

• Login to the target instance as sysdba:

Run CreateControl.sql
By now the database will be mounted(If all the parameters mentioned above are correct)
 Recover database using backup controlfile until cancel or time:

Open the database with the following command

SQL>alter database open resetlogs;

• Execute the add_temp.sql script that was created in a previous step:

SQL> @add_temp.sql
• Bounce database (shutdown and start):
• Execute the adupdlib.sql script (with the “so” option) located in the $ORACLE_HOME/appsutil/install/ directory as sysdba:
SQL> @adupdlib.sql so

• cd to the $ORACLE_HOME/appsutil/clone/bin directory
• execute the perl script adcfgclone.pl
$ perl adcfgclone.pl dbconfig $ORACLE_HOME/appsutil/.xml


6. Configure the target system application server nodes (this step must be run on all application nodes):
• Log onto the target system application nodes as the application software owner
• cd to the $COMMON_TOP/clone/bin directory
• execute the perl script adpreclone.pl
 perl adcfgclone.pl appsTier
• Below is the adcfgclone.pl dialogue and example responses:
$ perl adcfgclone.pl appsTier

Copyright (c) 2002 Oracle Corporation
Redwood Shores, California, USA
Oracle Applications Rapid Clone
Version 12.0.0
adcfgclone Version 120.20.12000000.11
Enter the APPS password :
PROMPT :
Target System Hostname (virtual or normal) [test1]
PROMPT :
Target System Domain Name
test.oracle.com
PROMPT :
Target System Database SID
TEST
PROMPT :
Target System Database Server Node [testdb01]
PROMPT :
Target System Database Domain Name [testdb01.oracle.com]
PROMPT :
Target System Base Directory
/u01/app/oracle/TEST
Tools Oracle Home default value/u01/app/oracle/TEST/apps/tech_st/10.1.2
PROMPT :
Target System Tools ORACLE_HOME Directory [/u01/app/oracle/TEST/apps/tech_st/10.1.2]
ANSWER :
/u01/app/oracle/TEST/apps/tech_st/10.1.2
Web Oracle Home:/u01/app/oracle/TEST/apps/tech_st/10.1.3
Target System Web ORACLE_HOME Directory [/u01/app/oracle/TEST/apps/tech_st/10.1.3]
Appl TOP:/u01/app/oracle/TEST/apps/apps_st/appl
PROMPT :
Target System APPL_TOP Directory [/u01/app/oracle/TEST/apps/apps_st/appl]
/u01/app/oracle/TEST/apps/apps_st/appl
COMMON TOP:/u01/app/oracle/TEST/apps/apps_st/comn
PROMPT :
Target System COMMON_TOP Directory [/u01/app/oracle/TEST/apps/apps_st/comn]
PROMPT :
Target System Instance Home Directory [/u01/app/oracle/TEST/inst]
/u01/app/oracle/TEST/inst
PROMPT :

Target System Root Service [enabled]
enabled
PROMPT :
Target System Web Entry Point Services [enabled]
enabled
PROMPT :
Target System Web Application Services [enabled]
enabled
PROMPT :
Target System Batch Processing Services [enabled]
enabled
Target System Other Services [disabled]
disabled
PROMPT :
Do you want to preserve the Display [192.168.1.150:0.0] (y/n)
n
PROMPT :

Target System Display [test1.oracle:0.0]
PROMPT :
Do you want the the target system to have the same port values as the source system (y/n) [y] ?
n
Started testing the availabilty of ports in port pool 2



Post Cloning Tasks:

Shutdown Applications
Shutdown the database and put the database in archivelog mode
Startup Database
Startup Applications
Change the Profile option: Site_name to the TEST Instance name
Configure Workflow
Configure Concurrent Managers
Change Apps and SYSADMIN passwords



24 October 2011

Fusion Middleware Installation Part4

Configure SOA Suite

During the configuration, the Oracle Fusion Middleware Configuration Wizard automatically creates Managed Servers in the domain to host the Fusion Middleware system components. Oracle recommends that you use the default configuration settings for these Managed Servers. If you modify the default configuration settings, then you will have to perform some manual configuration steps before the Fusion Middleware environment can be started.

Depending on your selections, the following Managed Servers (default names shown) are created:

•soa_server1 - Hosts Oracle SOA
•bam_server1 - Hosts Oracle BAM

If this is a new installation and you need to create a new WebLogic domain, follow the steps below

The Domain creation process:

1. Navigate to the following DIR in Unix based systems.

[oracle@fusn01 bin]$ pwd
/u01/app/Fusion/Middleware/wlserver_10.3/common/bin
2.       Run config.sh
Select Create option.



Select Products for which the domains needs to be created


Enter Domain name and location where the domain needs to be stored.


Enter the Administrator user/password details



Enter thr startup role and the JDK location depending on your installation and requirements.

Click on each schema and enter the Database name, Hostname and the port where RCU had created schemas(Refer Part1) and click next

Select Server which you like to modify


Enter the details and click next

Review the screen and the options selected and then click on create




Note down the console URL and confirmation of successful domain creation


Start Weblogic Server:

cd DOMAIN_HOME/startWebLogic.sh

cd /u01/app/Fusion/Middleware/user_projects/domain/pracdba_domain/
./startWebLogic.sh


You should see this message to see that the web server is started successfully.

CompositeStoreMXBeanImpl is registered as domain runtime mbean.




PostInstallConfigIntegration:oracle_ias_farm target auth registration is done.

ADF Library non-OC4J post-deployment (millis): 126












Enter Login Details




You can now start deploying your applications.