Introduction
It is the DBA's choice whether to run
the database in ARCHIVELOG mode or in NOARCHIVELOG. If the database is
running in archivelog mode, contents of the online redolog files are
copied to an archive area by an Oracle background processes
Archiver(ARCn). These archive files are known as the archived redolog
files, archived redologs or simply archived redo. These files are
sometimes referred to as the offline redolog files since they are not
open during normal operation of the database and are required only
during recovery. The redo log files (online and archived) are essential
for database recovery since they contain information on all changes made
to the database. If database is chosen to operate in NOARCHIVELOG mode,
online backups and database recovery will not be possible.
Note:
LOG_ARCHIVE_START=TRUE, this parameter is obsolete in 10g and automatic archiving is enabled in 10g.
To Convert the database into ARCHIVELOG mode:
Enter the following parameters in the init<SID>.ora
SQL>SHUTDOWN IMMEDIATE
#for enabling the Archive log mode you have to shutdown the database with normal, immediate option.
$cd $ORACLE_HOME/dbs
$vi initDEMO.ora
LOG_ARCHIVE_DEST=/disk2/ oradata/DEMO/ARCH
:wq!
$mkdir /disk2/oradata/DEMO/ARCH
$sqlplus "/as sysdba"
SQL>STARTUP MOUNT
SQL>ARCHIVE LOG LIST
The above command will show whether automatic archival is
started are not and also whether the database is running in archive log
mode is not. After paasing the above parameters in init<SID>.ora
automatic archival will be started but the database will be still in
NOARCHIVELOG mode. The following command will convert the database into
ARCHIVELOG mode.
SQL>ALTER DATABASE ARCHIVELOG;
SQL>ALTER DATABASE OPEN;
Data Dictionary Views you can query:
-V$ARCHIVED_LOG
-V$ARCHIVE_DEST
-V$ARCHIVE_PROCESSES
Archive Log
CONTENT COPY OF REDO LOG FILES.
LOG_ARCHIVE_DEST
$ORACLE_HOME/dbs/arch
SQL>archive log list
SQL>select log_mode from v$database;
How to enable archive log:
SQL>shutdown immediate
Specify archive destination in pfile
log_archive_dest=/disk3/ oradata/earnest3/arch
$mkdir -p /disk3/oradata/earnest3/arch
SQL>startup mount
SQL>alter database archivelog;
SQL>alter database open;
ENABLING ARCHIVE LOG MODE
SQL>archive log list
SQL>select log_mode from v$database;
SQL>shutdown immediate
SQL>exit
$cd $ORACLE_HOME/dbs
dbs]$vi init$ORACLE_SID.ora163 line
log_archive_dest=/disk3/ oradata/earnest3/arch
dbs]$cd /disk3/oradata/earnest3
$mkdir arch
SQL>startup mount
SQL>archive log list
SQL>alter database archivelog;
SQL>archive log list
SQL>alter database noarchivelog;
SQL>alter database archivelog;
SQL>alter database open;
$cd /disk3/oradata/earnest3/arch
$ls -l
SQL>alter system switch logfile;
No comments:
Post a Comment