备份恢复笔记

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/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值