博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
转:Oracle how-to backup and recovery with RMAN
阅读量:5072 次
发布时间:2019-06-12

本文共 4287 字,大约阅读时间需要 14 分钟。

Oracle how-to

backup and recovery with RMAN

 

============================================================BACKUP============================================================-------------------------------------------------------------- backup full database - compressed-- start rman and login to the target databaserman target /-- do not back up unchanged data filesCONFIGURE BACKUP OPTIMIZATION ON;-- Configure the number of server processes (channels) that write backups to DISKCONFIGURE DEVICE TYPE DISK PARALLELISM 2;-- configure backup destinationconfigure channel device type disk format '/data/backup/dbname/%U';-- automatically backup controlfile whenever you do backup of the databaseconfigure controlfile autobackup format for device type disk to '/data/backup/dbname/%F';-- keep backups 14 daysconfigure retention policy to recovery window of 14 days;-- delete records in repository for backup files which do not exist anymorecrosscheck backup device type disk;delete noprompt expired backup;-- delete backups older than retention periodreport obsolete;delete noprompt obsolete;-- backup database and archived redo logsbackup as compressed backupset database plus archivelog delete input;exit-------------------------------------------------------------- backup control file onlyrman target / nocatalogrun{  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 databaserman 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 timesqlplus / as sysdbashutdown immediatestartup nomountexitrman 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 filesrman target / nocatalogstartup 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 recoverysqlplus /nologconnect / as sysdbastartup mount;recover database using backup controlfile until cancel;ORA-00279: change 469586816 generated at 10/31/2007 11:33:12 needed for thread 1ORA-00289: suggestion : /oradata/DBNAME/arch/1_3919.dbfORA-00280: change 469586816 for thread 1 is in sequence #3919Specify log: {=suggested | filename | AUTO | CANCEL}ORA-00279: change 469593510 generated at 10/31/2007 11:55:07 needed for thread 1ORA-00289: suggestion : /oradata/DBNAME/arch/1_3920.dbfORA-00280: change 469593510 for thread 1 is in sequence #3920ORA-00278: log file '/oradata/DBNAME/arch/1_3919.dbf' no longer needed for this recoverySpecify log: {=suggested | filename | AUTO | CANCEL}cancelMedia 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 backuprman target / nocatalogstartup 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

转载于:https://www.cnblogs.com/weaver1/archive/2012/03/07/2383374.html

你可能感兴趣的文章
QTextCodec中的setCodecForTr等终于消失了 (Qt5)
查看>>
洛谷 P2197 【模板】nim游戏
查看>>
autoconf、automake
查看>>
学习方向、当前要做的事
查看>>
如何一步一步用DDD设计一个电商网站(三)—— 初涉核心域
查看>>
Mybatis Generator最完整配置详解
查看>>
实现web多语言的一种解决办法
查看>>
Entity Framework Core Relationship的学习笔记
查看>>
Delphi XE7的安卓程序如何调用JAVA的JAR,使用JAVA的类?
查看>>
jmeter学习
查看>>
pandas DataFrame 警告(SettingWithCopyWarning)
查看>>
了解实时媒体的播放(RTP/RTCP 和 RTSP)
查看>>
编写Makefile规则
查看>>
SpiderMonkey的使用
查看>>
限定 edittext 的 输入内容
查看>>
1002 A + B Problem II
查看>>
STL算法
查看>>
time series review
查看>>
获取iframe中的元素
查看>>
.NetCore下使用Prometheus实现系统监控和警报 (四)客户端代码处理
查看>>