Changing the Database Archiving Mode

To change the archiving mode of the database,use the ALTER DATABASE statement with the ARCHIVELOG or NOARCHIVELOG clause. To change the archiving mode,you must be connected to the database with administrator privileges ( AS SYSDBA).

The following steps switch the database archiving mode fromNOARCHIVELOG to automatic ARCHIVELOG:

  1. Shut down the database instance.

    SHUTDOWN
    

    An open database must first be closed and any associated instances shut down before you can switch the database archiving mode. You cannot change the mode fromARCHIVELOG to NOARCHIVELOG if any datafiles need media recovery.

  2. Back up the database.

    Before making any major change to a database,always back up the database to protect against any problems. This will be your final backup of the database inNOARCHIVELOG mode and can be used if something goes wrong during the change toARCHIVELOG mode.

  3. Edit the initialization parameter file to include the initialization parameters that specify the destinations for the archived redo log files

  4. Start a new instance and mount,but do not open,the database.

    STARTUP MOUNT
    

    To enable or disable archiving,the database must be mounted but not open.

  5. Change the database archiving mode. Then open the database for normal operations.

    ALTER DATABASE ARCHIVELOG;
    ALTER DATABASE OPEN;
    
  6. Shut down the database.

    SHUTDOWN IMMEDIATE
    
  7. Back up the database.

    Changing the database archiving mode updates the control file. After changing the database archiving mode,you must back up all of your database files and control file. Any previous backup is no longer usable because it was taken inNOARCHIVELOG mode.

The following steps switch the database archiving mode fromNOARCHIVELOG to matual ARCHIVELOG:

  1. Shut down the database instance.

    SHUTDOWN
    

    An open database must first be closed and any associated instances shut down before you can switch the database archiving mode. You cannot change the mode fromARCHIVELOG to NOARCHIVELOG if any datafiles need media recovery.

  2. Back up the database.

    Before making any major change to a database,always back up the database to protect against any problems. This will be your final backup of the database inNOARCHIVELOG mode and can be used if something goes wrong during the change toARCHIVELOG mode.

  3. Edit the initialization parameter file to include the initialization parameters that specify the destinations for the archived redo log files

  4. Start a new instance and mount,the database must be mounted but not open.

  5. Change the database archiving mode. Then open the database for normal operations.

    ALTER DATABASE ARCHIVELOG MANUAL;
    ALTER DATABASE OPEN;
    
  6. Shut down the database.

    SHUTDOWN IMMEDIATE
    
  7. Back up the database.

    Changing the database archiving mode updates the control file. After changing the database archiving mode,you must back up all of your database files and control file. Any previous backup is no longer usable because it was taken inNOARCHIVELOG mode.

When you operate your database in manual ARCHIVELOG mode,you must archive inactive groups of filled redo log files or your database operation can be temporarily suspended. To archive a filled redo log group manually,connect with administrator privileges. Ensure that the database is either mounted or open. Use the ALTER SYSTEM statement with theARCHIVE LOG clause to manually archive filled redo log files. The following statement archives all unarchived log files:

ALTER SYSTEM ARCHIVE LOG ALL;

When you use manual archiving mode,you cannot specify any standby databases in the archiving destinations.

Even when automatic archiving is enabled,you can use manual archiving for such actions as rearchiving an inactive group of filled redo log members to another location. In this case,it is possible for the instance to reuse the redo log group before you have finished manually archiving,and thereby overwrite the files. If this happens,the database writes an error message to the alert log.





相关文章

文章浏览阅读773次,点赞6次,收藏9次。【代码】c# json字符...
文章浏览阅读8.7k次,点赞2次,收藏17次。此现象一般定位到远...
文章浏览阅读2.8k次。mysql脚本转化为oracle脚本_mysql建表语...
文章浏览阅读2.2k次。cx_Oracle报错:cx_Oracle DatabaseErr...
文章浏览阅读1.1k次,点赞38次,收藏35次。本文深入探讨了Or...
文章浏览阅读1.5k次。默认自动收集统计信息的时间为晚上10点...