Monday, September 1, 2014

Enabling Archive log in RMAN


This article is tested in oracle11gR2. How do we setup the RMAN in oracle? There are couple of ways, we can setup the RMAN. We can use control file to store backup catalog info or we can have separate database to store catalog info. Here I am using separate database to store backup catalog
information.

I am using Linux OS. Please remember, the directories and folder might change based on the operating system and environment. But the below steps are pretty much same for any environment.

Here i am using ORCL as primary database and CATDB as catalog database.

Step1 Enable the archive log in ORCL database.

Step 1.1 We need to build the pfile from spfile to add new entries. If you already have recent pfile, the you do not need to do this step.

Login as sys user and execute this to create pfile.

create pfile='/Integration/app/oraint/product/11.2.0/dbhome_1/dbs/pfile.ora' from spfile;

Step 1.2 Once pfile is created, then edit the pfile and add the below two parameters.

log_archive_format=Log_%s_%t_%r.arc
log_archive_dest='/Integration/app/oraint/product/11.2.0/dbhome_1/database/archive'

In case, if you already have the below two entries in the pfile, then we need to remove or comment this below two entries. Since we can not have this below two entry with above new two parameters.

db_recovery_file_dest='/Integration/app/oraint/fast_recovery_area'
db_recovery_file_dest_size=4322230272


Till oracle9i, we use
log_archive_start=true in parameter file. Since from oracle10g, this parameter is deprecated. We should not add this entry in pfile from oracle10g. If we have this entry in oracle10g, we get the below error.

ORA-32004:obsolete and/or deprecated parameter specified.

Step 1.3 Once pfile is edited, then we need to create the spfile with modified pfile. Login as sys user and execute the below command.

create spfile = '/Integration/app/oraint/product/11.2.0/dbhome_1/dbs/XX.ORA' from pfile='/Integration/app/oraint/product/11.2.0/dbhome_1/dbs/PFILE.ORA'

Step 1.4 Rename the original SPFILEORCL.ORA to different name. Then rename the XX.ORA to SPFILEORCL.ORA.

Step 1.5 Login as sys user and shutdown the database and follow the steps.

Mount the database
alter database archivelog
alter database open;

Here is the screen output....

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area 612368384 bytes
Fixed Size 1250428 bytes
Variable Size 188746628 bytes
Database Buffers 415236096 bytes
Redo Buffers 7135232 bytes
Database mounted.
SQL> alter database archivelog;

Database altered.

SQL> alter database open;

Database altered.

SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination / Integration/app/oraint/product/11.2.0/dbhome_1/ database/archive
Oldest online log sequence 2
Next log sequence to archive 4
Current log sequence 4
SQL>

No comments:

Post a Comment

IAS Cache initialization failed

 Today I faced an Issue in R12.2 instance. The solution I followed to overcome the issue is very simple, but they are more than one solution...