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.

23 October 2011

Fusion Middleware Installation Part3

Download SOA from here

Install Oracle SOA and start the installer.




Click Next



Select the Middleware Home


Click Install








Click Finish


Configure Domain for SOA in Part4

21 October 2011

Fusion Middleware Installation Part2

Installing an Application Server


All Oracle Fusion Middleware products (except for Oracle WebTier) require an application server on your system. For Oracle Application Developer or Oracle SOA Suite and Business Process Management Suite you can choose to install Oracle WebLogic Server or IBM WebSphere as the application server. Refer to the "System Requirements and Supported Platforms for Oracle Fusion Middleware 11gR1" document to determine the certified versions of these application servers for installation on your system. You should be installing the latest available version:
http://www.oracle.com/technetwork/middleware/ias/downloads/fusion-certification-100350.html


All Oracle Fusion Middleware products must be installed in the Oracle Middleware home directory, which can be created by installing Oracle WebLogic Server as the application server on your system. If you choose to use IBM WebSphere as your application server, you must manually create a Middleware home directory in which you can install your Oracle Fusion Middleware products.


The following types of WebLogic Server installers are available:

• OS-specific Package installer—This type of installer is a standalone version of the installation program that includes the JDKs for the selected platform. The installer may be either an .exe file or a .bin file, depending on the selected platform.


Note:
Silent mode installation is supported only for Package installers.


• Generic Package installer—This type of installer is a .jar file. It does not include the JRockit SDK and Sun JDK. You can use this type of installer to install the product on any supported platform on which Java is already installed.

• Upgrade installer—Upgrade installers allow you to upgrade an existing WebLogic Server installation to the current patch release. For example, if you have WebLogic Server 10.3.0 installed, you can use an Upgrade installer to upgrade your installation to WebLogic Server 10.3.4. If a patch release is available for your current WebLogic Server installation, you can download an Upgrade installer from My Oracle Support


Check for the complete prerequired for installing weblogic:
http://download.oracle.com/docs/cd/E17904_01/doc.1111/e14142/prepare.htm#i1129059


During the installation process, you must specify locations for the following home directories:


• Oracle Fusion Middleware
• WebLogic Server, Coherence (if applicable), and Enterprise Pack for Eclipse (if applicable)

Choosing a Middleware Home Directory

When you install WebLogic Server, you are prompted to specify a Middleware home directory. This directory serves as a repository for common files that are used by multiple Fusion Middleware products installed on the same machine. For this reason, the Middleware home directory can be considered a central support directory for all the Fusion Middleware products installed on your system.
The files in the Middleware home directory are essential to ensuring that WebLogic Server operates correctly on your system. They facilitate checking of cross-product dependencies during installation.


Run the Installer:
You may run the installer in 3 modes:
1. Graphical mode
2. Console Mode
3. Silent Mode


I have chosen graphical mode


Starting .bin Installation Programs in Graphical Mode on UNIX Machines:
1. Log in to the target UNIX system.
2. Go to the directory that contains the installation program.
3. Launch the installation by entering the following commands:





Click Next

Specify the Middleware home directory that will serve as the central support directory for all Fusion Middleware products installed on the target system, including WebLogic Server.
Click Next and enter support information for Oracle and click next


Select installation type

Choose product install document
Screen displays information about JDK and the documents








You will see this message once the installation is complete.

Next task is to install Middleware products in the Middleware Home created just now.

I will be installing SOA 11.1.2 for fusion middleware right now.

You can find the fusion middleare home installed as shown below:

[oracle@fusn01 Fusion]$ cd Middleware/




[oracle@fusn01 Middleware]$ ls


coherence_3.6 jrockit_160_24_D1.1.2-4 ocm.rsp registry.xml


domain-registry.xml logs oepe_11gR1PS4 utils


jdk160_24 modules registry.dat wlserver_10.3


[oracle@fusn01 Middleware]$
 
Continuation in Part3

Fusion Middleware Installation Part1

Creating the Database Schemas

Installation of most Oracle Fusion Middleware products requires the availability of a database (only Oracle Web Tier does not require a database). This database must be up and running, and does not have to be on the same system where you are installing the components. The database must also be compatible with Repository Creation Utility (RCU), which is used to create the schemas necessary for your Oracle Fusion Middleware components

Navigate to cd RCUHOME and run rcu command:


Click create schema option

Enter the database details as shown below:


Click Next



Once this completes click next


Required Schemas and Dependencies


This section lists the required schemas and their dependencies for Oracle Fusion Middleware components. Before you run RCU, you should make a note of the schemas you will need to create.

•Oracle SOA Suite Schemas

•Oracle WebCenter Schemas

•Oracle Application Developer Schema

•Oracle Identity Management Schemas

•Oracle Data Integrator Schema

•Oracle Business Intelligence Schemas



Enter the passwords based on your requirements


Click on Manage Tablespace if you need to organize your tablespaces.


Click OK if the tablespaces doesn't exist already.





Review the selected schemas and then click create button.



Wait for the confirmation as shown below:



Continuation in Part2







Install Fusion Middleware 11g

I'm back......

Let's do some Fusion(the most happenning) stuff!!!

Overview:

Oracle Fusion Middleware is a collection of standards-based software products that spans a range of tools and services from J2EE and developer tools, to integration services, business intelligence, collaboration, and content management. Oracle Fusion Middleware offers complete support for development, deployment, and management


Pre-Reqs:

1. Install Operating system(RHEL 5 in my case)
2. Install Oracle software and create the database(Please refer to the certification matrix here: http://download.oracle.com/docs/cd/E17904_01/doc.1111/e14259/overview.htm#RCUUG258)
3. Set the following parameters with these minimum values: open_cursors=500, processes=500
4. Make sure the database and the listener is up and running.

If you are starting the fusion middleware with this version, you can install it using Full Installer.

Installing a Release 11.1.1.4.0 Oracle Fusion Middleware product using the full installer involves the following:

•Creating the Database Schemas

•Installing an Application Server

•Installing Oracle Fusion Middleware Release 11g (11.1.1.4.0) Products

•Configuring Your Products and Creating the WebLogic Domains

Use the Installation guide for fusion installation - Part1