Saturday, February 5, 2011

Enable Archive log mode

Enabling Archive Mode for a Database
---------------------------------------------------------------------
This activity requires down time . Please get the approval for enabling the archive mode if it is a production server.
Step 1.

Please bring down the application.
login: oracle
password:

>sqlplus '/as sysdba'
sql>show user
       ------output should be 'SYS'
sql>show parameter log_archive_format
sql>show parameter log_archive_dest_1
sql>show parameter log_archive_dest_state_1
sql>select username,status from v$session;
        -----please ensure that no user is connected to the database.
sql>create pfile from spfile;
sql>shutdown immediate
sql>exit

Step 2.


>cd $ORACLE_HOME/dbs
– in this location “ init
sid.ora” file is here ,
 (to find the
sid
in the above init file put this command ----- >echo $ORACLE_SID )

Now open this init
sid.ora file in vi mode and add the below three line code at the end, save & exit
 ( Give the location as per space availability in the server and make sure that given path is existed)

>vi initsid.ora

*.log_archive_format=%t_%r_%s.arc
*.log_archive_dest_1='LOCATION=/export/home/oracle/oradg/arch'
*.log_archive_dest_state_1=enable


 
Step 3.

>sqlplus '/as sysdba'
sql>startup pfile='$ORACLE_HOME/dbs/init
sid.ora';
sql> create spfile from pfile;
sql>shutdown immediate;

Step 4.
sql>startup;
sql>alter system checkpoint;
sql>shutdown immediate;
sql>startup mount exclusive;
sql>alter database archivelog;
sql>shutdown immediate;


 
Step 5.
sql>startup;
sql>alter system archive log current;

check for the archive log in the given path.
( if the archive files are created in this path we can confirm that the bove activity was successfulf )


-------------------   END OF DOCUMENT  -----------------------

No comments:

Post a Comment