Oracle 11.2.0.4 Data Guard 部署练习【一主一备/单机】
Oracle DG 理论及实验笔记
DATAGUARD 是通过建立一个 PRIMARY 和 STANDBY 组来确立其参照关系。
STANDBY 一旦创建, DATAGUARD 就会通过将主数据库 (PRIMARY) 的 REDO 传递给 STANDBY 数据库,然后在 STANDBY 中应用 REDO 实现数据库的同步。
有两种类型的 STANDBY :物理 STANDBY 和逻辑 STANDBY 。
物理 STANDBY 提供与主数据库完全一样的拷贝(块到块),数据库 SCHEMA ,包括索引都是一样的。它是直接应用 REDO 实现同步的。逻辑 STANDBY 则不是这样,在逻辑 STANDBY 中,逻辑信息是相同的,但物理组织和数据结构可以不同,它和主库保持同步的方法是将接收的 REDO 转换成 SQL 语句,然后在 STANDBY 上执行 SQL 语句。逻辑 STANDBY 除灾难恢复外还有其它用途,比如用于用户进行查询和报表。
安装环境:
在主库 --primary 上搭建数据库软件,建立监听,采用 dbca 搭建实例;
在备库 --standby 上搭建数据库软件,建立监听,但是不需要建立实例。
在 linux 上搭建 oracle 数据库,过程略。
步骤概述:
1.主库开启归档并设置快速恢复区;
2.主库创建归档同步目录;
3.主库添加 STANDBY 日志文件;
4.主备皆配置网络 --- 监听配置文件;
5.将主库的密码文件传输到备库;
6.修改主库的参数文件传输到备库,需修改部分信息;
7.以动态参数文件的形式启动备库数据库;
8.主库登录 RMAN ,【 duplicate 】复制数据库;
1.主备库配置
1.1创建归档同步目录
[oracle@test1 ~]$ mkdir -p /home/oracle/flash
[oracle@test2 ~]$ mkdir -p /home/oracle/flash
1.2开启归档并设置快速恢复区
alter system set db_recovery_file_dest='/home/oracle/flash';
alter system set db_recovery_file_dest_size=4G;
alter database archivelog;
1.3主库添加 STANDBY 日志文件
alter database add standby logfile group 4 '/home/oracle/s1.log' size 50M;
alter database add standby logfile group 5 '/home/oracle/s2.log' size 50M;
alter database add standby logfile group 6 '/home/oracle/s3.log' size 50M;
alter database add standby logfile group 7 '/home/oracle/s4.log' size 50M;
1.4主备库修改监听配置文件
[oracle@test1 ~]$ cd /u01/app/oracle/product/11.2.0/db_1/network/admin/
[oracle@test1 admin]$ cat listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = test1.us.oracle.com)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
ADR_BASE_LISTENER = /u01/app/oracle SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME=PROD1)
(ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1)
(SID_NAME=PROD1))
)
[oracle@test1 admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools. PROD1 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = test1.us.oracle.com)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = PROD1)
)
) PROD1_S =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = test2.us.oracle.com)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = PROD1)
)
)
启动监听,并测试服务名网络的通畅。两台主机均需测试两个服务名(此省略主库的测试):
[oracle@test1 admin]$ lsnrctl start
[oracle@test2 admin]$ lsnrctl start
[oracle@test2 admin]$ tnsping prod1
TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 25-FEB-2019 11:46:06
Copyright (c) 1997, 2013, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = test1.us.oracle.com)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = PROD1)))
OK (0 msec) [oracle@test2 admin]$ tnsping prod1_s
TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 25-FEB-2019 11:47:04
Copyright (c) 1997, 2013, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = test2.us.oracle.com)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = PROD1)))
OK (0 msec)
1.5传输密码文件
[oracle@test1 dbs]$ cd $ORACLE_HOME/dbs
[oracle@test1 dbs]$ ls
hc_PROD1.dat init.ora lkPROD1 orapwPROD1 spfilePROD1.ora
[oracle@test1 dbs]$ scp orapwPROD1 test2:/u01/app/oracle/product/11.2.0/dbhome_1/dbs
oracle@test2's password:
orapwPROD1 100% 1536 1.5KB/s 00:00
1.6修改参数文件配置
[oracle@test1 dbs]$ ls
hc_PROD1.dat init.ora initPROD1.ora lkPROD1 orapwPROD1 spfilePROD1.ora
[oracle@test1 dbs]$ cat initPROD1.ora
PROD1.__db_cache_size=260046848
PROD1.__java_pool_size=4194304
PROD1.__large_pool_size=8388608
PROD1.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
PROD1.__pga_aggregate_target=398458880
PROD1.__sga_target=390070272
PROD1.__shared_io_pool_size=0
PROD1.__shared_pool_size=104857600
PROD1.__streams_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/PROD1/adump'
*.audit_trail='db'
*.compatible='11.2.0.4.0'
*.control_files='/u01/app/oracle/oradata/PROD1/control01.ctl','/u01/app/oracle/fast_recovery_area/PROD1/control02.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='PROD1'
*.db_recovery_file_dest='/home/oracle/flash'
*.db_recovery_file_dest_size=4294967296
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=PROD1XDB)'
*.memory_target=786432000
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1' DB_UNIQUE_NAME=PROD1
LOG_ARCHIVE_CONFIG='DG_CONFIG=(PROD1,LEILEI)'
LOG_ARCHIVE_DEST_1=
'LOCATION=/home/oracle/flash
VALID_FOR=(ALL_LOGFILES,ALL_ROLES)
DB_UNIQUE_NAME=PROD1'
LOG_ARCHIVE_DEST_2=
'SERVICE=PROD1_S ASYNC
VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)
DB_UNIQUE_NAME=LEILEI'
LOG_ARCHIVE_DEST_STATE_1=ENABLE
LOG_ARCHIVE_DEST_STATE_2=ENABLE
REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE
LOG_ARCHIVE_FORMAT=%t_%s_%r.arc
LOG_ARCHIVE_MAX_PROCESSES=30
FAL_SERVER=PROD1
STANDBY_FILE_MANAGEMENT=AUTO
传输静态参数文件到备库:
[oracle@test1 dbs]$ scp initPROD1.ora test2:/u01/app/oracle/product/11.2.0/dbhome_1/dbs
oracle@test2's password:
initPROD1.ora 100% 1399 1.4KB/s 00:00
在备库上修改静态参数文件:
[oracle@test2 dbs]$ cat initPROD1.ora
*.control_files='/u01/app/oracle/oradata/PROD1/control01.ctl','/u01/app/oracle/fast_recovery_area/PROD1/control02.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='PROD1'
*.db_recovery_file_dest='/home/oracle/flash'
*.db_recovery_file_dest_size=4294967296
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=PROD1XDB)'
*.memory_target=786432000
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1' DB_UNIQUE_NAME=LEILEI
LOG_ARCHIVE_CONFIG='DG_CONFIG=(LEILEI,PROD1)'
LOG_ARCHIVE_DEST_1=
'LOCATION=/home/oracle/flash
VALID_FOR=(ALL_LOGFILES,ALL_ROLES)
DB_UNIQUE_NAME=LEILEI'
LOG_ARCHIVE_DEST_2=
'SERVICE=PROD1 ASYNC
VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)
DB_UNIQUE_NAME=PROD1'
LOG_ARCHIVE_DEST_STATE_1=ENABLE
LOG_ARCHIVE_DEST_STATE_2=ENABLE
REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE
LOG_ARCHIVE_FORMAT=%t_%s_%r.arc
LOG_ARCHIVE_MAX_PROCESSES=30
FAL_SERVER=PROD1
STANDBY_FILE_MANAGEMENT=AUTO
1.7在备库上,创建静态参数文件中对应的目录文件夹
[oracle@test2 dbs]$
mkdir -p /home/oracle/flash
mkdir -p /u01/app/oracle/admin/PROD1/adump
mkdir -p /u01/app/oracle/oradata/PROD1
mkdir -p /u01/app/oracle/fast_recovery_area/PROD1
1.8启动备库到【 nomount 】阶段
[oracle@test2 ~]$ export ORACLE_SID=PROD1
[oracle@test2 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Mon Feb 25 13:59:23 2019
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to an idle instance. SYS@PROD1 >startup nomount;
ORACLE instance started.
Total System Global Area 1219260416 bytes
Fixed Size 2252744 bytes
Variable Size 788529208 bytes
Database Buffers 419430400 bytes
Redo Buffers 9048064 bytes
1.9主库登录 RMAN ,复制数据库
[oracle@test1 ~]$ rman target sys/oracle@prod1 auxiliary sys/oracle@prod1_s
RMAN> duplicate target database for standby from active database nofilenamecheck;
1 [oracle@test1 ~]$ rman target sys/oracle@prod1 auxiliary sys/oracle@prod1_s
2
3 Recovery Manager: Release 11.2.0.4.0 - Production on Mon Feb 25 13:43:23 2019
4 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
5 connected to target database: PROD1 (DBID=2222506242)
6 connected to auxiliary database: PROD1 (not mounted)
7
8 RMAN> duplicate target database for standby from active database nofilenamecheck;
9
10 Starting Duplicate Db at 2019-02-25 13:43:31
11 using target database control file instead of recovery catalog
12 allocated channel: ORA_AUX_DISK_1
13 channel ORA_AUX_DISK_1: SID=10 device type=DISK
14 contents of Memory Script:
15 {
16 backup as copy reuse
17 targetfile '/u01/app/oracle/product/11.2.0/db_1/dbs/orapwPROD1' auxiliary format
18 '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwPROD1' ;
19 }
20 executing Memory Script
21
22 Starting backup at 2019-02-25 13:43:32
23 allocated channel: ORA_DISK_1
24 channel ORA_DISK_1: SID=17 device type=DISK
25 Finished backup at 2019-02-25 13:43:33
26
27 contents of Memory Script:
28 {
29 backup as copy current controlfile for standby auxiliary format '/u01/app/oracle/oradata/PROD1/control01.ctl';
30 restore clone controlfile to '/u01/app/oracle/fast_recovery_area/PROD1/control02.ctl' from
31 '/u01/app/oracle/oradata/PROD1/control01.ctl';
32 }
33 executing Memory Script
34
35 Starting backup at 2019-02-25 13:43:33
36 using channel ORA_DISK_1
37 channel ORA_DISK_1: starting datafile copy
38 copying standby control file
39 output file name=/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_PROD1.f tag=TAG20190225T134333 RECID=2 STAMP=1001166214
40 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
41 Finished backup at 2019-02-25 13:43:36
42
43 Starting restore at 2019-02-25 13:43:36
44 using channel ORA_AUX_DISK_1
45
46 channel ORA_AUX_DISK_1: copied control file copy
47 Finished restore at 2019-02-25 13:43:37
48
49 contents of Memory Script:
50 {
51 sql clone 'alter database mount standby database';
52 }
53 executing Memory Script
54
55 sql statement: alter database mount standby database
56
57 contents of Memory Script:
58 {
59 set newname for tempfile 1 to
60 "/u01/app/oracle/oradata/PROD1/temp01.dbf";
61 switch clone tempfile all;
62 set newname for datafile 1 to
63 "/u01/app/oracle/oradata/PROD1/system01.dbf";
64 set newname for datafile 2 to
65 "/u01/app/oracle/oradata/PROD1/sysaux01.dbf";
66 set newname for datafile 3 to
67 "/u01/app/oracle/oradata/PROD1/undotbs01.dbf";
68 set newname for datafile 4 to
69 "/u01/app/oracle/oradata/PROD1/users01.dbf";
70 set newname for datafile 5 to
71 "/u01/app/oracle/oradata/PROD1/example01.dbf";
72 backup as copy reuse
73 datafile 1 auxiliary format
74 "/u01/app/oracle/oradata/PROD1/system01.dbf" datafile
75 2 auxiliary format
76 "/u01/app/oracle/oradata/PROD1/sysaux01.dbf" datafile
77 3 auxiliary format
78 "/u01/app/oracle/oradata/PROD1/undotbs01.dbf" datafile
79 4 auxiliary format
80 "/u01/app/oracle/oradata/PROD1/users01.dbf" datafile
81 5 auxiliary format
82 "/u01/app/oracle/oradata/PROD1/example01.dbf" ;
83 sql 'alter system archive log current';
84 }
85 executing Memory Script
86
87 executing command: SET NEWNAME
88
89 renamed tempfile 1 to /u01/app/oracle/oradata/PROD1/temp01.dbf in control file
90
91 executing command: SET NEWNAME
92
93 executing command: SET NEWNAME
94
95 executing command: SET NEWNAME
96
97 executing command: SET NEWNAME
98
99 executing command: SET NEWNAME
100
101 Starting backup at 2019-02-25 13:43:43
102 using channel ORA_DISK_1
103 channel ORA_DISK_1: starting datafile copy
104 input datafile file number=00001 name=/u01/app/oracle/oradata/PROD1/system01.dbf
105 output file name=/u01/app/oracle/oradata/PROD1/system01.dbf tag=TAG20190225T134343
106 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:45
107 channel ORA_DISK_1: starting datafile copy
108 input datafile file number=00002 name=/u01/app/oracle/oradata/PROD1/sysaux01.dbf
109 output file name=/u01/app/oracle/oradata/PROD1/sysaux01.dbf tag=TAG20190225T134343
110 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
111 channel ORA_DISK_1: starting datafile copy
112 input datafile file number=00005 name=/u01/app/oracle/oradata/PROD1/example01.dbf
113 output file name=/u01/app/oracle/oradata/PROD1/example01.dbf tag=TAG20190225T134343
114 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
115 channel ORA_DISK_1: starting datafile copy
116 input datafile file number=00003 name=/u01/app/oracle/oradata/PROD1/undotbs01.dbf
117 output file name=/u01/app/oracle/oradata/PROD1/undotbs01.dbf tag=TAG20190225T134343
118 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
119 channel ORA_DISK_1: starting datafile copy
120 input datafile file number=00004 name=/u01/app/oracle/oradata/PROD1/users01.dbf
121 output file name=/u01/app/oracle/oradata/PROD1/users01.dbf tag=TAG20190225T134343
122 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
123 Finished backup at 2019-02-25 13:45:16
124
125 sql statement: alter system archive log current
126
127 contents of Memory Script:
128 {
129 switch clone datafile all;
130 }
131 executing Memory Script
132
133 datafile 1 switched to datafile copy
134 input datafile copy RECID=2 STAMP=1001167339 file name=/u01/app/oracle/oradata/PROD1/system01.dbf
135 datafile 2 switched to datafile copy
136 input datafile copy RECID=3 STAMP=1001167339 file name=/u01/app/oracle/oradata/PROD1/sysaux01.dbf
137 datafile 3 switched to datafile copy
138 input datafile copy RECID=4 STAMP=1001167339 file name=/u01/app/oracle/oradata/PROD1/undotbs01.dbf
139 datafile 4 switched to datafile copy
140 input datafile copy RECID=5 STAMP=1001167339 file name=/u01/app/oracle/oradata/PROD1/users01.dbf
141 datafile 5 switched to datafile copy
142 input datafile copy RECID=6 STAMP=1001167339 file name=/u01/app/oracle/oradata/PROD1/example01.dbf
2.检查主备搭建情况
2.1主库
[oracle@test1 ~]$ export ORACLE_SID=PROD1
[oracle@test1 ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0 Production on Mon Feb 25 13:46:56 2019 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 SYS@PROD1 >select open_mode,database_role,switchover_status from v$database; OPEN_MODE DATABASE_ROLE SWITCHOVER_STATUS
---------------------------------------- -------------------------------- ----------------------------------------
READ WRITE PRIMARY SESSIONS ACTIVE SYS@PROD1 >select * from v$log; GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARCHIV STATUS FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME
---------- ---------- ---------- ---------- ---------- ---------- ------ -------------------------------- ------------- ------------------- ------------ -------------------
1 1 16 52428800 512 1 NO CURRENT 996478 2019-02-25 14:19:03 2.8147E+14
2 1 14 52428800 512 1 YES INACTIVE 996073 2019-02-25 14:12:33 996161 2019-02-25 14:13:55
3 1 15 52428800 512 1 YES ACTIVE 996161 2019-02-25 14:13:55 996478 2019-02-25 14:19:03
2.2备库
[oracle@test2 ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0 Production on Mon Feb 25 14:04:36 2019
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 SYS@PROD1 >select open_mode,database_role,switchover_status from v$database; OPEN_MODE DATABASE_ROLE SWITCHOVER_STATUS
---------------------------------------- -------------------------------- ----------------------------------------
MOUNTED PHYSICAL STANDBY RECOVERY NEEDED
备库处于MOUNTED模式下,只能开启实时应用在线日志或者归档日志。
SYS@PROD1 >select PROCESS,STATUS,SEQUENCE# from v$managed_standby; PROCESS STATUS SEQUENCE#
------------------ ---------------------- -----------------
ARCH CLOSING 15
ARCH CONNECTED 0
......
ARCH CONNECTED 0
ARCH CONNECTED 0
ARCH CONNECTED 0
RFS IDLE 0
RFS IDLE 0
RFS IDLE 16 33 rows selected. SYS@PROD1 >alter database open;
Database altered. SYS@PROD1 >select open_mode,database_role,switchover_status from v$database; OPEN_MODE DATABASE_ROLE SWITCHOVER_STATUS
------------- ----------------- -------------------
READ ONLY PHYSICAL STANDBY NOT ALLOWED
3.测试主备功能及切换应用
Ø 测试1
Test1:
SYS@PROD1 >create table t1 (id number);
Table created. Test2:
SYS@PROD1 >desc t1
ERROR:
ORA-04043: object t1 does not exist SYS@PROD1 >recover managed standby database disconnect;
Media recovery complete. SYS@PROD1 >desc t1
ERROR:
ORA-04043: object t1 does not exist Test1:
SYS@PROD1 >alter system switch logfile;
System altered. Test2:
SYS@PROD1 >desc t1
Name Null? Type
----------------------------------------
ID NUMBER
Ø 测试 2------11G 新特性:ADG
Test2:
SYS@PROD1 >recover managed standby database cancel;
Media recovery complete. SYS@PROD1 >recover managed standby database using current logfile disconnect from session;
Media recovery complete. Test1:
SYS@PROD1 >create table t2 (id number);
Table created. Test2:
SYS@PROD1 >desc t2
Name Null? Type
-----------------------------------
ID NUMBER
Ø 测试 3-------角色切换
以下为 Data Guard 最为重要的两个功能:参考博客
3.3.1
TEST1:
SYS@PROD1 >select open_mode,database_role,switchover_status from v$database; OPEN_MODE DATABASE_ROLE SWITCHOVER_STATUS
---------------------------------------- -------------------------------- ----------------------------------------
READ WRITE PRIMARY TO STANDBY SYS@PROD1 >alter database commit to switchover to physical standby; Database altered. SYS@PROD1 >conn / as sysdba;
Connected to an idle instance.
SYS@PROD1 >startup
ORACLE instance started. Total System Global Area 1219260416 bytes
Fixed Size 2252744 bytes
Variable Size 788529208 bytes
Database Buffers 419430400 bytes
Redo Buffers 9048064 bytes
Database mounted.
Database opened.
SYS@PROD1 >select open_mode,database_role,switchover_status from v$database; OPEN_MODE DATABASE_ROLE SWITCHOVER_STATUS
---------------------------------------- -------------------------------- ----------------------------------------
READ ONLY PHYSICAL STANDBY TO PRIMARY
3.3.2
TEST2:
SYS@PROD1 >recover managed standby database cancel;
Media recovery complete. SYS@PROD1 >select open_mode,database_role,switchover_status from v$database; OPEN_MODE DATABASE_ROLE SWITCHOVER_STATUS
---------------------------------------- -------------------------------- ----------------------------------------
READ ONLY PHYSICAL STANDBY TO PRIMARY SYS@PROD1 >alter database commit to switchover to primary;
Database altered. SYS@PROD1 >select open_mode,database_role,switchover_status from v$database; OPEN_MODE DATABASE_ROLE SWITCHOVER_STATUS
---------------------------------------- -------------------------------- ----------------------------------------
MOUNTED PRIMARY NOT ALLOWED SYS@PROD1 >alter database open;
Database altered. SYS@PROD1 >insert into t1 values (1);
1 row created. SYS@PROD1 >commit;
Commit complete. SYS@PROD1 >select * from t1;
ID
----------
1 TEST1:
SYS@PROD1 >select * from t1;
no rows selected SYS@PROD1 >recover managed standby database using current logfile disconnect from session;
Media recovery complete. SYS@PROD1 >select * from t1; ID
----------
1
至此,Oracle RAC架构搭建完成。
如有转载,请标明出处。
Oracle 11.2.0.4 Data Guard 部署练习【一主一备/单机】的更多相关文章
- Oracle 11.2.0.4.0 Dataguard部署和日常维护(1)-数据库安装篇
本次测试环境 系统版本 CentOS release 6.8 主机名 ec2t-userdata-01 ec2t-userdata-01 IP地址 10.189.102.118 10.189.100. ...
- Oracle 11.2.0.4 DataGuard 环境打PSU,OJVM PSU补丁快速参考
环境:RHEL6.5 + Oracle 11.2.0.4 DataGuard physical standby 主库和备库都是单节点. 需求:主备库同时应用160719的PSU和OJVM PSU补丁. ...
- Oracle 11.2.0.1 ADG环境MRP进程遭遇ORA-600异常终止
环境:Linux + Oracle 11.2.0.1 ADG 现象:发现备库没有应用日志 1. 数据库查询备库目前状态 发现备库目前没有应用日志,apply lag已经显示备库有3天21小时多没有应用 ...
- Oracle 11.2.0.1 ADG环境MRP进程遭遇ORA
环境:Linux + Oracle 11.2.0.1 ADG现象:发现备库没有应用日志 1. 数据库查询备库目前状态发现备库目前没有应用日志,apply lag已经显示备库有3天21小时多没有应用日志 ...
- ORACLE LINUX 6.3 + ORACLE 11.2.0.3 RAC + VBOX安装文档
ORACLE LINUX 6.3 + ORACLE 11.2.0.3 RAC + VBOX安装文档 2015-10-21 12:51 525人阅读 评论(0) 收藏 举报 分类: Oracle RA ...
- CentOS 7 安装 Oracle 11.2.0.4
一.安装环境 CentOS Linux release 7.2.1511 (Core) Oracle Database 11g Release 2 (11.2.0.4) 二.安装前准备 2.1 修改主 ...
- Asianux 7.3安装Oracle 11.2.0.4单实例体验
环境:Asianux 7.3 需求:安装Oracle 11.2.0.4 单实例 背景:系统使用默认的最小安装部署,Oracle安装额外需要的包统一使用yum安装. 查看当前系统相关信息: [root@ ...
- Oracle 11.2.0.4 RAC重建EM案例
环境:Oracle 11.2.0.4 RAC 重建EM 背景:客户之前的EM已经被损坏,需要重建EM 重建EM的方案有很多,其中最简单的方法是:直接使用emca重建,oracle用户下,只需一条命令搞 ...
- 【原】Oracle 11.2.0.1 64bit for RHEL6.0 Server x86_64 静默安装
作者:david_zhang@sh [转载时请以超链接形式标明文章] 链接:http://www.cnblogs.com/david-zhang-index/p/4182469.html 本文适用Or ...
- oracle 11.2.0.4静默安装
oracle 11.2.0.4静默安装 1.安装包 1.1.上传安装包 xshell可用rz命令,选择安装包. mobaxterm可用左侧栏上传功能. 2.安装准备 2.1.关闭防火墙.SELinux ...
随机推荐
- 记录一次实验室linux系统的GPU服务器死机故障的排查——Linux系统的Power States
实验室的ubuntu服务器不知怎么的突然又崩溃了,死机重启,然后查看日志,发现了下面的情况: 由于从其他的日志中知道是显卡的问题引起的死机,而这个显卡的地址正好是D9:00,这部分的日志就不给出了.结 ...
- Leetcode: 586. Customer Placing the Largest Number of Orders
题目要求如下: 给出的例子如下: 简单地说就是要找出表中订单最多客户的ID. 使用如下的代码进行实现: import pandas as pd def largest_orders(orders: p ...
- QT的基础设置(菜单栏、状态栏、任务栏。。。。)
Qt [1] 是一个1991年由Qt Company开发的跨平台C++图形用户界面应用程序开发框架.它既可以开发GUI程序,也可用于开发非GUI程序,比如控制台工具和服务器.下面介绍QT的基础配置 1 ...
- AWG(American wire gauge)美国线规
AWG(American wire gauge)美国线规,是一种区分导线直径的标准,又被称为 Brown & Sharpe线规.这种标准化线规系统于1857年起在美国开始使用.AWG前面的数值 ...
- 如何诱导AI犯罪-提示词注入
我们用到的大模型基本把政治类信息.犯罪相关信息都已屏蔽.但是,黑客依旧可以使用提示词诱导和提示词注入的方式对大模型进行攻击. 1.提示词诱导 如果直接让AI提供犯罪过程,AI会直接拒绝.虽然AI对于大 ...
- Shell 目录栈操作
Shell 目录栈允许你将一系列目录压入栈中,然后方便地在这些目录之间进行切换.以下是一些常见的命令及其用途: 常见命令 pushd:将当前目录压入栈中,并切换到指定目录. popd:从栈中移除顶部的 ...
- 【FFmpeg】之Mac系统爬取所有M3U8视频下载方法
前言 由于有的网站不允许下载视频,到了有效期就不能看了,但是我想以后反复看,怎么办呢? 前提准备 操作系统:Mac 浏览器:谷歌浏览器 抓取m3u8工具:猫爪 视频处理工具:ffmpeg 需要安装工具 ...
- 【GaussDB】应用报错 socket is not closed; Urgent packet sent to backend successfully; An I/O error occured while sending to the backend.detail:EOF Exception;
数据库原理差异 会话空闲时间超过sesseion_time后,数据库主动断开,客户端再发起请求,就会报此类错误: 当一个会话连接长时间没有执行SQL或者活动时,会将该会话释放,可以释放缓存避免出现例如 ...
- SpringBoot 引入 WebSocket
maven 添加websocket ,按照一篇博文引入 websocket https://www.cnblogs.com/likun10579/p/5450209.html 在浏览器控制台测试是否连 ...
- AI工具合集
以下工具来源于互联网,可能会失效,请参考使用 网红工具 名称 链接 说明 GPT-4 https://chat.openai.com/ 需要梯子,需要付费.功能最强大的聊天机 器人. 文心一言 h ...