1.连接目标数据库: rman TARGET /
2.启动和关闭数据库:
RMAN>startup mount;
RMAN>shutdown immediate;
[@more@]
3.列出目标数据库当前的schema:
RMAN>report schema;
4.备份数据库:
*全备份:
RMAN>run
{
allocate channel c1 type disk;
backup database format 'e:/oracle/rmanbackup/db_%d_%s.bak';
}
RMAN>backup database;
*增量备份:
RMAN>backup incremental level database;
5.备份表空间:
RMAN>backup tablespace ;
6.备份归档日志:
RMAN>backup archivelog all delete input;
7.COPY数据文件:
RMAN>copy datafile to '/tmp/.cpy';
8.列出备份和拷贝:
RMAN>list backup;
RMAN>list copy;
9.验证备份的restore
RMAN>restore database validate;
10.恢复数据库:
RMAN>shutdown immediate;
RMAN>exit;
模拟删除数据文件;
RMAN>connect target /
RMAN>restore database;
RMAN>recover database;
RMAN>alter database open;
11.恢复表空间:
RMAN>run
{
sql 'alter tablespace offline immediate';
restore tablespace ;
recover tablespace ;
sql 'alter tablespace online';
}
12.显示RMAN设置:
RMAN>show all;
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/20546452/viewspace-783336/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/20546452/viewspace-783336/