Hot Backup Cloning in 9i database :
***********************************
High Level Steps :
******************
1. Run preclone on both db as well apps Tier
2. Make a note of the current archive log change number using following command
SQL> select max(first_change#) chng from v$archived_log;
3. Make a note on db size and datafiles location and count(tablespace) using dba_data_files
4. Prepare the begin/end backup scripts
SQL> spool begin_backup.sql
select 'alter tablespace ' || tablespace_name || ' begin backup;' tsbb
from dba_tablespaces
where contents != 'TEMPORARY'
order by tablespace_name
/
SQL> spool off
SQL>spool end_backup.sql
select 'alter tablespace ' || tablespace_name || ' end backup;' tseb
from dba_tablespaces
where contents != 'TEMPORARY'
order by tablespace_name
/
SQL>spool off
5. Run begin_backup.sql script
6. Copy Datafiles,DB Home,Apps files from production to test server
7. Run end_backup.sql script
8. Copy archive logs
It is only necessary to copy archive logs created during the time the source database was in backup mode. Begin by archiving the current redo:
SQL> alter system archive log current;
Then, identify which archive log files are required. When run, the following query will ask for a change number. This is the number noted in step 2.
SQL> select name from v$archived_log where first_change# >= &change_no order by name;
Create an archive directory in the clone database and copy all of the identified logs into it.
9. Create Controlfile trace on production and copy it to test.
SQL> alter database backup controlfile to trace as '/oracle/ctl.sql';
Edit ctl.sql file as follows,
a. The word 'REUSE' needs to be changed to 'SET'
b. The database name needs setting to the new database name
c. Decide whether the database will be put into archivelog mode or not
d. If the file paths are being changed, alter the file to reflect the changes
e. Make a copy of the 'ALTER TABLESPACE TEMP...' lines, and then remove them from the file. Make sure that you hang onto the command, it will be used later
10. Run adcfgclone.pl dbTechStack
SQL> startup nomount pfile
SQL> @ctl.sql
SQL> recover database using backup controlfile until cancel
Apply all the archive logs which are required and apply current log file of production
SQL> alter database open resetlogs;
SQL> alter tablespace temp add tempfile '/oradata/temp01.dbf' size 50m reuse autoextend on next 1m maxsize 500m;
SQL> EXEC FND_CONC_CLONE.SETUP.CLEAN;
11. Run autoconfig on dbtier
12. Run adcfgclone.pl appsTier
RMAN CLONING USING MANUAL METHOD :
**********************************
High Level Steps :
******************
1. Run adpreclone on both tiers.
2. Take rman full backup with archivelogs and controlfile.
3. Copy rman backup pieces,db home,application files
4. Run adcfgclone.pl dbTechstack
5. Edit pfile only----db_name = source db name
6. startup nomount pfile
7. rman target /
8. restore controlfile from '/u01/backup/ctl/c-4423-20140116-00';
9. alter database mount;
10. Prepare restore.rcv for restoration process
11. Run restore script
12. exit
13. sqlplus '/as sysdba'
14. Use the below command for 3 of the logfiles. If we are using same logfile location for both source and target database, no need to rename the logfiles.
alter database rename file 'old logfile location' to 'newlogfile location';
15. alter database open resetlogs;
16. recreate controlfile file using following command and edit the db_name in ctl.sql and pfile
alter database backup controlfile to trace as '/u01/ctl.sql';
17. shut immediate
18. startup nomount pfile
19. Run ctl.sql
20. alter database open resetlogs;
21. alter tablespace TEMP add tempfile 'LOCATON' size 1024m autoextend on;
22. conn apps/apps
23. exec fnd_conc_clone.setup_clean;
24. commit;
25. Run autoconfig on db tier.
26. Run adcfgclone.pl on apps tier.
No comments:
Post a Comment