oracle歸檔日誌過滿清理
歸檔日誌過大導致資料庫連線失敗,解決方法有三種
1.增大db_recovery_file_dest_size值
2:更換歸檔日誌路徑
3:檢查失效的歸檔日誌檔案,然後刪除(或者刪除N天以前的歸檔日誌)
一.增大db_recovery_file_dest_size值
[oracle@XXXX ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Jun 8 08:18:56 2017
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/arch
Oldest online log sequence 22
Next log sequence to archive 26
Current log sequence 26
SQL> show parameter db_recovery_dest
SQL> show parameter db_recovery
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string /u01/arch
db_recovery_file_dest_size big integer 2G
SQL> alter system set db_recovery_file_dest_size=4294967296; ---------(4x1024x1024x1024)
System altered.
SQL> show parameter db_recovery_file
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string /u01/arch
db_recovery_file_dest_size big integer 4G
二、刪除歸檔日誌
[oracle@XXXX ~]$ rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Thu Jun 8 08:20:28 2017
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: PROD (DBID=322088611)
RMAN> list archivelog all;
using target database control file instead of recovery catalog
List of Archived Log Copies
Key Thrd Seq S Low Time Name
------- ---- ------- - --------- ----
9 1 8 A 11-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_12/o1_mf_1_8_dk9ht6jf_.arc
10 1 9 A 11-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_12/o1_mf_1_9_dk9ht6mk_.arc
11 1 10 A 12-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_12/o1_mf_1_10_dk9ht885_.arc
12 1 1 A 12-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_15/o1_mf_1_1_dkk7df0n_.arc
13 1 2 A 15-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_16/o1_mf_1_2_dkmybt18_.arc
14 1 3 A 16-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_22/o1_mf_1_3_dl3t8q9o_.arc
15 1 4 A 22-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_24/o1_mf_1_4_dl8wdxm6_.arc
16 1 5 A 24-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_5_dlcpcjbg_.arc
17 1 6 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_6_dlcq4sj5_.arc
18 1 7 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_7_dlcr1zpt_.arc
19 1 8 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_8_dld2rxo4_.arc
20 1 9 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_9_dld2s0dn_.arc
21 1 10 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_10_dld3j48q_.arc
22 1 11 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_11_dld3j5ol_.arc
23 1 12 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_12_dld3j6v4_.arc
24 1 13 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_13_dld3j7dr_.arc
25 1 14 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_14_dld3jfv7_.arc
26 1 15 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_15_dld3jfy6_.arc
27 1 16 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_16_dld3jg0c_.arc
28 1 17 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_17_dld3jg0o_.arc
29 1 18 A 25-MAY-17 /u01/arch1_18_943760710.dbf
30 1 19 A 26-MAY-17 /u01/arch1_19_943760710.dbf
31 1 20 A 26-MAY-17 /u01/arch1_20_943760710.dbf
32 1 21 A 26-MAY-17 /u01/arch1_21_943760710.dbf
33 1 22 A 31-MAY-17 /u01/arch1_22_943760710.dbf
34 1 23 A 08-JUN-17 /u01/arch/1_23_943760710.dbf
35 1 24 A 08-JUN-17 /u01/arch/1_24_943760710.dbf
36 1 25 A 08-JUN-17 /u01/arch/1_25_943760710.dbf
RMAN> delete archivelog all completed before 'sysdate-1';
(刪除當前系統時間-1天之前的歸檔日誌)
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=141 devtype=DISK
List of Archived Log Copies
Key Thrd Seq S Low Time Name
------- ---- ------- - --------- ----
9 1 8 A 11-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_12/o1_mf_1_8_dk9ht6jf_.arc
10 1 9 A 11-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_12/o1_mf_1_9_dk9ht6mk_.arc
11 1 10 A 12-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_12/o1_mf_1_10_dk9ht885_.arc
12 1 1 A 12-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_15/o1_mf_1_1_dkk7df0n_.arc
13 1 2 A 15-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_16/o1_mf_1_2_dkmybt18_.arc
14 1 3 A 16-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_22/o1_mf_1_3_dl3t8q9o_.arc
15 1 4 A 22-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_24/o1_mf_1_4_dl8wdxm6_.arc
16 1 5 A 24-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_5_dlcpcjbg_.arc
17 1 6 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_6_dlcq4sj5_.arc
18 1 7 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_7_dlcr1zpt_.arc
19 1 8 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_8_dld2rxo4_.arc
20 1 9 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_9_dld2s0dn_.arc
21 1 10 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_10_dld3j48q_.arc
22 1 11 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_11_dld3j5ol_.arc
23 1 12 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_12_dld3j6v4_.arc
24 1 13 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_13_dld3j7dr_.arc
25 1 14 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_14_dld3jfv7_.arc
26 1 15 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_15_dld3jfy6_.arc
27 1 16 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_16_dld3jg0c_.arc
28 1 17 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_17_dld3jg0o_.arc
29 1 18 A 25-MAY-17 /u01/arch1_18_943760710.dbf
30 1 19 A 26-MAY-17 /u01/arch1_19_943760710.dbf
31 1 20 A 26-MAY-17 /u01/arch1_20_943760710.dbf
32 1 21 A 26-MAY-17 /u01/arch1_21_943760710.dbf
Do you really want to delete the above objects (enter YES or NO)? yes
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_12/o1_mf_1_8_dk9ht6jf_.arc recid=9 stamp=943760710
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_12/o1_mf_1_9_dk9ht6mk_.arc recid=10 stamp=943760712
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_12/o1_mf_1_10_dk9ht885_.arc recid=11 stamp=943760715
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_15/o1_mf_1_1_dkk7df0n_.arc recid=12 stamp=944014224
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_16/o1_mf_1_2_dkmybt18_.arc recid=13 stamp=944103261
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_22/o1_mf_1_3_dl3t8q9o_.arc recid=14 stamp=944623387
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_24/o1_mf_1_4_dl8wdxm6_.arc recid=15 stamp=944789408
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_5_dlcpcjbg_.arc recid=16 stamp=944881522
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_6_dlcq4sj5_.arc recid=17 stamp=944882331
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_7_dlcr1zpt_.arc recid=18 stamp=944883266
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_8_dld2rxo4_.arc recid=19 stamp=944894238
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_9_dld2s0dn_.arc recid=20 stamp=944894240
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_10_dld3j48q_.arc recid=21 stamp=944894980
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_11_dld3j5ol_.arc recid=22 stamp=944894981
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_12_dld3j6v4_.arc recid=23 stamp=944894982
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_13_dld3j7dr_.arc recid=24 stamp=944894983
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_14_dld3jfv7_.arc recid=25 stamp=944894989
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_15_dld3jfy6_.arc recid=26 stamp=944894989
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_16_dld3jg0c_.arc recid=27 stamp=944894990
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_17_dld3jg0o_.arc recid=28 stamp=944894990
Deleted 20 objects
RMAN-06207: WARNING: 4 objects could not be deleted for DISK channel(s) due
RMAN-06208: to mismatched status. Use CROSSCHECK command to fix status
RMAN-06210: List of Mismatched objects
RMAN-06211: ==========================
RMAN-06212: Object Type Filename/Handle
RMAN-06213: --------------- ---------------------------------------------------
RMAN-06214: Archivelog /u01/arch1_18_943760710.dbf
RMAN-06214: Archivelog /u01/arch1_19_943760710.dbf
RMAN-06214: Archivelog /u01/arch1_20_943760710.dbf
RMAN-06214: Archivelog /u01/arch1_21_943760710.dbf
RMAN> crosscheck archivelog all;
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=141 devtype=DISK
validation failed for archived log
archive log filename=/u01/arch1_18_943760710.dbf recid=29 stamp=944960303
validation failed for archived log
archive log filename=/u01/arch1_19_943760710.dbf recid=30 stamp=944969753
validation failed for archived log
archive log filename=/u01/arch1_20_943760710.dbf recid=31 stamp=944969887
validation failed for archived log
archive log filename=/u01/arch1_21_943760710.dbf recid=32 stamp=945401231
validation failed for archived log
archive log filename=/u01/arch1_22_943760710.dbf recid=33 stamp=946109008
validation succeeded for archived log
archive log filename=/u01/arch/1_23_943760710.dbf recid=34 stamp=946109739
validation succeeded for archived log
archive log filename=/u01/arch/1_24_943760710.dbf recid=35 stamp=946109739
validation succeeded for archived log
archive log filename=/u01/arch/1_25_943760710.dbf recid=36 stamp=946109739
Crosschecked 8 objects
RMAN> delete expired archivelog all;
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=141 devtype=DISK
List of Archived Log Copies
Key Thrd Seq S Low Time Name
------- ---- ------- - --------- ----
29 1 18 X 25-MAY-17 /u01/arch1_18_943760710.dbf
30 1 19 X 26-MAY-17 /u01/arch1_19_943760710.dbf
31 1 20 X 26-MAY-17 /u01/arch1_20_943760710.dbf
32 1 21 X 26-MAY-17 /u01/arch1_21_943760710.dbf
33 1 22 X 31-MAY-17 /u01/arch1_22_943760710.dbf
Do you really want to delete the above objects (enter YES or NO)? yes
deleted archive log
archive log filename=/u01/arch1_18_943760710.dbf recid=29 stamp=944960303
deleted archive log
archive log filename=/u01/arch1_19_943760710.dbf recid=30 stamp=944969753
deleted archive log
archive log filename=/u01/arch1_20_943760710.dbf recid=31 stamp=944969887
deleted archive log
archive log filename=/u01/arch1_21_943760710.dbf recid=32 stamp=945401231
deleted archive log
archive log filename=/u01/arch1_22_943760710.dbf recid=33 stamp=946109008
Deleted 5 EXPIRED objects
RMAN> list archivelog all;
List of Archived Log Copies
Key Thrd Seq S Low Time Name
------- ---- ------- - --------- ----
34 1 23 A 08-JUN-17 /u01/arch/1_23_943760710.dbf
35 1 24 A 08-JUN-17 /u01/arch/1_24_943760710.dbf
36 1 25 A 08-JUN-17 /u01/arch/1_25_943760710.dbf
RMAN> delete archivelog from time 'sysdate-7';
(刪除7天內的歸檔日誌)
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=141 devtype=DISK
List of Archived Log Copies
Key Thrd Seq S Low Time Name
------- ---- ------- - --------- ----
34 1 23 A 08-JUN-17 /u01/arch/1_23_943760710.dbf
35 1 24 A 08-JUN-17 /u01/arch/1_24_943760710.dbf
36 1 25 A 08-JUN-17 /u01/arch/1_25_943760710.dbf
Do you really want to delete the above objects (enter YES or NO)? yes
deleted archive log
archive log filename=/u01/arch/1_23_943760710.dbf recid=34 stamp=946109739
deleted archive log
archive log filename=/u01/arch/1_24_943760710.dbf recid=35 stamp=946109739
deleted archive log
archive log filename=/u01/arch/1_25_943760710.dbf recid=36 stamp=946109739
Deleted 3 objects
RMAN> list archivelog all;
specification does not match any archive log in the recovery catalog
RMAN> exit
Recovery Manager complete.
三、更換歸檔日誌路徑
1.增大db_recovery_file_dest_size值
2:更換歸檔日誌路徑
3:檢查失效的歸檔日誌檔案,然後刪除(或者刪除N天以前的歸檔日誌)
一.增大db_recovery_file_dest_size值
[oracle@XXXX ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Jun 8 08:18:56 2017
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/arch
Oldest online log sequence 22
Next log sequence to archive 26
Current log sequence 26
SQL> show parameter db_recovery_dest
SQL> show parameter db_recovery
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string /u01/arch
db_recovery_file_dest_size big integer 2G
SQL> alter system set db_recovery_file_dest_size=4294967296; ---------(4x1024x1024x1024)
System altered.
SQL> show parameter db_recovery_file
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string /u01/arch
db_recovery_file_dest_size big integer 4G
二、刪除歸檔日誌
[oracle@XXXX ~]$ rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Thu Jun 8 08:20:28 2017
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: PROD (DBID=322088611)
RMAN> list archivelog all;
using target database control file instead of recovery catalog
List of Archived Log Copies
Key Thrd Seq S Low Time Name
------- ---- ------- - --------- ----
9 1 8 A 11-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_12/o1_mf_1_8_dk9ht6jf_.arc
10 1 9 A 11-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_12/o1_mf_1_9_dk9ht6mk_.arc
11 1 10 A 12-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_12/o1_mf_1_10_dk9ht885_.arc
12 1 1 A 12-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_15/o1_mf_1_1_dkk7df0n_.arc
13 1 2 A 15-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_16/o1_mf_1_2_dkmybt18_.arc
14 1 3 A 16-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_22/o1_mf_1_3_dl3t8q9o_.arc
15 1 4 A 22-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_24/o1_mf_1_4_dl8wdxm6_.arc
16 1 5 A 24-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_5_dlcpcjbg_.arc
17 1 6 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_6_dlcq4sj5_.arc
18 1 7 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_7_dlcr1zpt_.arc
19 1 8 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_8_dld2rxo4_.arc
20 1 9 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_9_dld2s0dn_.arc
21 1 10 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_10_dld3j48q_.arc
22 1 11 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_11_dld3j5ol_.arc
23 1 12 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_12_dld3j6v4_.arc
24 1 13 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_13_dld3j7dr_.arc
25 1 14 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_14_dld3jfv7_.arc
26 1 15 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_15_dld3jfy6_.arc
27 1 16 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_16_dld3jg0c_.arc
28 1 17 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_17_dld3jg0o_.arc
29 1 18 A 25-MAY-17 /u01/arch1_18_943760710.dbf
30 1 19 A 26-MAY-17 /u01/arch1_19_943760710.dbf
31 1 20 A 26-MAY-17 /u01/arch1_20_943760710.dbf
32 1 21 A 26-MAY-17 /u01/arch1_21_943760710.dbf
33 1 22 A 31-MAY-17 /u01/arch1_22_943760710.dbf
34 1 23 A 08-JUN-17 /u01/arch/1_23_943760710.dbf
35 1 24 A 08-JUN-17 /u01/arch/1_24_943760710.dbf
36 1 25 A 08-JUN-17 /u01/arch/1_25_943760710.dbf
RMAN> delete archivelog all completed before 'sysdate-1';
(刪除當前系統時間-1天之前的歸檔日誌)
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=141 devtype=DISK
List of Archived Log Copies
Key Thrd Seq S Low Time Name
------- ---- ------- - --------- ----
9 1 8 A 11-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_12/o1_mf_1_8_dk9ht6jf_.arc
10 1 9 A 11-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_12/o1_mf_1_9_dk9ht6mk_.arc
11 1 10 A 12-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_12/o1_mf_1_10_dk9ht885_.arc
12 1 1 A 12-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_15/o1_mf_1_1_dkk7df0n_.arc
13 1 2 A 15-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_16/o1_mf_1_2_dkmybt18_.arc
14 1 3 A 16-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_22/o1_mf_1_3_dl3t8q9o_.arc
15 1 4 A 22-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_24/o1_mf_1_4_dl8wdxm6_.arc
16 1 5 A 24-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_5_dlcpcjbg_.arc
17 1 6 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_6_dlcq4sj5_.arc
18 1 7 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_7_dlcr1zpt_.arc
19 1 8 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_8_dld2rxo4_.arc
20 1 9 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_9_dld2s0dn_.arc
21 1 10 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_10_dld3j48q_.arc
22 1 11 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_11_dld3j5ol_.arc
23 1 12 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_12_dld3j6v4_.arc
24 1 13 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_13_dld3j7dr_.arc
25 1 14 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_14_dld3jfv7_.arc
26 1 15 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_15_dld3jfy6_.arc
27 1 16 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_16_dld3jg0c_.arc
28 1 17 A 25-MAY-17 /u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_17_dld3jg0o_.arc
29 1 18 A 25-MAY-17 /u01/arch1_18_943760710.dbf
30 1 19 A 26-MAY-17 /u01/arch1_19_943760710.dbf
31 1 20 A 26-MAY-17 /u01/arch1_20_943760710.dbf
32 1 21 A 26-MAY-17 /u01/arch1_21_943760710.dbf
Do you really want to delete the above objects (enter YES or NO)? yes
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_12/o1_mf_1_8_dk9ht6jf_.arc recid=9 stamp=943760710
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_12/o1_mf_1_9_dk9ht6mk_.arc recid=10 stamp=943760712
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_12/o1_mf_1_10_dk9ht885_.arc recid=11 stamp=943760715
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_15/o1_mf_1_1_dkk7df0n_.arc recid=12 stamp=944014224
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_16/o1_mf_1_2_dkmybt18_.arc recid=13 stamp=944103261
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_22/o1_mf_1_3_dl3t8q9o_.arc recid=14 stamp=944623387
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_24/o1_mf_1_4_dl8wdxm6_.arc recid=15 stamp=944789408
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_5_dlcpcjbg_.arc recid=16 stamp=944881522
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_6_dlcq4sj5_.arc recid=17 stamp=944882331
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_7_dlcr1zpt_.arc recid=18 stamp=944883266
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_8_dld2rxo4_.arc recid=19 stamp=944894238
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_9_dld2s0dn_.arc recid=20 stamp=944894240
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_10_dld3j48q_.arc recid=21 stamp=944894980
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_11_dld3j5ol_.arc recid=22 stamp=944894981
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_12_dld3j6v4_.arc recid=23 stamp=944894982
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_13_dld3j7dr_.arc recid=24 stamp=944894983
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_14_dld3jfv7_.arc recid=25 stamp=944894989
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_15_dld3jfy6_.arc recid=26 stamp=944894989
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_16_dld3jg0c_.arc recid=27 stamp=944894990
deleted archive log
archive log filename=/u01/oracle/app/oracle/flash_recovery_area/PROD/archivelog/2017_05_25/o1_mf_1_17_dld3jg0o_.arc recid=28 stamp=944894990
Deleted 20 objects
RMAN-06207: WARNING: 4 objects could not be deleted for DISK channel(s) due
RMAN-06208: to mismatched status. Use CROSSCHECK command to fix status
RMAN-06210: List of Mismatched objects
RMAN-06211: ==========================
RMAN-06212: Object Type Filename/Handle
RMAN-06213: --------------- ---------------------------------------------------
RMAN-06214: Archivelog /u01/arch1_18_943760710.dbf
RMAN-06214: Archivelog /u01/arch1_19_943760710.dbf
RMAN-06214: Archivelog /u01/arch1_20_943760710.dbf
RMAN-06214: Archivelog /u01/arch1_21_943760710.dbf
RMAN> crosscheck archivelog all;
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=141 devtype=DISK
validation failed for archived log
archive log filename=/u01/arch1_18_943760710.dbf recid=29 stamp=944960303
validation failed for archived log
archive log filename=/u01/arch1_19_943760710.dbf recid=30 stamp=944969753
validation failed for archived log
archive log filename=/u01/arch1_20_943760710.dbf recid=31 stamp=944969887
validation failed for archived log
archive log filename=/u01/arch1_21_943760710.dbf recid=32 stamp=945401231
validation failed for archived log
archive log filename=/u01/arch1_22_943760710.dbf recid=33 stamp=946109008
validation succeeded for archived log
archive log filename=/u01/arch/1_23_943760710.dbf recid=34 stamp=946109739
validation succeeded for archived log
archive log filename=/u01/arch/1_24_943760710.dbf recid=35 stamp=946109739
validation succeeded for archived log
archive log filename=/u01/arch/1_25_943760710.dbf recid=36 stamp=946109739
Crosschecked 8 objects
RMAN> delete expired archivelog all;
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=141 devtype=DISK
List of Archived Log Copies
Key Thrd Seq S Low Time Name
------- ---- ------- - --------- ----
29 1 18 X 25-MAY-17 /u01/arch1_18_943760710.dbf
30 1 19 X 26-MAY-17 /u01/arch1_19_943760710.dbf
31 1 20 X 26-MAY-17 /u01/arch1_20_943760710.dbf
32 1 21 X 26-MAY-17 /u01/arch1_21_943760710.dbf
33 1 22 X 31-MAY-17 /u01/arch1_22_943760710.dbf
Do you really want to delete the above objects (enter YES or NO)? yes
deleted archive log
archive log filename=/u01/arch1_18_943760710.dbf recid=29 stamp=944960303
deleted archive log
archive log filename=/u01/arch1_19_943760710.dbf recid=30 stamp=944969753
deleted archive log
archive log filename=/u01/arch1_20_943760710.dbf recid=31 stamp=944969887
deleted archive log
archive log filename=/u01/arch1_21_943760710.dbf recid=32 stamp=945401231
deleted archive log
archive log filename=/u01/arch1_22_943760710.dbf recid=33 stamp=946109008
Deleted 5 EXPIRED objects
RMAN> list archivelog all;
List of Archived Log Copies
Key Thrd Seq S Low Time Name
------- ---- ------- - --------- ----
34 1 23 A 08-JUN-17 /u01/arch/1_23_943760710.dbf
35 1 24 A 08-JUN-17 /u01/arch/1_24_943760710.dbf
36 1 25 A 08-JUN-17 /u01/arch/1_25_943760710.dbf
RMAN> delete archivelog from time 'sysdate-7';
(刪除7天內的歸檔日誌)
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=141 devtype=DISK
List of Archived Log Copies
Key Thrd Seq S Low Time Name
------- ---- ------- - --------- ----
34 1 23 A 08-JUN-17 /u01/arch/1_23_943760710.dbf
35 1 24 A 08-JUN-17 /u01/arch/1_24_943760710.dbf
36 1 25 A 08-JUN-17 /u01/arch/1_25_943760710.dbf
Do you really want to delete the above objects (enter YES or NO)? yes
deleted archive log
archive log filename=/u01/arch/1_23_943760710.dbf recid=34 stamp=946109739
deleted archive log
archive log filename=/u01/arch/1_24_943760710.dbf recid=35 stamp=946109739
deleted archive log
archive log filename=/u01/arch/1_25_943760710.dbf recid=36 stamp=946109739
Deleted 3 objects
RMAN> list archivelog all;
specification does not match any archive log in the recovery catalog
RMAN> exit
Recovery Manager complete.
三、更換歸檔日誌路徑
見http://blog.itpub.net/29618264/viewspace-2139879/
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29618264/viewspace-2140729/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle歸檔日誌清理Oracle
- oracle歸檔日誌Oracle
- oracle 刪除過期的歸檔日誌Oracle
- 歸檔oracle alert日誌Oracle
- 【Oracle】歸檔日誌管理-設定歸檔日誌路徑以及歸檔日誌冗餘Oracle
- 日誌檔案過大清理
- PostgreSQL的xlog/Wal歸檔及日誌清理SQL
- oracle11G歸檔日誌管理Oracle
- 【REDO】Oracle 日誌挖掘,分析歸檔日誌線上日誌主要步驟Oracle
- oracle dg 歸檔日誌恢復情況Oracle
- 【SQL】Oracle 歸檔日誌暴增原因分析SQLOracle
- Oracle歸檔日誌暴增排查優化Oracle優化
- oracle rman備份歸檔日誌需要先切換日誌嗎Oracle
- Oracle DataGuard歸檔日誌丟失處理方法Oracle
- oracle資料庫歸檔日誌量陡增分析Oracle資料庫
- 歸檔日誌挖掘
- PostgreSQL 歸檔日誌SQL
- Oracle使用備份檔案集恢復歸檔日誌Oracle
- 【LOG】Oracle資料庫清理日誌、跟蹤檔案利器Oracle資料庫
- 在Oracle中,如何定時刪除歸檔日誌檔案?Oracle
- 14. 日誌歸檔
- Linux 使用 crontab 定時拆分日誌、清理過期檔案Linux
- 手工rm刪除歸檔日誌對備份歸檔日誌的影響
- Oralce資料庫關閉歸檔日誌並且刪除歸檔日誌資料庫
- Oracle設定多個歸檔路徑生成多份歸檔日誌,Rman備份時也只備份其中的一份歸檔日誌Oracle
- 批量註冊歸檔日誌
- Oracle歸檔日誌所在目錄時間不對&&Oracle叢集日誌時間顯示錯誤Oracle
- 測試在丟失歸檔日誌的情況下,跳過部分歸檔日誌進行資料恢復資料恢復
- oracle清理trace、alert、aud、listener等日誌檔案Oracle
- DG歸檔日誌缺失恢復
- ArgoWorkflow教程(四)---Workflow & 日誌歸檔Go
- logminer異機挖掘歸檔日誌
- 通過RMAN設定standby接收日誌後主庫歸檔日誌才可刪除
- rman 還原歸檔日誌(restore archivelogRESTHive
- 如何快速找到備份過最近、最大序號的歸檔日誌
- 配置rman來自動刪除應用過的歸檔日誌
- oracle adg備庫歸檔滿了無法同步Oracle
- 歸檔日誌滿導致ORA-13516錯誤,awr報表不能自動收集
- oracle歸檔Oracle