13.3.11

SAP Note 24594 - Backup of raw disks and Oracle parallel server

Symptom:


Topic:
Backup of databases on raw devices and Oracle parallel server configuration.

Other terms

Raw Disk, OPS
Oracle Real Application Server (RAC) - the new implementation of the Oracle Parallel Server in Release 9i or higher.

Reason and Prerequisites

Extract from the 3.0 documentation.

Solution

ORACLE Databases on Raw Devices
------------------------------------------------------
An ORACLE database can be operated from raw devices. The SAP
utilities for database backup support this configuration. The following
sections describe the special features for the SAP utilities if you
make a backup to raw devices.

1.) ORACLE Databases on Raw Devices: Overview
2.) SAPDBA Support for Raw Device Configuration
3.) Supporting the Raw Device Configuration with BRBACKUP and
BRRESTORE

---------------------------------------------
1.) ORACLE Databases on Raw Devices: Overview

Application programs such as database management systems
frequently avoid the file management of the UNIX system and the
data is written directly on a partition. In this case, the partition is
used as a raw device. No file system exists in such a partition. Using
this type of storage might bring certain advantages regarding the
speed when accessing the data, but requires its own file
management.
You can operate an ORACLE database on raw devices.

Advantages
Working with raw devices brings considerable performance gains for
the following reasons:
* The overhead for maintenance for a file system can be
neglected.
* Since the usual buffer cache for a file system can be neglected,
less main memory is required.
* Since no management information has to be stored on the disk,
less disk space is required.
* Since the accesses do not have to be synchronized and the
management information does not have to be recorded, the load
on the CPU is reduced.
If you operate the ORACLE database system on raw devices, you
can use the Parallel Server option.

Disadvantages
Working with raw devices makes administration more difficult for the
following reasons:
* There is no description of the files residing on the raw devices
in the system.
* The configuration of the storage space is quite inflexible
because only one database file is permitted per raw device (and
therefore per partition). The sizes of the individual partitions
must be adjusted to the sizes of the database files. This makes
later relocation of the database files to other partitions more
difficult.
* It is possible to save raw devices with the dd command, but its
complicated syntax must be accepted.

SAPDBA can only carry out limited checks on raw devices.
This has to do with the fact that SAPDBA only checks the raw
devices that belong to the database user ora.
Raw devices are recognized only if they are allocated to this
database SAPSID (SAPDBA does not check whether there
are also objects from other applications in these raw
devices). Therefore the database administrator has to work
carefully here.

----------------------------------------------------------------------
2.) SAPDBA Support for Raw Device Configuration

The following information is important for you if you intend to use
SAPDBA for ORACLE database administration on raw devices:
* The data for a tablespace can be stored either in raw devices or
in files. Be sure to observe the SAP naming convention for
tablespaces on raw devices:
/sapraw/_ -> / : Sequentially assigned number for files)
: Specifies the central directory containing
the devices. This directory may also be specified in the
rawdev_dir parameter.
: _

Each tablespace "file" (held on a raw device) visible to ORACLE
is a symbolic link to a raw device. SAPDBA checks that the
naming convention has been observed.

Example: Tablespace PSAPDOCUD
/oracle/C11/sapraw/docud_1 -> /dev/rdsk/C11docud_1

* The database link structure is one of things recorded in the
structure log struct.log.
If the database check is done using SAPDBA, SAPDBA uses
this structure log to check whether the link structure is still
complete and immediately repairs it if not. If a tablespace is
extended, a new tablespace is created or a tablespace is
reorganized with data files then SAPDBA updates the
structure log.
* Each raw device can contain only one tablespace "file"
(requirement of ORACLE). SAPDBA can set the size of this
partition. Therefore, in the case of tablespace extension (adding
a "file" from a raw device), for example, the size of the raw
device is determined automatically and is used for the size of
the file.
* It may be a good idea to specify the rawdev_dir
and blkdev_dir parameters in the init.dba profile.

-----------------------------------------------------
3.) Supporting the Raw Device Configuration with BRBACKUP and
BRRESTORE

The BRARCHIVE utility remains unchanged in a raw device
configuration because offline redo log files must always reside in a
file system.
There are some changes in the BRBACKUP and BRRESTORE
programs in a raw device configuration, but these changes have no
effect on the function scope of the programs. The known
functionality of BRBACKUP and BRRESTORE for backing up and
restoring file systems remains unchanged.

Use the dd command to access raw devices.
* With dd, you can write directly from/to the raw device to/from
tape (backup/restore to/from tape)
* With dd, you can copy directly from/to the raw device to/from
disk with file system (backup/restore to/from disk)
* In case of a backup with software compression, output of the
command dd is sent directly to the compress. In case of a
restore with decompression, output of uncompress is sent to dd.
* In case of a backup on a remote computer, output of dd is sent
for example directly to remsh (/rsh etc.). In case of a restore
from a remote computer, it is sent from remsh (/rsh etc.) to the
dd command.
* There are new init.sap parameters for defining the
options for the dd command: dd_flags and dd_in_flags.

Since the dd command does not support a dd
continuation tape (in this case an I/O error is reported), a
method which is similar to the cpio continuation method is not
supported. This means that each individual database file
residing on the raw devices must completely fit onto one
tape. This restriction does not refer to the BRBACKUP
continuation tape management, which means that the
BRBACKUP utility can request continuation tapes if they
should be necessary for backup of the next database files.



ORACLE Databases and Parallel Server Option
---------------------------------------------------------
If an ORACLE database is operated from raw devices, it is possible
to use the Parallel Server option of the ORACLE-RDBMS. The SAP
utilities for backing up the database support this configuration. In
the following sections, the special features of the SAP utilities for
backing up when using the Parallel Server option are explained.

1.) ORACLE Databases and Parallel Server Option: Overview
2.) Parallel Server Configuration for Using SAPDBA
3.) Parallel Server Configuration when Using BRBACKUP,
BRARCHIVE and BRRESTORE

---------------------------------------------------
1.) ORACLE Databases and Parallel Server Option: Overview

The ORACLE Parallel Server option (OPS) is described in the
corresponding ORACLE documentation. Only the most important
features of the OPS configuration when using the SAP utility
programs will be discussed here:
* All control files, online redo log files and database data files are
on raw devices, which can be accessed from all hosts in a
cluster (the raw devices are shared).
* On the hosts in the cluster, there are several ORACLE
instances, which can access the database files (normally one
instance per host).
* Every ORACLE instance has a unique name (this is a SAP
standard) - the so-called ORACLE system ID. When setting up a
connection to the database, the ORACLE instance is determined
by the environment variable ORACLE_SID (abbreviated,
DBSID) or by a connect string.
* Every ORACLE instance uses separate online redo log groups
which can also contain mirrored online redo log files. All groups
in one instance set up a so-called online redo thread which is
identified by a number.
* Every ORACLE instance writes separate offline redo log files
which are identified by the thread number and the sequential log
sequence number. The offline redo log files are stored in a file
system as normal files. You can normally only access this file
system locally, that is, from the host on which the instance runs.

  • * Every ORACLE instance has a separate init.ora profile which, among other things, determines the thread number (parameter thread) and the name format of the offline redo log files (parameter log_archive_format). The corresponding character strings can contain the usual placeholders ? () and @ (). To avoid problems, this is only allowed in the following form:
log_archive_dest = ?/saparch/arch
In the standard installation, all the instances should have the same . If they have different values, the question mark must be replaced directly: log_archive_dest = /oracle//saparch/arch
- log_archive_format = %t_%s.dbf
* One of the ORACLE instances (for SAP installations normally
the instance with thread number 1) is the so-called dedicated
database instance (DDB instance). All administration tasks in the
database (for example database backup, tablespace extension,
reorganization) are carried out from this instance.
* The standard assignment instance (ORACLE_SID or DBSID)
and thread look like this in an SAP System C11:

Instance (DBSID) Thread
C11 1 (DDB instance)
C11_002 2
C11_003 3
... ...

Before you work with your OPS database, you should become
familiar with the concrete installation. Use all the available
information, such as the installation guidelines.
* All the ORACLE instances must be administrable from the DDB
instance, that is, you must be able to start and stop them from
the DDB instance. You should be able to perform these
operations from a local SQLDBA session. In order to do this, the
following requirements must be met:
- Create an ORACLE password file:
orapwd file=/dbs/orapw
password= entries=100
Create softlinks to this file for all other database instances:
cd /dbs
ln -s orapw orapw
- The parameter remote_login_passwordfile =
exclusive must be entered in all the init.ora
profiles or in a common Include file (which is then linked into
all the profiles with the IFILE parameter). If the parameter
was only entered after an instance(s) was started, the
corresponding instances should be started so that it takes effect.
- User system must have SYSOPER (SYSDBA)
authorization on the DDB instance. Start SQLDBA as user
internal and perform the following ORACLE command:
sqldba> grant sysoper to system;
- It might be necessary to change the password for
user system:
sqldba> alter user system identified by ;

-------------------------------------------------------------
2.) Parallel Server Configuration for Using SAPDBA

SAPDBA should normally only be started from the DDB instance. In
exceptions (for example when looking for freespace in local
archiving directories), SAPDBA can also be started from another
instance.
Please read the information about setting up user system (in Topic 1).
User system has the authorization to start and stop
the database instances remotely. You can therefore
call SAPDBA in the usual manner.
The following functions were extended or introduced especially for
databases with OPS configuration:
* Startup/Shutdown instance, to start/stop single instances or all
instances.
* Instance information, to obtain status information about the
individual instances.
* Archive mode, to obtain information about archiving for the local
instance or for any parallel instance or to set the archiving
parameters.

Recovery measures on an OPS database should only be
performed by an experienced administrator. It is essential
that you read the ORACLE documentation. The
restore/recovery functionality of SAPDBA is only available
with some restrictions. (See topic "Special Features during
Restore/Recovery").

------------------------------------------------------------------------
Information in the init.dba Profile

There are a number of OPS-specific parameters in the
init.dba profile. These are:
* ops, to set the working mode of SAPDBA
specifically for the OPS
* parallel_instance, to define the parallel instances

There are also some parameters for special purposes, but these
should only be used by an experienced administrator.
* index_instances, to create indices on the individual
instances in parallel
* recovery_instances, to perform recoveries on the
individual instances in parallel

SAPDBA can also call the SAP utilities BRBACKUP, BRARCHIVE
and BRRESTORE. The init.sap profile for these
programs also contains a number of OPS-specific
parameters (see topic Information in the Profile
init.sap).

------------------------------------------------------------
Special Features during Restore/Recovery

SAPDBA will only provide restricted support of Release 3.0C in
order to be able to recover the OPS database as fast as possible in
a recovery situation. Due to the complex installation (for possible
scenarios see topic "Special Features of BRARCHIVE), there can
be no general recommendation. Due to its syntax,
the BRRESTORE program permits you to manually restore
the files which are relevant for the recovery (for example,
specification of the name of the parallel instance).
SAPDBA helps you to obtain the necessary information
about the status of the database system (also in mount status).
In special cases, individual objects can be
restored using SAPDBA.

Information about the Redo Log Files of the Individual Threads

* Use the SAPDBA menu option Archive mode -> Show all
archive information/Show complete archive history.
* Check (and repair) database -> Check database : If this check
finds that some files have an old status, SAPDBA displays the
redo log files of the different threads necessary for a recovery.

Support in Case of File Loss

1.) If SAPDBA finds that some files are missing with Check (and
repair) database -> Check database, these must be restored. If
only links were lost, SAPDBA tries to reconstruct them.
2.) The missing files can then be restored from a backup copy with
Check (and repair) database -> Restore backup files. The
subsequent actions, such as automatic restoring of the
corresponding offline redo log files, are not yet supported.
3.) If you start Check (and repair) database -> Check database
again, SAPDBA displays the redo log files of the different
threads necessary for a recovery.
4.) These redo log files can now be restored manually with
BRRESTORE.
5.) Now start the recovery with SQLDBA (sqldba> recover
database...). Read about this in the corresponding ORACLE
documentation.

Support when Restoring a Full Backup or Single Files

* The SAPDBA option Restore/Recovery -> Full restore is
completely supported, also for an OPS installation. See
Resetting the Databasesora10e.doc016>howto.
* The SAPDBA option Restore/Recovery -> Full restore and
recovery is not yet supported. If you want to perform for
example a point in time recovery, you should perform the
necessary preparations for the subsequent recovery with
Restore/Recovery -> Full restore -> Restore database and
startup mount (for manual recovery (using backup controlfile).
Then start the recovery with SQLDBA (sqldba> recover
database until

No comments:

Post a Comment