Database Reference
In-Depth Information
e xeRCiSe 1.1
Putting a Database in ARChivelOG Mode
In this exercise you will take a database that is in NOARCHIVELOG mode and put it in
ARCHIVELOG mode.
1.
First, validate that the database is in NOARCHIVELOG mode using the
V$DATABASE
column
LOG_MODE
:
SQL> Select log_mode from v$database;
LOG_MODE
------------
NOARCHIVELOG
2.
Next, look at the settings for the parameters (note that we have removed some of
the
LOG_ARCHIVE_DEST_n
parameter to save trees)
LOG_ARCHIVE_DEST_1
and
LOG_
ARCHIVE_FORMAT
:
SQL> show parameter log_archive_dest_1
NAME TYPE VALUE
------------------------------------ ----------- -----------
log_archive_dest_1 string
log_archive_dest_10 string
SQL> show parameter log_archive_format
NAME TYPE VALUE
------------------------------------ ----------- -----------
log_archive_format string ARC%S_%R.%T
3.
Create the archive log directory
c:\oracle\arch\orcl
:
SQL> host mkdir c:\oracle\arch\orcl
4.
You want to modify
LOG_ARCHIVE_DEST_1
and
LOG_ARCHIVE_FORMAT
so that they
are set correctly.
LOG_ARCHIVE_DEST_1
should be set to
c:\oracle\arch\orcl
and
LOG_ARCHIVE_FORMAT
should be
orcl_%r_%t_%s.arc
. You will use the
ALTER SYSTEM
command to set these parameters. You will then check to make sure they are set
correctly.
Alter system set log_archive_dest_1='location=c:\oracle\arch\orcl';
-- Note that we have to use the scope=spfile on this next parameter.
-- This is because it's not dynamic!
Alter system set log_archive_format='orcl_%r_%t_%s.arc' scope=spfile;
Search WWH ::
Custom Search