Oracle turns archiving mode on or off
Oracle can run in two modes: archive mode (archivelog) and non-archive mode (noarchivelog)
Archiving mode can improve the recoverability of Oracle database, and all production databases should run in this mode.
The archiving mode should be combined with the corresponding backup strategy, only the archiving mode without the corresponding backup strategy will only cause trouble.
1. Check whether archiving is enabled. Currently, it is not enabled.
SYS@icsdb > archive log list
Database log mode non-archiving mode
Automatic archiving is disabled
End of Archive / home/db/oracle/product/11.2.0/dbhome_1/dbs/arch
The earliest online log sequence 93
Current log sequence 95
2. Set the archive path
Alter system set log_archive_dest_1='location=/ora_arch'
3. Close the database
SYS@icsdb > shutdown immediate
The database has been closed.
The database has been uninstalled.
The ORACLE routine has been closed.
4. Start the database to mount state
SYS@icsdb > startup mount
The ORACLE routine has been started.
Total System Global Area 417546240 bytes
Fixed Size 2253824 bytes
Variable Size 314575872 bytes
Database Buffers 96468992 bytes
Redo Buffers 4247552 bytes
The database is loaded.
5. Enable or stop archive mode
If you want to enable archive mode
SYS@icsdb > alter database archivelog
The database has changed
If you want to deactivate archive mode
SYS@icsdb > alter database noarchivelog
The database has changed
6. Check the database status and open the database
SYS@icsdb > select instance_name,status from v$instance
INSTANCE_NAME STATUS
-
Icsdb MOUNTED
SYS@icsdb > alter database open
The database has changed.
7. Check the filing status
SYS@icsdb > archive log list
Database log mode archive mode
Automatic archiving enabled
End of Archive / ora_arch
The earliest online log sequence 93
Next archive log sequence 95
Current log sequence 95