Anda di halaman 1dari 9

STEP 1Login as Applications file user & run the environment file.

STEP 2 We need to check certain software component versions:


(i) Check the version of perl, it should be atleast 5.005 or above.
To check perl version, Type the following command-
$ perl -v
Make sure that perl is included in the PATH (environment variable of user; echo
$PATH).
(ii)Check the version of JRE & JDK which should be atleast 1.1.8 & 1.3.1 or above
respectively. for this type:
$ java -version
(iii) Check the version of zip which should be atleast 2.3 or above.for this type :
$ zip
If you don’t have following versions, upgrade these software components as per the
operating system.

STEP 3: It is recommendedto apply the latest AD Minipack & the latest AutoConfig Template
patch as mentioned in the metalink note 230672.1 but not necessary.

STEP 4: Then we check whether latest Rapid Clone patch is there or not, for this we query the
database whether latest Rapid Clone patch and other prerequisite patches as mentioned in
the metalink document 230672.1 as follows:
$ select * from AD_BUGS where bug_number=’&patch number’;
If it shows ” no rows selected ” that means you need to apply the patch. Do ensure that
you apply all the patches as per the requirement.

STEP 5: Run system configuration on the Application tier:


$ $COMMON_TOP/admin/scripts/<SID>/adautocfg.sh
Use the APPS password when prompted.

STEP 6: Run system configuration on the database tier:


$ $ORACLE_HOME/appsutil/<SID>/scripts/adautocfg.sh
Use the APPS password when prompted.

STEP 7: Copy AutoConfig to the RDBMS ORACLE_HOME:


Apply patch 2952369 to acquire adchkcfg utility.
Create appsutil.zip file by: $ perl $AD_TOP/bin/admkappsutil.pl.
Output is located in $APPL_TOP/admin/out/appsutil.zip; copy appsutil.zip file to the
$ORACLE_HOME
unzip -o appsutil.zip

STEP 8: Generate the database context file:


$ cd $ORACLE_HOME/appsutil/bin
adbldxml.sh tier=database appsuser=<APPSuser> appspasswd=<APPSpwd>
Output log is written to: $ORACLE_HOME/appsuti/out/<SID>/cfgcheck.txt
STEP 9: Generate and apply AutoConfig configuration file:
cd $ORACLE_HOME/appsutil/bin
adconfig.sh contextfile=<CONTEXT> appspass=<APPSpwd>

STEP 10: Prepare for source database clone:


cd $ORACLE_HOME/appsutil/scrips/<SID>
./perl adpreclone.pl dbTier

STEP 11: Prepare for source application clone:


cd $COMMON_TOP/admin/scripts/<SID>
./perl adpreclone.pl appsTier

STEP 12: Copy the application tier file system:


Logon to the source system as APPLMGR and shut down the server processes.
Copy the following application directories from the source to the target node/file system:
JAGGY Inc. | http://www.jaggy.com
$APPL_TOP
$OA_HTML
$OA_JAVA
$COMMON_TOP/util
$COMMON_TOP/clone
$806 ORACLE_HOME
$iAS ORACLE_HOME
Shut down the source database and copy it to the target node/file system.
Restart the source database and source application server processes.

STEP 13: Configure the target system database sever:


cd $ORACLE_HOME/appsutil/clon/bin
./perl adcfgclone.pl dbTier

STEP 14: Configure the target system application tier:


cd $COMMON_TOP/clone/bin
./perl adcfgclone.pl appsTier
Note: These steps are for a single node install. If you are using Oracle Workflow, you
must update wf_notification_attributes and wf_item_attribute_values.

Multi Node Cloning


Pre-cloning steps (source)
1. Setup Rapid Clone appsutil on the Database tier
perl $AD_TOP/bin/admkappsutil.pl
2. Output file is located in $APPL_TOP/admin/out/appsutil.zip
3. Login as ORACLE user, and copy the appsutil.zip file to the $ORACLE_HOME directory
$ su – oracle
(Source the RDBMS environment file)
$DATA_TOP/<CONTEXT_NAME>.env (/u01/oracle/proddb/9.2.0/PROD_apps.env
$ cd $ORACLE_HOME (RDBMS)
$ cp $APPL_TOP/admin/out/appsutil.zip ./
$ unzip -o appsutil.zip
4. Run AutoConfig on the DB tier
$ORACLE_HOME/appsutil/scripts/<CONTEXT_NAME>/adautocfg.sh
5. Run preclone script on the DB tier
cd $ORACLE_HOME/appsutil/script/<CONTEXT_NAME>/
perl adpreclone.pl dbTier
(check log file for errors:
$ORACLE_HOME/appsutil/log/<CONTEXT_NAME>/StageDBTier_MMDDXXXX.log)
6. Run preclone script on the AppsTier (make sure all Apps services are shutdown)
cd $COMMON_TOP/admin/scripts/<CONTEXT_NAME>/
perl adpreclone.pl appsTier
JAGGY Inc. | http://www.jaggy.com
(check log file errors:
$APPL_TOP/admin/<CONTEXT_NAME>/log/StageAppsTier_MMDDXXXX.log)
Cloning Steps
7. Copy the following application directories from the source to the target node/file system:
$APPL_TOP
$COMMON_TOP
$OH806
$OHiAS
8. Login as ORACLE user, and shutdown database and listener first
cd $ORACLE_HOME/appsutil/script/<CONTEXT_NAME>/
addbctl.sh stop immediate
addlnctl.sh stop <LISTENER_NAME>
(need to supply a listener name, even the name is just default LISTENER)
Copy $DATA_TOP from source to target
Copy $ORACLE_HOME
Cloning task – Steps to run on the target
1. Log on as ORACLE user on target, and DO NOT source the environment files
2. cd <PATH_TO_NEW_ORACLE_HOME>/appsutil/clone/bin
3. run the clone configuration script
$ perl adcfgclone.pl dbTier
(Please review the TAR if received CORE DUMP when running the perl script)
Note:262269.1: Illegal Instruction (COREDUMP) During adcfgclone.pl Dbtier
1. Please delete directories:
/app/oracle/test/testdb/9.2.0/appsutil/clone/jre/jre/lib
/app/oracle/test/testdb/9.2.0/appsutil/clone/jre/jre/bin
2. Please create directories lib and bin inside /app/oracle/test/testdb/9.2.0/appsutil/clone/jre/jre as
symbolic links to
lib to /app/oracle/test/testdb/9.2.0/appsutil/clone/jre/lib
bin to /app/oracle/test/testdb/9.2.0/appsutil/clone/jre/bin
ln –s ../bin bin
ln –s ../lib lib
• virtual hostname = N
• target system database name = TEST
• RAC = N
• Target ORACLE_HOME = /app/oracle/test/testdb/9.2.0
• Target system UTL_FILE = /usr/tmp
• # of DATA_TOP = 1
• DATA_TOP directory = /app/oracle/test/testdata
• Preserve display # = Y
• Port pool number = 1
4. After the DB cloning is completed, check the ApplyDBTier_MMDDXXXX.log located in the
$NEW_ORACLE_HOME/appsutil/log/<CONTEXT_NAME>/
5. Open a clean shell, and login as appltest to Steverogers
6. cd <PATH_TO_NEW_COMMON_TOP>/clone/bin
JAGGY Inc. | http://www.jaggy.com
7. Run cloning script
$ perl adcfgclone.pl appsTier
APPS password = apps
Virtual hostname = N
Target system SID = ORCL
Target system database node = <nodename>
Target system domain name = <company>.com
More than 1 apps tier = N
APPL_TOP divided into multiple mount points = N
APPL_TOP mount point = /app/oracle/test/testappl
COMMON_TOP mount point = /app/oracle/test/testcomn
8.0.6 ORACLE_HOME = /app/oracle/test/testora/8.0.6
iAS home = /app/oracle/test/testora/iAS
Port pool number = 0
UTL_FILE directory for APPLTMP = 1
Post-installation tasks
• Purge and flush queues - list of programs for purging, initiate data purge programs from the
Concurrent
Request
• Update profile options – only site level profile options will be cloned, user level needs to be
adjusted –
Change Site Name profile value
• Must manually set the node name as this is a single node to multi-node clone
• Must run Relink Application Programs after clone – shutdown all services first, then start all
services
after relinking. Otherwise, concurrent manager will not start
This article describes step by step approach to clone Oracle RAC databases using an RMAN hot
backup.
                                                      
Steps to be conducted on Source DB
 
Step 1: Identify number of online redo log groups available with the database using:
 
SQL> SELECT * FROM GV$LOGFILE;
 
This step is required to switch logs those many times before starting hot backup (Step 3). This
will make sure that all the online redo logs are archived. For example, if you have 4 online redo
log groups, switch logs 4 times. Online redo logs can be switched using:
                       
SQL> ALTER SYSTEM SWITCH LOGFILE;
                       
Step 2: Note the latest archive log file name from archive destination directory.
           
Step 3: Take hot backup tablespace by tablespace, copying datafiles to desired location. Execute
following script to get a spool file (hotbackup.sql), which in turn can be used to take hot backup.
                       
#############################################################################
spool hotbackup.sql
DECLARE
                          
            CURSOR dfiles
            IS
            SELECT tablespace_name,file_name
            FROM dba_data_files
            ORDER BY bytes DESC;
                           
BEGIN
 
            DBMS_OUTPUT.ENABLE(1000000);
                                      
            FOR i IN dfiles LOOP
            DBMS_OUTPUT.PUT_LINE ('alter tablespace '||
i.tablespace_name ||' begin backup;');
            DBMS_OUTPUT.PUT_LINE ('!cp ' || i.file_name ||
'/u99/oradata/clone');
            DBMS_OUTPUT.PUT_LINE ('alter tablespace ' ||
i.tablespace_name || ' end backup;');
            END LOOP;
                         
END;
spool off
#############################################################################
Note: Change hot backup location "/u99/oradata/clone" used in the script as required.
                       
Take hot backup by executing the spool file.
                       
SQL> @hotbackup.sql
                       
Step 4: Once hot backup is complete, again switch logfiles as many number of times as those
online redo log groups (same as Step 1).
                       
Step 5: Again, note the latest archive log file name from archive destination directory. Move all
archive log files created during hot backup to destination DB "db_recovery_file_dest" parameter
location.
                       
Step 6: Take backup of control file to trace and move it to destination DB location. This trace
file contents will be used to generate new control files at destination.
                       
SQL> ALTER DATABASE BACKUP CONTROLFILE TO TRACE;
 
 

Steps to be conducted on Destination DB

 
Step 7: Edit control file by removing all the statements except "CREATE CONTROL FILE ...
RESETLOGS" statement.
 
 Change "REUSE DATABASE" to "SET DATABASE"
 
 Change DBNAME (Source database name to appropriate Destination DB name)
 
 Retain entries related to online redo log groups for the first instance and remove all other
redo log groups.
 
 Change Datafile/Redo log locations and copy those files from hot backup to the location
specified in controlfile.
After making above changes, the control file should look something like this.
#############################################################################
CREATE CONTROLFILE SET DATABASE "PREPROD" RESETLOGS  ARCHIVELOG
    MAXLOGFILES 192
    MAXLOGMEMBERS 3
    MAXDATAFILES 1024
    MAXINSTANCES 32
    MAXLOGHISTORY 9344
LOGFILE
  GROUP 1 (
    '/u99/oradata/clone/redo1_01a.rdo',
    '/u99/oradata/clone/redo1_01b.rdo'
  ) SIZE 400M,
  GROUP 2 (
    '/u99/oradata/clone/redo1_02a.rdo',
    '/u99/oradata/clone/redo1_02b.rdo'
  ) SIZE 400M,
  GROUP 3 (
    '/u99/oradata/clone/redo1_03a.rdo',
    '/u99/oradata/clone/redo1_03b.rdo'
  ) SIZE 400M,
  GROUP 4 (
    '/u99/oradata/clone/redo1_4a.rdo',
    '/u99/oradata/clone/redo1_4b.rdo'
  ) SIZE 400M
DATAFILE
  '/u99/oradata/clone/system01.dbf',
  '/u99/oradata/clone/undotbs01.dbf'
  '/u99/oradata/clone/sysaux01.dbf',
  '/u99/oradata/clone/undotbs02.dbf',
  '/u99/oradata/clone/undotbs03.dbf',
  '/u99/oradata/clone/undotbs04.dbf',
  '/u99/oradata/clone/audit_data.dbf',
  '/u99/oradata/clone/audit_index.dbf',
  '/u99/oradata/clone/cust_data.dbf',
  '/u99/oradata/clone/cust_index.dbf',
  '/u99/oradata/clone/app_data.dbf',
  '/u99/oradata/clone/app_index.dbf',
  '/u99/oradata/clone/app_hist_data.dbf',
  '/u99/oradata/clone/app_hist_index.dbf',
  '/u99/oradata/clone/blob_data32_amh.dbf',
  '/u99/oradata/clone/blob_data32_och.dbf',
  '/u99/oradata/clone/note_data.dbf',
  '/u99/oradata/clone/note_index.dbf',
  '/u99/oradata/clone/lookup_data.dbf',
  '/u99/oradata/clone/lookup_index.dbf',
  '/u99/oradata/clone/rule_data.dbf',
  '/u99/oradata/clone/rule_index.dbf',
  '/u99/oradata/clone/queue_data.dbf',
  '/u99/oradata/clone/queue_index.dbf'
CHARACTER SET WE8ISO8859P1;
#############################################################################
 
Step 8: Get existing pfile from destination DB by using:
 
SQL> CREATE PFILE='/u99/pfile_dbname.ora' FROM SPFILE;
 
Edit this parameter file by changing CLUSTER_DATABASE parameter to FALSE. CREATE
CONTROLFILE command needs the database to be mounted exclusively and by setting
CLUSTER_DATABASE=FALSE, database can be mounted exclusively.
 
Step 9: Shutdown destination database (all nodes) and take a cold backup of datafiles, redo
logfiles, controlfiles, etc., if required. Shutdown database by shutting each instance by using
following command.
 
SQL> SHUTDOWN IMMEDIATE;
 
Otherwise, use following command from OS
 
srvctl stop database –d <dbname>
 
Step 10: Start the database in nomount stage using pfile created in step 8 using:
                       
SQL> STARTUP NOMOUNT PFILE='/u99/pfile_dbname.ora';
                       
Step 11: In nomount stage, create controlfile using edited backup controlfile (from Step 7). This
step creates control files as mentioned in pfile "control_files" parameter.                     
 
Step 12: Now, recover database using:
                         
SQL> RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL;
 
Start feeding archive logs one by one using:
                
SQL> SELECT * FROM GV$ARCHIVED_LOG
WHERE <CHANGE_NUMBER> BETWEEN FIRST_CHANGE# AND NEXT_CHANGE# AND
THREAD#=<THREAD_NUMBER>
 

Step 13: Once recovery is complete, open the database using resetlogs to start with new
redologs.
 
SQL> ALTER DATABASE OPEN RESETLOGS;
 
Now the database should be up and running and ready to use.
                         
Step 14: Create as many temporary tablespaces as they are in source DB with destination DB.
Those temporary tablespace metadata entries would be present in destination DB, but temp files
wouldn’t be present under those temporary tablespaces. For example, tempfiles can be created
using:
 
SQL> ALTER TABLESPACE <tablespace_name> ADD TEMPFILE
‘/u99/oradata/clone/temporary01.dbf’ size 20G
 
Step 15: While creating control files (in Step 7), online redo log groups and members were
created only for the first instance in the database. Online redo logs has to be created for other
instances also. Create as many online redo log files as they are on source DB in destination DB.
For example:
 
SQL> ALTER DATABASE ADD LOGFILE THREAD 2 GROUP 5
('/u99/oradata/clone/redo2_5a.rdo',
'/u99/oradata/clone/redo2_5b.rdo') SIZE 400M;
 
Step 16: Shutdown the instance (only one node is up as of now), edit pfile with
cluster_database=true parameter and start the database (all nodes).
 
Step 17: Shutdown the database and take a cold backup if required.

Anda mungkin juga menyukai