Getting Started with Server-Managed Recovery (SMR) and RMAN 8.0/8i_50875.1
Getting Started with Server-Managed Recovery (SMR) and RMAN 8.0/8i (Doc ID 50875.1)
***Checked for relevance on 19-JUL-2010***
View NOTE:50875.1View NOTE:50875.1View NOTE:50875.1gsrman
Checked for relevance on 24-Dec-2008 Getting started with Server-Managed Recovery (SMR) and Recovery Manager 8.0 / 8i (RMAN) Introduction:
This document explains the basic operation of SMR & RMAN. Because of the
For the sake of clarity, I have excluded RMAN error messages and return Contents:
1. What is RMAN & SMR?
RMAN can be used to backup and restore database files, archive logs, and
RMAN starts Oracle server processes on the database to be backed up or
Note that SMR can also be controlled from OEM's Backup Manager GUI. This 2.1. Backup sets A backup set is characterised by the following:
- Contains one or more datafiles or archivelogs 2.2. Backup pieces
A backup set is comprised of a number of backup pieces. Each backup piece 2.3. Image copies
An image copy is a copy of a single file (datafile, archivelog, or 2.4. Full backup sets
A full backup is a backup of one or more datafiles that contains all used 2.5. Incremental backup sets
An incremental backup is a backup of one or more datafiles that contains 2.6. File multiplexing
Datablocks from multiple datafiles can be multiplexed in the same 2.7. Recovery catalog resyncing
Resyncing the recovery catalog involves synchronising the recovery
2.8. Snapshot Controlfile
When RMAN needs to resynchronize from a read-consistent version
2.9. Resetlogs Operation
Whenever you open the database with the RESETLOGS option, all datafiles
2.1.0 Database Incarnation
Whenever you perform incomplete recovery or perform recovery using a
2.1.1. Resetting the Recovery Catalog
Before you can use RMAN again with a target database that you have
The recovery catalog is a repository of information that is used and
The recovery catalog can be in a schema of an existing Oracle8 database.
To set up the recovery catalog, firstly ensure that catalog and catproc
SVRMGR> spool create_rman.log
Note: Following steps only apply for an Oracle8 8.0.x catalog creation.
SVRMGR> connect rman/rman
Check create_rman.log for errors. The above commands assume that the
In Oracle8i the catalog is created a little differently.
Note: Following steps only apply to Oracle8i 8.1.5 and greater.
From the UNIX shell run:
% set ORACLE_SID=RCAT
This will generate the recovery catalog schema in the default tablespace for
Also ensure that catproc has been run on the target database as SYS
It is very important that the recovery catalog database is backed up
Note: Although you are not required to use a recovery catalog with RMAN,
RMAN has a command line interface, or can be run from Enterprise Manager.
The command line interface has following syntax:
rman target
Argument Quoted String Description
TARGET A connect string containing a userid and password for the
rman target system/manager@target
RCVCAT A connect string that contains a userid and password for the
rman rcvcat rman/rman@rcvcat
CMDFILE The name of a file that contains the input commands for
MSGLOG The name of a file where RMAN records commands and output
APPEND This parameters causes the msglog file to be opened in append
TRACE A file name where RMAN will dump a trace information.
For the purposes of the following examples, assume that
- the target database is called "targdb" and has the same TNS alias
Before invoking RMAN, set the NLS_DATE_FORMAT and NLS_LANG environment
NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1
For RMAN to connect to the recovery catalog and the target database, the
4.1. Connecting to RMAN without a recovery catalog
Set ORACLE_SID to be the target database, and issue the following:
% rman nocatalog
4.2. Connecting to RMAN with a recovery catalog
% rman rcvcat rman/rman@rcat
Note: Recovery Manager automatically requests a connection to the target
1. Be part of the operating system DBA group with respect to the
-or -
2. Have a password file setup. This requires the use of the "orapwd"
Note: The connect string (for example, @targdb) should be a valid TNS
4.3. Using RMAN
Once connected to the target database, you can specify RMAN commands
RMAN> resync catalog;
An example of calling a stored script would be:
RMAN> execute script alloc_1_disk;
To create/replace a stored script:
RMAN> replace script alloc_1_disk {
5. Register the target database
Database status:
The target database must be registered with the recovery catalog before
RMAN> register database;
6. Adding existing backups to the recovery catalog
Database status:
If user-created backups existed under version 8.x prior to registering with
RMAN> catalog datafilecopy '/supp/ .... /systargdb.dbf';
To view this file in the catalog, use the following command:
RMAN> list copy of database;
7. Backing up in noarchivelog mode
Database status:
Recovery catalog database is OPEN, target database is started (optionally
7.1. Example of how to back up a complete database
RMAN> run {
Line#
To view this backup in the catalog, use the following command:
RMAN> list backupset of database;
7.2. Example of how to back up a tablespace
RMAN> run {
Line#
To view this tablespace backup in the catalog, use the following command:
RMAN> list backupset of tablespace users;
If for example the USERS tablespace is going to be put READ ONLY after
Note that although this is a tablespace backup, the target database
7.3. Example of how to backup individual datafiles
RMAN> run {
Line#
To view this tablespace backup in the catalog, use the following command:
RMAN> list backupset of datafile 1;
7.4. Copying datafiles
RMAN> run {
To view this file copy in the catalog, use the following command:
RMAN> list copy of datafile '/oracle/dbs/temp.dbf';
Copying a datafile is different to backing up a datafile. A datafile copy
7.5. Backing up the controlfile
RMAN> run {
Note that a database backup will automatically back up the controlfile.
8. Backing up in archivelog mode
Database status:
The commands are identical to those in section 7 except that the target
8.1. Backing up archived logs
The following script backs up all archive logs:
RMAN> run {
The following script backs up archive logs from sequence# 90 to 100:
RMAN> run {
The following script backs up all archive logs generated in the past
RMAN> run {
To view the archive logs in the catalog, use the following command:
RMAN> list backupset of archivelog all;
Note that RMAN will backup specified logs if it finds them. If it can't
8.2. Backing up the online logs
Online logs CANNOT be backed up using RMAN; they must be archived first.
RMAN> run {
The above script might be run after performing a full 'database open'
Note, you cannot tag archive log backupsets.
A level N incremental backup backs up blocks that have changed since the
9.1. Level 0 - the basis of the incremental backup strategy
RMAN> run {
Line#
A list of the database backupsets will show the above backup. The 'type'
9.2. Example backup strategy using incremental backups
A typical incremental backup cycle would be as follows:
- Sun night - level 0 backup performed
If the database suffered a failure on Sat morning and this resulted in
10. Cumulative incremental backups
A cumulative incremental backup backs up all blocks that have changed since
RMAN> run {
To check the backup progress run the following sql against the target
select sid, serial#, context
This will produce an output such as:
SID SERIAL# CONTEXT % Complete Time Now
As with backup, recovery is probably best explained with a few examples
12.1. Database open, datafile deleted
Datafile has been deleted from a running database. There are two methods
(a) Datafile recovery
RMAN> run {
(b) Tablespace recovery
RMAN> run {
Note that if it is the system tablespace datafiles to be restored, the
12.2. Complete restore (lost online redo) and rollforward - database closed
RMAN> run {
12.3. Restore of a subset of datafiles, complete recovery
RMAN> run {
It is very easy to create and replace stored scripts with RMAN. E.g.
RMAN> create script alloc_disk {
RMAN> replace script rel_disk {
RMAN> replace script backup_db_full {
The first 2 scripts allocate and deallocate channels respectively. The
The 3rd script calls the previously stored scripts either side of
Example of executing a stored script:
RMAN> run {
Note that a stored scripts must be called from within a job command |
相關文章
- Oracle10g / 11g - Getting Started with Recovery Manager (RMAN) [ID 360416.1]Oracle
- Beaglebone - Getting Started
- getting started with transformjsORMJS
- Windows HLK Getting StartedWindows
- Hive Getting Started補充Hive
- Firebase Tutorial: Getting Started 教程翻譯
- 優雅地亂玩Redux: Getting StartedRedux
- 在 Android 上使用協程(二):Getting startedAndroid
- 【DocFX文件翻譯】DocFX 入門 (Getting Started with DocFX)
- Getting Started功能讓您快速熟悉如何接入HMS Core
- iOS動畫程式設計-Layer動畫[ 2 ] Getting Started with Layer AnimationsiOS動畫程式設計
- Remote Diagnostic Agent (RDA) - Getting Started (Doc ID 314422.1)REM
- Remote Diagnostic Agent (RDA) 4 - Getting Started [ID 314422.1]REM
- Getting Started and Beyond|雲原生應用負載均衡選型指南負載
- Android Auto-Building Apps for Auto,Getting Started with AutoAndroidUIAPP
- Oracle 19c DBA's Guide(01): Getting Started with Database AdministrationOracleGUIIDEDatabase
- RMAN: Tablespace Point In Time Recovery (TSPITR)
- 【RMAN】RMAN-20001: target database not found in recoveryDatabase
- 【Python for Everybody(Getting Started with Python)】Week 4 | Review:Chapter 2 題目彙總及個人答案PythonViewAPT
- SpringBoot 1024行程式碼 – Getting Started(一個簡單的web應用)Spring Boot行程Web
- RMAN : Consistent Backup, Restore and Recovery using RMAN (Doc ID 162855.1)REST
- RMAN: Monitoring Recovery Manager Jobs [ID 144640.1]
- RMAN-00554: initialization of internal recovery manager package failedPackageAI
- Backup And Recovery User's Guide-RMAN架構-RMAN庫(Repository)GUIIDE架構
- Oracle 基於 RMAN 的不完全恢復(incomplete recovery by RMAN)Oracle
- Backup And Recovery User's Guide-RMAN架構-關於RMAN環境GUIIDE架構
- Backup And Recovery User's Guide-RMAN架構-RMAN命令列客戶端及RMAN通道(channel)GUIIDE架構命令列客戶端
- Backup And Recovery User's Guide-RMAN架構-RMAN通道-通道和裝置GUIIDE架構
- Backup And Recovery User's Guide-從RMAN開始-指令碼化RMAN操作GUIIDE指令碼
- Backup And Recovery User's Guide-從RMAN開始-概覽RMAN環境GUIIDE
- 【RMAN】什麼是Fast Recovery Area(FRA),如何配置FRAAST
- Backup And Recovery User's Guide-RMAN TSPITR模型GUIIDE模型
- Backup And Recovery User's Guide-RMAN資料修復概念-RMAN還原操作GUIIDE
- Backup And Recovery User's Guide-RMAN備份概念-RMAN建立的映象拷貝GUIIDE
- Backup And Recovery User's Guide-RMAN資料修復概念-RMAN介質恢復GUIIDE
- Backup And Recovery User's Guide-RMAN架構-RMAN通道-自動和手動通道GUIIDE架構
- Backup And Recovery User's Guide-從RMAN開始-顯示預設的RMAN配置GUIIDE
- rman B14192B_backup and recovery basics筆記筆記