You are on page 1of 5

DBA Activities

Author: DAVIS KAVIN G


FocusR Consultancy and Technologies Private
Limited
#Y83, 1st Floor, 4th Street, Y Block, Anna Nagar, Chennai,
Tamil Nadu - 600040, INDIA.
Phone: +91 44 4550 0999
Web site : www.focusrtech.com

1
DBA Activities

Contents
1. What Is the use of archieve logs: .................................................................................. 3
2. Enabling archive log: ................................................................................................. 4
3. Here is the screen output: ........................................................................................... 5

2
DBA Activities

1. What Is the use of archieve logs:


If your database is running in ARCHIVELOG mode, it copies all transactions to the archive log
destination. The transactions are always written to the redolog files but when they are full, they are only
saved when running in archivelog mode. This enables you to restore your database to any point in time.
This restore operation starts with restoring a full backup where you can apply the archives until you reach
the point in time where you want to stop the recovery. For example, close before a table was dropped.

Normally production backups are made with the database online. Again a reason to run your
database in archivelog mode. IF not running archivelog mode, in a disaster scenario you might lose all your
transactions made since the last backup. If your transactions are really important it could be smart to copy
the archived log files to a second DC on a very regularly basis. How regularly depends on the cost of
loosing transactions. If you can handle losing one day, you copy daily, most sites copy a few times/hour or
even use standby databases that receive the transactions in a near sync way.

3
DBA Activities

2. Enabling archive log:


➢ Enable the archive log in ORCL database

➢ 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='/plcc/db/tech_st/11.2.0.4/dbs/initplcc.ora' from spfile;

➢ 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='/plcc/db/apps_st/arch/'

➢ 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 = '/plcc/db/tech_st/11.2.0.4/dbs/XX.ORA' from


pfile='/plcc/db/tech_st/11.2.0.4/dbs/PFILE.ORA'

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

➢ Login as sys user and shutdown the database and follow the steps.

Mount the database


alter database archivelog
alter database open;

4
DBA Activities

3. Here is the screen output:


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing 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 /plcc/db/apps_st/arch/
Oldest online log sequence 230
Next log sequence to archive 231
Current log sequence 231
SQL>

You might also like