Oracle RMAN 11g Backup and Recovery- P13

Chia sẻ: Thanh Cong | Ngày: | Loại File: PDF | Số trang:50

0
86
lượt xem
19
download

Oracle RMAN 11g Backup and Recovery- P13

Mô tả tài liệu
  Download Vui lòng tải xuống để xem tài liệu đầy đủ

Oracle RMAN 11g Backup and Recovery- P13: Oracle, yet another edition of our RMAN backup and recovery book has hit the shelves! Oracle Database 11g has proven to be quite the release to be sure. RMAN has new functionality and whizbang new features that improve an already awesome product. RMAN has certainly evolved over the years, as anyone who started working with it in Oracle version 8 can attest to.

Chủ đề:
Lưu

Nội dung Text: Oracle RMAN 11g Backup and Recovery- P13

  1. 568 Part V: Appendixes backupSpec Parameter Syntax Diagram archivelogRecordSpecifier ALL completedTimeSpec , ’ ’ BACKUPSET FROM TAG tag_name , primaryKey ’ filename ’ CONTROLFILECOPY ALL LIKE ’ string_pattern ’ ( copyOfSpec backupSpecOperand ) CURRENT CONTROLFILE DATABASE datafileCopySpec , DATAFILE datafileSpec RECOVERY AREA DB_RECOVERY_FILE_DEST RECOVERY FILES SPFILE , ’ ’ TABLESPACE tablespace_name Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
  2. Appendix A: RMAN Syntax Reference Guide 569 backupSpecOperand Parameter Syntax Diagram ’ ’ CHANNEL channel_id ALL DELETE INPUT DISKRATIO integer FILESPERSET integer FORCE , formatSpec AUXILIARY FORMAT NEW , FORMAT formatSpec , TO DESTINATION toDestSpec ’ ’ FROM TAG tag_name INCLUDE CURRENT CONTROLFILE keepOption MAXSETSIZE sizeSpec notBackedUpSpec NOEXCLUDE POOL integer REUSE SECTION SIZE sizeSpec skipSpec ’ ’ TAG tag_name Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
  3. 570 Part V: Appendixes backupTypeSpec Parameter Syntax Diagram COMPRESSED BACKUPSET AS COPY copyOfSpec Parameter Syntax Diagram DATABASE , DATAFILE datafileSpec COPY OF , ’ ’ TABLESPACE tablespace_name datafileCopySpec Parameter Syntax Diagram , ’ filename ’ ALL DATAFILECOPY LIKE ’ string_pattern ’ NODUPLICATES , ’ ’ FROM TAG tag_name duration Parameter Syntax Diagram LOAD MINIMIZE TIME PARTIAL DURATION integer : integer Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
  4. Appendix A: RMAN Syntax Reference Guide 571 forRecoverOfSpec Parameter Syntax Diagram DATAFILECOPY FORMAT formatSpec ’ ’ WITH TAG tag_name COPY FOR RECOVER OF ’ ’ TAG tag_name notBackedUpSpec Parameter Syntax Diagram integer TIMES SINCE TIME ’ date_string ’ NOT BACKED UP sizeSpec Parameter Syntax Diagram G K M integer skipSpec Parameter Syntax Diagram INACCESSIBLE SKIP OFFLINE READONLY Chapter Reference The backup command is covered in detail in Chapter 11. Examples backup database plus archivelog delete input; backup tablespace users, system; backup as copy datafile 1,2,3; backup incremental level 0 check logical database plus archivelog; Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
  5. 572 Part V: Appendixes catalog Command The catalog command allows you to do the following: ■ Add metadata about backup pieces and image copies to the database control file and recovery catalog ■ Catalog valid backup sets, datafile copies, and archived redo logs in the flash recovery area (FRA) ■ Catalog valid backups in ASM, OMF, and user-defined disk locations ■ Record a datafile copy as a level 0 backup in the RMAN repository, so you can use that backup as the source of an incremental backup Syntax Diagram ARCHIVELOG , BACKUPPIECE ’ filename ’ CONTROLFILECOPY LEVEL integer CATALOG , ’ ’ ; TAG tag_name DATAFILECOPY ’ filename ’ RECOVERY AREA NOPROMPT DB_RECOVERY_FILE_DEST START WITH ’ string_pattern ’ Chapter Reference Chapter 16 provides more information on the catalog command. Examples catalog recovery area noprompt; catalog datafilecopy 'd:\oracle\oraback\system01.bak' 'd:\oracle\oraback\users01.bak' level 0; Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
  6. Appendix A: RMAN Syntax Reference Guide 573 change Command The change command is used to mark backup pieces, image copies, and archived redo logs with a status of AVAILABLE if they currently have a status of UNAVAILABLE. Additionally, this command can totally remove a backup or copy from a repository, and can also be used to modify the retention policy that is effective for a given backup or copy. Syntax Diagram AVAILABLE , keepOption forDbUniqueNameOption DEVICE TYPE deviceSpecifier maintSpec resetDbUniqueNameOption UNAVAILABLE UNCATALOG ; CHANGE changeFailure ’ ’ ’ ’ DB_UNIQUE_NAME FROM db_unique_name TO db_unique_name maintSpec Parameter Syntax Diagram OF listObjList BACKUP maintQualifier archivelogRecordSpecifier OF listObjList COPY foreignlogRecordSpecifier , DEVICE TYPE deviceSpecifier recordSpec forDbUniqueNameOption Parameter Syntax Diagram DB_UNIQUE_NAME ALL FOR ’ ’ DB_UNIQUE_NAME db_unique_name Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
  7. 574 Part V: Appendixes resetDbUniqueNameOption Parameter Syntax Diagram ’ ’ TO db_unique_name RESET DB_UNIQUE_NAME changeFailure Parameter Syntax Diagram ALL CRITICAL , HIGH EXCLUDE FAILURE failureNumber CLOSED NOPROMPT FAILURE HIGH LOW PRIORITY , LOW failureNumber Chapter Reference Chapter 16 contains a discussion on the use of the change command. Example change backup tag 'Gold Backup' keep forever nologs; configure Command The configure command allows you to configure persistent RMAN configuration settings. These settings apply to all RMAN sessions, unless they are changed or disabled. These settings are stored in the database control file. Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
  8. Appendix A: RMAN Syntax Reference Guide 575 Syntax Diagram ’ ’ CLEAR DB_UNIQUE_NAME db_unique_name CONNECT IDENTIFIER quoted_string delalConf CLEAR AUXNAME FOR DATAFILE datafileSpec TO ’ filename ’ backupConf cfauConf CLEAR TRUE COMPRESSION ALGORITHM OPTIMIZE FOR LOAD CONFIGURE FALSE AS OF RELEASE quoted_string quoted_string deviceConf CLEAR ALGORITHM quoted_string ENCRYPTION ON DATABASE FOR ’ ’ OFF TABLESPACE tablespace_name CLEAR CLEAR SNAPSHOT CONTROLFILE NAME TO ’ filename ’ forDbUniqueNameOption ; Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
  9. 576 Part V: Appendixes delalConf Parameter Syntax Diagram CLEAR ALL ARCHIVELOG DELETION POLICY APPLIED ON STANDBY BACKED UP integer TIMES TO DEVICE TYPE deviceSpecifier TO NONE ALL SHIPPED TO STANDBY backupConf Parameter Syntax Diagram ARCHIVELOG CLEAR BACKUP COPIES FOR DEVICE TYPE deviceSpecifier DATAFILE TO integer ON BACKUP OPTIMIZATION OFF CLEAR ’ ’ CLEAR EXCLUDE FOR TABLESPACE tablespace_name CLEAR MAXSETSIZE sizeSpec TO UNLIMITED CLEAR RETENTION POLICY NONE TO RECOVERY WINDOW OF integer DAYS REDUNDANCY integer cfauConf Parameter Syntax Diagram ON OFF CONTROLFILE AUTOBACKUP CLEAR CLEAR FORMAT FOR DEVICE TYPE deviceSpecifier TO formatSpec Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
  10. Appendix A: RMAN Syntax Reference Guide 577 deviceConf Parameter Syntax Diagram AUXILIARY integer allocOperandList CHANNEL DEVICE TYPE deviceSpecifier CLEAR CLEAR DEFAULT DEVICE TYPE TO deviceSpecifier CLEAR COMPRESSED DEVICE TYPE deviceSpecifier BACKUPSET BACKUP TYPE TO COPY PARALLELISM integer forDbUniqueNameOption Parameter Syntax Diagram DB_UNIQUE_NAME ALL FOR ’ ’ DB_UNIQUE_NAME db_unique_name Chapter Reference The configure command is covered in Chapter 3 in detail. Examples configure retention policy to recovery window of 180 days; configure backup optimization off; configure default device type to 'sbt tape'; configure controlfile autobackup on; configure controlfile autobackup format for device type 'sbt tape' ''%f''; configure controlfile autobackup format for device type disk to '/oradata/oraback/rman/robone/%f'; configure device type 'sbt tape' parallelism 4; configure device type disk parallelism 2; configure datafile backup copies for device type 'sbt tape' to 1; configure datafile backup copies for device type disk to 1; configure archivelog backup copies for device type 'sbt tape' to 1; configure archivelog backup copies for device type disk to 1; configure channel device type 'sbt tape' parms 'env (tdpo optfile /opt/oracle/rman/tdpo a273.opt)' rate 9 g format 'a273 %u' maxpiecesize 20 g maxopenfiles 64; configure channel device type disk format '/oradata/orabck01/rman/a273/ora a273 df%t s%s s'; configure auxiliary channel device type 'sbt tape' parms 'env (tdpo optfile /opt/oracle/rman/tdpo a273 dup.opt)' Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
  11. 578 Part V: Appendixes rate 99 g format 'a273 %u' maxpiecesize 20 g maxopenfiles 64; configure maxsetsize to 20 g; configure snapshot controlfile name to '/oradata/orabck01/rman/a273/snapcf a273.f'; configure channel 1 device type sbt connect 'sys/robert@test1' parms 'env (nsr server bktest1)'; connect Command The connect command is used to connect to the target database, the recovery catalog, or the auxiliary instance from the RMAN prompt. Syntax Diagram CONNECT AUXILIARY connectStringSpec CONNECT CATALOG ; connectStringSpec CONNECT TARGET Chapter References Examples of the connect command can be found in many of the chapters in this book. Examples connect target sys/Robert@maindb connect catalog rman/rman@rmancat convert Command The convert command is used when moving tablespaces and databases across platforms. If the source and destination platforms are of a different byte-ordering format (endian), then the convert command must be used to make the datafiles compatible with the new platform. The convert command can also be used to move datafiles in and out of ASM storage. Syntax Diagram transportOptionList DATABASE convertOptionList , convertOptionList DATAFILE ’ filename ’ convertOptionList ; CONVERT , ’ ’ TABLESPACE tablespace_name convertOptionList Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
  12. Appendix A: RMAN Syntax Reference Guide 579 transportOptionList Parameter Syntax Diagram ’ ’ NEW DATABASE database_name ’ ’ CONVERT SCRIPT script_name ON DESTINATION PLATFORM skipSpec SKIP UNNECESSARY DATAFILES ’ ’ TRANSPORT SCRIPT script_name skipSpec Parameter Syntax Diagram INACCESSIBLE SKIP OFFLINE READONLY convertOptionList Parameter Syntax Diagram fileNameConversionSpec FORMAT formatSpec FROM PLATFORM ’ platform ’ PARALLELISM integer TO PLATFORM ’ platform ’ Chapter Reference The convert command is covered in Chapter 14 in more detail. Examples -- Copy regular datafiles into ASM storage convert datafile '/disk1/oracle/dbs/my tbs f1.df', '/disk1/oracle/dbs/t ax1.f' format '+asmfile'; -- Copy a tablespace from ASM storage to disk. convert tablespace tbs 2 format '/tmp/tbs 2 %U.df'; -- Convert a database, moving it to a new platform convert database new database 'convdb' transport script '/ora01/scripts/transport/transportscript' to platform 'Microsoft Windows IA (32-bit)' db file name convert '/ora01/oracle/dbs' '/newora/converted'; Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
  13. 580 Part V: Appendixes create catalog Command The create catalog command is used to create the recovery catalog schema. Syntax Diagram VIRTUAL ; CREATE CATALOG Chapter Reference The create catalog command is covered in Chapter 10. Example create catalog tablespace rec cat; create script Command The create script command allows you to create a stored command script within RMAN. You must have a recovery catalog to use this command. Syntax Diagram GLOBAL ’ ’ COMMENT ’ comment ’ CREATE SCRIPT script_name backupCommands maintenanceCommands { } miscellaneousCommands restoreCommands ; FROM FILE ’ filename ’ Chapter Reference The create script command is referenced in Chapter 10. Example create script backup db {backup database plus archivelog delete input;} crosscheck Command The crosscheck command is used to verify that existing backup sets and backup set pieces listed in the control file or recovery catalog exist on the backup media. Any physical backup file (backup set piece, copy, and so forth) that is not found on backup media is marked as EXPIRED and will not be considered by RMAN for recovery operations. If the backup file later appears, then it will be marked AVAILABLE during a subsequent crosscheck operation. Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
  14. Appendix A: RMAN Syntax Reference Guide 581 Syntax Diagram CROSSCHECK maintSpec ; maintSpec Parameter Syntax Diagram OF listObjList BACKUP maintQualifier archivelogRecordSpecifier OF listObjList COPY foreignlogRecordSpecifier , DEVICE TYPE deviceSpecifier recordSpec Chapter Reference The crosscheck command is covered in Chapter 16. Examples crosscheck backup; crosscheck backup completed between 'sysdate' and 'sysdate-30'; crosscheck archivelog all; crosscheck archivelog time between 'sysdate' and 'sysdate-30'; delete Command The delete command allows you to mark backups and copies in the recovery catalog or control file with a status of DELETED. Once backups or copies are marked DELETED, the status cannot be changed. Objects that are marked as EXPIRED (via the crosscheck command) or OBSOLETE (via predefined retention criteria) can be marked DELETED with the delete command. Syntax Diagram EXPIRED forDbUniqueNameOption FORCE maintSpec NOPROMPT , ; DELETE obsOperandList DEVICE TYPE deviceSpecifier OBSOLETE Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
  15. 582 Part V: Appendixes maintSpec Parameter Syntax Diagram OF listObjList BACKUP maintQualifier archivelogRecordSpecifier OF listObjList COPY foreignlogRecordSpecifier , DEVICE TYPE deviceSpecifier recordSpec forDBUniqueNameOption Parameter Syntax Diagram DB_UNIQUE_NAME ALL FOR ’ ’ DB_UNIQUE_NAME db_unique_name Chapter Reference The delete command is covered in Chapter 16. Examples delete expired backup; delete expired archivelog; delete script Command The delete script command allows you to delete any existing RMAN script stored in the recovery catalog. Syntax Diagram GLOBAL ’ ’ DELETE SCRIPT script_name ; Chapter Reference The delete script command is covered in Chapter 10. Example delete script backup; drop catalog Command The drop catalog command is used to drop the recovery catalog schema. Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
  16. Appendix A: RMAN Syntax Reference Guide 583 Syntax Diagram ; DROP CATALOG Chapter Reference The drop catalog command is covered in Chapter 10. Example drop catalog; drop database Command The drop database command is used to remove the target database. If connected to a recovery catalog, the database will also be unregistered. When dropped, RMAN will remove all datafiles, online logs, and control files belonging to the target database. Syntax Diagram INCLUDING BACKUPS NOPROMPT DROP DATABASE ; Chapter Reference The drop database command is discussed in Chapter 16. Example drop database; duplicate Command The duplicate command is used to create either a duplicate database (with a new DBID) or a standby database (with the same DBID) using RMAN backups of a given target database. Syntax Diagram ’ ’ DBID integer INCARNATION primaryKey database_name DATABASE TARGET DATABASE DUPLICATE FOR STANDBY dupOptionList ; ’ ’ TO database_name Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
  17. 584 Part V: Appendixes dupOptionList Parameter Syntax Diagram ’ ’ BACKUP LOCATION backup_location , DEVICE TYPE deviceSpecifier DORECOVER fileNameConversionSpec FROM ACTIVE DATABASE , INSTANCE ’ name ’ LOGFILE logSpec NOFILENAMECHECK NOREDO NORESUME OPEN RESTRICTED PASSWORD FILE ’ ’ PFILE filename SKIP READONLY , ’ ’ SKIP TABLESPACE tablespace_name setParameter , ( ’ ’ ) setParameter PARAMETER_VALUE_CONVERT string_pattern SPFILE , TABLESPACE ’ ’ tablespace_name UNDO TABLESPACE TO RESTORE POINT restore_point_name untilClause SetParameter Parameter Syntax Diagram , identifier COMMENT quoted_string SET string quoted_string identifier RESET quoted_string Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
  18. Appendix A: RMAN Syntax Reference Guide 585 logSpec Parameter Syntax Diagram REUSE ’ filename ’ SIZE sizeSpec , REUSE GROUP integer ( ’ filename ’ ) SIZE sizeSpec dupOptionList Parameter Syntax Diagram ’ ’ BACKUP LOCATION backup_location , DEVICE TYPE deviceSpecifier DORECOVER fileNameConversionSpec FROM ACTIVE DATABASE , INSTANCE ’ name ’ LOGFILE logSpec NOFILENAMECHECK NOREDO NORESUME OPEN RESTRICTED PASSWORD FILE ’ ’ PFILE filename SKIP READONLY , ’ ’ SKIP TABLESPACE tablespace_name setParameter , ( ’ ’ ) setParameter PARAMETER_VALUE_CONVERT string_pattern SPFILE , TABLESPACE ’ ’ tablespace_name UNDO TABLESPACE TO RESTORE POINT restore_point_name untilClause Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
  19. 586 Part V: Appendixes sizeSpec Parameter Syntax Diagram G K M integer Chapter References The duplicate command is covered in Chapters 19 and 20. Example duplicate target database to copydb db file name convert ('/ora01/oracle/oradata/olddb/','/ora02/oracle/oradata/newdb/') until time 'sysdate- 5' skip tablespace oldusers, test pfile ?/dbs/initcopydb.ora logfile group 1 ('/ora01/oraredo/newdb/redo01 1.f', '/ora02/oraredo/newdb/redo01 2.f') size 200k, group 2 ('/ora01/oraredo/newdb/redo02 1.f', '/ora02/oraredo/newdb/redo02 2.f') size 200k, group 3 ('/ora01/oraredo/newdb/redo03 1.f', '/ora02/oraredo/newdb/redo03 2.f') size 200k reuse; execute script Command The execute script command is used to execute a stored RMAN script. Syntax Diagram string_or_identifier USING GLOBAL ’ ’ integer EXECUTE SCRIPT script_name ; Chapter Reference The execute script command is covered in Chapter 10. Example execute script my script; exit Command The exit command terminates the operation of your RMAN session and returns you to the OS prompt. Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
  20. Appendix A: RMAN Syntax Reference Guide 587 Chapter Reference The exit command is covered in Chapter 3. flashback database Command The flashback database command allows RMAN to manage Oracle Flashback Database operations. This allows you to reset the database to some previous time or SCN. Syntax Diagram , DEVICE TYPE deviceSpecifier FLASHBACK DATABASE TO BEFORE SCN integer THREAD integer TO BEFORE SEQUENCE integer TO BEFORE RESETLOGS TO BEFORE TIME ’ date_string ’ ; TO SCN integer THREAD integer TO SEQUENCE integer TO RESTORE POINT restore_point_name TO TIME ’ date_string ’ Chapter Reference Chapter 15 contains a great deal of information on the flashback command. Examples flashback database to scn 669605; flashback database to timestamp (sysdate-2); flashback database to timestamp to timestamp('2006-01-03 15:00:00', 'yyyy-mm-dd hh24:mi:ss'); flashback database to restore point “gold copy”; flashback database to before resetlogs; grant Command The grant command is associated with the RMAN recovery catalog and a feature called a virtual private catalog. This feature provides the ability to restrict access to recovery catalog records by user. The grant command provides the means to grant privileges to users to see records in the recovery catalog when a virtual private catalog has been configured. Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark.
Đồng bộ tài khoản