[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 ...
随机推荐
- Windows环境下利用anaconda3安装python版本的Xgboost
网上有各种不同安装Xgboost的教程,但是有些教程对于一个新手来说,照着做安装成功是很困难的.本人也是新手,第一次安装Xgboost的时候,照着某个教程做,结果总是安装不上,甚至想到要放弃.后来经一 ...
- Python三大神器:装饰器,迭代器,生成器
一.装饰器 由于一个函数能实现一种功能,现在想要在不改变其代码的情况下,让这个函数进化一下,即能保持原来的功能,还能有新的"技能",怎么办? 现已经存在一个自定义的函数func1, ...
- 小程序之 swiper高度根据图片高度变化
今天做的是这个效果⬇️ swiper的高度根据图片的高度而改变 wxml:<swiper indicator-dots="{{indicatorDots}}" vertic ...
- Inception部署
Inception是集审核.执行.回滚于一体的一个SQL自动化运维系统,基于MySQL代码修改,官方文档地址:https://mysql-inception.github.io/inception-d ...
- Vue开发与调试工具
vscode: Visual Studio Code https://code.visualstudio.com/Download 可以下载各个版本的,Windows/ Debian /Mac 等 W ...
- HDU - 3652
#include<stdio.h> #include<string.h> #include<math.h> #include<time.h> #incl ...
- vfile.hpp
//vov #ifndef VFILE_HPP #define VFILE_HPP #include <cstdio> #include <unistd.h> #include ...
- tcp和udp区别
1.TCP面向连接(如打电话要先拨号建立连接);UDP是无连接的,即发送数据之前不需要建立连接 2.TCP提供可靠的服务.也就是说,通过TCP连接传送的数据,无差错,不丢失,不重复,且按序到达;UDP ...
- Springboot使用alibaba的fastJson,@JSONField不起作用的问题
在Springboot中默认的JSON解析框架是jackson 今天引入alibaba的fastjson,使用@JSONField(serialize=false),让@RestController转 ...
- pta
一:实验代码 include <stdio.h> char theValue[10] = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j ...