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