启动归档模式:
shutdown immediate;
startup mount;
alter database archivelog;
alter database open;
查看归档模式:
archive log list
关闭归档模式:
shutdown immediate;
startup mount;
alter database noarchivelog;
alter database open;
查看归档文件:
show parameter db_recovery;
alter system set db_recovery_file_dest_size=100g scope=spfile sid='*';
select * from v$log;
select * from v$logfile;
select * from v$flash_recovery_area_usage;
report obsolete;
delete obsolete;
备份归档文件:
backup archivelog all;
删除归档文件:
1. rman target / 或者 rman target user/password@tns
list archive all;
crosscheck archivelog all;
list expired archivelog all;
delete expired archivelog all;
2. rman target /
delete archivelog all completed before 'sysdate-7';
3.backup first
backup format '/tmp/arch-%T_%s_%U' archivelog all delete input;
或者 backup database plus archivelog;
常用的备份配置:
rman target /;
spool log to a.log
configure retention policy to recovery window of 9 days;
configure backup optimization on;
configure default device type to 'disk';
configure controlfile autobackup on;
configure retention policy to redundancy to 1;
spool log off;
exit
阅读(1139) | 评论(1) | 转发(2) |