Saturday, January 29, 2011

RAPID CLONE WITH RMAN HOTBACKUP

Clone / temp / rman


1. At Target side : Production Server

Run à adpreclone Oracle Home and Application Home.

2. cp –rph -- All Application Tops to another Mount point ( Except Database C/R/D ).

3. Restore Database from RMAN

3.1 . Copy archive log auto backup backup set folders from Production flash area to
Test server flash area i.e
/p01/oracle/others/rman_oracle_backup/flash_recovery_area/PROD

Scp –r 2010_10_05/ root@erpprod.pittilam.com:/p01/oracle/others/rman.....


3.2 in TEST server /p01/oracle/10gdb/10.2.0
Connect RMAN
$ rman target=/

RMAN> STARTUP NOMOUNT;

RMAN> restore controlfile from '/p01/oracle/others/rman_oracle_backup/flash_recovery_area/PROD/autobackup/2010_10_04/o1_mf_s_731485220_6bl96dq0_.bkp';


RMAN> alter database mount;


RMAN> RESTORE DATABASE UNTIL TIME "TO_DATE('04-Oct-2010 14:06','DD-MON-YYYY HH24:MI')"; -- 2:45 afternoon to


RMAN> RECOVER DATABASE UNTIL TIME "TO_DATE('04-Oct-2010 14:06','DD-MON-YYYY HH24:MI')";


sql> alter database disable block change tracking;

RMAN> ALTER DATABASE OPEN RESETLOGS;






4.1 Add the datafile to Temp table space.

Sql> select property_name, property_value from database_properties where property_name='DEFAULT_TEMP_TABLESPACE' Sql> ALTER TABLESPACE temp ADD TEMPFILE '/p01/oracle/proddata/temp01.dbf’ SIZE 512m AUTOEXTEND ON NEXT 200m MAXSIZE UNLIMITED
SQL> SELECT tablespace_name, file_name, bytes FROM dba_temp_files WHERE tablespace_name = 'TEMP'; SQL> CREATE TEMPORARY TABLESPACE temp2 TEMPFILE '/u02/oradata/TESTDB/temp2_01.dbf' SIZE 5000M REUSE AUTOEXTEND ON NEXT 1M MAXSIZE unlimited SQL> ALTER DATABASE DEFAULT TEMPORARY TABLESPACE temp2; SQL> DROP TABLESPACE temp INCLUDING CONTENTS AND DATAFILES;
SQL> SELECT COUNT(*) FROM v$sort_usage WHERE tablespace = 'TEMP'
4.2Copy Datafiles (C/R/D) to Clone Location. $ sqlplus ‘/as sysdba’ SQL> shut immediate; $ cp –r /p01/oracle/proddata ---- > clone location. 4.3Change owner the as per username clone ( in second server) #chown –R clone:dba prodappl --- like do all the folders 5.1Login as a clone user in test server start the clone part . DB_Tier
$/B01/testnew/test10gdb/10.2.0/appsutil/clone/bin
Ls
adcfgclone.pl adchkutl.sh adclone.pl adclonectx.pl core

bash-3.00$ perl adcfgclone.pl dbTier
Enter the APPS password [APPS]:
pllerp

First Creating a new context file for the cloned system.
The program is going to ask you for information about the new system:


Provide the values required for creation of the new Database Context file.

Do you want to use a virtual hostname for the target node (y/n) [n] ?:

Target instance is a Real Application Cluster (RAC) instance (y/n) [n]:

Target System database name [PROD]:CLINST

Target system RDBMS ORACLE_HOME directory [/p01/oracle/10gdb/10.2.0]:/B01/testnew/test10gdb/10.2.0

Target system utl_file accessible directories list [/usr/tmp, /usr/tmp, /p01/oracle/proddb/9.2.0/appsutil/outbound/PROD_prod]:

Number of DATA_TOP's on the target system [4]:2

Target system DATA_TOP 1:/B01/testnew/testdata

Target system DATA_TOP 2:/B01/testnew/testdb/9.2.0/dbs

Do you want to preserve the Display set to prod:0.0 (y/n) [y] ?:n

Target system Display [erpprod:0.0]:

Perl executable location is set to:
/usr/bin/perl

Do you want to preserve the port values from the source system on the target system (y/n) [y] ?:n

Clone Context uses the same port pool mechanism as the Rapid Install
Once you choose a port pool, Clone Context will validate the port availability.

Enter the port pool number [0-99]:
50

Checking the port pool 50
done: Port Pool 50 is free
Database port is 1571

Creating the new Database Context file from :
/B01/testnew/test10gdb/10.2.0/appsutil/template/adxdbctx.tmp

The new database context file has been created :
/B01/testnew/test10gdb/10.2.0/appsutil/CLINST_erpprod.xml

Log file located at /tmp/CloneContext_10091021.log

Running Rapid Clone with command:
perl /B01/testnew/test10gdb/10.2.0/appsutil/clone/bin/adclone.pl java=/B01/testnew/test10gdb/10.2.0/appsutil/clone/bin/../jre mode=apply stage=/B01/testnew/test10gdb/10.2.0/appsutil/clone/bin/.. component=dbTier method=CUSTOM dbctxtg=/B01/testnew/test10gdb/10.2.0/appsutil/CLINST_erpprod.xml showProgress contextValidated=true

Beginning database tier Apply - Sat Oct 9 10:22:46 2010
Log file located at /B01/testnew/test10gdb/10.2.0/appsutil/log/CLINST_erpprod/ApplyDBTier_10091022.log


Completed Apply...
Sat Oct 9 10:26:22 2010

Beginning APPSDB_CLINST registration to central inventory...

ORACLE_HOME NAME : APPSDB_CLINST
ORACLE_HOME PATH : /B01/testnew/test10gdb/10.2.0
Using Inventory location in /etc/oraInst.loc
Log file located at /etc/oraInventory/logs/OracleHomeCloner_10091026.log
ORACLE_HOME /B01/testnew/test10gdb/10.2.0 was registered successfully.

Starting database listener for CLINST:
Running:
/B01/testnew/test10gdb/10.2.0/appsutil/scripts/CLINST_erpprod/addlnctl.sh start CLINST

You are running addlnctl.sh version 115.7

Logfile: /B01/testnew/test10gdb/10.2.0/appsutil/log/CLINST_erpprod/addlnctl.txt

Starting listener process CLINST ...


Listener CLINST has already been started.


addlnctl.sh: exiting with status 0
Note : controlfile manual creation If any controlfile creation error ,You should create controlfile manually, First take controlfile from production server. sql> alter database backup controlfile to trace;
go to udump directory (/t01/oracle/proddb/9.2.0/admin/DEV_erpprod/udump)
$ls -ltr ---------> take latest .trc fileSql> In Test server side: $ vi contnew.trc STARTUP NOMOUNTCREATE CONTROLFILE SET DATABASE "CLNINST" RESETLOGS NOARCHIVELOG--- -- -- '/B01/testnew/testdata/strabus01.dbf'CHARACTER SET US7ASCII; Sql>@contnew.trcSql> alter database open resetlogs; sql> select status from v$instance; ---------- > It should be in Open Mode $ run Autoconfig on DB Tier Note :If you get any coredump error , you can do below action plan:
$ vi /t01/TEST/10gdb/10.2.0/appsutil/CLONENEW_erpprod.xml

/p01/oracle/10gdb/10.2.0/perl/bin/perl


/t01/clone/test10gdb/10.2.0/perl/lib/5.8.3/aix-thread-multi: /t01/clone/test10gdb/10.2.0perl/lib/5.8.3: /t01/clone/test10gdb/10.2.0/perl/lib/site_perl/5.8.3/aix-thread-multi: /t01/clone/test10gdb/10.2.0/perl/lib/site_perl/5.8.3: /t01/clone/test10gdb/10.2.0/perl/lib/site_perl:.:/t01/clone/test10gdb/10.2.0/appsutil/perl
And re-run the Autoconfig.
/B01/testnew/test10gdb/10.2.0/appsutil/scripts/CLINST_erpprod

adautocfg.sh addbctl.sh adexecsql.pl adpreclone.pl adstrtdb.sql
adchknls.pl addlnctl.sh adlsnodes.sh adstopdb.sql core































Apps Tier

/B01/testnew/testcomn/clone

1.cd /appsutil/clone/jre
2.move lib lib.old
3.move bin bin.old
4.ln -s jre/bin bin
5.ln -s jre/lib lib

$/B01/testnew/testcomn/clone/bin
adaddnode.pl adclonectx.pl
adcfgclone.pl core
adchkutl.sh javacore2216028.1286642450.txt
adclone.pl
6.Run perl adcfgclone.pl appsTier




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

Note 1: If Apps Tns listener not started

Stop the Services
Run the autoconfig.

Note 2: If Concurrent managers show wrong Nodes. Not starting FNDLIBR

So clear all the Nodes in TEST Server.

Sql>
select node_name "Node Name", node_mode "Mode", support_cp "C", support_web "W", support_admin "A", support_forms "F"from FND_NODES;
SQL> EXEC FND_CONC_CLONE.SETUP_CLEAN; COMMIT; EXIT;*) Run AutoConfig on all tiers, firstly on the DB tier and then the APPS tiers, to repopulate the required system tables.

Note 3: If Java Cache error while login the application at first time.

For Oracle Apps 11.5.10.2 run the script.
sql> begin apps.wf_local_synch.BULKSYNCHRONIZATION(P_ORIG_SYSTEM=>'ALL', P_PARALLEL_PROCESSES=>2, P_LOGGING=>'LOGGING', P_RAISEERRORS=>TRUE, P_TEMPTABLESPACE=>'APPS_TS_TX_DATA'); END; /


If you are NOT running the Oracle Applications Table Space Model run ( Mean before Apps 11.5.10 version)
sql> begin apps.wf_local_synch.BULKSYNCHRONIZATION(P_ORIG_SYSTEM=>'ALL', P_PARALLEL_PROCESSES=>2, P_LOGGING=>'LOGGING', P_RAISEERRORS=>TRUE, P_TEMPTABLESPACE=>'APPLSYSX'); END; /

NOTE 4 : After the clone instance started

Add the xml_file_path. Through xml_publisher --- After that run Autoconfig.
Stop the Workflow Manager Services.

No comments:

Post a Comment