我有两台服务器,分别用做生产数据库,rman备份数据库,基本信息如下:
生产数据库(IP:192.168.1.30,sid:orcl,没有自动备份控制文件,归档模式)
rman数据库(IP:192.168.1.60,sid:ora,归档模式)
不小心将生产数据库上的控制文件,数据文件全部删除了,应该怎么做恢复,可以把具体步骤语句详细的写出来吗,网上抄来的就谢谢啦???我用rman做了所有控制文件,数据文件的备份。以下是我的备份时语句:
db_backup_L0.bat文件内容:set oralce_sid=ora
set logPath=f:\103\logs\L0
set bakPath=f:\103\script\L0rman target 'sys/system@orcl_192.168.1.60' catalog 'rman/rman' msglog %logPath%\bak_L0.log cmdfile=%bakPath%\db_bakup_L0.rmandb_bakup_L0.rman文件内容:run{
configure retention policy to redundancy 1;
allocate channel c0 type disk;
allocate channel c1 type disk;
allocate channel c2 type disk;
backup incremental level 0 database tag 'L0_dbf_bak' format 'f:\bak\L0\L0_%d_DF_s.%s_p.%p_%T.bak' plus archivelog tag 'L0_arc_bak' format 'f:\bak\L0\L0_%d_ARC_s.%s_p.%p_%T.bak' delete all input;
backup tag 'L0_spfile_bak' format 'f:\bak\L0\L0_%d_SPFILE_s.%s_p.%p_%T.bak' spfile;
backup tag 'L0_ctl_bak' format 'f:\bak\L0\L0_%d_CTL_s.%s_p.%p_%T.bak' current controlfile;
report obsolete;
delete noprompt obsolete;
release channel c0;
release channel c1;
release channel c2;
}
生产数据库(IP:192.168.1.30,sid:orcl,没有自动备份控制文件,归档模式)
rman数据库(IP:192.168.1.60,sid:ora,归档模式)
不小心将生产数据库上的控制文件,数据文件全部删除了,应该怎么做恢复,可以把具体步骤语句详细的写出来吗,网上抄来的就谢谢啦???我用rman做了所有控制文件,数据文件的备份。以下是我的备份时语句:
db_backup_L0.bat文件内容:set oralce_sid=ora
set logPath=f:\103\logs\L0
set bakPath=f:\103\script\L0rman target 'sys/system@orcl_192.168.1.60' catalog 'rman/rman' msglog %logPath%\bak_L0.log cmdfile=%bakPath%\db_bakup_L0.rmandb_bakup_L0.rman文件内容:run{
configure retention policy to redundancy 1;
allocate channel c0 type disk;
allocate channel c1 type disk;
allocate channel c2 type disk;
backup incremental level 0 database tag 'L0_dbf_bak' format 'f:\bak\L0\L0_%d_DF_s.%s_p.%p_%T.bak' plus archivelog tag 'L0_arc_bak' format 'f:\bak\L0\L0_%d_ARC_s.%s_p.%p_%T.bak' delete all input;
backup tag 'L0_spfile_bak' format 'f:\bak\L0\L0_%d_SPFILE_s.%s_p.%p_%T.bak' spfile;
backup tag 'L0_ctl_bak' format 'f:\bak\L0\L0_%d_CTL_s.%s_p.%p_%T.bak' current controlfile;
report obsolete;
delete noprompt obsolete;
release channel c0;
release channel c1;
release channel c2;
}
rman> restore controlfile to '/opt/oracle/product/10.2.0.1/recovery/control.ctl' from
'/opt/oracle/product/10.2.0.1/autoback/control.ctl';幸亏你这里是是用的catalog的模式,要不上面的方式恢复不了的。
将目标数据库改为nomount模式时,rman显示连不到目标数据库。。
错误提示:
RMAN> startup nomount;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: startup 命令 (在 09/14/2009 15:47:33 上) 失败
RMAN-06171: 没有连接到目标数据库
RMAN> restore controlfile;
启动 restore 于 14-9月 -09
MAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: restore 命令 (在 09/14/2009 15:48:30 上) 失败
RMAN-12010: 自动通道分配初始化失败
RMAN-06171: 没有连接到目标数据库这些需要怎么解决呀。。
谢谢了,能告诉我怎么连接到目标数据库吗??RMAN> list backup of controlfile;
MAN-00571: ===================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =======
RMAN-00571: ===================================================
RMAN-03002: list 命令 (在 09/14/2009 16:25:41 上) 失败
RMAN-06171: 没有连接到目标数据库
rman>restore spfile to '/opt/oracle/product/10.2.0.1/recovery/spfileSID.ora' from
'/opt/oracle/product/10.2.0.1/autoback/control.ctl';
rman target 'sys/system@orcl_192.168.1.60' catalog 'rman/rman'
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00554: initialization of internal recovery manager package failed
RMAN-06429: TARGET database is not compatible with this version of RMAN
$ rman target 'sys/oracle' catalog 'rman/rman@oem'Recovery Manager: Release 10.2.0.4.0 - Production on Mon Sep 14 17:32:27 2009Copyright (c) 1982, 2007, Oracle. All rights reserved.connected to target database: CCTT (DBID=2638397401)
connected to recovery catalog databaseRMAN> quit
Recovery Manager complete.
$ rman target / catalog 'rman/rman@oem'Recovery Manager: Release 10.2.0.4.0 - Production on Mon Sep 14 17:32:44 2009Copyright (c) 1982, 2007, Oracle. All rights reserved.connected to target database: CCTT (DBID=2638397401)
connected to recovery catalog databaseRMAN>
这个方法好像不使很好用
C:\Documents and Settings\Administrator>rman target / catalog 'rman/rman'
恢复管理器: Release 10.2.0.1.0 - Production on 星期一 9月 14 17:52:57 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
连接到目标数据库: ORA (DBID=1312255125)
连接到恢复目录数据库
这里的目标数据库不是我真正的生产数据库,在备份日志中目标数据库的dbid是:
连接到目标数据库: ORCL (DBID=1223251843)
连接到恢复目录数据库
RMAN> restore controlfile from 'D:\backup\C-1231904857-20100220-02';启动 restore 于 21-2月 -10
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: restore 命令 (在 02/21/2010 11:17:21 上) 失败
RMAN-12010: 自动通道分配初始化失败
RMAN-06403: 无法获得完全授权的会话
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
我看到提示"ORACLE not available"所以试着执行了startup命令后
RMAN> startupOracle 实例已启动
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: startup 命令 (在 02/21/2010 11:18:35 上) 失败
ORA-00205: 标识控制文件时出错, 有关详细信息, 请查看预警日志虽然报了错误,但是再执行:
RMAN> restore controlfile from 'D:\backup\C-1231904857-20100220-02';启动 restore 于 21-2月 -10
分配的通道: ORA_DISK_1
通道 ORA_DISK_1: sid=157 devtype=DISK
………………
………………这样就能正常往下执行了。
不知道LZ是不是也是数据库没开导致的啊?