oracle删除归档日志

查看归档模式:

SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /OraLog/arch
Oldest online log sequence
Next log sequence to archive
Current log sequence

修改oracle日志模式(是否归档)

1. 关闭数据库:shutdown immediate;
2. 启动数据库实例到mount状态:startup mount;
3. 切换数据库日志模式:
      alter database archivelog;(设置数据库为归档日志模式)
      alter database noarchivelog;(设置数据库为非归档日志模式)
4. 打开数据库:alter database open;
5. 确认数据库处于归档模式:archive log list;

查看asm空间:

select name,total_mb,free_mb from v$asm_diskgroup_stat;
NAME                            TOTAL_MB       FREE_MB
------------------------------     ----------           ----------
ARCHDG                                   
DATADG                                    
rman
connect target /
crosscheck archivelog all;
delete expired archivelog all;
delete archivelog all completed before 'sysdate - 4';

  

删除归档日志脚本:

export ORACLE_BASE=/u01/app/oracle
export ORACLE_SID=dyjldb1
export ORACLE_HOME=$ORACLE_BASE/product/10.2./db_1 $ORACLE_HOME/bin/rman log=/home/oracle/rman.log <<EOF
connect target /
run {
delete noprompt archivelog all completed before 'sysdate - 4';
}
exit;
EOF

Oracle查询被锁死:

https://www.cnblogs.com/SweetMemory/p/6289980.html

上一篇:python 全栈开发,Day75(Django与Ajax,文件上传,ajax发送json数据,基于Ajax的文件上传,SweetAlert插件)


下一篇:如何检查oracle的归档日志及空间占用率,清除归档日志