ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 备份恢复笔记

备份恢复笔记

原创 Linux操作系统 作者:soOracle 时间:2012-04-15 15:47:46 0 删除 编辑

rman 备份
rman
connect target sys/sys123@myorac1
backup database;
run{
    allocate channel c1 device type disk;
    allocate channel c2 device type disk;
    backup as compressed backupset database;
}

list backup;
list backup of database;
list backup of controlfile;
restore preview database ;
restore database from tag TAG20120410T142353;
SELECT FILE#,CHECKPOINT_CHANGE# FROM v$datafile ;
SELECT RFILE#,CHECKPOINT_CHANGE# FROM v$datafile_header;
recover database;
alter database open;

SELECT * FROM dba_tablespaces;
backup tablespace users;
backup tablespace users, TEST;

--备份数据文件
SELECT * FROM dba_data_files;
backup datafile 3,4;

--备份控制文件
backup current controlfile;

--备份参数文件
backup spfile;

--备份归档日志
backup archivelog all;
alter system switch logfile;

delete noprompt backup;  --不需要提示
delete backupset 13; --删除备份集
delete expired backupset 6;

crosscheck backupset 17;
list backup 4;

------------------rman 自动维护---------------------
delete obsolete;
report obsolete;

run{
backup database;
delete noprompt obsolete;
backup archivelog all;
}


CONFIGURE RETENTION POLICY TO recovery window of  7 days;

list backup of archivelog sequence 71;

CONFIGURE RETENTION

backup datebase format='D:\oracleBackup\%d_%U_%T.bak';
copy datafile 4 to 'd:\oracleBackup\user01.dbf';

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26885292/viewspace-721218/,如需转载,请注明出处,否则将追究法律责任。

下一篇: undo表空间
请登录后发表评论 登录
全部评论

注册时间:2012-04-15

  • 博文量
    5
  • 访问量
    5556