|
Wednesday, April 29, 2009 |
RMAN Setup |
Hello Everyone!!!
Setup RMAN User, Catalog & Register ----------------------------------------- MAKE SURE ALL DATABASE have PASSWORD FILE
sqlplus system/manager@rman <<__1
drop user rman_TEST cascade;
create user rman_TEST identified by rman_TEST default tablespace users temporary tablespace ts_temp quota unlimited on users quota unlimited on ts_temp ; grant connect , resource, recovery_catalog_owner to rman_TEST; exit __1 # create the catalog rman catalog rman_TEST/rman_TEST@rman << __2 create catalog; exit __2 rman target \"sys/pass9999@TEST as sysdba\" \ catalog rman_TEST/rman_TEST@rman << __3 register database ; EXIT __3
Full Backup Script – Hot Backup – Target DB in Archivelog Mode ------------------------------------------------------------------- run { allocate channel c1 type disk; set limit channel c1 kbytes 500000; backup full filesperset 2 (database format '/rman_backup/BACKUP/TEST_data_%U'); sql "alter system archive log current"; backup filesperset 10 format '/rman_backup/BACKUP/TEST_arch%U' (archivelog all ); release channel c1; } exit;
Incremental Backup Script ------------------------------ resync catalog; change archivelog all validate; run{ allocate channel c1 type 'SBT_TAPE'; allocate channel c2 type 'SBT_TAPE'; backup format '/intr/cf_t%t_s%s_p%p' (current controlfile); backup incremental level 0 tag db_intr_0 filesperset 5 format '/intr/df_t%t_s%s_p%p' (database); sql 'alter system archive log current'; backup filesperset 20 format '/intr/rl_t%t_s%s_p%p' (archivelog all delete input); release channel c1; release channel c2; }
Full Backup Script – To Tape --------------------------------
run { allocate channel t1 type 'SBT_TAPE'; backup format 'db_%d_t%t_s%s_p%p' (database); sql 'alter system archive log current'; backup format 'arch_%d_t%t_s%s_p%p' (archivelog all delete input); }
Recover Specific Datafile ----------------------------- run { allocate channel c1 type disk; sql 'alter database datafile 2 offline drop'; restore datafile 2; recover datafile 2; release channel c1; }
COMPLETE RECOVERY script using current controlfile ------------------------------------------------------- run { allocate channel d1 type disk; restore database; sql 'alter database mount'; recover database; }
INCOMPLETE RECOVERY script using backup controlfile -------------------------------------------------------- -- Required if there are gaps in log sequence
run { SET UNTIL logseq = 6 thread = 1; allocate channel d1 type disk ; restore controlfile; restore database; sql 'alter database mount'; recover database; sql 'alter database open resetlogs'; }
COMPLETE RECOVERY script using backup controlfile ------------------------------------------------------ run { allocate channel d1 type disk; restore controlfile; restore database; sql 'alter database mount'; recover database; sql 'alter database open resetlogs'; }
INCOMPLETE RECOVERY script using backup controlfile -------------------------------------------------------- -- Required if there are gaps in log sequence
run { # recover database until specific time allocate channel dev1 type 'SBT_TAPE'; set until time 'Apr 20 2003 12:15:00'; sql "alter database mount" ; restore database; switch datafile all; recover database; sql "alter database open resetlogs"; release channel dev1; }
Happy Learning --SreeneLabels: RMAN Setup |
posted by Srinivasan .R @ 4:23 AM |
|
|
|
|