您的位置:首页 > 其它

Delete archivelog in the primary database

2013-09-18 10:25 411 查看
ORACLE_RMAN_delete archivelog in the primary database

About RMAN-08137, please refer to :

1.  Case 1

Check that the standby database is uptodate - if not, restartmanaged recovery and resolve the gap first then query the Primaryv$archived_log view again for any log sequences that still have applied='NO'.

If you still have logs with applied='NO' and you are certain that these logshas been applied at standby and there is no 'gap', you need to remove theentries from the rman repository:

a. check that  the physical files still exist on disk and if they do, usean OS command to delete them

b. run crosschek followed by delete expired to remove them from the rmanrepository

RMAN>crosscheckarchivelog all;

RMAN>delete expired archivelog all;

Once the problematic log(s)  have been removed from the rman repositoryyou can resume normal use of 'delete input' option on  the backup command.

 

2.  Case 2

RMAN is used to backup archivelogs fromPrimary site using the syntax:

    backup archivelog ...... delete input;

All logs are backed up successfully but not deleted; for each log the

following error is returned:

RMAN-8137: WARNING: archive log not deleted as it is still needed

archive log filename=<log> thread=<thrd> sequence=<seq>

The archivelogs have definitely been shipped and applied to standby site

which runs in maximum availability mode.

No logs are being deleted from Primary site after backup leaving the database

at risk of going down if the archivelog directory fills.

Logs have to be deleted manually.
WORKAROUND:-----------
Donot use DELETE INPUT option when backing up logs in a Data Guard environment.

Use instead (for example):

backup ARCHIVELOG UNTIL TIME '<date>' not backed up 1 times to devicetype

sbt;

delete archivelog until time '<date>' backed up 1 times to device typesbt;
Just a case:

delete noprompt archivelog until time'sysdate -1' backed up 1 times to device type sbt;
Or

run{

ALLOCATE CHANNEL FOR MAINTENANCE TYPEDISK;

    crosscheck archivelog all;

    delete noprompt archivelog until time 'sysdate -1' backed up1 times to device type sbt;

    delete noprompt archivelog until time 'sysdate -1' backed up1 times to device type disk;

    release channel;

}

 

 

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐