- ANKUSH THAVALI
- 29 May, 2022
- 0 Comments
- 3 Mins Read
RAC to RAC RMAN clone- learnomate
HOW TO PERFORM RAC TO RAC RMAN CLONE IN 19C ?
RAC Database Clone
- Prestep take source DB backups and transfer it to target
- RMAN CloneÂ
- Post Restore/Clone Steps
- Prestep take source DB backups and transfer it to target
. oraenv primDB SELECT NAME,DBID FROM V$DATABASE; name:primDB DBID:1000656445 EXIT rman target / delete backup; list backup; rman target / run { allocate channel ch1 device type disk; backup as backupset database format '/u01/backup/Fullback_%T_%U' plus archivelog format '/u01/backup/Archive_%T_%U'; backup current controlfile format '/u01/backup/Controlback_%T_%U'; backup spfile format '/u01/backup/spfile_%T_%U'; release channel ch1; } scp /u01/backup/* oracle@target:/u01/backup/.
2. RMAN Clone scenario:(different database name primDB:TEESTDB)
CREATE DUMMY PFILE:
Int dummy to start database in nomount for clone *.db_name=TESTDB *.db_unique_name=TESTDB *.cluster_database=false *.audit_file_dest='/u01/app/oracle/admin/TESTDB/adump' *.db_create_file_dest='+DATA' *.db_create_online_log_dest_1='+DATA' *.db_create_online_log_dest_2='+RECO' *.db_file_name_convert='+DATA/primDB','+DATA/TESTDB' *.log_file_name_convert='+DATA/primDB','+DATA/TESTDB','+RECO/primDB','+RECO/TESTDB' *.control_files='+DATA/TESTDB/controlfile/control01.ctl','+RECO/TESTDB/controlfile/control02.ctl' *.db_recovery_file_dest_size=8931M *.db_recovery_file_dest='+RECO' *.log_archive_dest_1='LOCATION=USE_DB_RECOVERY_FILE_DEST' sqlplus / as sysdba startup nomount pfile='/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/initTESTDB.ora'; rman auxiliary / duplicate target database to TESTDB backup location '/u01/backup' nofilenamecheck;
Â
3.Post Restore/Clone Steps:(Converting restored standalone database on target as a RAC database ):
Get a pfiles from source and modify according to target environment
create pfile from spfile;
Â
verify:
cd $ORACLE_HOME/dbs
Â
cp to notepad++
Make changes and verify :-
cat initTESTDB1.ora TESTDB1.__data_transfer_cache_size=0 TESTDB2.__data_transfer_cache_size=0 TESTDB1.__db_cache_size=1627389952 TESTDB2.__db_cache_size=1644167168 TESTDB1.__inmemory_ext_roarea=0 TESTDB2.__inmemory_ext_roarea=0 TESTDB1.__inmemory_ext_rwarea=0 TESTDB2.__inmemory_ext_rwarea=0 TESTDB1.__java_pool_size=0 TESTDB2.__java_pool_size=0 TESTDB1.__large_pool_size=16777216 TESTDB2.__large_pool_size=16777216 TESTDB1.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment TESTDB2.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment TESTDB1.__pga_aggregate_target=788529152 TESTDB2.__pga_aggregate_target=788529152 TESTDB1.__sga_target=2365587456 TESTDB2.__sga_target=2365587456 TESTDB1.__shared_io_pool_size=117440512 TESTDB2.__shared_io_pool_size=117440512 TESTDB1.__shared_pool_size=587202560 TESTDB2.__shared_pool_size=570425344 TESTDB1.__streams_pool_size=0 TESTDB2.__streams_pool_size=0 TESTDB1.__unified_pga_pool_size=0 TESTDB2.__unified_pga_pool_size=0 *.audit_file_dest='/u01/app/oracle/admin/TESTDB/adump' *.audit_trail='db' *.cluster_database=true *.compatible='19.0.0' *.control_files='+DATA/TESTDB/CONTROLFILE/control01.ctl','+RECO/TESTDB/CONTROLFILE/control02.ctl' *.db_block_size=8192 *.db_create_file_dest='+DATA' *.db_name='TESTDB' *.db_recovery_file_dest='+RECO' *.db_recovery_file_dest_size=8931m *.diagnostic_dest='/u01/app/oracle' *.dispatchers='(PROTOCOL=TCP) (SERVICE=TESTDBXDB)' family:dw_helper.instance_mode='read-only' TESTDB2.instance_number=2 TESTDB1.instance_number=1 *.local_listener='-oraagent-dummy-' *.log_archive_format='%t_%s_%r.dbf' *.nls_language='AMERICAN' *.nls_territory='AMERICA' *.open_cursors=300 *.pga_aggregate_target=748m *.processes=300 *.remote_login_passwordfile='exclusive' *.sga_target=2244m TESTDB2.thread=2 TESTDB1.thread=1 TESTDB1.undo_tablespace='UNDOTBS1' TESTDB2.undo_tablespace='UNDOTBS2' pfile is ready SHUTDOWN TESTDB sqlplus / as sysdba shut immediate Start target instance using pfiles vi /u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/initTESTB1.ora AND PASTE THE PFILE ALREADY CREATED AS ABOVE . oraenv >>> TESTDB1 sqlplus / as sysdba startup mount pfile='/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/initTESTDB1.ora'; create spfile='+DATA/TESTDB/PARAMETERFILE/spfileTESTDB.ora' from pfile='/u01/app/oracle/product/19.0.0.0/dbhome_1/dbs/initTESTDB1.ora'; shut immediate; Create local pfile initDEVDB1.ora point to SPFILE '+DATA/DEVDB/PARAMETERFILE/spfileDEVDB.ora' Node1>>> cd $ORACLE_HOME/dbs cat > initTESTDB1.ora spfile='+DATA/TESTDB/PARAMETERFILE/spfileTESTDB.ora' Node2 >>> cat > initTESTDB2.ora spfile='+DATA/TESTDB/PARAMETERFILE/spfileTESTDB.ora' sqlplus / as sysdba startup mount; show parameter spfile shut immediate Convert TESTDB database to RAC srvctl add database -d TESTDB -n TESTDB -o '/u01/app/oracle/product/19.0.0.0/dbhome_1' -p '+DATA/TESTDB/PARAMETERFILE/spfileTESTDB.ora' -t IMMEDIATE -a 'DATA,RECO' -n database unique name -t shutdown immediate Before making it as RAC crsctl stat res -t TESTDB details not shown in cluster resources After adding TESTDB to cluster the crsctl stat res -t command shows the TESTDB details in the cluster Not running offline now Add the NODE instances srvctl add instance -d TESTDB -i TESTDB1 -n node1 srvctl add instance -d TESTDB -i TESTDB2 -n node2 Srvctl start database -d TESTDB
Hope It Helps !