backup and recovery protects from data loss. backup and recovery protects from data loss provides...
TRANSCRIPT
Backup and Recovery
Protects From Data Loss
Backup and Recovery
Protects From Data Loss
Provides for Media Recovery
Backup and Recovery
Protects From Data Loss
Provides for Media Recovery
Backup TypesPhysical
Logical
Backup and Recovery
Protects From Data Loss
Provides for Media Recovery
Backup TypesPhysical
Logical
Types of BackupsRecovery Manager (RMAN)
User-Managed (including third party utility)
Backup Strategy
ComprehensiveRMAN• Database files, including datafiles, control
files, and the server parameter file (SPFILE)• Archived redo logs
OS• Network configuration files (listener.ora, tnsnames.ora, et cetera)
• Password files• External tables• Oracle home
RMAN BACKUP Command
Basic BACKUP Commands:BACKUP DATABASE
BACKUP CURRENT CONTROLFILE
BACKUP SPFILE
BACKUP ARCHIVELOG ALL
RMAN Default Configuration
Backup Location OS Dependent
Backup Type Disk
Backup Channels One
MAXSETSIZEUnlimited
Backup Example$ rmanRecovery Manager: Release 10.2.0.3.0 - Production on Thu Jun 15 10:28:59 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
RMAN> connect target tsb@mylreptarget database Password: connected to target database: MYLREP (DBID=518368273)
RMAN> backup database;Starting backup at 12-JUN-08.Output from backup is printed here.Finished backup at 12-JUN-08RMAN> exit
BACKUPSET vs. COPIES
BACKUP SET
Consists of BACKUP PIECES• Proprietary Format• Backup "USED" blocks
Only RMAN can be used to restore/recover
BACKUPSET vs. COPIES
BACKUP SET
Consists of BACKUP PIECES• Proprietary Format• Backup "USED" blocks
Only RMAN can be used to restore/recover
COPIES
Identical to OS copies.
Can be used as replacement to datafile.
Can be used in user-controlled recover/restores.
Block Change Tracking
Used for Incremental Backups
Traditional incremental backup read entire datafile.
Enabled Block Change TrackingCreates Change Tracking File (CTF)
Use CTF to determine blocks to backup
Consider Environment
Enabling and Disabling Change Tracking
Current State:SQL> SELECT * FROM V$BLOCK_CHANGE_TRACKING;
Enabling/Disabling:SQL> ALTER DATABASE ENABLE BLOCK CHANGE TRACKING;
SQL> ALTER DATABASE ENABLE BLOCK CHANGE TRACKING USING FILE '/oracle/bu/rman_change_track.f' REUSE;
SQL> ALTER DATABASE DISABLE BLOCK CHANGE TRACKING;
RMAN> list backup;List of Backup Sets===================
BS Key Type LV Size Device Type Elapsed Time Completion Time------- ---- -- ---------- ----------- ------------ ---------------1 Full 1.80G DISK 00:02:49 12-JUN-08 BP Key: 1 Status: AVAILABLE Compressed: NO Tag:
TAG20080612T102922 Piece Name: /opt/oracle/product/10g/dbs/01jio142_1_1 List of Datafiles in backup set 1 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- --------- ---- 1 Full 23722948433 12-JUN-08
/oracle/mylrep/sxfbf35/ora/system01.dbf 11 Full 23722948433 12-JUN-08
/oracle/mylrep/sxfbf35/ora/mgmt_ecm_depot1.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time------- ---- -- ---------- ----------- ------------ ---------------2 Full 6.92M DISK 00:00:01 12-JUN-08 BP Key: 2 Status: AVAILABLE Compressed: NO Tag:
TAG20080612T102922 Piece Name: /opt/oracle/product/10g/dbs/02jio19j_1_1 Control File Included: Ckp SCN: 23722948667 Ckp time: 12-JUN-08 SPFILE Included: Modification time: 11-JUN-08
LIST COMMANDS
LIST BACKUP;
LIST BACKUPSET;
LIST COPY;
LIST EXPIRED BACKUP;
CROSSCHECK and DELETE
RMAN> CROSSCHECK BACKUP;
RMAN> DELETE EXPIRED BACKUP;
REPORT
REPORT NEED BACKUP;
REPORT OBSOLETE;
REPORT SCHEMA;
REPORT UNRECOVERABLE;