备份与恢复

逻辑DataGuard重新部署逻辑备用数据库

时间:2014/11/27 22:33:21  作者:solgle  来源:www.solgle.com  查看:1108  评论:0
内容摘要:---因同步失败,重新部署逻辑备用数据库C:\Users\user>sqlplus sys/********@sd_solgle as sysdbaSQL*Plus: Release 11.2.0.1.0 Production on Thu Nov 27 11:30:57 201...
---因同步失败,重新部署逻辑备用数据库
C:\Users\user>sqlplus sys/********@sd_solgle as sysdba
 
SQL*Plus: Release 11.2.0.1.0 Production on Thu Nov 27 11:30:57 2014
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
 
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
 
SQL> create pfile='hao123.ora' from spfile ;
 
File created.
---*.db_name='solgle'  #db_name修改为跟主库一致
 
SQL> create spfile from pfile='hao123.ora';
create spfile from pfile='hao123.ora'
*
ERROR at line 1:
ORA-32002: cannot create SPFILE already being used by the instance
 
 
SQL> shutdown immediate;
ORA-01507: database not mounted
ORACLE instance shut down.
 
SQL>
SQL> create spfile from pfile='hao123.ora';
 
File created.
 
SQL>
 
SQL> startup nomount;
ORACLE instance started.
 
Total System Global Area 1039708160 bytes
Fixed Size                  2259800 bytes
Variable Size             612369576 bytes
Database Buffers          419430400 bytes
Redo Buffers                5648384 bytes
SQL>
 
 
---rman
C:\Users\user>rman target=sys/********@os_solgle nocatalog auxiliary=sys/********@sd_solgle
 
恢复管理器: Release 11.2.0.1.0 - Production on 星期四 11月 27 11:34:37 2014
 
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
 
连接到目标数据库: solgle (DBID=1370340464)
使用目标数据库控制文件替代恢复目录
已连接到辅助数据库: solgle (未装载)
 
RMAN> duplicate target database for standby from active database nofilenamecheck;
 
启动 Duplicate Db 于 27-11月-14
分配的通道: ORA_AUX_DISK_1
通道 ORA_AUX_DISK_1: SID=20 设备类型=DISK
 
内存脚本的内容:
{
   backup as copy reuse
   targetfile  '/u01/app/product/11.2.0/dbname_1/dbs/orapwsolgle' auxiliary form
at
 '/u01/app/product/11.2.0/dbname_1/dbs/orapwsolgle'   ;
}
正在执行内存脚本
 
启动 backup 于 27-11月-14
分配的通道: ORA_DISK_1
通道 ORA_DISK_1: SID=57 设备类型=DISK
完成 backup 于 27-11月-14
 
内存脚本的内容:
{
   backup as copy current controlfile for standby auxiliary format  '/u01/data/g
uard6/control01.ctl';
   restore clone controlfile to  '/u01/app/fast_recovery_area/solgle/control02.c
tl' from
 '/u01/data/solgle/control01.ctl';
}
正在执行内存脚本
 
启动 backup 于 27-11月-14
使用通道 ORA_DISK_1
通道 ORA_DISK_1: 启动数据文件副本
复制备用控制文件
... ...
输入数据文件: 文件号=00015 名称=/u01/data/user_data/p11_partdb.dbf
输出文件名=/u01/data/user_data/p11_partdb.dbf 标记=TAG20141127T113206
通道 ORA_DISK_1: 数据文件复制完毕, 经过时间: 00:00:16
通道 ORA_DISK_1: 启动数据文件副本
输入数据文件: 文件号=00016 名称=/u01/data/user_data/p12_partdb.dbf
输出文件名=/u01/data/user_data/p12_partdb.dbf 标记=TAG20141127T113206
通道 ORA_DISK_1: 数据文件复制完毕, 经过时间: 00:00:16
通道 ORA_DISK_1: 启动数据文件副本
输入数据文件: 文件号=00017 名称=/u01/data/user_data/p13_partdb.dbf
输出文件名=/u01/data/user_data/p13_partdb.dbf 标记=TAG20141127T113206
通道 ORA_DISK_1: 数据文件复制完毕, 经过时间: 00:00:15
通道 ORA_DISK_1: 启动数据文件副本
输入数据文件: 文件号=00018 名称=/u01/data/user_data/p14_partdb.dbf
输出文件名=/u01/data/user_data/p14_partdb.dbf 标记=TAG20141127T113206
通道 ORA_DISK_1: 数据文件复制完毕, 经过时间: 00:00:16
通道 ORA_DISK_1: 启动数据文件副本
输入数据文件: 文件号=00019 名称=/u01/data/user_data/p15_partdb.dbf
... ...
输入数据文件副本 RECID=35 STAMP=864733844 文件名=/u01/data/user_data/tbl_part
_P5_01.dbf
数据文件 33 已转换成数据文件副本
输入数据文件副本 RECID=36 STAMP=864733844 文件名=/u01/data/user_data/tbl_part
_P6_01.dbf
数据文件 34 已转换成数据文件副本
输入数据文件副本 RECID=37 STAMP=864733844 文件名=/u01/data/user_data/user_data00
2.dbf
数据文件 35 已转换成数据文件副本
输入数据文件副本 RECID=38 STAMP=864733844 文件名=/u01/data/user_data/user_temp01
.dbf
数据文件 36 已转换成数据文件副本
输入数据文件副本 RECID=39 STAMP=864733844 文件名=/u01/data/user_data/view_data00
1.dbf
完成 Duplicate Db 于 27-11月-14
 
RMAN>
 
 
C:\Users\user>sqlplus sys/********@sd_solgle as sysdba
 
SQL*Plus: Release 11.2.0.1.0 Production on Thu Nov 27 11:56:15 2014
 
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
 
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
 
SQL>alter database open;
 
Database altered.
 
SQL> alter database recover managed standby database using current logfile disconnect;
 
Database altered.
------物理备用库到此已经创建
 
SQL> alter database recover managed standby database cancel;
 
Database altered.
 
SQL>
 
-----登陆主库执行
C:\Users\user>sqlplus sys/********@os_solgle as sysdba
 
SQL*Plus: Release 11.2.0.1.0 Production on Thu Nov 27 15:22:20 2014
 
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
 
 
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
 
SQL> exec dbms_logstdby.build;
 
PL/SQL procedure successfully completed.
 
SQL> alter database set standby to maximize availability;
 
Database altered.
 
SQL>
 
------回到备份库
 
SQL> alter database close;
 
Database altered.
 
SQL> alter database recover to logical standby solglel;
 
Database altered.
 
SQL> startup mount force
ORACLE instance started.
 
Total System Global Area 1039708160 bytes
Fixed Size                  2259800 bytes
Variable Size             612369576 bytes
Database Buffers          419430400 bytes
Redo Buffers                5648384 bytes
Database mounted.
SQL>
SQL> alter database open resetlogs;
 
Database altered.
 
SQL> alter database start logical standby apply immediate;
 
Database altered.
 
SQL>
---数据同步已经成功,备份库可以打开查询数据

 
标签:逻辑DataGuard重新部署逻辑备用数据库 

solgle.com 版权所有,欢迎分享!!!

相关文章
    相关评论
     img1 img2 img3 img4 img5 img6 img7 img8 img9 img10
    评论者:      验证码:  点击获取验证码
       Copyright © 2013-2028 solgle.com,All rights reserved.[solgle.com] 公安机关备案号:51010802000219
    Email:solgle@solgle.com; weixin:cd1008610000 ICP:蜀ICP备14011070号-1