[Oracle][DATAGUARD] PHYSICAL STANDBY环境里,使用CATALOG管理Primary和Standby
1.先使用控制文件构筑好PHYSICAL STANDBY环境(Primary:Single 11.2.0.4,Standby Single 11.2.0.4)
2.构筑好Catalog用的服务器(Catalog:Single 11.2.0.4)
3.构建Catalog
|SQL> startup mount ------------------Mount启动
|ORACLEインスタンスが起動しました。
|
|Total System Global Area 839282688 bytes
|Fixed Size 2257880 bytes
|Variable Size 541068328 bytes
|Database Buffers 289406976 bytes
|Redo Buffers 6549504 bytes
|データベースがマウントされました。
|SQL> alter database archivelog; ------------------变成archivelog模式
|
|データベースが変更されました。
|
|SQL> archive log list ------------------变换成功
|データベース・ログ・モード アーカイブ・モード
|自動アーカイブ 有効
|アーカイブ先 USE_DB_RECOVERY_FILE_DEST
|最も古いオンライン・ログ順序 5
|アーカイブする次のログ順序 7
|現行のログ順序 7
|SQL> alter database open;
|
|データベースが変更されました。
|
|SQL> CREATE TABLESPACE tools DATAFILE SIZE 1000M SEGMENT SPACE MANAGEMENT AUTO; ------------------创建表领域
|
|表領域が作成されました。
|
|SQL> CREATE USER rman IDENTIFIED BY rman
| TEMPORARY TABLESPACE temp
| DEFAULT TABLESPACE tools
| QUOTA UNLIMITED ON tools; 2 3 4 ------------------创建需要用的用户
|
|ユーザーが作成されました。
|
|SQL> GRANT RECOVERY_CATALOG_OWNER TO rman; ------------------赋予RECOVERY_CATALOG_OWNER权限
|
|権限付与が成功しました。
|
|SQL> grant dba to rman; ------------------保险起见,还是给予了dba权限
|
|権限付与が成功しました。
|
|SQL> exit
|Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
|With the Partitioning, OLAP, Data Mining and Real Application Testing optionsとの接続が切断されました。
|[oracle@db11204 ~]$ export NLS_LANG='American'
|[oracle@db11204 ~]$ export NLS_DATE_FORMAT=YYYY-MM-DD_HH24:MI:SS
|[oracle@db11204 ~]$ rman catalog rman/rman@ora11204 ------------------连接
|
|Recovery Manager: Release 11.2.0.4.0 - Production on Thu Oct 12 17:12:36 2017
|
|Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
|
|connected to recovery catalog database
|
|RMAN> drop catalog; ------------------如果有,就Drop,当然没有也没啥
|
|recovery catalog owner is RMAN
|enter DROP CATALOG command again to confirm catalog removal
|
|RMAN> create catalog tablespace tools; ------------------建造catalog
|
|recovery catalog created
4.在Primary侧,执行REGISTER DATABASE;
|[oracle@primary ~]$ export NLS_LANG='American'
|[oracle@primary ~]$ export NLS_DATE_FORMAT=YYYY-MM-DD_HH24:MI:SS
|[oracle@primary ~]$ rman target / catalog rman/rman@db11204
|
|Recovery Manager: Release 11.2.0.4.0 - Production on Thu Oct 12 17:13:37 2017
|
|Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
|
|connected to target database: ORCL (DBID=1460344535)
|connected to recovery catalog database
|
|RMAN> REGISTER DATABASE; ------------------执行REGISTER DATABASE;
|
|database registered in recovery catalog
|starting full resync of recovery catalog
|full resync complete
5.在Standby侧,尝试连接catalog
|[oracle@standby ~]$ export NLS_LANG='American'
|[oracle@standby ~]$ export NLS_DATE_FORMAT=YYYY-MM-DD_HH24:MI:SS
|[oracle@standby ~]$ env | grep ORA
|ORACLE_SID=orcls
|ORACLE_BASE=/u01/app/oracle
|ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
|[oracle@standby ~]$ rman target / catalog rman/rman@db11204 ------------------可以连接
6.在Catalog侧,确认是否成功
|RMAN> LIST DB_UNIQUE_NAME ALL;
|
|[oracle@db11204 ~]$ rman catalog rman/rman@ora11204
|
|Recovery Manager: Release 11.2.0.4.0 - Production on Thu Oct 12 17:12:36 2017
|
|Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
|
|connected to recovery catalog database
|RMAN> list db_unique_name all;
|List of Databases
|DB Key DB Name DB ID Database Role Db_unique_name
|------- ------- ----------------- --------------- ------------------
|1 ORCL 1460344535 PRIMARY ORCL ------------------成功
|1 ORCL 1460344535 STANDBY ORCLS ------------------成功
|
|RMAN> upgrade catalog; ------------------保险起见,执行两次upgrade catalog;
|
|recovery catalog owner is RMAN
|enter UPGRADE CATALOG command again to confirm catalog upgrade
|
|RMAN> upgrade catalog; ------------------保险起见,执行两次upgrade catalog;
|
|recovery catalog upgraded to version 11.02.00.04
|DBMS_RCVMAN package upgraded to version 11.02.00.04
|DBMS_RCVCAT package upgraded to version 11.02.00.04
|
|RMAN> list db_unique_name all;
|
|
|List of Databases
|DB Key DB Name DB ID Database Role Db_unique_name
|------- ------- ----------------- --------------- ------------------
|1 ORCL 1460344535 PRIMARY ORCL ------------------成功
|1 ORCL 1460344535 STANDBY ORCLS ------------------成功
7.在Primary侧动作确认
|[oracle@primary ~]$ rman target / catalog rman/rman@db11204
|
|Recovery Manager: Release 11.2.0.4.0 - Production on Thu Oct 12 17:15:52 2017
|
|Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
|
|connected to target database: ORCL (DBID=1460344535)
|connected to recovery catalog database
|
|RMAN>
|
|RMAN>
|
|RMAN> list backupset verbose; ------------------没问题
|
|
|List of Backup Sets
|===================
|
|
|BS Key Size Device Type Elapsed Time Completion Time
|------- ---------- ----------- ------------ -------------------
|129 6.24M DISK 00:00:02 2017-01-09_12:47:19
| BP Key: 133 Status: AVAILABLE Compressed: YES Tag: TAG20170109T124717
| Piece Name: /tmp/standby_archive_01rpjdel_1_1
|
| List of Archived Logs in backup set 129
| Thrd Seq Low SCN Low Time Next SCN Next Time
| ---- ------- ---------- ------------------- ---------- ---------
| 1 53 697572 2017-01-06_14:20:24 704298 2017-01-09_12:47:10
|
|BS Key Type LV Size Device Type Elapsed Time Completion Time
|------- ---- -- ---------- ----------- ------------ -------------------
|130 Full 353.30M DISK 00:04:11 2017-01-09_12:51:32
| BP Key: 134 Status: AVAILABLE Compressed: YES Tag: TAG20170109T124721
| Piece Name: /tmp/standby_database_02rpjdep_1_1
| List of Datafiles in backup set 130
| File LV Type Ckp SCN Ckp Time Name
| ---- -- ---- ---------- ------------------- ----
| 1 Full 704308 2017-01-09_12:47:21 /u01/app/oracle/oradata/ORCL/datafile/o1_mf_system_d6y7bpkd_.dbf
8.在Standby侧动作确认
|[oracle@standby ~]$ rman target / catalog rman/rman@db11204
|
|Recovery Manager: Release 11.2.0.4.0 - Production on Thu Oct 12 17:24:42 2017
|
|Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
|
|connected to target database: ORCL (DBID=1460344535, not open)
|connected to recovery catalog database
|
|RMAN> list backupset verbose; ------------------出错了(我了个去)
|
|RMAN-00571: ===========================================================
|RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
|RMAN-00571: ===========================================================
|RMAN-03002: failure of list command at 10/12/2017 17:24:46
|RMAN-03014: implicit resync of recovery catalog failed
|RMAN-03009: failure of partial resync command on default channel at 10/12/2017 17:24:46
|RMAN-20999: internal error
|
|RMAN> exit ------------------先出去
|
|
|Recovery Manager complete.
|[oracle@standby ~]$ sqlplus / as sysdba
|
|SQL*Plus: Release 11.2.0.4.0 Production on Thu Oct 12 17:28:26 2017
|
|Copyright (c) 1982, 2013, 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> recover managed standby database using current logfile disconnect; ------------------打开MRP,进行REDO应用
|Media recovery complete.
|set line 200
|col name for a100
|SQL>
|SQL> select sequence#, name, applied from v$archived_log where resetlogs_change# = (select resetlogs_change# from v$database) order by sequence#;
|
| SEQUENCE# NAME APPLIED
|---------- ---------------------------------------------------------------------------------------------------- ---------
| 55 /u01/app/oracle/fast_recovery_area/ORCLS/archivelog/2017_01_09/o1_mf_1_55_d768d472_.arc YES
| 56 /u01/app/oracle/fast_recovery_area/ORCLS/archivelog/2017_01_09/o1_mf_1_56_d768dvdr_.arc YES
| 57 /u01/app/oracle/fast_recovery_area/ORCLS/archivelog/2017_08_17/o1_mf_1_57_dsb0ljby_.arc YES
| 58 /u01/app/oracle/fast_recovery_area/ORCLS/archivelog/2017_08_17/o1_mf_1_58_dsb0lgkq_.arc YES
| 59 /u01/app/oracle/fast_recovery_area/ORCLS/archivelog/2017_08_17/o1_mf_1_59_dsb0lgk1_.arc YES
| 60 /u01/app/oracle/fast_recovery_area/ORCLS/archivelog/2017_08_17/o1_mf_1_60_dsb0ljc1_.arc YES
| 61 /u01/app/oracle/fast_recovery_area/ORCLS/archivelog/2017_08_17/o1_mf_1_61_dsb0mg3z_.arc YES
| 62 /u01/app/oracle/fast_recovery_area/ORCLS/archivelog/2017_08_23/o1_mf_1_62_dssw8dyj_.arc YES
| 63 /u01/app/oracle/fast_recovery_area/ORCLS/archivelog/2017_08_23/o1_mf_1_63_dssw81co_.arc YES
| 64 /u01/app/oracle/fast_recovery_area/ORCLS/archivelog/2017_08_23/o1_mf_1_64_dssw875p_.arc YES
| 65 /u01/app/oracle/fast_recovery_area/ORCLS/archivelog/2017_08_23/o1_mf_1_65_dsswpmjq_.arc YES
|
| SEQUENCE# NAME APPLIED
|---------- ---------------------------------------------------------------------------------------------------- ---------
| 66 /u01/app/oracle/fast_recovery_area/ORCLS/archivelog/2017_08_23/o1_mf_1_66_dsswsswg_.arc YES
| 67 /u01/app/oracle/fast_recovery_area/ORCLS/archivelog/2017_08_23/o1_mf_1_67_dsswx135_.arc YES
| 68 /u01/app/oracle/fast_recovery_area/ORCLS/archivelog/2017_08_23/o1_mf_1_68_dsswytvj_.arc YES
| 69 /u01/app/oracle/fast_recovery_area/ORCLS/archivelog/2017_08_23/o1_mf_1_69_dssx0tjp_.arc YES
| 70 /u01/app/oracle/fast_recovery_area/ORCLS/archivelog/2017_08_23/o1_mf_1_70_dssx2d95_.arc YES
| 71 /u01/app/oracle/fast_recovery_area/ORCLS/archivelog/2017_08_23/o1_mf_1_71_dssxyzmk_.arc YES
| 72 /u01/app/oracle/fast_recovery_area/ORCLS/archivelog/2017_08_23/o1_mf_1_72_dsszd9j0_.arc YES
| 73 /u01/app/oracle/fast_recovery_area/ORCLS/archivelog/2017_08_23/o1_mf_1_73_dsszfm4y_.arc YES
| 74 /u01/app/oracle/fast_recovery_area/ORCLS/archivelog/2017_08_23/o1_mf_1_74_dsszh6os_.arc YES
| 75 /u01/app/oracle/fast_recovery_area/ORCLS/archivelog/2017_08_23/o1_mf_1_75_dst02m6p_.arc YES
| 76 /u01/app/oracle/fast_recovery_area/ORCLS/archivelog/2017_09_25/o1_mf_1_76_dwjvjb0l_.arc YES
|
| SEQUENCE# NAME APPLIED
|---------- ---------------------------------------------------------------------------------------------------- ---------
| 77 /u01/app/oracle/fast_recovery_area/ORCLS/archivelog/2017_09_25/o1_mf_1_77_dwjvjf1t_.arc YES
| 78 /u01/app/oracle/fast_recovery_area/ORCLS/archivelog/2017_09_25/o1_mf_1_78_dwjvyj29_.arc YES
| 79 /u01/app/oracle/fast_recovery_area/ORCLS/archivelog/2017_10_12/o1_mf_1_79_dxy69k4v_.arc YES
| 80 /u01/app/oracle/fast_recovery_area/ORCLS/archivelog/2017_10_12/o1_mf_1_80_dxy691hf_.arc YES
| 81 /u01/app/oracle/fast_recovery_area/ORCLS/archivelog/2017_10_12/o1_mf_1_81_dxy691h9_.arc YES
| 82 /u01/app/oracle/fast_recovery_area/ORCLS/archivelog/2017_10_12/o1_mf_1_82_dxy6984z_.arc YES
| 83 /u01/app/oracle/fast_recovery_area/ORCLS/archivelog/2017_10_12/o1_mf_1_83_dxy9jgry_.arc IN-MEMORY ------------------成功了
|
|29 rows selected.
|
|SQL> exit
|Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
|With the Partitioning, OLAP, Data Mining and Real Application Testing options
|[oracle@standby ~]$ rman target / catalog rman/rman@db11204 ------------------再一次连接
|
|Recovery Manager: Release 11.2.0.4.0 - Production on Thu Oct 12 17:29:14 2017
|
|Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
|
|connected to target database: ORCL (DBID=1460344535, not open)
|connected to recovery catalog database
|
|RMAN> list backupset verbose; ------------------好用了
|
|
|List of Backup Sets
|===================
|
|
|BS Key Type LV Size Device Type Elapsed Time Completion Time
|------- ---- -- ---------- ----------- ------------ -------------------
|269 Full 353.30M DISK 00:00:00 2017-01-09_12:47:21
| BP Key: 273 Status: AVAILABLE Compressed: YES Tag: TAG20170109T124721
| Piece Name: /tmp/standby_database_02rpjdep_1_1
| List of Datafiles in backup set 269
| File LV Type Ckp SCN Ckp Time Name
| ---- -- ---- ---------- ------------------- ----
| 1 Full 704308 2017-01-09_12:47:21 /u01/app/oracle/oradata/ORCLS/datafile/o1_mf_system_d765zflg_.dbf
| 2 Full 704308 2017-01-09_12:47:21 /u01/app/oracle/oradata/ORCLS/datafile/o1_mf_sysaux_d765zflp_.dbf
| 3 Full 704308 2017-01-09_12:47:21 /u01/app/oracle/oradata/ORCLS/datafile/o1_mf_undotbs1_d765zflw_.dbf
| 4 Full 704308 2017-01-09_12:47:21 /u01/app/oracle/oradata/ORCLS/datafile/o1_mf_users_d765zfm5_.dbf
[Oracle][DATAGUARD] PHYSICAL STANDBY环境里,使用CATALOG管理Primary和Standby的更多相关文章
- [Oracle][DATAGUARD] LOGICAL STANDBY环境里,有些SEQUENCE无法应用,导致Primary和Standby无法同期
今天遇到了一个客户,问题是这样的,客户构筑了一个RACtoRAC的 LOGICAL STANDBY环境.并用EM在监视同期情况,发现EM页面上55115和55116这两个SEQUENCE一直在应用. ...
- [Oracle][DATAGUARD] PHYSICAL STANDBY环境里,11.2.0.4 , 也可以使用Pfile来运行Primary和Standby(虽然很少有人用)
####Primary#### [oracle@primary ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0 Production on 金 ...
- 9. Oracle DataGuard的介绍
一. Oracle DataGuard简介 Oracle DataGuard:简称DG.是由一个Primary Database(主库)和一个或者多个Standby Database(备库)组成.对O ...
- [Oracle] DataGuard switchover
Oracle DataGuard switchover 2013/07/11 Tag.Data Guard,primary,standby,switchover 切换前primary site和sta ...
- SQL Server中的事务日志管理(5/9):完整恢复模式里的日志管理
当一切正常时,没有必要特别留意什么是事务日志,它是如何工作的.你只要确保每个数据库都有正确的备份.当出现问题时,事务日志的理解对于采取修正操作是重要的,尤其在需要紧急恢复数据库到指定点时.这系列文章会 ...
- Oracle Dataguard之物理standby的基本配置
尽管网上有很多Oracle Dataguard的配置教程,但不难发现,很多采用的是rman duplicate这种方法,尽管此种方法较为简便.但在某种程度上,却也误导了初学者,虽说也能配置成功,但只知 ...
- Oracle Dataguard Standby Redo Log的两个实验
在Data Guard环境中,Standby Redo Log是一个比较特殊的日志类型.从最新的DG安装指导中,都推荐在Primary和Standby端,都配置Standby Redo Log. 简单 ...
- Oracle DataGuard 物理Standby 搭建(上)
物理standby database 环境搭建 Arch asysnc Oracle Dataguard host IP Oracle_sid DB_unique_name FAL_server FA ...
- Oracle DataGuard 物理Standby 搭建(下)
主备库切换 Switchover 一般SWITCHOVER切换都是计划中的切换,特点是在切换后,不会丢失任何的数据,而且这个过程是可逆的,整个DATA GUARD环境不会被破坏,原来DATA GUAR ...
随机推荐
- Blender学习笔记
本文是根据B站上面,顺子老师的视频学习整理,建模部分,并未设计到渲染,内容整理所得 下载安装,可以直接在blender官网下载,建议下载最新版吧.因为每次软件的更新都会有新的东西出现,在使用中把你的心 ...
- Flask Web框架
Flask依赖两个外部库:Werkzeug和Jinja2.Werkzeug是一个WSGI(在Web应用和多种服务器之间的标准Python接口)工具集:Jinja2负责渲染模板.所以在安装Flask之前 ...
- 解决 scapy “NameError: global name 'wrpcap' is not defined” 错误
解决 scapy "NameError: global name 'wrpcap' is not defined" 错误 通过 scapy 编写发包脚本时遇到如下错误: Trace ...
- 数据类型 varchar 和 uniqueidentifier 在 add 运算符中不兼容
select '<a href="/'+a.id +'" title="'+ a.title +'">'+a.Title+'</a>' ...
- Go语言库之strconv包(转载自--http://blog.csdn.net/alvine008/article/details/51283189)
golang strconv.ParseInt 是将字符串转换为数字的函数 func ParseInt(s string, base int, bitSize int) (i int64, err e ...
- hdu 6006 Engineer Assignment 状压dp
Engineer Assignment Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Othe ...
- js for 循环示例
//for 循环 ,,,,,,]; ; i < array.length; i++) { console.log(i,array[i]); } //for in ,,,,,,]; for(let ...
- 在线批量将gps经纬度坐标转换为百度经纬度坐标
1.首先打开百度api示例页面: 在浏览器地址栏中输入:http://developer.baidu.com/map/jsdemo.htm#a5_3 2.修改代码 如下图,将需要批量转换的坐标,按规则 ...
- cookie 和session 详解
cookie机制采用的是在客户端保持状态的方案,而session机制采用的是在服务器端保持状态的方案. 由于采用服务器端保持状态的方案在客户端也需要保存一个标识,所以session机制可能需要借助于c ...
- 20190321xlVBA_明细信息表汇总成数据表
刚开始能把代码敲得行云流水的时候,写代码是种乐趣.有了功利目的之后,重复的工作写多几次,厌烦的情绪四处弥漫. 去年八月份正好写了一回,还能支持控件,在此备忘. Public Sub Informati ...