Oracle 归档日志
netnr 2023-02-16
# 进入 oracle 用户
su - oralce

# 查看归档
SQL> archive log list;
# 查看归档路径及大小限制
SQL> show parameter recover;
# 看看归档日志(按百分比),超 90% 随时有宕机的危险
SQL> select * from v$flash_recovery_area_usage;
SQL> select * from v$recovery_file_dest;
# 增大归档日志空间
SQL> alter system set db_recovery_file_dest_size=20G;

# 进入 RMAN 或 rman target /
RMAN> connect target /
# RMAN> rman target system/oracle
# 或 rman target sys/pass

# 列出认归档日志路径
RMAN> list archivelog all;

# 删除 90 天以前的归档日志
RMAN> delete archivelog all completed before 'sysdate-90';
# 删除 1 小时前的归档日志
RMAN> delete force archivelog all completed before 'sysdate-1/24';
# 删除 3 天前到现在的全部日志
RMAN> delete archivelog from time 'sysdate-3';

# 检查归档日志
RMAN> crosscheck archivelog all;

# 删除失效的归档日志
RMAN> delete expired archivelog all;

# 强行删除所有日志
RMAN> delete noprompt force archivelog all;
登录写评论