基于RMAN搭建DataGuard,使用Broker管理DataGuard
一、环境准备
1、数据库软件准备
(1)、在主节点,安装单机数据库软件并创建数据库。
(2)、在备库, 安装单机数据库软件, 但是不创建数据库。
2、操作系统配置
在/etc/hosts下面配置主机名。
$ cat /etc/hosts127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4::1 localhost localhost.localdomain localhost6 localhost6.localdomain6192.168.56.31 xiaohe_dg1192.168.56.32 xiaohe_dg2
3、数据库部分参数
| 角色 | 主机名 | 数据库实例 | db_domain |
| 主库 | xiaohe_dg1 | xiaohe | xiaohe.com |
| 备库 | xiaohe_dg2 | xiaohedg | xiaohe.com |
二、配置数据库
1、主库打开数据库
SQL> startup
2、配置监听
(1)、设置db_domain
SQL> show parameter db_domain;NAME TYPE VALUE------------------------------------ ----------- ------------------------------db_domain stringSQL>SQL> alter system set db_domain='xiaohe.com' scope=spfile;- SQL> shutdown immediate
- SQL> startup
- SQL> show parameter db_domain;
NAME TYPE VALUE------------------------------------ ----------- ------------------------------db_domain string xiaohe.com
(2)、在主/备库设置监听
路径:$ORACLE_HOME/network/admin
主库配置:
$ cat listener.oraLISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=xiaohe_dg1)(PORT=1521))))SID_LIST_LISTENER=(SID_LIST=(SID_DESC=(GLOBAL_DBNAME=xiaohe_DGMGRL.xiaohe.com)(ORACLE_HOME=/u01/app/oracle/product/11.2.0)(SID_NAME=xiaohe)))
备库配置:
$ cat listener.oraLISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=xiaohe_dg2)(PORT=1521))))SID_LIST_LISTENER=(SID_LIST=(SID_DESC=(GLOBAL_DBNAME=xiaohedg_DGMGRL.xiaohe.com)(ORACLE_HOME=/u01/app/oracle/product/11.2.0)(SID_NAME=xiaohedg)))
说明:GLOBAL_DBNAME为db_unique_name_DGMGRL.db_domain
(3)、启动主备库的监听
下面是备库的监听:
[oracle@xiaohe_dg2 admin]$ lsnrctl startLSNRCTL for Linux: Version 11.2.0.3.0 - Production on 18-MAR-2017 18:32:48Copyright (c) 1991, 2011, Oracle. All rights reserved.Starting /u01/app/oracle/product/11.2.0/bin/tnslsnr: please wait...TNSLSNR for Linux: Version 11.2.0.3.0 - ProductionSystem parameter file is /u01/app/oracle/product/11.2.0/network/admin/listener.oraLog messages written to /u01/app/oracle/diag/tnslsnr/xiaohe_dg2/listener/alert/log.xmlListening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=xiaohe_dg2)(PORT=1521)))Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=xiaohe_dg2)(PORT=1521)))STATUS of the LISTENER------------------------Alias LISTENERVersion TNSLSNR for Linux: Version 11.2.0.3.0 - ProductionStart Date 18-MAR-2017 18:32:49Uptime 0 days 0 hr. 0 min. 1 secTrace Level offSecurity ON: Local OS AuthenticationSNMP OFFListener Parameter File /u01/app/oracle/product/11.2.0/network/admin/listener.oraListener Log File /u01/app/oracle/diag/tnslsnr/xiaohe_dg2/listener/alert/log.xmlListening Endpoints Summary...(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=xiaohe_dg2)(PORT=1521)))Services Summary...Service "xiaohedg_DGMGRL.xiaohe.com" has 1 instance(s).Instance "xiaohedg", status UNKNOWN, has 1 handler(s) for this service...The command completed successfully
监听实例必须是静态的, 因为数据库没有启动, 监听也是能够启动的。
3、配置tnsnames
(1)、监听的内容
$ cat tnsnames.oraxiaohe_dg1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=xiaohe_dg1)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=xiaohe_DGMGRL.xiaohe.com)))xiaohe_dg2=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=xiaohe_dg2)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=xiaohedg_DGMGRL.xiaohe.com)))
SERVICE_NAME可以通过lsnrctl status来查看。
(2)、在主库验证监听是否配置成功
[oracle@xiaohe_dg1 admin]$ sqlplus sys/oracle123@xiaohe_dg1 as sysdbaSQL*Plus: Release 11.2.0.3.0 Production on Sat Mar 18 19:02:30 2017Copyright (c) 1982, 2011, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL>
(3)、将主库的tnsnames配置文件传到备库
$ scp tnsnames.ora xiaohe_dg2:/u01/app/oracle/product/11.2.0/network/admin/oracle@xiaohe_dg2's password:tnsnames.ora 100% 333 0.3KB/s 00:00
4、开启主库的归档模式
(1)、新建归档目录
[oracle@xiaohe_dg1 oradata]$ mkdir archive[oracle@xiaohe_dg1 oradata]$ cd archive/[oracle@xiaohe_dg1 archive]$ pwd/oradata/archive
(2)、开启归档
SQL> shutdown immediateSQL> startup mountSQL> alter database archivelog;- SQL> alter system set log_archive_dest_1='location=/oradata/archive' scope=spfile;
- SQL> shutdown immediate;
SQL> startupSQL> archive log list;Database log mode Archive ModeAutomatic archival EnabledArchive destination /oradata/archiveOldest online log sequence 10Next log sequence to archive 12Current log sequence 12
5、配置主备库数据、日志目录转换
SQL> alter system set db_file_name_convert='/oradata/xiaohedg','/oradata/xiaohe' scope=spfile;SQL> alter system set log_file_name_convert='/oradata/xiaohedg','/oradata/xiaohe' scope=spfile;
注意格式:alter system set log_file_name_convert='对端库的目录','当前库目录' scope=spfile;
6、设置闪回
设置闪回, 后面测试建立测试库。
(1)、新建闪回目录
[oracle@xiaohe_dg1 oradata]$ mkdir flash[oracle@xiaohe_dg1 oradata]$ cd flash/[oracle@xiaohe_dg1 flash]$ pwd/oradata/flash
(2)、设置闪回参数
SQL> show parameter recover;NAME TYPE VALUE------------------------------------ ----------- ------------------------------db_recovery_file_dest stringdb_recovery_file_dest_size big integer 0db_unrecoverable_scn_tracking boolean TRUErecovery_parallelism integer 0SQL> alter system set db_recovery_file_dest_size=500M;SQL> alter system set db_recovery_file_dest='/oradata/flash';- SQL> show parameter recover;
NAME TYPE VALUE------------------------------------ ----------- ------------------------------db_recovery_file_dest string /oradata/flashdb_recovery_file_dest_size big integer 500Mdb_unrecoverable_scn_tracking boolean TRUErecovery_parallelism
7、设置standby的文件传输参数
如果设置为手动, 那么主库新建的表空间文件无法传到备库。
SQL> show parameter standby- NAME TYPE VALUE
------------------------------------ ----------- ------------------------------standby_archive_dest string ?/dbs/archstandby_file_management string MANUALSQL> alter system set standby_file_management=AUTO;SQL> show parameter standby;- NAME TYPE VALUE
------------------------------------ ----------- ------------------------------standby_archive_dest string ?/dbs/archstandby_file_management string AUTO
8、开启强制日志
SQL> alter database force logging;
9、开启闪回
SQL> shutdown immediateSQL> startup mount;- SQL> alter database flashback on;
SQL> alter database open;
10、配置standby log参数
创建4组standby 日志, 比原日志数目多一个。
SQL> alter database add standby logfile group 4 '/oradata/xiaohe/std_redo04.log' size 50M;SQL> alter database add standby logfile group 5 '/oradata/xiaohe/std_redo05.log' size 50M;SQL> alter database add standby logfile group 6 '/oradata/xiaohe/std_redo06.log' size 50M;SQL> alter database add standby logfile group 7 '/oradata/xiaohe/std_redo07.log' size 50M;
11、生成参数文件pfile
(1)、生成pfile文件
SQL> create pfile='/oradata/initxiaohedg.ora' from spfile;
(2)、传送pfile到备库的dbs目录下面
$ scp initxiaohedg.ora xiaohe_dg2:/u01/app/oracle/product/11.2.0/dbs/oracle@xiaohe_dg2's password:initxiaohedg.ora
12、传送密码文件到备库
$ cd $ORACLE_HOME/dbs[oracle@xiaohe_dg1 dbs]$ scp orapwxiaohe xiaohe_dg2:/u01/app/oracle/product/11.2.0/dbs/orapwxiaohedgoracle@xiaohe_dg2's password:orapwxiaohe
注意:密码文件传过去, 一定要改名字。
13、在备库修改pfile文件
[oracle@xiaohe_dg2 dbs]$ cat initxiaohedg.oraxiaohe.__db_cache_size=327155712xiaohe.__java_pool_size=4194304xiaohe.__large_pool_size=4194304xiaohe.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environmentxiaohe.__pga_aggregate_target=339738624xiaohe.__sga_target=503316480xiaohe.__shared_io_pool_size=0xiaohe.__shared_pool_size=155189248xiaohe.__streams_pool_size=4194304*.audit_file_dest='/u01/app/oracle/admin/xiaohe/adump'*.audit_trail='db'*.compatible='11.2.0.0.0'*.control_files='/oradata/xiaohedg/control01.ctl','/oradata/xiaohedg/control02.ctl'*.db_block_size=8192*.db_domain='xiaohe.com'*.db_file_name_convert='/oradata/xiaohe','/oradata/xiaohedg'*.db_name='xiaohe'*.db_unique_name='xiaohedg'*.db_recovery_file_dest_size=524288000*.db_recovery_file_dest='/oradata/flash'*.diagnostic_dest='/u01/app/oracle'*.dispatchers='(PROTOCOL=TCP) (SERVICE=xiaoheXDB)'*.log_archive_dest_1='location=/oradata/archive'*.log_file_name_convert='/oradata/xiaohe','/oradata/xiaohedg'*.memory_target=839909376*.open_cursors=300*.processes=150*.remote_login_passwordfile='EXCLUSIVE'*.standby_file_management='AUTO'*.undo_tablespace='UNDOTBS1'
修改的地方:
(1)、*.audit_file_dest:目录不存在, 重新创建
(2)、*.control_files:修改控制文件的目录,并创建目录/oradata/xiaohedg
(3)、*.db_file_name_convert 和 *.log_file_name_convert的对端库和当前库的目录位置互换。
(4)、*.log_archive_dest_1目录不存在, 需要创建。
(4)、新增一个条目:*.db_unique_name='xiaohedg'
14、在备库启动实例
生成启动文件spfile, 下次启动时候能自动选择spfile启动。
将数据库启动到nomount。
SQL> startupORACLE instance started.Total System Global Area 839282688 bytesFixed Size 2233000 bytesVariable Size 494931288 bytesDatabase Buffers 339738624 bytesRedo Buffers 2379776 bytesORA-00205: error in identifying control file, check alert log for more infoSQL> show parameter spfile;NAME TYPE VALUE------------------------------------ ----------- ------------------------------spfile stringSQL> create spfile from pfile;File created.SQL> shutdown immediate;ORA-01507: database not mountedORACLE instance shut down.SQL> startup nomountORACLE instance started.Total System Global Area 839282688 bytesFixed Size 2233000 bytesVariable Size 494931288 bytesDatabase Buffers 339738624 bytesRedo Buffers 2379776 bytes
在主库多切换几次日志:
SQL> alter system switch logfile;System altered.SQL> /System altered.SQL> /System altered.SQL> /System altered.SQL> /
15、检查并重启主库
(1)、重启主库, 查看能否正常启动。
(2)、检查主备库的db_name是否一致。
db_name必须一样, db_unique_name不能一样。
(3)、检查网络:
$ sqlplus sys/oracle123@xiaohe_dg1 as sysdba;$ sqlplus sys/oracle123@xiaohe_dg2 as sysdba;
(4)、检查目录转换
SQL> show parameter convert;
16、使用rman
[oracle@xiaohe_dg1 dbs]$ rman target sys/oracle123@xiaohe_dg1 auxiliary sys/oracle123@xiaohe_dg2Recovery Manager: Release 11.2.0.3.0 - Production on Sat Mar 18 20:21:06 2017Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.connected to target database: XIAOHE (DBID=4061739917)connected to auxiliary database: XIAOHE (not mounted)RMAN> duplicate target database for standby from active database;Starting Duplicate Db at 18-MAR-17using target database control file instead of recovery catalogallocated channel: ORA_AUX_DISK_1channel ORA_AUX_DISK_1: SID=20 device type=DISKcontents of Memory Script:{backup as copy reusetargetfile '/u01/app/oracle/product/11.2.0/dbs/orapwxiaohe' auxiliary format'/u01/app/oracle/product/11.2.0/dbs/orapwxiaohedg' ;}executing Memory ScriptStarting backup at 18-MAR-17allocated channel: ORA_DISK_1channel ORA_DISK_1: SID=38 device type=DISKFinished backup at 18-MAR-17contents of Memory Script:{backup as copy current controlfile for standby auxiliary format '/oradata/xiaohedg/control01.ctl';restore clone controlfile to '/oradata/xiaohedg/control02.ctl' from'/oradata/xiaohedg/control01.ctl';}executing Memory ScriptStarting backup at 18-MAR-17using channel ORA_DISK_1channel ORA_DISK_1: starting datafile copycopying standby control fileoutput file name=/u01/app/oracle/product/11.2.0/dbs/snapcf_xiaohe.f tag=TAG20170318T202332 RECID=2 STAMP=938982213channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03Finished backup at 18-MAR-17Starting restore at 18-MAR-17using channel ORA_AUX_DISK_1channel ORA_AUX_DISK_1: copied control file copyFinished restore at 18-MAR-17contents of Memory Script:{sql clone 'alter database mount standby database';}executing Memory Scriptsql statement: alter database mount standby databasecontents of Memory Script:{set newname for tempfile 1 to"/oradata/xiaohedg/temp01.dbf";switch clone tempfile all;set newname for datafile 1 to"/oradata/xiaohedg/system01.dbf";set newname for datafile 2 to"/oradata/xiaohedg/sysaux01.dbf";set newname for datafile 3 to"/oradata/xiaohedg/undotbs01.dbf";set newname for datafile 4 to"/oradata/xiaohedg/users01.dbf";set newname for datafile 5 to"/oradata/xiaohedg/example01.dbf";backup as copy reusedatafile 1 auxiliary format"/oradata/xiaohedg/system01.dbf" datafile2 auxiliary format"/oradata/xiaohedg/sysaux01.dbf" datafile3 auxiliary format"/oradata/xiaohedg/undotbs01.dbf" datafile4 auxiliary format"/oradata/xiaohedg/users01.dbf" datafile5 auxiliary format"/oradata/xiaohedg/example01.dbf" ;sql 'alter system archive log current';}executing Memory Scriptexecuting command: SET NEWNAMErenamed tempfile 1 to /oradata/xiaohedg/temp01.dbf in control fileexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEexecuting command: SET NEWNAMEStarting backup at 18-MAR-17using channel ORA_DISK_1channel ORA_DISK_1: starting datafile copyinput datafile file number=00001 name=/oradata/xiaohe/system01.dbfoutput file name=/oradata/xiaohedg/system01.dbf tag=TAG20170318T202342channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:45channel ORA_DISK_1: starting datafile copyinput datafile file number=00002 name=/oradata/xiaohe/sysaux01.dbfoutput file name=/oradata/xiaohedg/sysaux01.dbf tag=TAG20170318T202342channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:35channel ORA_DISK_1: starting datafile copyinput datafile file number=00005 name=/oradata/xiaohe/example01.dbfoutput file name=/oradata/xiaohedg/example01.dbf tag=TAG20170318T202342channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25channel ORA_DISK_1: starting datafile copyinput datafile file number=00003 name=/oradata/xiaohe/undotbs01.dbfoutput file name=/oradata/xiaohedg/undotbs01.dbf tag=TAG20170318T202342channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15channel ORA_DISK_1: starting datafile copyinput datafile file number=00004 name=/oradata/xiaohe/users01.dbfoutput file name=/oradata/xiaohedg/users01.dbf tag=TAG20170318T202342channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01Finished backup at 18-MAR-17sql statement: alter system archive log currentcontents of Memory Script:{switch clone datafile all;}executing Memory Scriptdatafile 1 switched to datafile copyinput datafile copy RECID=2 STAMP=938982344 file name=/oradata/xiaohedg/system01.dbfdatafile 2 switched to datafile copyinput datafile copy RECID=3 STAMP=938982344 file name=/oradata/xiaohedg/sysaux01.dbfdatafile 3 switched to datafile copyinput datafile copy RECID=4 STAMP=938982344 file name=/oradata/xiaohedg/undotbs01.dbfdatafile 4 switched to datafile copyinput datafile copy RECID=5 STAMP=938982344 file name=/oradata/xiaohedg/users01.dbfdatafile 5 switched to datafile copyinput datafile copy RECID=6 STAMP=938982344 file name=/oradata/xiaohedg/example01.dbfFinished Duplicate Db at 18-MAR-17
17、在备库应用日志
SQL> select status from v$instance ;STATUS------------MOUNTEDSQL> alter database recover managed standby database disconnect from session;Database altered.
18、在主、备库启用broker
SQL> show parameter broker;NAME TYPE VALUE------------------------------------ ----------- ------------------------------dg_broker_config_file1 string /u01/app/oracle/product/11.2.0/dbs/dr1xiaohe.datdg_broker_config_file2 string /u01/app/oracle/product/11.2.0/dbs/dr2xiaohe.datdg_broker_start boolean FALSESQL> alter system set dg_broker_start=true;System altered.
19、进入broker, 并创建配置信息
$ dgmgrl sys/oracle123@xiaohe_dg1;
创建配置信息并启用:
DGMGRL> CREATE CONFIGURATION c1 ASPRIMARY DATABASE IS xiaoheCONNECT IDENTIFIER IS xiaohe_dg1;DGMGRL> ADD DATABASE xiaohedgAS CONNECT IDENTIFIER IS xiaohe_dg2;DGMGRL> ENABLE CONFIGURATION;
查看配置信息:
DGMGRL> show configuration;Configuration - c1Protection Mode: MaxPerformanceDatabases:xiaohe - Primary databasexiaohedg - Physical standby databaseFast-Start Failover: DISABLEDConfiguration Status:SUCCESS
查看详细信息:
DGMGRL> show configuration verbose;Configuration - c1Protection Mode: MaxPerformanceDatabases:xiaohe - Primary databasexiaohedg - Physical standby databaseProperties:FastStartFailoverThreshold = '30'OperationTimeout = '30'FastStartFailoverLagLimit = '30'CommunicationTimeout = '180'FastStartFailoverAutoReinstate = 'TRUE'FastStartFailoverPmyShutdown = 'TRUE'BystandersFollowRoleChange = 'ALL'Fast-Start Failover: DISABLEDConfiguration Status:SUCCESSDGMGRL>
帮助信息如下:
DGMGRL> help create;Creates a broker configurationSyntax:CREATE CONFIGURATION <configuration name> ASPRIMARY DATABASE IS <database name>CONNECT IDENTIFIER IS <connect identifier>;DGMGRL> help add;Adds a standby database to the broker configurationSyntax:ADD DATABASE <database name>[AS CONNECT IDENTIFIER IS <connect identifier>][MAINTAINED AS {PHYSICAL|LOGICAL}];DGMGRL> help enable;Enables a configuration, a database, or fast-start failoverSyntax:ENABLE CONFIGURATION;ENABLE DATABASE <database name>;ENABLE FAST_START FAILOVER [CONDITION <condition>];DGMGRL>
20、打开备库
(1)、关闭备库
(2)、打开备库
shutdown immediatestartup open read only;
查看mode信息:
select open_mode from v$database;
21、打开备库的闪回创建测试库
(1)、将备库重启到mount状态
(2)、开启闪回
SQL> select flashback_on from v$database;- FLASHBACK_ON
------------------NOSQL> shutdown immediate;SQL> startup mount;SQL> alter database flashback on;SQL> select flashback_on from v$database;- FLASHBACK_ON
------------------YESSQL> alter database open;SQL> select open_mode from v$database; OPEN_MODE -------------------- READ ONLYSQL> select open_mode from v$database; OPEN_MODE -------------------- READ ONLY WITH APPLY
(3)、在broker下面切换
DGMGRL> help convert;Converts a database from one type to anotherSyntax:CONVERT DATABASE <database name> TO{SNAPSHOT STANDBY|PHYSICAL STANDBY};DGMGRL> CONVERT DATABASE xiaohedg TO SNAPSHOT STANDBY;Converting database "xiaohedg" to a Snapshot Standby database, please wait...Database "xiaohedg" converted successfullyDGMGRL> show configuration;Configuration - c1Protection Mode: MaxPerformanceDatabases:xiaohe - Primary databasexiaohedg - Snapshot standby databaseFast-Start Failover: DISABLEDConfiguration Status:SUCCESS
(4)、在备库当做测试库读写操作
查看备库已经可以读写了:
SQL> select open_mode from v$database;OPEN_MODE--------------------READ WRITE
建表插入数据等操作:
SQL> create table test(id number, name varchar2(20));- SQL> insert into test values(1, 'node');
SQL> commit;SQL> select * from test;ID NAME---------- --------------------1 node
(5)、将备库从快照切换为物理standby
DGMGRL> CONVERT DATABASE xiaohedg TO PHYSICAL STANDBY;Converting database "xiaohedg" to a Physical Standby database, please wait...Operation requires shutdown of instance "xiaohedg" on database "xiaohedg"Shutting down instance "xiaohedg"...Database closed.Database dismounted.....
(6)、备库在快照状态下的数据全部丢失
22、主备库切换
DGMGRL> show configuration;Configuration - c1Protection Mode: MaxPerformanceDatabases:xiaohe - Primary databasexiaohedg - Physical standby databaseFast-Start Failover: DISABLEDConfiguration Status:SUCCESSDGMGRL> switchover to xiaohedg;Performing switchover NOW, please wait...New primary database "xiaohedg" is opening...Operation requires shutdown of instance "xiaohe" on database "xiaohe"Shutting down instance "xiaohe"...ORACLE instance shut down.Operation requires startup of instance "xiaohe" on database "xiaohe"Starting instance "xiaohe"...ORACLE instance started.Database mounted.Database opened.Switchover succeeded, new primary is "xiaohedg"DGMGRL>DGMGRL> show configuration;Configuration - c1Protection Mode: MaxPerformanceDatabases:xiaohedg - Primary databasexiaohe - Physical standby databaseFast-Start Failover: DISABLEDConfiguration Status:SUCCESS
23、几个有用的视图
(1)、主库
SQL> select sequence#,applied from v$archived_log order by 1 desc;SEQUENCE# APPLIED---------- ---------79 NO79 NO78 YES78 NO77 NO77 YES76 YES
做一次日志切换后:
SQL> alter system switch logfile;System altered.SQL> select sequence#,applied from v$archived_log order by 1 desc;SEQUENCE# APPLIED---------- ---------80 NO80 NO79 YES79 NO78 YES78 NO77 YES
SQL> select dest_id,error from v$archive_dest;DEST_ID ERROR---------- -----------------------------------------------------------------1234
SQL> select database_role,open_mode from v$database;DATABASE_ROLE OPEN_MODE---------------- --------------------PRIMARY READ WRITE
(2)、备库
SQL> select sequence#,status from v$standby_log;SEQUENCE# STATUS---------- ----------80 ACTIVE0 UNASSIGNED0 UNASSIGNED0 UNASSIGNED
SQL> set lines 200SQL> col DATABASE_ROLE for a30;SQL> select database_role,open_mode from v$database;DATABASE_ROLE OPEN_MODE------------------------------ --------------------PHYSICAL STANDBY READ ONLY WITH APPLY
SQL> select process,status from v$managed_standby;PROCESS STATUS--------- ------------ARCH CLOSINGARCH CONNECTEDARCH CONNECTEDARCH CONNECTEDMRP0 APPLYING_LOGRFS IDLERFS IDLERFS IDLE8 rows selected.

浙公网安备 33010602011771号