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/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/26885292/viewspace-721218/