ARCHIVE LOG FILE MANAGEMENT
Archived log files are used for media recovery.
Before overwritting online redolog file content if we take the backup of the redolog file content into the backup destination the backup file is called Archive log file.
REDOLOG FILES 3 TYPES:
**Online Redolog files
**Archive Redologfiles
**Standby Redologfiles
As a DBA to generate archive logfiles we need to put database in Archive log mode.
By default database will be in noarchive log mode.
To put the database into Archivelog Mode use the below steps.
SQL>shut immediate;
put the database into mount state.
SQL>startup nomount;
----------------------------------------------
SQL>alter database archivelog;
---------------------------------------------
SQL>alter database open;
SQL>select log_mode from v$database;
By above commands we are instructing oracle that start generating archivelogfiles for every logswitch.
If don't specify archive destination default destination well be
consideredas $ORACLE_HOME/DBS/ARCH
To specify explicitly as DBA use the Parameter
LOG_ARCHIVE_DEST in pfile or spfile.
When logswitch occurs oracle perform below 2 things.
**generate the checkpoint event
**Generate archivelogfiles.
TO KNOW THE DATABASE INARCHIVE LOGMODE OR NOT
SQL>select log_mode from v$database;
SQL>archive log list;
SQL>select archiver from v$instance;
NOTE:
In real time all production databases must be in archivelogmode
MOUNT STAGE:
it is called maintance stage.
TO KNOW ARC BG PROCESS STARTED OR NOT IN OS LEVEL
]#ps -ef |grep arc0
when you open database automatically oracle starts arc0 bg process and responibility of this process is for every log switch it will wakeup once and reads the entire content of oldest online sequence number and copies into archive destination as single file.
We can increase the count of arch bg process to copy the content of archive redo log group (or)fast copying of redolog group content to archive destination.
By default oracle starts 2 arc bg process in case of 10g .
11g,12c by default oracle starts 4 arch bg process.
Dynamically we can increase the content of arch bg process by specifying the high value for the parameter.
--------------------------------------------------
LOG_ARCHIVE_MAX_PROCESSES
---------------------------------------------------
LOG_ARCHIVE_PROCESS=2
default value of this parameter 2 in 10g we can specify maximum value 10 where as 11g&12c you can specify max value 30
arc0 to arc9 and arca to arcj+10
SQL>alter system set log_archive_max_process=4 scope=spfile;
TO CHANGE THE LOG_ARCHIVE DESTINATION
SQL>alter system set log_archive_dest='E/arc' scope=both;
SQL>archive log list;
SQL>select group#,status,sequence#,archived from v$log;
SQL>alter system switch logfile;
you can check E/arc directory created files;
SQL>show parameter log_archive_start
type value
boolean false
From 10g onwards archiveing process is automatic because
it is always (10g,11g,12c) assumes
log_archive_start parameter as TRUE
SQL>show parameter log_archive_format
The naming convention of the archive log file decided by
the parameter log_archive_format
universally accepted naming convention for
archive log files is %t_%s_%r.arc(%t_%s_%r.dbf default )
(thread no:1,sequence no,resetlogid)
SQL>alter system set log_archive_format='%t_%s_%r.arc' scope=spfile;
SQL>select group#,status,sequence#,archived from v$log;
Archived log files are used for media recovery.
Before overwritting online redolog file content if we take the backup of the redolog file content into the backup destination the backup file is called Archive log file.
REDOLOG FILES 3 TYPES:
**Online Redolog files
**Archive Redologfiles
**Standby Redologfiles
As a DBA to generate archive logfiles we need to put database in Archive log mode.
By default database will be in noarchive log mode.
To put the database into Archivelog Mode use the below steps.
SQL>shut immediate;
put the database into mount state.
SQL>startup nomount;
----------------------------------------------
SQL>alter database archivelog;
---------------------------------------------
SQL>alter database open;
SQL>select log_mode from v$database;
By above commands we are instructing oracle that start generating archivelogfiles for every logswitch.
If don't specify archive destination default destination well be
consideredas $ORACLE_HOME/DBS/ARCH
To specify explicitly as DBA use the Parameter
LOG_ARCHIVE_DEST in pfile or spfile.
When logswitch occurs oracle perform below 2 things.
**generate the checkpoint event
**Generate archivelogfiles.
TO KNOW THE DATABASE INARCHIVE LOGMODE OR NOT
SQL>select log_mode from v$database;
SQL>archive log list;
SQL>select archiver from v$instance;
NOTE:
In real time all production databases must be in archivelogmode
MOUNT STAGE:
it is called maintance stage.
TO KNOW ARC BG PROCESS STARTED OR NOT IN OS LEVEL
]#ps -ef |grep arc0
when you open database automatically oracle starts arc0 bg process and responibility of this process is for every log switch it will wakeup once and reads the entire content of oldest online sequence number and copies into archive destination as single file.
We can increase the count of arch bg process to copy the content of archive redo log group (or)fast copying of redolog group content to archive destination.
By default oracle starts 2 arc bg process in case of 10g .
11g,12c by default oracle starts 4 arch bg process.
Dynamically we can increase the content of arch bg process by specifying the high value for the parameter.
--------------------------------------------------
LOG_ARCHIVE_MAX_PROCESSES
---------------------------------------------------
LOG_ARCHIVE_PROCESS=2
default value of this parameter 2 in 10g we can specify maximum value 10 where as 11g&12c you can specify max value 30
arc0 to arc9 and arca to arcj+10
SQL>alter system set log_archive_max_process=4 scope=spfile;
TO CHANGE THE LOG_ARCHIVE DESTINATION
SQL>alter system set log_archive_dest='E/arc' scope=both;
SQL>archive log list;
SQL>select group#,status,sequence#,archived from v$log;
SQL>alter system switch logfile;
you can check E/arc directory created files;
SQL>show parameter log_archive_start
type value
boolean false
From 10g onwards archiveing process is automatic because
it is always (10g,11g,12c) assumes
log_archive_start parameter as TRUE
SQL>show parameter log_archive_format
The naming convention of the archive log file decided by
the parameter log_archive_format
universally accepted naming convention for
archive log files is %t_%s_%r.arc(%t_%s_%r.dbf default )
(thread no:1,sequence no,resetlogid)
SQL>alter system set log_archive_format='%t_%s_%r.arc' scope=spfile;
SQL>select group#,status,sequence#,archived from v$log;