[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 ...
随机推荐
- MySql 8.0 C#连接报错 MySql.Data.MySqlClient.MySqlException (0x80004005): Authentication to host '12.118.224.181' for user 'root' using method 'caching_sha2_password' failed with message: Reading from t
解决方法 在连接字符串后面加上 SslMode=None
- Cent OS6下SS+BBR+改SSH端口
SS+BBR+改SSH端口 (一)搭建SS wget --no-check-certificate -O shadowsocks-libev.sh https://raw.githubusercont ...
- 关于js中的类式继承
; }; ,,]; }; ); ; }; //子类 function Bb(){ }; var F=new f(); F.prototype=Aa.prototype;//此处只能传递方法,没有办法传 ...
- 使用Java SDK实现离线签名
严格来说,tx-signer并不属于SDK,它是bytomd中构建交易.对交易签名两大模块的java实现版.因此,若想用tx-signer对交易进行离线签名,需要由你在本地保管好自己的私钥. 如果你的 ...
- speech
1.李开复:一个人的成功,15%靠专业知识,其余15%人际沟通,公众演讲,以及影响他人的能力 2.演讲是一门遗憾的艺术 3.没有准备就等于准备失败 4.追求完美,就是在追求完蛋 5.宁可千日无机会,不 ...
- [译]RabbitMQ教程C#版 - 远程过程调用(RPC)
先决条件 本教程假定 RabbitMQ 已经安装,并运行在localhost标准端口(5672).如果你使用不同的主机.端口或证书,则需要调整连接设置. 从哪里获得帮助 如果您在阅读本教程时遇到困难, ...
- 【GO】【LiteIDE】
https://blog.csdn.net/qq_32034593/article/details/82986311 下载地址:https://www.golangtc.com/download/li ...
- ios和android 浏览器适配问题总结
转自 https://blog.csdn.net/wcy7916/article/details/83345705
- 忽略 iconv 转码错误导致输出中断
在遇到一些特殊字符时候,使用iconv转码会提示报错,导致整段文字输出为空,解决的方法是增加TRANSLIT//IGNORE $str = iconv("UTF-8", " ...
- js if判断示例
){ ){ console.log("%0 pass") }else{ $(,v,function() { fla=; }); } }){ ){ console.log(" ...