------------------------------------------------------------------------------------------------------------------------------------
Allocation
------------------------------------------------------------------------------------------------------------------------------------
ALLOCATE CHANNEL c1 DEVICE TYPE sbt
PARMS='SBT_LIBRARY=/mediavendor/lib/libobk.so ENV=(NSR_SERVER=tape_srv,NSR_
GROUP=oracle_tapes)';
ALLOCATE CHANNEL ch3 DEVICE TYPE DISK FORMAT '/disk1/%d_backups/%U';
ALLOCATE CHANNEL ch3 DEVICE TYPE sbt;
ALLOCATE AUXILIARY CHANNEL aux1 DEVICE TYPE DISK;
ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE DISK;
------------------------------------------------------------------------------------------------------------------------------------
CONFIGURE
------------------------------------------------------------------------------------------------------------------------------------
CONFIGURE CHANNEL DEVICE TYPE sbt
PARMS='SBT_LIBRARY=/mediavendor/lib/libobk.so
ENV=(NSR_SERVER=tape_svr,NSR_CLIENT=oracleclnt,NSR_GROUP=ora_tapes)'
FORMAT "BACKUP_%U";
OTHERS
CONFIGURE MAXSETSIZE TO 7500K;
CONFIGURE MAXSETSIZE = 100M;
CONFIGURE AUXNAME FOR DATAFILE 2 TO '/newdisk/datafiles/df2.df;'
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/oracle/oradata/trgt/snap_trgt.ctl';
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 2;
clear
CONFIGURE EXCLUDE FOR TABLESPACE cwmlite CLEAR;
CONFIGURE AUXNAME FOR DATAFILE 2 CLEAR;
CONFIGURE CHANNEL DEVICE TYPE sbt CLEAR;
CONFIGURE CHANNEL 3 DEVICE TYPE DISK CLEAR;
CONFIGURE DEVICE TYPE DISK CLEAR;
CONFIGURE DEFAULT DEVICE TYPE CLEAR;
DUPLEXING
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE sbt TO 2;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 2;
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE sbt TO 2;
Device
CONFIGURE DEVICE TYPE sbt PARALLELISM 1;
CONFIGURE DEVICE TYPE DISK PARALLELISM 3;
CONFIGURE DEFAULT DEVICE TYPE TO sbt;
CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO COPY;
CONFIGURE DEVICE TYPE 'SBT_TAPE' PARALLELISM 2 BACKUP TYPE TO BACKUPSET;
Channel+disk
CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE = 2G;
CONFIGURE CHANNEL DEVICE TYPE sbt RATE 1M;
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT = /tmp/%U;
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/save1/%U', '/save2/%U';
CONFIGURE CHANNEL DEVICE TYPE DISK MAXPIECESIZE = 2M;
CONFIGURE CHANNEL 3 DEVICE TYPE DISK MAXPIECESIZE = 900K;
CONFIGURE CHANNEL DEVICE TYPE sbt PARMS 'ENV=(NSR_DATA_VOLUME_POOL=first_pool)';
controlfile
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u02/%F';
Optimization
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE BACKUP OPTIMIZATION OFF;
CONFIGURE BACKUP OPTIMIZATION CLEAR;
------------------------------------------------------------------------------------------------------------------------------------
Backup
------------------------------------------------------------------------------------------------------------------------------------
DATABASE
BACKUP DATABASE;
BACKUP DATABASE FORMAT '/tmp/%U', '?/dbs/%U', '?/oradata/%U';
BACKUP DEVICE TYPE sbt COPY OF DATABASE;
BACKUP DEVICE TYPE sbt COPY OF DATABASE DELETE INPUT;
BACKUP FORMAT = 'UW_%d/%t/%s/%p' ARCHIVELOG LIKE '%arc_dest%';
BACKUP TAG 'weekly_full_db_bkup' DATABASE MAXSETSIZE 10M;
BACKUP AS COMPRESSED BACKUPSET DEVICE TYPE DISK COPIES 2 DATABASE FORMAT '/u01/db_%U', '/u02/db_%U';
controlfile
BACKUP DEVICE TYPE sbt CURRENT CONTROLFILE;
BACKUP CURRENT CONTROLFILE TO DESTINATION '/u01/backups';
BACKUP AS COPY CURRENT CONTROLFILE;
SPFILE
BACKUP SPFILE TO DESTINATION '/u01/backups';
TABLESPACE
BACKUP TABLESPACE users;
BACKUP TABLESPACE users FORMAT = '/tmp/users_%u%p%c';
BACKUP TABLESPACE tools MAXSETSIZE 5G;
BACKUP AS COPY TABLESPACE system, tools, users, undotbs;
DATAFILE
BACKUP DATAFILE 5,6,7;
BACKUP DATAFILE 5;
BACKUP DATAFILE 6;
BACKUP DATAFILE 7;
BACKUP DATAFILE 1 FORMAT '/u01/backups/%U', '/u02/backups/%U';
BACKUP DATAFILE 6 TO '/u01/backups', '/u02/backups';
BACKUP DEVICE TYPE DISK COPIES 3 DATAFILE 7 FORMAT '/tmp/%U','?/oradata/%U','?/%U';
ARCHIVELOG
BACKUP DEVICE TYPE sbt ARCHIVELOG ALL;
BACKUP NOT BACKED UP SINCE TIME 'SYSDATE-14' DATABASE PLUS ARCHIVELOG;
BACKUP ARCHIVELOG ALL;
BACKUP ARCHIVELOG FROM SEQUENCE 288 UNTIL SEQUENCE 388 THREAD 1 DELETE INPUT;
BACKUP DEVICE TYPE sbt ARCHIVELOG ALL FROM TIME 'SYSDATE-10' DELETE ALL INPUT;
PROXY
BACKUP DEVICE TYPE sbt PROXY DATAFILE 3;
BACKUP DEVICE TYPE sbt PROXY ONLY DATABASE;
BACKUP DEVICE TYPE sbt PROXY ONLY ARCHIVELOG ALL;
backupset
BACKUP DEVICE TYPE sbt BACKUPSET ALL;
BACKUP COPIES 2 DEVICE TYPE sbt BACKUPSET ALL;
BACKUP DEVICE TYPE sbt BACKUPSET COMPLETED BEFORE 'SYSDATE-7' DELETE INPUT;
BACKUP DEVICE TYPE sbt BACKUPSET ALL;
BACKUP DEVICE TYPE sbt BACKUPSET ALL DELETE INPUT;
backup backupset
BACKUP DEVICE TYPE DISK AS BACKUPSET DATABASE PLUS ARCHIVELOG;
BACKUP AS BACKUPSET DATAFILE 1;
BACKUP AS BACKUPSET (DATAFILE 3, 4, 5, 6, 7) (DATAFILE 8, 9);
BACKUP AS BACKUPSET DATAFILE 3, 4, 5, 6, 7, 8, 9;
BACKUP AS BACKUPSET DEVICE TYPE DISK COPIES 3 INCREMENTAL LEVEL 0 DATABASE;
BACKUP AS BACKUPSET
DATAFILE 1,2,3,4
CHANNEL ch1
CONTROLFILECOPY '/tmp/control01.ctl'
CHANNEL ch2
BACKUP AS BACKUPSET
ARCHIVELOG FROM TIME 'SYSDATE-14'
CHANNEL ch3;
TAG
BACKUP AS BACKUPSET TAG for_audit
COPY OF TABLESPACE users FROM TAG monday_users TABLESPACE SYSTEM FROM TAG monday_system;
BACKUP ARCHIVELOG ALL TAG first_copy;
DELETE ARCHIVELOG ALL BACKED UP 2 TIMES TO DEVICE TYPE sbt;
BACKUP DEVICE TYPE sbt DATAFILECOPY FROM TAG 'LATESTCOPY' FORMAT 'Datafile%f_Database%d';
BACKUP TAG 'weekly_full_db_bkup' DATABASE MAXSETSIZE 10M;
policy based
BACKUP DATABASE KEEP UNTIL TIME "TO_DATE('31-DEC-2007' 'dd-mon-yyyy')" NOLOGS;
BACKUP DATABASE NOT BACKED UP SINCE TIME 'SYSDATE-1';
BACKUP MAXSETSIZE 10G DATABASE PLUS ARCHIVELOG;
BACKUP NOT BACKED UP SINCE TIME 'SYSDATE-1' MAXSETSIZE 10M DATABASE PLUS ARCHIVELOG;
BACKUP TABLESPACE users KEEP FOREVER NOLOGS;
BACKUP MAXSETSIZE = 100M ARCHIVELOG ALL;
BACKUP ARCHIVELOG FROM TIME 'SYSDATE-1' UNTIL TIME 'SYSDATE';
BACKUP DURATION 3:30 DATABASE;
BACKUP DURATION 4:00 TABLESPACE users;
BACKUP DURATION 4:00 PARTIAL TABLESPACE users FILESPERSET 1;
BACKUP DURATION 4:00 PARTIAL MINIMIZE TIME DATABASE FILESPERSET 1;
BACKUP DURATION 4:00 PARTIAL MINIMIZE LOAD DATABASE FILESPERSET 1;
BACKUP DATABASE FORCE;
BACKUP ARCHIVELOG ALL FORCE;
EXCLUDING
CONFIGURE EXCLUDE FOR TABLESPACE cwmlite;
CONFIGURE EXCLUDE FOR TABLESPACE example;
BACKUP DATABASE NOEXCLUDE;
BACKUP TABLESPACE cwmlite, example;
CONFIGURE EXCLUDE FOR TABLESPACE cwmlite CLEAR;
CONFIGURE EXCLUDE FOR TABLESPACE example CLEAR;
BACKUP DATABASE
SKIP INACCESSIBLE
SKIP READONLY
SKIP OFFLINE;
------------------------------------------------------------------------------------------------------------------------------------
RESTORE
------------------------------------------------------------------------------------------------------------------------------------
RESTORE CONTROLFILE;
RESTORE CONTROLFILE FROM AUTOBACKUP;
RESTORE SPFILE FROM AUTOBACKUP;
RESTORE DATAFILE '?/oradata/trgt/tools01.dbf';
------------------------------------------------------------------------------------------------------------------------------------
recovery
------------------------------------------------------------------------------------------------------------------------------------
RECOVER DATABASE NOREDO;
RECOVER TABLESPACE users, tools UNTIL LOGSEQ 1300 THREAD 1
RECOVER DATABASE TEST
RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL TEST
RECOVER TABLESPACE users TEST
RECOVER DATABASE UNTIL CANCEL TEST
BLOCK RECOVERY
BLOCKRECOVER
DATAFILE 7 BLOCK 3
DATAFILE 2 BLOCK 235;
BLOCKRECOVER DATAFILE 8 BLOCK 13 DATAFILE 2 BLOCK 19 FROM BACKUPSET;
BLOCKRECOVER DATAFILE 8 BLOCK 13 DATAFILE 2 BLOCK 19 FROM DATAFILECOPY;
BLOCKRECOVER DATAFILE 8 BLOCK 13 DATAFILE 2 BLOCK 199 FROM TAG = mondayam;
BLOCKRECOVER DATAFILE 8 BLOCK 13 DATAFILE 2 BLOCK 19 RESTORE UNTIL 'SYSDATE-7';
BLOCKRECOVER DATAFILE 8 BLOCK 13 DATAFILE 2 BLOCK 19 RESTORE UNTIL SCN 100;
BLOCKRECOVER DATAFILE 8 BLOCK 13 DATAFILE 2 BLOCK 19 RESTORE UNTIL SEQUENCE 7024;
BLOCKRECOVER CORRUPTION LIST RESTORE UNTIL TIME 'SYSDATE-10';
------------------------------------------------------------------------------------------------------------------------------------
MANAGING
------------------------------------------------------------------------------------------------------------------------------------
SHOWING
SHOW CHANNEL FOR DEVICE TYPE sbt;
SHOW DEFAULT DEVICE TYPE;
SHOW CHANNEL;
SHOW BACKUP OPTIMIZATION;
SHOW DATAFILE BACKUP COPIES;
SHOW EXCLUDE;
SHOW AUXNAME;
SHOW SNAPSHOT CONTROLFILE NAME;
show datafile backup copies;
show archivelog backup copies;
show controfile autobackup;
show device type;
show encryption algorithm;
show maxsetsize;
show retention policy;
show retention policy to redundancy;
CHECKING
CROSSCHECK BACKUPPIECE
CROSSCHECK BACKUPSET OF TABLESPACE UWDATA;
CROSSCHECK COPY OF ARCHIVELOG ALL;
CROSSCHECK CONTROLFILECOPY
CROSSCHECK DATAFILECOPY ALL;
CROSSCHECK FOREIGN ARCHIVELOG ALL;
CROSSCHECK PROXY 941;
BACKUP CHECK LOGICAL DATABASE;
BACKUP VALIDATE DATABASE ARCHIVELOG ALL;
BACKUP VALIDATE CHECK LOGICAL DATABASE ARCHIVELOG ALL;
LIST BACKUP;
LIST BACKUP SUMMARY;
LIST SCRIPT NAMES;
LIST GLOBAL SCRIPT NAMES;
LIST ALL SCRIPT NAMES;
Reduntancy
CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
CONFIGURE RETENTION POLICY TO NONE;
CHANGE BACKUP TAG 'db_archive_1' UNAVAILABLE;
CHANGE BACKUPSET TAG year_end_2002 KEEP FOREVER NOLOGS;
CHANGE BACKUPSET TAG year_end_2002 NOKEEP;
CHANGE BACKUPSET 2 NOKEEP;
DELETION
DELETE NOPROMPT BACKUP OF DATABASE COMPLETED BEFORE 'SYSDATE-7';
DELETE ARCHIVELOG ALL COMPLETED AFTER 'SYSDATE-7';
DELETE BACKUP DEVICE TYPE sbt;
DELETE BACKUP DEVICE TYPE DISK;
DELETE COPY;
DELETE COPY TAG 'LATESTCOPY';
DELETE SCRIPT 'full_backup';
DELETE GLOBAL SCRIPT 'global_full_backup';
VALIDATE
VALIDATE ARCHIVELOG ALL
VALIDATE ARCHIVELOG LIKE '
VALIDATE ARCHIVELOG FROM SCN
VALIDATE ARCHIVELOG BETWEEN SCN
VALIDATE ARCHIVELOG UNTIL SCN
VALIDATE ARCHIVELOG FROM SEQUENCE
VALIDATE ARCHIVELOG SEQUENCE
VALIDATE ARCHIVELOG SEQUENCE BETWEEN
VALIDATE ARCHIVELOG UNTIL SEQUENCE
TIME BETWEEN '
UNTIL TIME '
VALIDATE CONTROLFILECOPY ALL
VALIDATE CONTROLFILECOPY '
VALIDATE CONTROLFILECOPY LIKE '
VALIDATE COPY OF DATABASE
VALIDATE COPY OF DATAFILE '
VALIDATE COPY OF DATAFILE
VALIDATE COPY OF TABLESPACE '
VALIDATE CURRENT CONTROLFILE
VALIDATE DATABASE
VALIDATE DATAFILE '
VALIDATE DATAFILE
VALIDATE DB_RECOVERY_FILE_DEST
VALIDATE RECOVERY AREA
VALIDATE RECOVERY FILES
VALIDATE SPFILE
VALIDATE TABLESPACE
------------------------------------------------------------------------------------------------------------------------------------
OTHERS
------------------------------------------------------------------------------------------------------------------------------------
ENCRYTION
CONFIGURE ENCRYPTION FOR DATABASE ON;
CONFIGURE ENCRYPTION FOR TABLESPACE uwdata OFF;
SET ENCRYPTION ON
CONFIGURE ENCRYPTION FOR DATABASE OFF
CONFIGURE ENCRYPTION ALGORITHM 'AES256';
CONFIGURE COMPRESSION ALGORITHM 'ZLIB';
CONFIGURE ENCRYPTION CLEAR;
CATALOG BASED
REGISTER DATABASE;
RESYNC CATALOG;
REPORT SCHEMA;
CATALOG DATAFILECOPY '/disk1/old_datafiles/01_01_2003/users01.dbf';
CATALOG ARCHIVELOG '/disk1/arch_logs/archive1_731.dbf','/disk1/arch_logs/archive1_732.dbf';
CATALOG START WITH '/disk1/backups/';
UNREGISTER DATABASE;
OTHERS
SET NEWNAME FOR DATAFILE '?/oradata/trgt/tools01.dbf' TO '/tmp/tools01.dbf';
SWITCH DATAFILE '/tmp/tools01.dbf' TO DATAFILECOPY '?/oradata/trgt/tools01.dbf';
RESTORE SPFILE TO PFILE '?/oradata/test/inittrgta.ora' FROM AUTOBACKUP;
DUPLICATE TARGET DATABASE TO 'dupdb';
DUPLICATE TARGET DATABASE TO dupdb NOFILENAMECHECK UNTIL TIME 'SYSDATE-7';
INCREMENTAL
BACKUP INCREMENTAL LEVEL 0 DATABASE;
BACKUP INCREMENTAL LEVEL 1 DIFFERENTIAL TABLESPACE users;
BACKUP INCREMENTAL LEVEL 1 CUMULATIVE DATABASE;
BACKUP INCREMENTAL LEVEL 1 CUMULATIVE SKIP INACCESSIBLE DATABASE;
First, what you need to know is what RMAN is then you go through the post and see the references of RMAN. In this post all the references are explained. I really like your work. Thanks for sharing your effort with us through this blog. Keep up the good work.
ReplyDeletesap upgrade challenges