Friday, March 2, 2012

Enable Archive Log 11g

I setup a test box and wanted to do some RMAN testing. Noticed that my database was not set to archive log mode. I wanted to test some archive log backup and restores so needed to remedy this first.


This command will enable Archive Logging on your database


alter system set log_archive_start = TRUE scope=spfile

This command will set the destination for the archive logs


alter system set log_archive_dest_1='location=/u01/app/oracle/oradata/orcl/arch' scope=spfile;

Then we shut the database down and then start it up and mount it


shutdown immediate
startup mount

Then we enable archive logging and open the database


alter database archivelog;
alter database open; 

Run the archive log list command to check the settings


archive log list

Then force a log switch and check the directory to make sure you have an archive log.


alter system switch logfile;

Check your log destination directory you should see an archive log in the directory. You can run a show parameter command to see the archive parameters


show parameter archive

0 comments:

Post a Comment