你好,游客 登录 注册 搜索
背景:
阅读新闻

RMAN常用命令汇总

[日期:2012-06-16] 来源:Linux社区  作者:mikixiyou [字体:大 中 小]

3 、还原和恢复数据库操作命令
 

完全恢复

startup nomount;

run {

  allocate channel  t1 type disk;

  restore controlfile;

  restore archivelog all;

  alter database mount;

  restore database;

  recover database;

  release channel t1;

}

sql 'alter database open resetlogs';

 

不完全恢复,至某个时间点

startup nomount;

run {

  set until time ="to_date('2012-06-14 00:00:00','yyyy-mm-dd hh24:mi:ss')";

  allocate channel  t1 type disk;

  restore controlfile;

  restore archivelog all;

  alter database mount;

  restore database;

  recover database;

  release channel t1;

}

sql 'alter database open resetlogs';

 

RAC 环境中还原某几个归档日志文件

run

{

allocate channel t1 type disk;

restore archivelog from logseq  5023 thread 1 until logseq  5036 thread 1;

releaase channel t1;

}

 

单实例环境中还原某几个归档日志文件

run

{

allocate channel t1 type disk;

restore archivelog from logseq  5023 until logseq  5036;

releaase channel t1;

}

 

4 、注册备份集到 CATALOG 操作命令
catalog start with '/backup/xxx.xxx';

 

5 、其他管理命令
list backupset;

list backup of database;

list backup of archivelog all;

report obsolete;

report obsolete redundancy = 2;

delete obsolete;

restore database validate; 

report unrecoverable;

report schema;

crosscheck backup; 

delete expired backup; 

rman target sys/*****@ora10 catalog rman/rman@dbarep

 

allocate channel for maintenance device type disk;

delete obsolete redundancy = 4 device type disk; 

delete obsolete redundancy = 2 device type disk;

 

delete noprompt archivelog until time "sysdate-5"

更多的命令和说明请参考Oracle 官方文档和rman 帮助文档。

linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款