Oracle turn on/off archive mode

Source: Internet
Author: User

1. Change non-archive mode to archive mode:
1) sql> Conn/as sysdba (database connected as DBA)
2) sql> shutdown immediate; (Close database now)
3) Sql> startup mount (launches the instance and loads the database but does not open)
4) sql> ALTER DATABASE archivelog; (Change database to archive mode)
5) sql> ALTER DATABASE open; (Open database)
6) sql> alter system archive log start; (Enable automatic archiving)
7) Sql> exit (exit)

Use Rman for a full backup because the backup log generated in non-archived log mode is no longer available for archive mode.

Sql>ArchiveLoglist; database log mode non-archive mode AutoArchive disable archive endpoint use_db_recovery_file_dest oldest online log sequence8Current log sequenceTenSQL> SelectName,log_mode fromv$Database; NAME Log_mode--------- ------------ORCL Noarchivelogsql> shutdownimmediate; The database is closed. The database has been uninstalled. The ORACLE routine has been closed. SQL>The startup Mount;oracle routine has been started. Total System Global Area855982080bytesfixed Size2180544bytesvariable Size553650752bytesDatabaseBuffers293601280Bytesredo Buffers6549504The bytes database is loaded. SQL> Alter DatabaseArchivelog; The database has changed. SQL> Alter Database Open; the database has changed. SQL> AlterSystem ArchiveLogstart; the system has changed. SQL>ArchiveLoglit; SP2-0718: illegal ARCHIVE.LOGoption SQL>ArchiveLoglist; database log mode archive Mode AutoArchive enable archive endpoint use_db_recovery_file_dest oldest online log sequence8next archived log sequenceTenCurrent log sequenceTenSQL>

2. Change the archive mode to non-archive mode:
1) Sql>shutdown normal or shutdown immediate;
2) Sql>startup Mount;
3) Sql>alter database noarchivelog;
4) Sql>alter database open;

Sql> shutdownimmediate; The database is closed. The database has been uninstalled. The ORACLE routine has been closed. SQL>The startup Mount;oracle routine has been started. Total System Global Area855982080bytesfixed Size2180544bytesvariable Size553650752bytesDatabaseBuffers293601280Bytesredo Buffers6549504The bytes database is loaded. SQL> Alter DatabaseNoarchivelog; The database has changed. SQL> Alter Database Open; the database has changed. SQL>ArchiveLoglist; database log mode non-archive mode AutoArchive disable archive endpoint use_db_recovery_file_dest oldest online log sequence8Current log sequenceTenSQL> SelectName,log_mode fromv$Database; NAME Log_mode--------- ------------ORCL Noarchivelogsql>

3. Archive related commands
Select Name,log_mode from v$database; View archive status
Archive log list; View archive status
Archive log stop;
Archive log start;
Archive log list;
Show parameters;
Show Parameters Log_archive_start;
Show Parameters log_archive_max_process; #归档进程数
alter system set LOG_ARCHIVE_MAX_PROCESS=5; #将归档进程数改为5
SELECT * from V$bgprocess; #检察后台进程

Oracle turn on/off 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.