- 浏览: 1019773 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (529)
- 服务器 (8)
- jsp (1)
- java (6)
- AIX (1)
- solaris (3)
- linux学习 (53)
- javaScript (2)
- hibernate (1)
- 数据库 (74)
- sql语句 (8)
- oracle 学习 (75)
- oracle 案例 (42)
- oracle 管理 (42)
- Oracle RAC (27)
- oracle data guard (12)
- oracle 参数讲解 (14)
- Oracle 字符集 (8)
- oracle性能调优 (24)
- oracle备份与恢复 (12)
- oracle Tablespace (9)
- oracle性能诊断艺术 (1)
- oracle 11g学习 (5)
- oracle streams (1)
- oracle upgrade and downgrade (4)
- db2学习 (13)
- db2命令学习 (2)
- mysql (28)
- sql server (30)
- sql server 2008 (0)
- 工具 (10)
- 操作系统 (3)
- c++ (1)
- stock (1)
- 生活 (5)
- HADOOP (2)
最新评论
-
massjcy:
...
如何将ubuntu文件夹中文名改为英文 -
skypiea:
谢谢。。。
终于解决了。。。
Oracle 10.2.0.4(5)EM不能启动的解决方案(Patch 8350262) -
qwe_rt:
引用vi /etc/sysconfig/network 请问 ...
Linux操作系统下配置静态IP上网 -
liuqiang:
sudo killall -9 apache2
ps 和 kill 命令详解 -
dazuiba:
引用*绝杀 kill -9 PID 当使用此命令时,一定要通过 ...
ps 和 kill 命令详解
RMAN: RAC Backup and Recovery using RMAN [ID 243760.1] Metalink
- 博客分类:
- oracle备份与恢复
"Checked for relevance on 21-Dec-2008"
RAC Backup and Recovery using RMAN
Objectives:
===========
1. Verify the database mode and archive destination.
2. Verify connectivity using sqlnet for target and catalog.
3. Determine your backup device
4. Understand how to create an RMAN persistent configuration for a RAC env.
5. Create backups to disk using
6. Backupset Maintenance using the configured retention policy
7. Restore and Recover
a. complete
b. incomplete
8. Review and understand the impact of resetlogs on the catalog.
9. RMAN Sample Commands
Configuration:
==============
This discussion is for a 2-node Oracle RAC Cluster.
The logs are being archived to their respective node.
We are allocating channels to each node to enable the autolocate feature
of RMAN in a RAC env.
1. Verify the databases are in archivelog mode and archive destination.
a. NODE 1: thread 1
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u02/app/oracle/product/9.2.0/dbs/arch
Oldest online log sequence 20
Next log sequence to archive 21
Current log sequence 21
b. NODE 2: thread 2
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u02/app/oracle/product/9.2.0/dbs/arch
Oldest online log sequence 8
Next log sequence to archive 9
Current log sequence 9
2. Verify connectivity to the target nodes and catalog if used.
a. % setenv TNS_ADMIN $ORACLE_HOME/network/admin
b. % sqlplus /nolog
c. SQL> connect sys/pwd@node1 as sysdba
d. SQL> connect sys/pwd@node2 as sysdba
e. SQL> connect rman/rman@rcat
3. Set your testing areas.
Testing HOME for logs: /u02/home/usupport/rman
Backups HOME Location: /rman/V920
4. Connect using RMAN to verify and set the controlfile persistent configuration.
The controlfiles are shared between the instances so configuring the control-
file on node 1 also sets it for all nodes in the RAC cluster.
a. Alway note the target DBID
connected to target database: V920 (DBID=228033884)
b. Default Configuration
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u02/app/oracle/product/9.2.0/dbs/snapcf_V9201.f'; # default
c. Make changes to the default that fit your business requirements.
Note the retention policy can be set "TO REDUNDANCY x" or it can
be set "TO RECOVERY WINDOW OF x DAYS", this is new in Oracle9i.
In this example, using PARALLELISM 2 as 2 nodes are used.
The PARALLELISM will than automaticly start 2 channels and will
use the related CONFIGURE CHANNEL for additional clauses.
CONFIGURE RETENTION POLICY TO REDUNDANCY 3;
CONFIGURE BACKUP OPTIMIZATION OFF;
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/rman/V920/%F';
CONFIGURE DEVICE TYPE DISK PARALLELISM 2;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
CONFIGURE MAXSETSIZE TO UNLIMITED;
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/rman/V920/snapcf_V92321.f';
CONFIGURE CHANNEL 1 DEVICE TYPE DISK connect 'SYS/rac@node1';
CONFIGURE CHANNEL 2 DEVICE TYPE DISK connect 'SYS/rac@node2';
d. Review/Verify your new configuration.
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 3;
CONFIGURE BACKUP OPTIMIZATION OFF;
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/rman/V920/%F';
CONFIGURE DEVICE TYPE DISK PARALLELISM 2;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
CONFIGURE CHANNEL 1 DEVICE TYPE DISK CONNECT 'SYS/rac@node1';
CONFIGURE CHANNEL 2 DEVICE TYPE DISK CONNECT 'SYS/rac@node2';
CONFIGURE MAXSETSIZE TO UNLIMITED;
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/rman/V920/snapcf_V92321.f';
5. Make a backup using the new persistent configuration parameters.
a. Backup database with differential incremental 0 and then archived logs
using the delete input option.
backup incremental level 0
format '/rman/V920/%d_LVL0_%T_%u_s%s_p%p'
database;
backup archivelog all format '/rman/V920/%d_AL_%T_%u_s%s_p%p'
delete input;
b. Backup again using differential inremental level 1
backup incremental level 1
format '/rman/V920/%d_LVL1_%T_%u_s%s_p%p'
database;
backup archivelog all format '/rman/V920/%d_AL_%T_%u_s%s_p%p'
delete input;
c. To simplify this in Oracle9i we can also use PLUS ARCHIVELOG
Note: This uses a different alorithm then backup database and
backup archivelog in separate commands.
BACKUP incremental level 0
format '/rman/V920/%d_LVL0_%T_%u_s%s_p%p'
database PLUS ARCHIVELOG format '/rman/V920/%d_AL_%T_%u_s%s_p%p'
delete input;
Algorithm for PLUS ARCHIVELOG:
1. Archive log current
2. Backup archived logs
3. Backup database level 0
4. Archive log current
5. Backup any remaining archived log created during backup
6. Backupset Maintenance using the configured retention policy
RMAN> list backup summary;
list backup by datafile;
list backup of database;
list backup of archivelog all;
list backup of controlfile;
Note: these above can be enhanced with the "until time" clause as well as
the archivelog backups using "not backed up x times" to cut down on
many copies of a log in several backupsets. Then continuing with SMR
Server Managed Recovery use the change archivelog from...until...delete
to remove old logs no longer needed on disk.
RMAN> report obsolete;
RMAN> delete obsolete;
or
delete noprompt obsolete;
RMAN> report schema;
7. Restore and Recover
Complete Recovery
a. With the database mounted on the node1 and nomount on node2 connect
to the target and catalog using RMAN.
rman target / catalog rman/rman@rcat
This script will restore and recover the database completely and open.
All previous backup will still be available for use because there was
not RESETLOGS command given.
run {
restore database;
recover database;
alter database open;
}
Incomplete Recovery
Note: If you are using instance registration the database must be mounted to
register with the listener. This means you must use the current control
file for restore and recovery or setup a dedicated listener if not
already done. RMAN requires a dedicated server connection and does not
work with using instance registration before mounting the controlfile.
Using the autobackup controlfile feature requires the DBID of the
TARGET database. It must be set when the database is not mounted and
only the controlfile and spfile (in 9.2>) can be restored this way.
a. shutdown node1 and node2
b. startup nomount node2 and node1
c. start rman
> rman trace reco1.log
RMAN> connect catalog rman/rman@rcat
RMAN> set dbid=228033884;
RMAN> connect target
d. Restore the controlfile from autobackup
% rman trace recocf.log
RMAN> SET DBID=228033884;
RMAN> CONNECT TARGET
RUN
{
SET CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE disk TO '/rman/V920/%F';
ALLOCATE CHANNEL d1 DEVICE TYPE disk;
RESTORE CONTROLFILE FROM AUTOBACKUP
MAXSEQ 5 # start at sequence 5 and count down (optional)
MAXDAYS 5; # start at UNTIL TIME and search back 5 days (optional)
MOUNT DATABASE;
}
e. Verify what is available for incomplete recovery. We will recover to the
highest scn log sequence and thread. We will use the log sequence in this
case. Your options are "until time", "until scn", or "until sequence".
SQL> select max(sequence#) from v$archived_log
2 where thread#=1;
MAX(SEQUENCE#)
--------------
25
SQL> select max(sequence#) from v$archived_log
2 where thread#=2;
MAX(SEQUENCE#)
--------------
13
Note: In this case the scn is greater in thread 2 sequence# 13 then in
sequence 25 from thread 1. So we will set the seqeunce to 14 for
rman recovery because log recovery is always sequence+1 to end
at +1 after applying the prior sequence.
SQL> select sequence#, thread#, first_change#, next_change#
2 from v$archived_log
3 where sequence# in (13,25);
SEQUENCE# THREAD# FIRST_CHANGE# NEXT_CHANGE#
---------- ---------- ------------- ------------
25 1 1744432 1744802
13 2 1744429 1744805
SQL> select sequence#, thread#, first_change#, next_change#
2 from v$backup_redolog
3 where sequence# in (13,25);
SEQUENCE# THREAD# FIRST_CHANGE# NEXT_CHANGE#
---------- ---------- ------------- ------------
25 1 1744432 1744802
13 2 1744429 1744805
f. If using LMT Temporary tablespace the controlfile will have the syntax
to add the tempfile after recovery is complete.
SQL> alter database backup controlfile to trace;
Example:
# Commands to add tempfiles to temporary tablespaces.
# Online tempfiles have complete s
发表评论
-
Oracle数据恢复 - Linux / Unix 误删除的文件恢复
2012-03-22 15:09 991今天有客户的数据库意外被删除了整个目录中的数据文件,操作系统级 ... -
Oracle数据库恢复:存储故障导致的数据损坏(摘抄自eygle)
2010-12-03 22:56 1159最近帮助用户恢复了一个由于存储故障导致的数据库灾难,整个数据库 ... -
undo 表空间丢失之恢复(ORA-01548)
2010-04-13 17:31 1789SYS@huiche>startupORACLE 例程已 ... -
非归档模式下,ORA-01190错误解决案例
2010-04-08 14:39 31431.非归档模式下,断电重新启动导致无法锁定数据文件 SYS@ ... -
数据库非归档模式下丢失所有redo log 的恢复记录
2010-04-08 00:06 1480SYS@huiches>startup ... -
利用Flashback Query 恢复误操作的数据
2009-12-09 13:58 1186利用Flashback Query 恢复误操作的数据 Au ... -
Oralce 数据库的灾难恢复
2009-08-20 17:05 1207数据库管理员应针对具 ... -
rman使用小记
2009-08-07 17:04 19521. Introduction to Recovery Man ... -
Linux ORACLE RAC 10201升级10203
2009-07-21 22:38 1875一.准备工作 1.有效备份 作好对ORACL ... -
配置归档日志,让数据库管理更加顺畅
2009-07-20 14:54 1743一、更改日志操作模式 ... -
oracle备份--redo丢失与恢复(一)
2009-07-18 22:39 2121一、先阐述下测试环 ...
相关推荐
MetaLink-RMAN RAC Backup and Recovery using RMAN 希望对ORACLE使用者有点作用
1 Oracle Database 11g Backup and Recovery Architecture Tour . . . . . . . . . . . . . . 3 2 Introduction to the RMAN Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 ...
Oracle RMAN 11g Backup And Recovery (中文名:Oracle RMAN 11g 备份和恢复) 英文原版图书,Oracle官方出版,学习Oracle Rman备份和恢复的最佳学习资料,与大家一起分享。
#### 一、RMAN(Recovery Manager)概述 在Oracle 12c版本中,RMAN是用于管理数据库备份和恢复的强大工具。它不仅可以帮助管理员执行数据库备份,还能进行灾难恢复操作,确保数据的安全性和完整性。RMAN能够自动...
#### 二、RMAN(Recovery Manager)备份与恢复 - **RMAN简介**:RMAN是Oracle提供的一种强大的备份与恢复工具,主要用于自动化数据库备份和恢复过程。 - **RMAN功能**: - **数据库备份**:可以备份整个数据库或...
该文档重点介绍了如何使用Recovery Manager (RMAN)进行常见的备份和恢复任务。 #### 版权声明 本书版权所有归Oracle公司所有,并受到版权法和其他知识产权法律保护。在未获得许可的情况下,不得进行逆向工程、拆解...
RMAN(Recovery Manager)是Oracle数据库自带的一个强大工具,专用于数据库的备份、恢复和维护。在Oracle 11g版本中,RMAN的功能得到了进一步增强,提供了更高效、更安全的数据保护方案。 RMAN的基本概念包括:备份...
本篇文章将详细介绍如何在RAC(Real Application Clusters)环境下通过RMAN(Recovery Manager)进行单实例数据库的恢复过程。恢复的目标是在一个单实例环境中实现,具体包括操作系统、数据库版本、IP地址、磁盘类型...
在本案例中,需要将原有的Oracle单机数据库通过RMAN(Recovery Manager)迁移到一个新的RAC集群中。具体需求如下: 1. **构建RAC集群**:搭建一套包含多个节点的RAC集群。 2. **数据迁移**:利用RMAN进行异机恢复,...
本文将基于Oracle官方文档《Oracle Database Backup and Recovery Basics 10g Release 1 (10.1)》的内容,详细介绍Oracle数据库备份与恢复的基础概念和技术。 #### 二、备份与恢复的重要性 备份是指将数据存储为...
本案例重点讲述了如何利用RMAN(Recovery Manager)工具进行Oracle 11.2.0.3单实例到11gR2 RAC的异机恢复操作。这一过程涉及多个关键步骤,包括数据备份、目标环境准备、恢复和配置调整。 首先,RMAN是Oracle数据库...
Oracle RMAN(Recovery Manager)是Oracle数据库管理系统中一个强大的备份和恢复工具,它提供了全面的数据保护方案。在Oracle环境中,RMAN能够执行各种备份操作,包括冷备份和热备份,以确保数据的安全性和可恢复性...
RMAN(Recovery Manager)是Oracle数据库的备份和恢复工具,VEEAM Rman Plugin for Oracle是基于RMAN的备份插件。该插件可以将Oracle数据库备份到VEEAM存储库中,提供了一个可靠的数据保护解决方案。 系统兼容要求 ...
rman catalog rmanuser1/rmanuser1@orada target system/system@oradb CMDFILE 'F:\backup\orabackup.rcv' LOG 'F:\backup\oracle_%date%' ``` - 这个批处理文件用于调用RMAN脚本执行备份,并记录日志。 3. **...
在本过程中,Recovery Manager (RMAN) 是Oracle提供的强大备份和恢复工具,它在迁移过程中扮演了关键角色。下面将详细解释这个迁移过程中的主要步骤和知识点。 一、理解RMAN RMAN是Oracle数据库管理的重要组成部分...
Oracle 9i RMAN( Recovery Manager)是Oracle数据库系统中用于数据备份和恢复的重要工具。在Oracle 9i版本中,RMAN引入了许多增强功能,旨在提供更高效、可靠的数据库保护策略。以下是对RMAN备份与恢复技术的详细...
file=/dinglp/ora_managed/backup/export/rman.dmp log=/dinglp/ora_managed/backup/log/rman.log ``` 2. **导出RMAN数据Shell脚本`exp_rman.sh`:** - 定义执行命令所需的环境变量。 ```bash #!/bin/bash ...
在RAC环境中,归档日志通常通过网络文件系统(NFS)共享或使用RMAN (Recovery Manager)在每个节点上分别备份,以便在需要时合并和恢复。这种策略保证了在多节点环境中归档日志的一致性和可用性。 总之,更改RAC环境...