COLD
User Managed
Physical Backup
HOT
RMAN (Automated)
RAC environment is for availability, so we can’t take cold backup.
We should take hot, RMAN level backup.
We can’t use CP command , instead of CP we need to use DD command.
DD command is used for copying raw device info.
We can’t take cold, hot in RAC.
Must we should take RMAN backup.
In case of OCFS, ASM, VXFS we can’t use ‘DD’ command.
RMAN Advantages :
Block level Backup
Remote Backup
Compressed Backup
Incremental Backup
Block change tracking
Encrypted Backup
Recovering corrupted blocks
Migration of Non ASM to ASM Database
Configuration of Clone DB and standby DB.
RMAN SETUP :
Node 1 & Node 2 & TESTRAC &
DBRAC1 DBRAC2 Catalog
1. Configure TNSNAMES.ora
External
2. Create RMAN Tablespace
Storage
3. Create RMAN USER
1. Start the Listener. 4. Grant connect,resource,
2. Create the password file. recovery_catalog_owner to RMAN
3. Create Backup 5. Connect to RMAN and create
destination. catalog.
6. connect to target DB using RMAN
and Register the Target DB.
7. Apply RMAN policy.
Target Database (NODE1 or DBRAC1) Catalog(DB Name:parag) or TESTRAC
$ export ORACLE_SID=parag
$sqlplus ‘/ as sysdba’
> startup
Root #ifconfig eth0:1 192.168.100.110 up
(enabling virtual IP temporarily)
$export ORACLE_SID=+ASM1
sqlplus ‘/ as sysdba’
>startup
$export ORACLE_SID=dbrac1
$sqlplus ‘/ as sysdba’
>startup
>!
$ vi listener.ora
LISTENER_RAC1 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)
(HOST = rac1-vip)(PORT = 1521)(IP =
FIRST))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)
(HOST = 200.200.0.117)(PORT = 1521)
(IP = FIRST))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)
(KEY = EXTPROC))
)
)
)
$ lsnrctl start listener_rac1
$ cd $ORACLE_HOME/dbs
$orapwd file=orapwd$ORACLE_SID
password=abcde
$ export ORACLE_SID=dbrac1
$sqlplus ‘/ as sysdba’
> select *From v$pwfile_users;
rac1$mkdir bkp
We must use global dbname in RAC
environment
$ vi
/oraeng/oracle/network/admin/tnsnames.ora
to_rac1 =
(HOST=rac1-vip)
(service_name=DBRAC.parag.com)
:wq!
$tnsping to_rac1
$ export $ORACLE_SID=parag
$ sqlplus ‘/ as sysdba’
> create tablespace rman datafile ‘/oraeng/oracle/oradata/parag/rman.dbf’ size 30m;
> grant connect,resource, recovery_catalog_owner to rman
> alter user rman default tablespace rman;
$ rman catalog rman/rman
RMAN> Create catalog;
$rman catalog rman/rman target sys/abcde@to_rac1
RMAN> register database;
RMAN> spool log to show.log
RMAN>SHOW all;
RMAN>SPOOL OFF;
RMAN> exit;
$ vi show.log
CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO
'/home/oracle/bkp/%F.ctl';
CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO BACKUPSET;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
CONFIGURE CHANNEL 1 DEVICE TYPE DISK FORMAT '/home/oracle/bkp/%U.bkp';
CONFIGURE CHANNEL 2 DEVICE TYPE DISK FORMAT '/home/oracle/bkp/%U.bkp';
CONFIGURE MAXSETSIZE TO UNLIMITED;
CONFIGURE ENCRYPTION FOR DATABASE OFF;
CONFIGURE ENCRYPTION ALGORITHM 'AES128';
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE;
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/home/oracle/bkp/snapcf_nonclu.f';
:wq!
Note : Snap shot control file keeps track of ongoing transactions information of target DB, while target
DB is in backup mode, after completion of backup snap shot controlfile will update the original control
file.
$ rman catalog rman/rman target sys/abcde@to_rac1
RMAN> @show.log
RMAN> backup database;
<Password>
RMAN> set encryption identified by <VISHNU> only
RMAN>backup database;
RMAN>backup as compressed backupset database;
RMAN>report need backup;
RMAN>list backup summary;
RMAN>backup as compressed backupset database tag
‘TODAY’;
RMAN>bckup incremental level 0 database;
RMAN>backup as compressed backup set incremental level 2
database;
RMAN>cross check backup
RMAN>list backup;
While restoring decryption of wallet
RMAN>set decryption identified by <Password>;
RMAN>configure encryption for database off;