Wednesday, October 17, 2018

Enable ARCHIVELOG Mode on Oracle 11g

1-      Create Directory for store archivelog


$ mkdir -p /Archivelog/DBNANE

SQL> archive log list
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            /u01/app/oracle/product/11.2.0/db_1/dbs/arch
Oldest online log sequence     5
Current log sequence           7


2-      Change Archive destination


SQL> ALTER SYSTEM SET log_archive_dest ='/Archivelog/DBNANE' ;

System altered.

SQL>  archive log list
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            /Archivelog/DBNANE
Oldest online log sequence     5
Current log sequence           7

3-      Enabling database to archivelog mode


SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup mount;
ORACLE instance started.

Total System Global Area  941600768 bytes
Fixed Size                  1348860 bytes
Variable Size             608176900 bytes
Database Buffers          327155712 bytes
Redo Buffers                4919296 bytes
Database mounted.

SQL> alter database archivelog;

Database altered.

SQL> alter database open ;

Database altered.

SQL> alter system switch logfile ;

System altered.

SQL> /

System altered.

SQL> !ls -ltr  /Archivelog/DBNANE
total 11284


-rw-r----- 1 oracle oinstall     1024 Jan 20 15:35 1_8_769768273.dbf
-rw-r----- 1 oracle oinstall 29083648 Jan 20 15:35 1_7_769768273.dbf

SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /Archivelog/DBNANE
Oldest online log sequence     7
Next log sequence to archive   9
Current log sequence           9

SQL> show parameter dest

log_archive_dest                     string      /Archivelog/DBNANE

No comments:

Post a Comment