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 |
相關文章
- 優雅地亂玩Redux: Getting StartedRedux
- 在 Android 上使用協程(二):Getting startedAndroid
- Getting Started功能讓您快速熟悉如何接入HMS Core
- Oracle 19c DBA's Guide(01): Getting Started with Database AdministrationOracleGUIIDEDatabase
- Getting Started and Beyond|雲原生應用負載均衡選型指南負載
- 【Python for Everybody(Getting Started with Python)】Week 4 | Review:Chapter 2 題目彙總及個人答案PythonViewAPT
- 備份恢復Lesson 04.Using the RMAN Recovery Catalog
- 【RMAN】什麼是Fast Recovery Area(FRA),如何配置FRAAST
- Get Started with EC2
- Module 1 Getting to know you
- 1、 Getting Stared with Database AdministrationDatabase
- 1. Getting Stared with Database AdministrationDatabase
- 排查not eligible for getting processed by all BeanPostProcessorsBean
- Getting NOW() in your preferred time zone
- 【RMAN】RMAN備份至ASMASM
- Rockchip RK3588 - Rockchip Linux Recovery recovery原始碼分析Linux原始碼
- SharePoint 2013 workflows stop working (Failed on started.)AI
- buuctf-pwn-get_started_3dsctf_20163D
- Oracle 11G RAC複製備庫RMAN-03002 RMAN-05501 RMAN-03015 RMAN-03009 RMAN-10038Oracle
- 【RMAN】RMAN的備份保留策略
- ORACLE rman與RMAN-00054&ORA-09945Oracle
- RMAN(轉)
- 【RMAN】Oracle rman 常用命令參考Oracle
- RMAN恢復之RMAN-06555處理
- Codeforces Round #491 (Div. 2) B. Getting an A
- 在 Android 上使用協程(一):Getting The BackgroundAndroid
- Get Started:Mac下搭建PHP開發環境MacPHP開發環境
- 手機刷TWRP Recovery
- RMAN-06207和RMAN-06208的處理
- 【RMAN】在備庫執行rman備份時報錯RMAN-06820 ORA-17629
- [20181011]ORA-44777 – Pluggable database service cannot be started.txtDatabase
- [轉帖]Get started with JDK Flight Recorder in OpenJDK 8uJDK
- The Db2 Recovery History FileDB2
- SQL Server進行Crash RecoverySQLServer
- RMAN增量恢復
- RMAN備份概述
- oracle手工建庫後rman無法啟用(RMAN-04015)Oracle
- ORA-01153: an incompatible media recovery is active
- MySQL crash recovery恢復慢分析MySql