Database Reference
In-Depth Information
These two approaches are discussed in detail in the following sections.
■
if you don't specifically set the archive redo log location via an initialization parameter or by enabling the Fra,
then the archive redo logs are written to a default location. For linux/unix the default location is
ORACLE_HOME/dbs
. For
Windows the default location is
ORACLE_HOME\database
. For active production database systems, the default archive
redo log location is rarely appropriate.
Tip
Setting the Archive Location to a User-Defined Disk Location (non-FRA)
If you're using an
init<SID>.ora
file, modify the file with an OS utility (such as
vi
). In this example the archive redo
log location is set to
/u01/oraarch/O12C
:
log_archive_dest_1='location=/u01/oraarch/O12C'
log_archive_format='O12C_%t_%s_%r.arc'
In the prior line of code, my standard for naming archive redo log files includes the
ORACLE_SID
(in this example,
O12C
to start the string); the mandatory parameters
%t
,
%s
, and
%r
; and the string
.arc
, to end. I like to embed the
name of the
ORACLE_SID
in the string to avoid confusion when multiple databases are housed on one server. I like to
use the extension
.arc
to differentiate the files from other types of database files.
■
if you don't specify a value for
LOG_ARCHIVE_FORMAT
, oracle uses a default, such as
%t_%s_%r.dbf
. one aspect
of the default format that i don't like is that it ends with the extension
.dbf
, which is widely used for data files. this
can cause confusion about whether a particular file can be safely removed because it's an old archive redo log file or
shouldn't be touched because it's a live data file. Most dBas are reluctant to issue commands such as
rm *.dbf
for fear
of accidentally removing live data files.
Tip
If you're using an
spfile
, use
ALTER SYSTEM
to modify the appropriate initialization variables:
SQL> alter system set log_archive_dest_1='location=/u01/oraarch/O12C' scope=both;
SQL> alter system set log_archive_format='O12C_%t_%s_%r.arc' scope=spfile;
You can dynamically change the
LOG_ARCHIVE_DEST_n
parameters while your database is open. However, you
have to stop and start your database for the
LOG_ARCHIVE_FORMAT
parameter to take effect.