Oracle Archive Management

Source: Internet
Author: User

Oracle Archive logs are often full, represented as/oraarchive this file space occupies 100% people must complain about why Oracle does not have archive maintenance tools, many people directly delete the incident, wrong, Oracle has, and very smart, can correctly delete the archive and FLASHBACK, Remember, however, that Oracle Archive logs are important for Oracle's data recovery and backup, and it is not necessary to delete archived logs. To delete the Oracle file log: 1. Log on to the database server host as an Oracle user or access the Oracle Data Backup tool via a network connection Rman target/or Rman target/@orcl2. Execute delete in the command window ARCHIVELOG all completed before ' sysdate-7'; Description SYSDATA-7, indicating that the current system time is 7 days ago, the Before keyword represents the archive log 7 days ago, and if flashback is used, the flashback data is deleted. Similarly, you can also delete all logs from 7 days ago to the present, but this command should be considered clearly, after this deletion, it is best to do a full backup database delete ARCHIVELOG from time ' sysdate-7'; Unix/linux can also find the archive data 7 days ago via find, delete find/oraarchive-xdev-mtime +7-name with exec sub-operation "*.dbf" -exec rm-f {}; Doing so still leaves an undocumented archive in Rman still needs to execute the following 2 commands in Rman crosscheck archivelog all;delete expired archivelog all; So it's not as good as the method above, but the advantage of using find is that you can do a lot of things on the condition, and on the Exec subkey, to achieve more complex functionality. Archive log logs are full Ora-00257:archiver error. Connect internal only, until freed error handling method 1. Log in with SYS user Sqlplus sys/[email protected] as SYSDBA2. See Archiv log location sql>     Show Parameter Log_archive_dest;name                                TYPE VALUE----------------------------------------------------------------------- ------log_archive_dest stringlog_archive_dest_1 stringlog_archive_dest_10 stri Ng3. General value is empty, you can use the archive log list; Check the archive directory and log sequencesql> Archive Log list;database log mode archive modeautomatic archival enabledarchive Destina tion use_db_recovery_file_destoldest Online log sequence 360Next log sequence to archive 360Current Log sequence 3624. Check the use of Flash recovery area, you can see Archivelog is very large, reached 96.62sql> SELECT * from V$flash_recovery_area_usage; File_type percent_space_used percent_space_reclaimable number_of_files-------------------------------------------                  ---------------------------controlfile. 0 1ONLINELOG   2.93 0 3ARCHIVELOG             96.62 0 141BACKUPPIECE 0 0                         0IMAGECOPY 0 0 0FLASHBACKLOG 0 0 05. Calculates the space occupied by the Flash recovery area sql> Select SUM (percent_space_used) *3/100 from V$flash_recovery_area_usage; SUM (percent_space_used) *3/100-----------------------------2.9904 6. Find the recovery directory, show parameter recoversql> Show parameter Recover;name TYPE VALUE-------------------------------------------- ---------------------------------db_recovery_file_dest string/u01/app/oracle/flash_recovery_are                     Adb_recovery_file_dest_size Big integer 5grecovery_parallelism integer 0 7 The above results tell us that the archive location is in the default value, placed under Flash_recovery_area (Db_recovery_file_dest directory =/u01/app/oRacle/flash_recovery_area) [[email protected] 10.2.0]# echo $ORACLE _base/u01/app/oracle[[email protected ] 10.2.0]# CD $ORACLE _base/flash_recovery_area/tt/archivelog transfer or clear the corresponding archive log, delete some unused date directory files, Note Keep The last few files (e.g. after 360)---------------------------------------------------------------------------------------Note: After you delete the archive log, you must maintain the control file with Rman or the space display is still not released. ---------------------------------------------------------------------------------------8. Rman Target sys/pass[[email protected] oracle]# rman target sys/passrecovery manager:release 10.2.0.4.0-productio  N on Tue Jan 01:41:26 2009Copyright (c) 1982, Oracle. All rights reserved.connected to target Database:tt (dbid=4147983671) 9. Check out some useless archivelogrman>. Crosscheck Archivelog all;10. Delete an expired archive rman> Delete Expired Archivelog all;delete archivelog until time 'sysdate-1'; Delete all archivelog11 until the day before. Query again, found that the use of normal, has been reduced to 23.03sql> SELECT * from V$flash_recovery_area_usage; File_type percent_space_usedPercent_space_reclaimable number_of_files----------------------------------------------------------------------                         Controlfile. 0 1ONLINELOG 2.93                   0 3ARCHIVELOG 23.03 0 36BACKUPPIECE 0 0 0IMAGECOPY 0 0 0F Lashbacklog 0 0 0 Other useful command:----------------------------------if a Rchive log mode can not be normal startup, the first recovery into noarchive log,startup successful, then Shutdown;shutdown immediate;startup mount;alter Database Noarchivelog;alter database Open;shutdown immediate; startup again with archive log mode shutdown Immediate;startup mount;show               Parameter Log_archive_dest;alter database archivelog;archive log list; ALTER DATABASE open; if not, remove some archlog logsql> Select group#,sequence# from V$loG group# sequence#--------------------1 62 3 64 2 63 It turns out that a log of log Group One cannot be archived sql&am P;GT; ALTER DATABASE clear unarchived logfile Group 1;alter database open; Finally, you can also specify the location of Arch Log, please configure the select name from V$datafile as follows ; alter system set log_archive_dest='/opt/app/oracle/oradata/usagedb/arch' Scope=spfile or modify size sql> Alter system set DB_RECOVERY_FILE_DEST_SIZE=3G Scope=both;

Oracle Archive Management

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.