OS환경 : Oracle Linux 6.8 (64bit)
DB 환경 : Oracle Database 11.2.0.4
방법 : rman 으로 아카이브로그 정리하기
0. sqlplus 접속해서 아카이브로그 파일 확장자 확인
1 2 3 4 5 6 7 8 9 10 | [oracle@orcl ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0 Production on Fri Oct 12 11:26:52 2018 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, Real Application Clusters and Automatic Storage Management options SQL> show parameter log_archive_format NAME TYPE VALUE ------------------------------------ --------------------------------- ------------------------------ log_archive_format string orcl%t_%s_%r.arc |
1. rman target /로 rman에 접속
1 2 3 4 | [oracle@orcl ~]$ rman target / Recovery Manager: Release 11.2.0.4.0 - Production on Fri Oct 12 11:25:02 2018 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. connected to target database: ORCL (DBID=1501707358) |
2. 아래 명령어로 아카이브로그 파일 확인
FRA영역에 아카이브로그 파일이 있음을 확인가능함
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | RMAN> LIST ARCHIVELOG LIKE '%.arc' 2> ; using target database control file instead of recovery catalog List of Archived Log Copies for database with db_unique_name ORCL ===================================================================== Key Thrd Seq S Low Time ------- ---- ------- - -------- 28 1 487 A 18/10/07 Name: +FRA/archive/orcl_1_487_979730782.arc 34 1 488 A 18/10/08 Name: +FRA/archive/orcl_1_488_979730782.arc 35 1 489 A 18/10/08 Name: +FRA/archive/orcl_1_489_979730782.arc 36 1 490 A 18/10/08 Name: +FRA/archive/orcl_1_490_979730782.arc 38 1 491 A 18/10/09 Name: +FRA/archive/orcl_1_491_979730782.arc 39 1 492 A 18/10/09 Name: +FRA/archive/orcl_1_492_979730782.arc 43 1 493 A 18/10/09 Name: +FRA/archive/orcl_1_493_979730782.arc 27 2 180 A 18/10/08 Name: +FRA/archive/orcl_2_180_979730782.arc 29 2 181 A 18/10/08 Name: +FRA/archive/orcl_2_181_979730782.arc 30 2 182 A 18/10/08 Name: +FRA/archive/orcl_2_182_979730782.arc 31 2 183 A 18/10/08 Name: +FRA/archive/orcl_2_183_979730782.arc 32 2 184 A 18/10/08 Name: +FRA/archive/orcl_2_184_979730782.arc 33 2 185 A 18/10/08 Name: +FRA/archive/orcl_2_185_979730782.arc 37 2 186 A 18/10/08 Name: +FRA/archive/orcl_2_186_979730782.arc 40 2 187 A 18/10/09 Name: +FRA/archive/orcl_2_187_979730782.arc 41 2 188 A 18/10/10 Name: +FRA/archive/orcl_2_188_979730782.arc 42 2 189 A 18/10/10 Name: +FRA/archive/orcl_2_189_979730782.arc |
3. 아래 명령어로 아카이브로그파일 모두 삭제(만료된것은 안지워짐)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | RMAN> DELETE ARCHIVELOG LIKE '%.arc'; allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=66 instance=ORCL2 device type=DISK List of Archived Log Copies for database with db_unique_name ORCL ===================================================================== Key Thrd Seq S Low Time ------- ---- ------- - -------- 28 1 487 A 18/10/07 Name: +FRA/archive/orcl_1_487_979730782.arc 34 1 488 A 18/10/08 Name: +FRA/archive/orcl_1_488_979730782.arc 35 1 489 A 18/10/08 Name: +FRA/archive/orcl_1_489_979730782.arc 36 1 490 A 18/10/08 Name: +FRA/archive/orcl_1_490_979730782.arc 38 1 491 A 18/10/09 Name: +FRA/archive/orcl_1_491_979730782.arc 39 1 492 A 18/10/09 Name: +FRA/archive/orcl_1_492_979730782.arc 43 1 493 A 18/10/09 Name: +FRA/archive/orcl_1_493_979730782.arc 27 2 180 A 18/10/08 Name: +FRA/archive/orcl_2_180_979730782.arc 29 2 181 A 18/10/08 Name: +FRA/archive/orcl_2_181_979730782.arc 30 2 182 A 18/10/08 Name: +FRA/archive/orcl_2_182_979730782.arc 31 2 183 A 18/10/08 Name: +FRA/archive/orcl_2_183_979730782.arc 32 2 184 A 18/10/08 Name: +FRA/archive/orcl_2_184_979730782.arc 33 2 185 A 18/10/08 Name: +FRA/archive/orcl_2_185_979730782.arc 37 2 186 A 18/10/08 Name: +FRA/archive/orcl_2_186_979730782.arc 40 2 187 A 18/10/09 Name: +FRA/archive/orcl_2_187_979730782.arc 41 2 188 A 18/10/10 Name: +FRA/archive/orcl_2_188_979730782.arc 42 2 189 A 18/10/10 Name: +FRA/archive/orcl_2_189_979730782.arc |
여기서 삭제하겠냐고 물어보면 YES 입력
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | Do you really want to delete the above objects (enter YES or NO)? yes deleted archived log archived log file name=+FRA/archive/orcl_1_487_979730782.arc RECID=28 STAMP=988986854 deleted archived log archived log file name=+FRA/archive/orcl_1_488_979730782.arc RECID=34 STAMP=988986875 deleted archived log archived log file name=+FRA/archive/orcl_1_489_979730782.arc RECID=35 STAMP=989013705 deleted archived log archived log file name=+FRA/archive/orcl_1_490_979730782.arc RECID=36 STAMP=989046028 deleted archived log archived log file name=+FRA/archive/orcl_1_491_979730782.arc RECID=38 STAMP=989100052 deleted archived log archived log file name=+FRA/archive/orcl_1_492_979730782.arc RECID=39 STAMP=989100121 deleted archived log archived log file name=+FRA/archive/orcl_1_493_979730782.arc RECID=43 STAMP=989107321 deleted archived log archived log file name=+FRA/archive/orcl_2_180_979730782.arc RECID=27 STAMP=988986561 deleted archived log archived log file name=+FRA/archive/orcl_2_181_979730782.arc RECID=29 STAMP=988986864 deleted archived log archived log file name=+FRA/archive/orcl_2_182_979730782.arc RECID=30 STAMP=988986869 deleted archived log archived log file name=+FRA/archive/orcl_2_183_979730782.arc RECID=31 STAMP=988986870 deleted archived log archived log file name=+FRA/archive/orcl_2_184_979730782.arc RECID=32 STAMP=988986871 deleted archived log archived log file name=+FRA/archive/orcl_2_185_979730782.arc RECID=33 STAMP=988986871 deleted archived log archived log file name=+FRA/archive/orcl_2_186_979730782.arc RECID=37 STAMP=989046029 deleted archived log archived log file name=+FRA/archive/orcl_2_187_979730782.arc RECID=40 STAMP=989107255 deleted archived log archived log file name=+FRA/archive/orcl_2_188_979730782.arc RECID=41 STAMP=989107266 deleted archived log archived log file name=+FRA/archive/orcl_2_189_979730782.arc RECID=42 STAMP=989107319 Deleted 17 objects |
4. 삭제되었는지 다시 확인
모두 삭제가 되어서 나오지 않음(expried 된 아카이브로그 파일이 있으면 나옴)
1 2 3 | RMAN> LIST ARCHIVELOG LIKE '%.arc'; specification does not match any archived log in the repository |
5. expried 된 아카이브로그 파일 삭제방법
1 | RMAN> delete expired archivelog all; |
참조 :
'ORACLE > Admin' 카테고리의 다른 글
oracle redo log 삭제 및 추가 및 리사이즈 하기 (0) | 2018.11.08 |
---|---|
failed login attempts 설정 후 실패한 세션 확인 (0) | 2018.10.24 |
oracle dba_data_files의 maxsize (2) | 2018.09.07 |
tnsnames 설정으로 다른서버 db 접속 (0) | 2018.09.06 |
dbms_redefinition 패키지 테스트 시나리오 (2) | 2018.08.31 |