Cloning Oracle Application with Rapid Clone - Database
(9i/10g/11g) Using Hot Backup on Open Database
|
||
S.No
|
Step
|
Remarks
|
Step 1:
|
Ensure adpreclone.pl has been run
|
|
Step 2:
|
Obtain a trace file script to recreate the controlfile. On the source database issue the following command:
SQL>
ALTER DATABASE BACKUP CONTROLFILE TO TRACE;
The trace file script will be put into the user_dump_dest directory. The name of the trace file script will be something like PROD_ora_12345.trc. Compare the date and time of the new trace file script to the time in which you entered the ALTER DATABASE BACKUP CONTROLFILE TO TRACE command. This will ensure you will be using the most recent trace file script, the one you created in this step |
|
Step 3
|
In the create controlfile script just created in step 2 change:
CREATE CONTROLFILE REUSE DATABASE "PROD" NORESETLOGS
to: CREATE CONTROLFILE DATABASE "PROD" RESETLOGS ARCHIVELOG
If you want to change the Database Name , You need to use the
clause SET DATABASE
CREATE CONTROLFILE SET DATABASE "newdbname" RESETLOGS NOARCHIVELOG
You must specify RESETLOGS.
The ARCHIVELOG mode may be changed to NOARCHIVELOG if you wish to run the copied database in noarchive log mode. Change all directories in the create controlfile clause to point to the correct directories for the new target database, if necessary. Leave "only" the CREATE CONTROLFILE clause. The other statements, like the recover command, will be done manually. Be sure you also remove the STARTUP NOMOUNT command.
Note: Please ensure that there is no new
datafile/tablespace added to Database after you generate controlfile
script as above
|
|
Step 4
|
On the source database make an online copy of all datafiles
using:
SQL> ALTER TABLESPACE
Copy all datafiles within tablespace On Unix systems, this can be done with the cp command. Then do:
SQL> ALTER TABLESPACE
Do NOT copy the controlfiles and redo log files as they will be recreated. You must copy the datafiles only after the ALTER .. BEGIN BACKUP command has been executed, otherwise the datafiles may be corrupted. The names of the datafiles and tablespaces to which the datafiles belong can be obtained using the following command:
SQL> SELECT FILE_NAME, TABLESPACE_NAME FROM DBA_DATA_FILES;
Note: Instead of performing step 4 and step 5 to create a new online backup, you may instead use a previously taken online backup of your database.If you choose to use a previous online backup be sure to copy the required archived redo logs taken with the the previous online backup. |
|
Step 5
|
Step 5: After all datafiles have been copied and the tablespaces
taken out of backup mode issue the following command:
SQL> ALTER SYSTEM ARCHIVE LOG CURRENT;
You will need all of the archivelog files from the start of datafile copy commands including the one just created with the command ALTER SYSTEM ARCHIVE LOG CURRENT. |
|
Step 6
|
Copy the database (DBF) files,controlfile
script and archive log files from the source to the target
system |
|
Step 7
|
Step 7: So, As mentioned in 230672.1 (Appendix B), Replace
section 2.2a (Configure the target system database server) with the following
steps:
Execute the following commands to configure the target system. You will be prompted for the target system specific values (SID, Paths, Ports, etc)
cd
perl adcfgclone.pl dbTechStack Step 7: On the target system issue STARTUP NOMOUNT command. For example:
SQL> startup
nomount pfile=initTEST.ora
|
|
Step 8
|
Step 8: Run the prepared script created in step
3 to create the new controlfile. For example:
SQL> @PROD_ora_12345.trc
|
|
Step 9
|
Step 9: Issue the command:
SQL> RECOVER
DATABASE UNTIL CANCEL USING BACKUP CONTROLFILE
You will be prompted to apply all of the archived redo logs from the source database including the last archive redo log file created with the ALTER DATABASE ARCHIVE LOG CURRENT command from step 5. After applying all of these archive log files issue the CANCEL command. |
|
Step 10
|
Step 10: Open the database with resetlogs:
SQL>ALTER DATABASE
OPEN RESETLOGS
At this point the target database will have been successfully cloned and opened. |
|
Step 11
|
Step 11: Create Temporary Tablespace if not created in
Source, else you shall add Temporary tablespace
You can check if tablespace TEMP has tempfiles or datafiles using the following SQL:
SQL> SELECT
FILE_NAME,TABLESPACE_NAME,STATUS,AUTOEXTENSIBLE from DBA_TEMP_FILES where
TABLESPACE_NAME like 'TEMP';
SQL> SELECT FILE_NAME,TABLESPACE_NAME, STATUS,AUTOEXTENSIBLE FROM DBA_DATA_FILES WHERE TABLESPACE_NAME LIKE 'TEMP'; If Temporary Tablespace is not created from above query,
SQL>
create temporary tablespace temp add tempfile 'xxxx.dbf' size xx
Or
SQL> alter tablespace TEMP add tempfile 'xxxx.dbf' size xx
|
|
Step 12
|
Step 12: Run the library update script against the
database
where
not required for Windows. |
|
Step 13
|
Step 13: Configure the target database (the database must be
open)
where target context file is:
Finally, refer back to cloning notes and the following sections:
|
|
Thursday, December 3, 2015
Cloning Oracle Application with Rapid Clone - Database (9i/10g/11g) Using Hot Backup on Open Database
Subscribe to:
Post Comments (Atom)
This comment has been removed by a blog administrator.
ReplyDelete