Home > Database > Mysql Tutorial > body text

Oracle 11gR2 单实例 + asm for RMAN

WBOY
Release: 2016-06-07 17:39:46
Original
1373 people have browsed it

【RMAN备份与恢复之单实例】【主题:RMAN的简单的使用】一、rman备份操作:1.oracle用户登录,..

                                   【RMAN备份与恢复之单实例】

【主题:RMAN的简单的使用】
一、rman备份操作:
1.oracle用户登录,首先确定/u02/rman目录是否存在
2.使用sys用户,密码oracle 登录rman
rman target  sys/oracle
run{
CROSSCHECK  ARCHIVELOG  ALL;
ALLOCATE CHANNEL CH1 DEVICE TYPE DISK  FORMAT  '/u02/rman/test_%U' ;
ALLOCATE CHANNEL CH2 DEVICE TYPE DISK  FORMAT  '/u02/rman/test_%U';
BACKUP  incremental  level  0  DATABASE  plus  archivelog  delete  input;
RELEASE  CHANNEL  CH1;
RELEASE  CHANNEL  CH2;
}
RMAN>list backupset;  

 Oracle 11gR2 单实例 + asm for RMAN

//备份完毕,一定要记录scn。
(备份时记录备份完成的SCN号,美国服务器,此SCN号作为数据库恢复的时间点,香港服务器租用,必须记录下来)
#SCN号类似如下:
--------------------------------------------------------------------------
二、rman 首次恢复操作
1、ORACLE用户登录
2、首次进行恢复
使用sys用户登录rman
rman target sys/oracle
shutdown immediate;
startup mount;
run{
set  until  scn  277970;
ALLOCATE CHANNEL CH1 DEVICE TYPE DISK  FORMAT  '/u02/rman/test_%U';
ALLOCATE CHANNEL CH2 DEVICE TYPE DISK  FORMAT  '/u02/rman/test_%U';
restore  database;
recover  database;
sql  'alter  database  open  resetlogs';
RELEASE CHANNEL CH1;
RELEASE CHANNEL CH2;
}
三、rman 多次恢复操作
在使用备份文件恢复数据库,用open resetlogs方式打开数据之后,
如果需要再次恢复数据库,需要指定数据库的incarnation.
1、ORACLE用户登录
2、进行恢复
使用sys用户登录rman
rman target sys/oracle
shutdown  immediate ;
startup mount;
list incarnation;
reset database to incarnation  1;
run{
set until scn 1;
ALLOCATE CHANNEL CH1 DEVICE TYPE DISK  FORMAT  '/u02/rman/test_%U';
ALLOCATE CHANNEL CH2 DEVICE TYPE DISK  FORMAT  '/u02/rman/test_%U';
restore database;
recover database;
sql 'alter database open resetlogs';
RELEASE  CHANNEL  CH1;
RELEASE  CHANNEL  CH2;
}

 Oracle 11gR2 单实例 + asm for RMAN

---------------------------------------------------------

【RMAN备份与恢复之一】 Oracle 11gR2 单实例 + asm for RMAN
【RMAN备份与恢复之二】 Oracle 11gR2 RAC + asm for RMAN
【RMAN备份与恢复之三】 Oracle 11gR2 + asm for RMAN 命令应用

-----------------------------------------------------------

本文出自 “寒枫” 博客,香港虚拟主机,请务必保留此出处

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!