您好,登錄后才能下訂單哦!
--1、開啟歸檔
【步驟】
a.一致性關閉數據庫(shutdown [immediate | transactional |normal])
b.啟動到mount階段(startup mount)
c.切換到歸檔模式(alter database archivelog[manual])
d.切換到open階段(alter database open)
e.對數據做一個完整備份(full backup)
show parameter spfile
alter system set log_archive_dest_1='location=/ggs/arch_data' scope=spfile;
alter system set db_recovery_file_dest_size=100g scope=spfile sid='*';
alter system set db_recovery_file_dest='/ggs/ora_recovery' scope=spfile;
alter system set log_archive_format='arch_%t_%s_%r.arc' scope=spfile;
shutdown immediate;
startup mount;
alter database archivelog;
alter database open ;
archive log list;
--2、關閉歸檔
【步驟】歸檔模式切換到非歸檔模式
a. [immediate | transactional |normal])一致性關閉數據庫(shutdown
b.啟動到mount階段(startup mount)
c.切換到歸檔模式(alter database noarchivelog)
d.切換到open階段(alter database open)
關閉歸檔模式:
shutdown immediate;
startup mount;
alter database noarchivelog;
alter database open;
查看歸檔文件:
select * from v$log;
select * from v$logfile;
select * from v$flash_recovery_area_usage;
report obsolete;
delete obsolete;
備份歸檔文件:
backup archivelog all;
也可以:
先執行alter system switch logfile;
再找到歸檔日志位置,復制到別的地方即可。
rman target /
delete archivelog all completed before 'sysdate-7';
backup first
backup format '/tmp/arch-%t_%s_%u' archivelog all delete input;
或者backup database plus archivelog;
刪除歸檔文件:
rman target / 或者 rman target user/password@tns
list archivelog all;
crosscheck archivelog all;
list expired archivelog all;
delete expired archivelog all;
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。