Technorati label: rman, backup, Oracle
RMAN backup environment configuration-advanced
ConfigurationRMANBack up data to Media Manager
On most platforms, tape must be integrated with Oracle when backed up to tape or dumped from tape. The media manager is not an oracle product. Therefore, if you select RMAN to work with the media manager, you must obtain all product-related information from the supplier.
To configure RMAN to use the media manager, follow these steps:
RMANRequirements for using media manager
Install it first and ensure that RMAN can communicate with it. This step is usually described in the vendor documentation. After installation, make sure that non-RMAN backup works properly. This step makes subsequent troubleshooting easier and ensures that media management can work correctly on the OS.
Then, the third-party media management module is installed and integrated with the server. This module contains the Media Manager library that Oracle uses to load and access the Media Manager. This product is usually purchased separately.
Locate Media Management Library:Sbt_libraryParameters
When you allocate or configure channels for RMAN to communicate with the Media Manager, you need to set the sbt_library parameter to provide the media management software library. During actual RMAN execution, the database in sbt_library will be loaded. If this value is not set, it will be searched in the default location of the platform, $ ORACLE_HOME/lib/libobk. so, the suffix may be. SL ,. A and so on. It is % ORACLE_HOME %/bin/orasbt in windows. DLL.
By default, the library is not part of the database installation. Media Management software must be installed.
If RMAN locates an error, a ORA-27211 error is returned.
Whenever channel allocation fails, the following information is written to the trace file in user_dump_dest:
Skgfq OSD: Error in function sbtinit on line 2278
Skgfq OSD: Look for SBT trace messages in file/Oracle/rdbms/log/sbtio. Log
SBT initialize failed for/Oracle/lib/libobk. So
Test whether the media management library is correctly integrated
After confirming that the database server can load the media management database, you need to test to ensure that RMAN can be backed up to the Media Manager.
IsRMANBackup configuration Media Management Software
After the media management software is installed, execute any vendor-required configuration so that the software can accept RMAN backup. You may need to configure media pools, users, classes, and so on.
Then determine the parms settings required for the allocate channel or configure channel. And backup recommended format. The parms parameter is used to send commands to the Media Manager. The details are described in the product documentation.
Configure the media manager's backup title and size
Because the media manager may have a size limit, you need to configure RMAN to limit the names and sizes of these backup slices.
Backup name configuration: the backup name is defined by the format string of backup, configure channel, and allocate channel.
Configure the backup part size: the backup Part Size is determined by the maxpiecesize parameter of configure channel and allocate channel.
Test on Media ManagerAllocate Channel
Use the following procedure to confirm that RMAN can load the media management library when allocating channels to the Media Manager:
1. connect to the target database;
2. Run the allocate channel command with parms, as shown below:
Run
{
Allocate channel C1 device type SBT
Parms = 'sbt _ Library =/mediavendor/lib/libobk. So Env = (ns_server = tape_srv, NSR _
Group = oracle_tapes )';
}
If no error message is received, RMAN loads the Media Management Library Correctly; otherwise, a ORA-27211 error occurs.
RMAN-00571: ========================================================== ==============================
RMAN-00569: ======= error message stack follows ========================
RMAN-00571: ========================================================== ==============================
RMAN-03009: failure of allocate command on C1 channel at 11/30/2001 13:57:18
The ORA-19554: error allocating device, device type: sbt_tape, device name:
ORA-27211: failed to load Media Management Library
Additional information: 25
In this case, you need to re-check whether the installation is correct and whether the sbt_library is correct.
Test backup to media management database
After the test channel is allocated, You need to test the backup.
Run
{
Allocate channel C1 device type SBT
Parms = 'sbt _ Library =/mediavendor/lib/libobk. So
ENV = (ns_server = tape_srv, ns_group = oracle_tapes )';
Backup current controlfile;
}
Parms and format depend on specific products. If the backup is successful, you can start the backup. Errors include:
ORA-19511: media management software is not correctly configured;
Backup pending: the media manager is waiting to mount the tape;
ConfigurationSBTChannels use Media Manager
1. RMAN> Configure Channel Device Type SBT
Parms = 'sbt _ Library =/mediavendor/lib/libobk. So
ENV = (ns_server = tape_svr, ns_client = oracleclnt, ns_group = ora_tapes )'
Format "backup _ % u ";
2. RMAN> Backup Device Type SBT current controlfile;
3. RMAN> Show Channel for device type SBT;
4. RMAN> Configure Default device type to SBT;
Backup configuration optimization
Backup optimization only applies to the following commands:
· Backup database
· Backup archivelog... All | like;
· Backup backupset all
You can overwrite the force option of the Backup command at any time, as shown below:
Backup database force;
Backup archivelog all force;
By default, backup optimization is off. You can use the following command to enable it:
Configure backup Optimization on;
Configure backup copy:Configure... backup copies
Configure... backup copies declares the number of backup sets to be created on a specific device for a specific type of backup. Setting the replication configure only affects data files, control files, archiving logs, and only applies to backup sets.
Except for automatic backup of control files.
Configure datafile backup copies for device type disk to 2;
Configure archivelog backup copies for device type SBT to 3;
If you use the copy feature with multiple format strings, you can run the command to name each backup set. As follows:
Backup database format '/tmp/% U ','? /Dbs/% U ','? /Oradata/% U ';
In this case, RMAN creates three backups for the backup slices in each backup set, and names them according to the strings in the format.
To clear the logs, run the following command:
Configure datafile backup copies for device type SBT clear;
If you do not want to set permanent replication, you can use the backup copies and set backup copies commands.
UseShow... backup copiesShow the number of copies
After connecting to the target database, you can run the show archivelog backup copies or show datafile backup copies command to view the current configuration.
Configure the tablespace to be excluded when backing up the entire database
You can use the configure exclude for tablespace command to configure the tablespace automatically excluded during full database backup.
Even after configuration, You can forcibly include them in: backup database noexclude;
To clear the logs, run the following command:
Configure exclude for tablespace tbs_1 clear;
Then, the tablespace will be included when the full database is backed up.
ConfigurationAuxiliaryInstance data file name:Configure auxname
When you use tspitr or RMAN to copy a database, you can set the data file name of the auxiliary instance before performing the actual tspitr or database replication. As follows:
Configure auxname for datafilespec to 'filename ';
Datafilespec: original file name or file number; filename: Path of the new file.
Like other settings, configure auxname for datafile 2 clear;
When duplicate is run, configure auxname is an alternative to the set newname command. The difference is that after the auxname is used, you do not need to reset the file name to execute other duplicate commands until configure auxname... clear is executed.
DisplayAuxiliaryDefault Channel Configuration
Show auxname;
Configure auxname for datafile '/Oracle/oradata/trgt/tools01.dbf' to '/tmp/tools01.dbf ';
Set the snapshot Control File Location
When RMAN needs to be re-synchronized from a version of the read consistency control file, it will create a snapshot control file. RMAN only requires snapshots for RMAN synchronization or backup of the current control file. By default, $ ORACLE_HOME/dbs/snapcf _ @. F, instead of FRA.
Default location of snapshot Control File
Create a new database in the current version: the snapshot uses the default location and depends on ORACLE_HOME;
Upgrade from Versions earlier than 8.1.7 to the current version: Use the snapshot location stored in the control file;
View configurations
Show snapshot controlfile name;
Set the location of the snapshot Control File
Use configure snapshot controlfile name to 'filename' to set the location of the snapshot control file.
If you want to change to another location, you only need to re-execute to point to the new location.
SetRMANUse
RMAN cannot connect to the server through the Shared Server. A dedicated server is required. To ensure that RMAN is not connected to the scheduler under MTS, the connection string used by rman must contain (Server = dedicated) in CONNECT_DATA.
As follows:
Instancespx =
(Description =
(Address = (Protocol = TCP) (host = instanchost) (port1521 ))
(CONNECT_DATA = (SERVICE_NAME = inst1) (Server = shared ))
)
Inst1 is a value of service_names;
Configure RMAN to work in MTS as follows:
1. Create a network service name to connect through a non-shared Sid:
Instancded =
(Description =
(Address = (Protocol = TCP) (host = instanchost) (port1521 ))
(CONNECT_DATA = (SERVICE_NAME = inst1) (Server = dedicated ))
)
2. Start SQL * Plus to test two connection strings:
Connect sys/Oracle @ instancded
Select Server
From v $ session
Where sid = (select distinct Sid from V $ mystat );
Connect sys/Oracle @ instancshs as sysdba
Select Server
From v $ session
Where sid = (select distinct Sid from V $ mystat );
3. Use a dedicated service name to connect to the server.
Configuration of the Shared Server
In 10 Gb, you only need to set shared_servers to be greater than 0, as shown below:
Alter system set shared_servers = 1;
Run the LSNRCTL services command. The result is as follows:
Routine "test", status ready, contains one processing program of this service...
Handler:
"D000" created: 0 rejected: 0 current: 1 Maximum: 1002 status: Ready
Dispatcher
(Address = (Protocol = TCP) (host = PD-00167674093A.tcsgegdc.com) (Port = 1579 ))
Configure a TNS service name, use port 1579, and then use the TNS service name configured for this port to connect to the shared server.