RMAN Clone on same/different servers
In just a few steps, you can clone TB-sized Oracle databases on the same or different servers. The following blog will discuss how to add a cloned database to a RAC environment.
Note- Please keep in mind that noredo should not be used for large databases. It will not allow you to recover.
How to Clone :
Source: primary (make sure Archivelog mode enabled)
Target: clonedb
1. Take Backup: create directory where you want the backup
run
{
backup full database format '/home/oracle/Downloads/backup_110621/%d_D_%T_%u_s%s_p%p' database plus archivelog ;
};
2. create pfile (i.e use the pfile of source and rename the DB Or create pfile from alert log of source database >> also create below directories
mkdir /u01/app/oracle/oradata/clonedb/
mkdir /u01/app/oracle/fast_recovery_area/clonedb/
mkdir -p audit_file_dest='/u01/app/oracle/admin/clonedb/adump/
Pfile Format
==============
clonedb.__data_transfer_cache_size=0
clonedb.__db_cache_size=1258291200
clonedb.__java_pool_size=16777216
clonedb.__large_pool_size=33554432
clonedb.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
clonedb.__pga_aggregate_target=587202560
clonedb.__sga_target=1761607680
clonedb.__shared_io_pool_size=83886080
clonedb.__shared_pool_size=352321536
clonedb.__streams_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/clonedb/adump'
*.audit_trail='db'
*.compatible='12.1.0.2.0'
*.control_files='/u01/app/oracle/oradata/clonedb/control01.ctl','/u01/app/oracle/fast_recovery_area/clonedb/control02.ctl'
*.db_block_size=8192
*.db_domain='localdomain'
*.db_name='clonedb'
*.db_recovery_file_dest='/u01/app/oracle/fast_recovery_area'
*.db_recovery_file_dest_size=10560m
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=clonedbXDB)'
*.open_cursors=300
*.pga_aggregate_target=560m
*.processes=500
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=1680m
*.undo_tablespace='UNDOTBS1'
db_file_name_convert='/u01/app/oracle/oradata/oradb','/u01/app/oracle/oradata/clonedb/'
log_file_name_convert='/u01/app/oracle/oradata/oradb','/u01/app/oracle/oradata/clonedb/'
If its ASM: replace in above pfile
===========
*.db_create_file_dest='+DATADISK'
*.db_recovery_file_dest='+DATADISK'
*.control_files='+DATADISK/clonedb/CONTROLFILE/control01.ctl','+DATADISK/clonedb/CONTROLFILE/control02.ctl'
db_file_name_convert='+DATADISK','+DATADISK/CLONEDB/'
log_file_name_convert='+DATADISK','+DATADISK/CLONEDB/'
Source: primary (make sure Archivelog mode enabled)
Target: clonedb
1. Take Backup: create directory where you want the backup
run
{
backup full database format '/home/oracle/Downloads/backup_110621/%d_D_%T_%u_s%s_p%p' database plus archivelog ;
};
2. create pfile (i.e use the pfile of source and rename the DB Or create pfile from alert log of source database >> also create below directories
mkdir /u01/app/oracle/oradata/clonedb/
mkdir /u01/app/oracle/fast_recovery_area/clonedb/
mkdir -p audit_file_dest='/u01/app/oracle/admin/clonedb/adump/
Pfile Format
==============
clonedb.__data_transfer_cache_size=0
clonedb.__db_cache_size=1258291200
clonedb.__java_pool_size=16777216
clonedb.__large_pool_size=33554432
clonedb.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
clonedb.__pga_aggregate_target=587202560
clonedb.__sga_target=1761607680
clonedb.__shared_io_pool_size=83886080
clonedb.__shared_pool_size=352321536
clonedb.__streams_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/clonedb/adump'
*.audit_trail='db'
*.compatible='12.1.0.2.0'
*.control_files='/u01/app/oracle/oradata/clonedb/control01.ctl','/u01/app/oracle/fast_recovery_area/clonedb/control02.ctl'
*.db_block_size=8192
*.db_domain='localdomain'
*.db_name='clonedb'
*.db_recovery_file_dest='/u01/app/oracle/fast_recovery_area'
*.db_recovery_file_dest_size=10560m
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=clonedbXDB)'
*.open_cursors=300
*.pga_aggregate_target=560m
*.processes=500
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=1680m
*.undo_tablespace='UNDOTBS1'
db_file_name_convert='/u01/app/oracle/oradata/oradb','/u01/app/oracle/oradata/clonedb/'
log_file_name_convert='/u01/app/oracle/oradata/oradb','/u01/app/oracle/oradata/clonedb/'
If its ASM: replace in above pfile
===========
*.db_create_file_dest='+DATADISK'
*.db_recovery_file_dest='+DATADISK'
*.control_files='+DATADISK/clonedb/CONTROLFILE/control01.ctl','+DATADISK/clonedb/CONTROLFILE/control02.ctl'
db_file_name_convert='+DATADISK','+DATADISK/CLONEDB/'
log_file_name_convert='+DATADISK','+DATADISK/CLONEDB/'
3. place new pfile 'initclonedb.ora' in dbs location
4. Set up environment for clonedb
5. startup nomount;
6. rman auxiliary /
7. duplicate target database to clonedb backup location '/home/oracle/Downloads/backup_110621/' NOREDO;
In next blog will discuss how to add a cloned database to a RAC environment.
Good Luck.
Good Luck.
Comments
Post a Comment