Database Reference
In-Depth Information
Assume that you have a database called orcl and you have decided that you want Oracle
to back up your archived redo logs to a directory called c:\oracle\archivelog\orcl (in
Unix, perhaps it's called /oracle/archivelog/orcl ). You would first have to create the file
system directory structures, and then you would need to set the appropriate parameters.
In this case, you would use the ALTER SYSTEM command to set the LOG_ARCHIVE_DEST_1
parameter to point to c:\oracle\archivelog\orcl , as shown in this code example:
Alter system set log_archive_dest_1='location=c:\oracle\archivelog\orcl';
You can also clear this parameter setting by just using blank quotes, as shown in this
example:
Alter system set log_archive_dest_1='';
With the LOG_ARCHIVE_DEST_ n parameter, you can configure up to 31 different archive-log
destination directories. This feature can be used to provide redundant backup locations for
your archive logs to protect them in the event of a failure of one or more of those locations.
For example, you could archive to a local disk, and you could archive to an NFS-mounted
disk. In that case, you would have two LOG_ARCHIVE_DEST_ n parameters set like this:
-- Local mount on C: drive
Alter system set log_archive_dest_1='location=c:\oracle\archivelog\orcl';
-- NFS Mount on Z: drive
Alter system set log_archive_dest_2='location=Z:\oracle\archivelog\orcl';
Oracle will archive to both destinations, in parallel. This type of configuration is also
used in more advanced database setups such as standby databases.
Archive-log destination directories can take on different states, such as
ENABLED , DEFERRED , or ALTERNATE (I tried to get the folks at Oracle to add
a state of EXAUSTION or FRUSTRATION ; they said no, but they did seem to
like the suggestion of a state of CONFUSION ). They can also be defined as
MANDATORY or OPTIONAL . You will not need to be aware of these advanced
settings for your OCP exam, but you might need to use these options as
a part of your normal duties. You can find more information on these dif-
ferent attributes in the Oracle documentation.
You may also want to control how Oracle names the archived redo logs. This is done
with the LOG_ARCHIVE_FORMAT parameter. For example, you may want to put the database
name in the name of the archive logs being created, but you also want them to be numbered
in such a way that the name will always be unique. You can set the LOG_ARCHIVE_FORMAT
string to a value of orcl_%s_%t_%r_%d.arc , as shown in this example:
Alter system set log_archive_format='orcl_%s_%t_%r_%d.arc' scope=spfile;
Search WWH ::




Custom Search