Enable database in Archivelog mode in Oracle database 11gR2
Posted by Mir Sayeed Hassan on February 13th, 2018
Enable database in Archivelog mode in Oracle database 11gR2
Check the database Instance Name & Version
sys@TESTDB>select INSTANCE_NAME, VERSION from v$instance; INSTANCE_NAME VERSION ---------------- ----------------- testdb 11.2.0.4.0
Check the status of the database in archive mode or not
sys@TESTDB>select log_mode from v$database; LOG_MODE ------------ NOARCHIVELOG
To enable the database in archivelog mode, Fallow the below procedure
Shutdown the database, if it’s in running
sys@TESTDB>shu immediate Database closed. Database dismounted. ORACLE instance shut down.
Set the below parameters in parameter file for archive log format & destination
(vi $ORACLE_HOME/dbs/inittestdb.ora)
*.log_archive_format=’%t_%s_%r.arc’
*.log_archive_dest_1=’location=/u01/app/oracle/oradata/archive’
If case you want you can specify second destination, assign below given loc
log_archive_dest_2=’location=/u02/oradata/archive’
sys@TESTDB> startup mount ORACLE instance started. Total System Global Area 2455228416 bytes Fixed Size 2255712 bytes Variable Size 771753120 bytes Database Buffers 1660944384 bytes Redo Buffers 20275200 bytes Database mounted.
Enable archivelog mode
sys@TESTDB> alter database archivelog; Database altered.
sys@TESTDB> archive log list; Database log mode Archive Mode Automatic archival Enabled Archive destination /u01/app/oracle/oradata/archive Oldest online log sequence 12488 Next log sequence to archive 12489 Current log sequence 12489
sys@TESTDB> alter database open; Database altered.
Verify:
sys@TESTDB> select log_mode from V$database; LOG_MODE ----------- ARCHIVELOG
sys@TESTDB> alter system switch logfile; System altered.
[oracle@ogg-test1 archive]$ ll total 4296 -rw-rw----. 1 oracle oracle 4384768 Feb 13 11:57 1_12489_895132695.arc