How to clear the archive log
来源:互联网 发布:杭州网站设计宣盟网络 编辑:程序博客网 时间:2024/05/05 20:03
Some time, the archive is full, we have to clear the archive log and then make the database normal.
The following way, maybe is useful to you.
1. For NO-DATAGUARD:
--- 1. Check the archivelog folder
# df -k
# su - oracle
$ sqlplus / as sysdba
SQL> archive log list;
--- 2. Move some old history archivelog files to the other folder which have enough free space
Maybe sometimes, we can't login the database or the rman, so, we must move some old archivelog files to the other folder, so that we can login the rman.
--- 3. Clear the history archivelog
# su - oracle
$ rman target /
RMAN> delete noprompt archivelog until time 'sysdate-1';
RMAN> crosscheck archivelog all;
RMAN> delete obsolete;
RMAN> exit;
$ sqlplus / as sysdba
SQL> alter system switch logfile;
--- 4. Please finish a FULL backup for the current database.
The old full backup have become to invalid, we must backup the current database.
2. For DATAGUARD:
--- 1. Check the following on the primary database and the standby database
On the primary database:
# su - oracle
$ sqlplus / as sysdba
SQL> archive log list;
On the standby database:
# su - oracle
$ sqlplus / as sysdba
SQL> set linesize 400
SQL> archive log list;
SQL> select process,status,thread#,sequence#,block#,blocks from v$managed_standby;
--- 2. If the archivelog folder close to full on the standby database
On the standby database:
You can clear archive log using the above steps.
--- 3. If the archivelog folder close to full on the primary database
On the primary database:
# su - oracle
$ rman target /
RMAN> delete noprompt archivelog until time 'sysdate -1'backed up 1 times to device type disk; <===== If there are some archvielog files which didn’t move to the standby database after had finished the full rman backup in the primary database, will be move, and have to rebuild the standby database.
If there are some old history archivelog can't delete, and show warning:RMAN-08137
Please don't remove them directly, because of they didn't were moved to the standby database, we have to check status of the standby database.
RMAN> crosscheck archivelog all;
RMAN> delete obsolete;
RMAN> exit;
- How to clear the archive log
- How to clear the grid
- How To Delete Archive Log Files Out Of +Asm
- Clear the database log
- How to clear COMS
- SQL to clear database log
- How to clear UIWebView cache?
- How to clear Java cache
- How to clear the views which are held in the ListView's RecycleBin?
- How to delete the log file of log4j dynamically
- How to Refine the Log Retention Settings in XenServer
- How to log the correct Ip having Varnish and Nginx
- How to enable the uart log in user version
- how to find the log file of mysql
- How to move the InnoDB log sequence number (LSN) forward
- how to capture log
- 如何清空 XMLHTTP 的 缓存 . How to clear the cache of XMLHTTP
- How to Clear the Application Server Cache Without Shutting it Down
- H264基本概念之 宏块、片和片组 .
- vc常用数据类型使用转换详解-(2013/09/18)
- textbox有个AutoCompleteType的属性
- Android NFC相关资料之MifareClassic卡(读写)
- c# Invoke和BeginInvoke 区别
- How to clear the archive log
- 随机产生一些数传递给一个函数,写程序找出并维护这些数的中位数。
- css样式表中margin负值的五种应用详解
- opencv中的内存泄露cvLoadImage
- •在使用微软提供的安全模版(安全策略)时需要注意的安全问题-(2013/09/18)
- 内存管理一点也不神秘————手绘iOS内存管理细节
- C#导出生成excel文件方法(xml,html方式)
- java基础08 异常
- 计算1的个数