Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Database \ Oracle archive log deletion     - Java, hashcode, equals and == (Programming)

- How to write a new Git protocol (Linux)

- Git and GitHub use of Eclipse and Android Studio (Programming)

- Network Security: SYN attacks against under linux (Linux)

- 12 novice Linux command must learn (Linux)

- Python script file directory traversal examples (Programming)

- Use Spring cache and ehcache (Programming)

- Ubuntu 14.10 / 14.04 / 12.04 How to install Kodi 14.0 RC3 (Linux)

- Zabbix configuration of SNMP (Server)

- Linux C source code (Ascii HexToBinary: Converts hexadecimal string format ASCII codes) (Programming)

- CentOS How quickly customize kernel binary RPM package (Linux)

- CentOS 6.4 of cron scheduled task configuration (Linux)

- Based on Python: OpenCV simple image manipulation (Programming)

- Linux network security probing tools Hping2 (Linux)

- Java threads and thread pools (Programming)

- 30 minutes with your Quick Start MySQL Tutorial (Database)

- MongoDB collection data migration to MySQL database (Database)

- 5 steps to help you become a good Docker contributors (Linux)

- Installation on Ubuntu class Winamp audio player Qmmp 0.9.0 (Linux)

- Ubuntu 14.04 compile, install, configure, the latest development version GoldenDict (Linux)

 
         
  Oracle archive log deletion
     
  Add Date : 2018-11-21      
         
         
         
  We all know that recorded in the controlfile in every a archivelog information, of course, after they in the OS to the physical file delete out in our controlfile still recording these archivelog information, there is in Oracle's OEM Manager visual log to show when we manually clear the file archive directory, these records have not been removed from the controlfile us, that is oracle does not know these files no longer exist! this time we have to do manual scavenging then, here I go through the experiment, you can try this approach:

1. Go to rman

2. connect target /

3. crosscheck archivelog all;

4. delete expired archivelog all;

This time we will certainly go OEM seen see, if you've never done this action, we can compare the controlfile from this action before the size of the operation after the controlfile!

ORACLE properly remove and archive space reclamation methods

ORACLE properly remove and archive space reclamation methods

ORACLE often a log file is full, the performance / oraarchive this file space occupancy 100% why we must not complain ORACLE archive maintenance tools, a lot of people just delete wrong, wrong, ORACLE there, and very intelligent, you can correct and delete archived FLASHBACK, but remember, ORACLE ORACLE archive logs for data recovery and backup is very important, not a last resort do not delete archived logs.

Archive log deletion process

Log in to ORACLE database server to a host or via a network connection

Enter the ORACLE data backup tool

rman target /

Or rman target / @ orcl

In the Command window inside the implementation

DELETE ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-7';

Explanation

SYSDATA-7, indicating that the current system time seven days ago, before the archive log keyword indicates 7 days ago, if you use the flashback function will delete flashback data.

Similarly, you can delete from seven days ago to the present all the logs, but the order to think clearly, to finish this deletion, the best full backup of the database immediately

DELETE ARCHIVELOG FROM TIME 'SYSDATE-7';

 

UNIX / LINUX can also find the archive data under 7 days ago by FIND, delete sub-operation using EXEC

 

find / oraarchive -xdev -mtime +7 -name "* .dbf" -exec rm -f {};

This still leaves the archive file is not managed in the RMAN

Still need to run the following two commands in RMAN

crosscheck archivelog all;

delete expired archivelog all;

So it was not as easy to use the method above, but with the benefits of FIND is that you can in the conditions, and the EXEC child do many operations to achieve more complex functions

3. brief overview report obsolete command

 

Use report obsolete expired backup command reports

RMAN> report obsolete;

RMAN retention policy will be applied to the command

RMAN retention policy is set to redundancy 1

Report of obsolete backups and copies

Type Key Completion Time Filename / Handle

-------------------- ------ ------------------ ------ --------------

Backup Set 125 01-NOV-04

Backup Piece 125 01-NOV-04 / data1 / oracle / orabak / full_1_541045804

Backup Set 131 04-NOV-04

Backup Piece 131 04-NOV-04 / data1 / oracle / orabak / full_AVATAR2_20041104_131

....

Backup Set 173 06-DEC-04

Backup Piece 173 06-DEC-04 / data1 / oracle / orabak / full_AVATAR2_20041206_173

Backup Set 179 11-DEC-04

Backup Piece 179 11-DEC-04 /data1/oracle/orabak/arch544588206.arc

.....

Backup Piece 189 17-DEC-04 /data1/oracle/orabak/arch545106606.arc

Backup Set 190 17-DEC-04

Backup Piece 190 17-DEC-04 /data1/oracle/orabak/arch545106665.arc

Backup Set 191 20-DEC-04

Backup Piece 191 20-DEC-04 / data1 / oracle / orabak / arch_AVATAR2_20041220_194

Archive Log 2973 20-DEC-04 /opt/oracle/oradata/avatar2/archive/1_2985.dbf

Archive Log 2971 20-DEC-04 /opt/oracle/oradata/avatar2/archive/1_2984.dbf

.....

Archive Log 2705 17-DEC-04 /opt/oracle/oradata/avatar2/archive/1_2717.dbf

Archive Log 2704 17-DEC-04 /opt/oracle/oradata/avatar2/archive/1_2716.dbf

Archive Log 2703 17-DEC-04 /opt/oracle/oradata/avatar2/archive/1_2715.dbf

Archive Log 2702 17-DEC-04 /opt/oracle/oradata/avatar2/archive/1_2714.dbf

 

4. Use the delete obsolete command to delete outdated backups:

 

RMAN> delete obsolete;

 

RMAN retention policy will be applied to the command

RMAN retention policy is set to redundancy 1

using channel ORA_DISK_1

Deleting the following obsolete backups and copies:

Type Key Completion Time Filename / Handle

-------------------- ------ ------------------ ------ --------------

Backup Set 125 01-NOV-04

Backup Piece 125 01-NOV-04 / data1 / oracle / orabak / full_1_541045804

....

Archive Log 2704 17-DEC-04 /opt/oracle/oradata/avatar2/archive/1_2716.dbf

Archive Log 2703 17-DEC-04 /opt/oracle/oradata/avatar2/archive/1_2715.dbf

Archive Log 2702 17-DEC-04 /opt/oracle/oradata/avatar2/archive/1_2714.dbf

 

Do you really want to delete the above objects (enter YES or NO)? Yes

deleted backup piece

backup piece handle = / data1 / oracle / orabak / full_AVATAR2_20041206_173 recid = 173 stamp = 544156241

.....

deleted archive log

archive log filename = / opt / oracle / oradata / avatar2 / archive / 1_2715.dbf recid = 2703 stamp = 545108268

deleted archive log

archive log filename = / opt / oracle / oradata / avatar2 / archive / 1_2714.dbf recid = 2702 stamp = 545107659

Deleted 286 objects

 

 

RMAN> crosscheck archivelog all;

 

released channel: ORA_DISK_1

allocated channel: ORA_DISK_1

channel ORA_DISK_1: sid = 19 devtype = DISK

specification does not match any archive log in the recovery catalog

 

 

5 rman archive log with crosscheck examination, two archive log is a failure:

RMAN> crosscheck archivelog all;

 

Release channels: ORA_DISK_1

Distribution channels: ORA_DISK_1

Channel ORA_DISK_1: sid = 14 devtype = DISK

Validation of archived log failed

Archived log file name = D: ORACLEORADATATESTARCHIVE1_47.DBF record ID = 1 timestamp = 572 866

683

Validation of archived log failed

Archived log file name = D: ORACLEORADATATESTARCHIVE11_48.DBF Record ID = 2 timestamp = 57286

6931

2 objects have been cross-checked

 

6 Try to synchronize it, look okay, not the result, crosscheck or failure:

RMAN> resync catalog;

 

Starting full recovery catalog resync

To complete a full resync

 

RMAN> crosscheck archivelog all;

 

Release channels: ORA_DISK_1

Distribution channels: ORA_DISK_1

Channel ORA_DISK_1: sid = 14 devtype = DISK

Validation of archived log failed

Archived log file name = D: ORACLEORADATATESTARCHIVE1_47.DBF record ID = 1 timestamp = 572 866

683

Validation of archived log failed

Archived log file name = D: ORACLEORADATATESTARCHIVE11_48.DBF Record ID = 2 timestamp = 57286

6931

2 objects have been cross-checked

 

7 A list expired see if there is failure of the archive log, there is no proof of the failure of the archive log:

RMAN> list expired archivelog all;

 

Description and recovery catalog does not match any of the archived logs

 

8 to try to change the language setting, the results crosscheck again, two archive log had been successful:

RMAN> exit

 

 

Recovery Manager complete.

 

C:> set nls_lang = american_america.zhs16gbk

 

C:> rman catalogrman / rman @ safetarget /

 

Recovery Manager: Release 9.2.0.1.0 - Production

 

Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.

 

connected to target database: TEST (DBID = 1870953724)

connected to recovery catalog database

 

RMAN> crosscheck archivelog all;

 

allocated channel: ORA_DISK_1

channel ORA_DISK_1: sid = 9 devtype = DISK

validation succeeded for archived log

archive log filename = D: ORACLEORADATATESTARCHIVE1_47.DBF recid = 1 stamp = 57286

6683

validation succeeded for archived log

archive log filename = D: ORACLEORADATATESTARCHIVE11_48.DBF recid = 2 stamp = 5728

66931

Crosschecked 2 objects
     
         
         
         
  More:      
 
- GO five stages of language learning (Programming)
- CentOS 6.4 installation and configuration LNMP build PHP server runtime environment (Server)
- RHEL6.5 install the latest version of Vim and increase support for the Python2.7.5 (Linux)
- DataGuard the MRP can not start to analyze and solve problems (Database)
- Wi-Fi hackers use to attack your seven methods (Linux)
- MySQL partition summary (Database)
- Upgrading KDE Plasma 5.3 in Ubuntu 15.04 (Linux)
- Kubernetes (k8s) environment to build combat (Server)
- MySQL related statements (CRUD) (SQLyog software) (Database)
- Stucts2 values on the page and how the attribute values corresponding to the Action (Programming)
- Create the best introductory tutorial REST API (Linux)
- OpenGL Programming Guide (8th edition of the original book) - compute shader (Programming)
- Linux platform Oracle MySQL connection (Database)
- MySQL main and backup replication structures (using mysqld_multi) (Database)
- Linux uses the SMTP proxy to send mail (Linux)
- Getting Started Linux Shell Scripting (Programming)
- Tsunami-udp accelerated network transmission (Linux)
- Nginx reverse proxy and self-signed https (Server)
- Java concurrent programming using the synchronized keyword ReentrantLock alternative primitive (Programming)
- FileZilla FTP && TLS connection settings of (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.