Change the Oracle archive path and archive mode

Source: Internet
Author: User

Change the Oracle archive path and archive mode   in oracle10g and 11g versions, the Oracle default log archive path is the Flashback recovery area ($ORACLE _base/flash_recovery_area). For this path, Oracle has a limitation, that is, the default is only 2G of space, and not just the default path of the archive log, but also the default address of the backup file and the flashback log, so that the archive log lock uses less than 2G of space, without setting the path size of the case, Many systems have encountered an issue where archived logs are full and cannot be archived, which can be used to view archived information using the following SQL statement.  SQL> Archive Log List database logging mode             Non-archive mode AutoArchive         &NBS P   Disable Archive endpoint            use_db_recovery_file_dest oldest online log sequence     321 current log sequence   & nbsp       326.   Archive endpoint above use_db_recovery_file_dest default is the Flashback recovery area ($ORACLE _base/flash_recovery_area), you can view the Flash recovery area information through the following SQL.   www.2cto.com  SQL> Show parameter db_recovername                 &N Bsp      type         VALUE-------------------------- --------------------------- ------------db_recovery_file_dest       string      d:\oracle\flash_recovery_areadb_ Recovery_file_dest_size  big integer   2g  You can see from the above SQL results that the Flashback recovery area is D:\oracle\flash_recovery_area, size 2G, or you can query v$ Recovery_file_dest view to view the limit information for flashback recovery.  SQL> Select name,space_limit,space_used from v$recovery_file_dest;name                           Space_limit space_used----------------------------------------- ----------D:\oracle\flash_recovery_area   2147483648   21225472  by default, archived logs are stored in the Flashback recovery area (D:\oracle\flash _recovery_area), if the Flashback recovery area has been used to 2G, the archive log may not continue to archive, the database is compacted, the usual solution is to increase the flash recovery area, can be implemented with the following SQL.  SQL> alter system set DB_RECOVERY_FILE_DEST_SIZE=3G;   is the current pressing problem with this approach, although the Flashback recovery area Oracle automatically manages to clean up useless data if there is not enough space in the Flashback recovery area, but if the backup strategy is not perfect and the database is very busy, you may encounter this situation. Usually you need to modify the path of the archive log, put the archive log to other unrestricted path to solve the problem, you can use the following SQL to modify the archive log storage path.  SQL> alter system set log_archive_dest_1= ' Location=d:\arch ';  www.2cto.com    then starts the database to mount state, modifies the database to archive mode, and then launches the database to the open state.  SQL> shutdown immediate database is closed. The database has been uninstalled. OThe Racle routine has been closed. Sql> startup Mountoracle Routine has been started. The database is loaded. sql> ALTER DATABASE Archivelog; sql> ALTER DATABASE open;   Review the archive of the database again.  SQL> Archive Log List database logging mode             Archive mode auto-archive             Enable archive endpoint            d:\arch oldest online log sequence     321 next archive log sequence   326 current log sequence &nbsp ;         326  can verify that the archive path is set correctly by switching logs to see if an archive log is generated under the archive path, and you can switch logs by using the following command.  SQL> alter system switch logfile;  www.2cto.com    See if an archive path is generated under the archive path (D:\arch).  D:\arch>dir/bARC0000000326_0764368160.0001  can see that the archive log has been generated under the D:\arch path, and the name of the archived log is Log_archive_ The format parameter is limited and can be viewed by the following command.  SQL> Show parameter log_archive_formatname                   TYPE &N Bsp       VALUE----------------------------------------------log_archive_format     string       arc%s_%r.%t  top productionThe raw archive file name arc0000000326_0764368160.0001,%s is 0000000326 is the log switch number, that is, the archive log list above the current sequence of logs,%r is the scene number,%t is the thread number, Can be understood as the node number, if it is not a RAC environment,%t is 1, you can also add the Log_archive_format parameter value%d,%d is a 16 binary ID dbid, shown below: sql> alter system set LOG_ archive_format= ' Arc%s_%r.%t_%d.log ' scope=spfile; the system has changed.  www.2cto.com  SQL> Shutdown immediate database is closed. The database has been uninstalled. The ORACLE routine has been closed. The sql> startuporacle routine has been started. The database is loaded. The database is already open. sql> alter system switch logfile;   View the name of the archive log, 5aa14a62 is the 16 binary dbid.  d:\arch>dir/barc0000000326_0764368160.0001arc0000000327_0764368160.0001_5aa14a62. LOG

Change the Oracle archive path and archive mode

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.