Database Reference
In-Depth Information
You may wonder what the %s , %t , %r , and %d represent. These are variables that represent
values for particular components of the archived redo log. The %s represents the sequence
number, which is always unique for a given database (until a RESETLOGS command occurs,
which we will discuss in Chapter 2). The %t is the thread number that represents an individ-
ual node on a cluster when your database is running on Oracle's Real Application Clusters
(RAC). The %r represents the reset logs number (see Chapter 2). Finally, the %d represents the
DBID that should be unique for each database. Together, this string of variables will make
the archive log filenames unique for every database on your system.
Every database in Oracle has a DBID, which is a unique identifier for the
database (see the DBID column in V$DATABASE to see your DBID). Be careful,
though! It is possible to have databases on two different boxes with the same
name and even with the same DBID. If you will be sharing an ARCHIVELOG
mount point between boxes (say, via NFS), you will need to make sure you
do not accidentally overwrite archived redo logs originating from databases
with the same name and/or DBID! You won't need to know about the DBID for
your OCP exam, but we thought we'd tell you anyway!
Putting the Database in ARCHIVELOG Mode
Putting the database in ARCHIVELOG mode is as easy as following these steps:
1. Configure archiving-related parameters as shown in the previous section.
2. Shut down the database in a consistent state using the SHUTDOWN , SHUTDOWN IMMEDIATE ,
or SHUTDOWN TRANSACTIONAL command.
3. Mount the database with the STARTUP MOUNT command.
4. Put the database in ARCHIVELOG mode with the ALTER DATABASE ARCHIVELOG
command.
5. Open the database with the ALTER DATABASE OPEN command.
One thing to be aware of when the database is in ARCHIVELOG mode is that if you
have not configured archiving correctly, you could find yourself with a database that just
stops running. If Oracle cannot archive the online redo logs, it will suspend all database
operations once it cycles through all the online redo log groups. So, for example, if your
database does log switches every 10 minutes and has three redo log groups, your database
will mysteriously freeze after 30 minutes. Lack of configuration is not as big of a problem
in Oracle Database 12 c as it was in earlier versions since Oracle defaults to using the Fast
Recovery Area (discussed in Chapter 3).
Similar problems can occur if the archive-log destination directory runs out of space or
if the permissions are not set correctly. If Oracle starts to have problems of this sort, it will
Search WWH ::




Custom Search