转:Oracle how-to backup and recovery with RMAN
2012-03-07 13:25
495 查看
Oracle how-to
backup and recovery with RMAN
Slavo Kozac, 17 Apr 2010, 19:54============================================================ BACKUP ============================================================ ------------------------------------------------------------ -- backup full database - compressed -- start rman and login to the target database rman target / -- do not back up unchanged data files CONFIGURE BACKUP OPTIMIZATION ON; -- Configure the number of server processes (channels) that write backups to DISK CONFIGURE DEVICE TYPE DISK PARALLELISM 2; -- configure backup destination configure channel device type disk format '/data/backup/dbname/%U'; -- automatically backup controlfile whenever you do backup of the database configure controlfile autobackup format for device type disk to '/data/backup/dbname/%F'; -- keep backups 14 days configure retention policy to recovery window of 14 days; -- delete records in repository for backup files which do not exist anymore crosscheck backup device type disk; delete noprompt expired backup; -- delete backups older than retention period report obsolete; delete noprompt obsolete; -- backup database and archived redo logs backup as compressed backupset database plus archivelog delete input; exit ------------------------------------------------------------ -- backup control file only rman target / nocatalog run { allocate channel ch0 type disk format '/oradata/BACKUP/%d_%s_%t_%U'; backup current controlfile; } exit ============================================================ RECOVERY ============================================================ ------------------------------------------------------------ -- recover tablespace users -- start rman and login to the target database rman target / sql "alter tablespace users offline immediate"; restore tablespace users; recover tablespace users; sql "alter tablespace users online"; exit ------------------------------------------------------------ -- incomplete recovery from old backup - until time sqlplus / as sysdba shutdown immediate startup nomount exit rman target / alter database mount; restore database; recover database until time "to_date('09-04-2008 22:20','dd-mm-yyyy hh24:mi')"; alter database open resetlogs; exit ------------------------------------------------------------ -- incomplete recovery using control file from backup -- restore files rman target / nocatalog startup nomount; set dbid 3708878893; restore controlfile from '/oradata/BACKUP/DBNAME_1599_637421512_hvivshu8_1_1'; sql "alter database mount"; restore database; restore archivelog sequence between 3914 and 3919; exit -- do incomplete recovery sqlplus /nolog connect / as sysdba startup mount; recover database using backup controlfile until cancel; ORA-00279: change 469586816 generated at 10/31/2007 11:33:12 needed for thread 1 ORA-00289: suggestion : /oradata/DBNAME/arch/1_3919.dbf ORA-00280: change 469586816 for thread 1 is in sequence #3919 Specify log: {=suggested | filename | AUTO | CANCEL} ORA-00279: change 469593510 generated at 10/31/2007 11:55:07 needed for thread 1 ORA-00289: suggestion : /oradata/DBNAME/arch/1_3920.dbf ORA-00280: change 469593510 for thread 1 is in sequence #3920 ORA-00278: log file '/oradata/DBNAME/arch/1_3919.dbf' no longer needed for this recovery Specify log: {=suggested | filename | AUTO | CANCEL} cancel Media recovery cancelled. alter database open resetlogs; alter tablespace temp add tempfile '/oradata/DBNAME/temp01.dbf' size 897581056 reuse autoextend on next 655360 maxsize 32767m; ------------------------------------------------------------ -- incomplete recovery using control file from backup rman target / nocatalog startup nomount; set dbid 1384950137; restore controlfile from 'E:ORACLEFLASH_RECOVERY_AREAPDNLBACKUPSET2010_04_12O1_MF_NCNNF_BACKUP_PDNL_000202_0_5W52RZTX_.BKP'; sql "alter database mount"; restore database validate; list backup; restore archivelog sequence between 38205 and 38366 validate; restore database; recover database until sequence 38367; catalog start with 'E:ORACLEFLASH_RECOVERY_AREAPDNLBACKUPSET2010_04_15O1'; crosscheck backup device type disk completed between '14-APR-10' AND '16-APR-10'; restore archivelog sequence between 38367 and 38423 validate; recover database until sequence 38470; alter database open resetlogs; exit
相关文章推荐
- How to Configure RMAN I/O Block Size to Improve Backup and Recovery Performance [ID 107213.1]
- How to Configure RMAN I/O Block Size to Improve Backup and Recovery Performance [ID 107213.1]
- How To Perform Oracle Solaris 11 System Backup And Recovery
- How to Configure RMAN I/O Block Size to Improve Backup and Recovery Performance [ID 107213.1]
- How To Backup And Recovery On IBM AIX
- Oracle:How to create physical standby database with 11g RMAN DUPLICATE FROM ACTIVE DATABASE [ID 747250.1]
- How to extract controlfiles, datafiles, and archived logs from SMR backupsets without using RMAN
- How to Enabling and Diabling VxDMP devices for use with Oracle ASM
- Oracle11G RMAN_1_Introduction to Backup and Recovery
- RMAN-06025: no backup of archived log for thread X with sequence Y and starting SCN of Z found to re
- How To Backup Your Android Phone’s Boot, Recovery And System Partition Images -- RomDump
- How to setup multiple data sources with Spring and JPA
- How to make BBED(Oracle Block Brower and EDitor Tool) on Unix/Linux/Windows
- How to setup multiple data sources with Spring and JPA
- How To Set Up A USB-Over-IP Server And Client With Ubuntu 10.04
- How To Install and Configure PHD Virtual Backup For Citrix XenServer
- How To Save Your App Data With NSCoding and NSFileManager
- How to Determine the Version of Oracle XML Publisher for Oracle E-Business Suite 11i and Release 12 (Doc ID 362496.1)
- How To Configure IIS 6.0 and Tomcat with the JK 1.2 Connector
- How to create physical standby database with 11g RMAN DUPLICATE FROM ACTIVE DATABASE [ID 747250.1]