Oracle异构Dataguard配置指南

五一假期期间,闲来无事,测试了下oracle 11g异构下的dataguard,主库采用rhel5.4 64位系统,备库采用winxp sp1 32位系统,数据库软件采用当前最新的11.2.0.3版本!事先声明,本文只用于测试环境,各位看官若用在生产环境,请三思,且慎重!

环境介绍:
主库
IP地址:192.168.1.63/24
操作系统版本:rhel5.4 64bit
数据库版本:11.2.0.3 64bit
数据库sid名:dg
数据库名:dg
数据库db_unique_name:dg3

备库1  物理备库 
IP地址:192.168.1.103/24
操作系统版本:winxp sp1 32位(有条件的话应该用win2003 server版)
数据库版本:11.2.0.3 32bit
数据库sid名:dg
数据库名:dg
数据库db_unique_name:dg4

在开始之前,还是先上MOS上找找相关的资料,看看能不能做!

Oracle异构Dataguard配置指南

 

主库id为13的情况下,备库id可以选择为7,但是必须要11g以后,且要搞定bug13104881

Oracle异构Dataguard配置指南

 

Oracle异构Dataguard配置指南

貌似这个bug在11.2.0.3中没有被修复,但是认真看下,这个bug只影响主库为windows,备库为linux的情况,也就是说,本例是个灰色地带了,那就用实践证明下吧!

Oracle异构Dataguard配置指南

一:配置主,备库的listener.ora和tnsnames.ora文件如下


  1. [oracle@dg3 ~]$ cat $TNS_ADMIN/listener.ora  
  2. SID_LIST_LISTENER =  
  3.   (SID_LIST =  
  4.     (SID_DESC =  
  5.       (GLOBAL_DBNAME = dg.yang.com)  
  6.       (ORACLE_HOME = /u01/app/oracle/product/11.2.0/db1)  
  7.       (SID_NAME = dg)  
  8.     )  
  9.   )  
  10.  
  11. LISTENER =  
  12.   (DESCRIPTION_LIST =  
  13.     (DESCRIPTION =  
  14.       (ADDRESS_LIST =  
  15.         (ADDRESS = (PROTOCOL = TCP)(HOST = dg3.yang.com)(PORT = 1521))  
  16.       )  
  17.     )  
  18.   )  
  19.  
  20. [oracle@dg3 ~]$ cat $TNS_ADMIN/tnsnames.ora  
  21. DG3 =  
  22.   (DESCRIPTION =  
  23.     (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.63)(PORT = 1521))  
  24.     (CONNECT_DATA =  
  25.       (SERVER = DEDICATED)  
  26.       (SERVICE_NAME = dg2.yang.com)  
  27.     )  
  28.   )  
  29.  
  30. DG4 =  
  31.   (DESCRIPTION =  
  32.     (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.103)(PORT = 1521))  
  33.     (CONNECT_DATA =  
  34.       (SERVER = DEDICATED)  
  35.       (SERVICE_NAME = dg4.yang.com)  
  36.     )  
  37.   )  
  38.  
  39. C:\app\oracle\product\11.2.0\dbhome_1\NETWORK\ADMIN\listener.ora  
  40.  
  41. SID_LIST_LISTENER =  
  42.   (SID_LIST =  
  43.     (SID_DESC =  
  44.       (SID_NAME = dg)  
  45.       (ORACLE_HOME = C:\app\oracle\product\11.2.0\dbhome_1)  
  46.       (GLOBAL_DBNAME=dg.yang.com)  
  47.       )  
  48.   )  
  49.  
  50. LISTENER =  
  51.   (DESCRIPTION_LIST =  
  52.     (DESCRIPTION =  
  53.       (ADDRESS = (PROTOCOL = TCP)(HOST =192.168.1.103)(PORT = 1521))  
  54.     )  
  55.   )  
  56.  
  57. ADR_BASE_LISTENER = C:\app\oracle  
  58.  
  59. C:\app\oracle\product\11.2.0\dbhome_1\NETWORK\ADMIN\tnsnames.ora  
  60.  
  61. DG3 =  
  62.   (DESCRIPTION =  
  63.     (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.63)(PORT = 1521))  
  64.     (CONNECT_DATA =  
  65.       (SERVER = DEDICATED)  
  66.       (SERVICE_NAME = dg.yang.com)  
  67.     )  
  68.   )  
  69.  
  70. DG4 =  
  71.   (DESCRIPTION =  
  72.     (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.103)(PORT = 1521))  
  73.     (CONNECT_DATA =  
  74.       (SERVER = DEDICATED)  
  75.       (SERVICE_NAME = dg.yang.com)  
  76.     )  
  77.   )  
  78.  
  79. C:\>lsnrctl services  
  80. LSNRCTL for 32-bit Windows: Version 11.2.0.3.0 - Production on 30-4月 -2012 16:0  
  81. 5:13  
  82.  
  83. Copyright (c) 1991, 2011, Oracle.  All rights reserved.  
  84.  
  85. 正在连接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.103)(PORT=1521)))  
  86.  
  87. 服务摘要..  
  88. 服务 "dg.yang.com" 包含 1 个实例。  
  89.   实例 "dg", 状态 UNKNOWN, 包含此服务的 1 个处理程序...  
  90.     处理程序:  
  91.       "DEDICATED" 已建立:0 已被拒绝:0  
  92.          LOCAL SERVER  
  93. 命令执行成功 

二:在主库上修改dg相关的参数,异构DG下,文件系统的路径一定不一致,所以需要注意db_file_name_convert和log_file_name_convert两个初始化参数的设置


  1. [oracle@dg3 ~]$ sqlplus /nolog  
  2. SQL*Plus: Release 11.2.0.3.0 Production on Mon Apr 30 16:09:15 2012  
  3. Copyright (c) 1982, 2011, Oracle.  All rights reserved.  
  4.  
  5. SQL> conn /as sysdba  
  6. Connected.  
  7. SQL> alter database force logging;  
  8. Database altered.  
  9.  
  10. SQL> alter system set db_unique_name='dg3' scope=spfile;  
  11. System altered.  
  12.  
  13. SQL> alter system set log_archive_config='DG_CONFIG=(dg3,dg4)';  
  14. System altered.  
  15.  
  16. SQL> alter system set log_archive_dest_1='LOCATION=/u01/app/oracle/archivelog valid_for=(all_logfiles,primary_role) db_unique_name=dg3' scope=spfile;  
  17. System altered.  
  18.  
  19. SQL> alter system set log_archive_dest_2='SERVICE=dg4 lgwr sync valid_for=(online_logfile,primary_role)   
  20. db_unique_name=dg4';  
  21. System altered.  
  22.  
  23. SQL> alter system set log_archive_dest_3='LOCATION=/u01/app/oracle/standbylog valid_for=(standby_logfile,standby_role) db_unique_name=dg3' scope=spfile;  
  24. System altered.  
  25.  
  26. SQL> alter system set fal_server='dg4';  
  27. System altered.  
  28.  
  29. SQL> alter system set fal_client='dg3';  
  30. System altered.  
  31.  
  32. SQL> alter system set standby_file_management='auto';  
  33. System altered.  
  34.  
  35. SQL> alter system set db_file_name_convert='/u01/app/oracle/oradata/dg','c:\app\oracle\oradata\dg' scope=spfile;  
  36. System altered.  
  37.  
  38. SQL> alter system set log_file_name_convert=''/u01/app/oracle/oradata/dg','c:\app\oracle\oradata\dg' scope=spfile;  
  39. System altered.  
  40.  
  41. SQL> alter system set log_archive_dest_state_3='defer';  
  42. System altered. 

三:重启主库后,添加standby日志组,并根据spfile文件生成pfile文件


  1. SQL> shutdown immediate  
  2. Database closed.  
  3. Database dismounted.  
  4. ORACLE instance shut down.  
  5. SQL> startup  
  6. ORACLE instance started.  
  7.  
  8. Total System Global Area  417546240 bytes  
  9. Fixed Size                  2228944 bytes  
  10. Variable Size             327159088 bytes  
  11. Database Buffers           79691776 bytes  
  12. Redo Buffers                8466432 bytes  
  13. Database mounted.  
  14. Database opened.  
  15.  
  16. SQL> alter database add standby logfile group 4 '/u01/app/oracle/oradata/dg/standby04.dbf' size 50M;  
  17. Database altered.  
  18.  
  19. SQL> alter database add standby logfile group 5 '/u01/app/oracle/oradata/dg/standby05.dbf' size 50M;  
  20. Database altered.  
  21.  
  22. SQL> alter database add standby logfile group 6 '/u01/app/oracle/oradata/dg/standby06.dbf' size 50M;  
  23. Database altered.  
  24.  
  25. SQL> alter database add standby logfile group 7 '/u01/app/oracle/oradata/dg/standby07.dbf' size 50M;  
  26. Database altered.  
  27.  
  28. SQL> create pfile='/home/oracle/initdg.ora' from spfile;  
  29. File created. 

四:修改pfile文件如下,注意红色字体部分,修改完成后将文件传输到备库,winscp,samba,ftp啦,这里大家就各显神通吧!

[oracle@dg3 ~]$ cat initdg.ora 
dg.__db_cache_size=79691776
dg.__java_pool_size=4194304
dg.__large_pool_size=4194304
dg.__oracle_base='c:\app\oracle'#ORACLE_BASE set from environment
dg.__pga_aggregate_target=180355072
dg.__sga_target=239075328
dg.__shared_io_pool_size=0
dg.__shared_pool_size=134217728
dg.__streams_pool_size=4194304
*.audit_file_dest='c:\app\oracle\admin\dg\adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='c:\app\oracle\oradata\dg\control01.ctl','c:\app\oracle\fast_recovery_area\dg\control02.ctl'
*.db_block_size=8192
*.db_domain='yang.com'
*.db_file_name_convert='/u01/app/oracle/oradata/dg','c:\app\oracle\oradata\dg'
*.db_name='dg'
*.db_recovery_file_dest='c:\app\oracle\fast_recovery_area'
*.db_recovery_file_dest_size=4322230272
*.db_unique_name='dg4'
*.diagnostic_dest='c:\app\oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=dgXDB)'
*.fal_client='dg4'
*.fal_server='dg3'
*.log_archive_config='DG_CONFIG=(dg3,dg4)'
*.log_archive_dest_1='LOCATION=c:\app\oracle\archivelog valid_for=(all_logfiles,primary_role) db_unique_name=dg4'
*.log_archive_dest_2='SERVICE=dg3 lgwr sync valid_for=(online_logfile,primary_role) db_unique_name=dg3'
*.log_archive_dest_3='LOCATION=c:\app\oracle\standbylog valid_for=(standby_logfile,standby_role)  db_unique_name=dg4'
*.log_archive_dest_state_3='enable'
*.log_archive_format='%t_%s_%r.dbf'
*.log_file_name_convert='/u01/app/oracle/oradata/dg','c:\app\oracle\oradata\dg'
*.memory_target=419430400
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.standby_file_management='auto'
*.undo_tablespace='UNDOTBS1'

五:配置备库,windows平台的oracle和linux很不一样,linux平台下备库只需要安装数据库软件即可,而在windows平台下,需要先建库,否则使用conn /as sysdba方式登录数据库会提示下图中的错误,主要是因为相关的windows服务不存在!不知道这里是不是可以采取其他的方法解决,在本例中,先使用dbca创建一个数据库,实例名和数据库均为dg,然后关闭数据库实例后,删除对应的数据文件!

Oracle异构Dataguard配置指南

 六:启动备库到nomount状态,在主库端检测数据库的是否可以正常连接


  1. C:\>sqlplus /nolog  
  2. SQL*Plus: Release 11.2.0.3.0 Production on 星期一 4月 30 16:37:06  
  3. Copyright (c) 1982, 2011, Oracle.  All rights reserved.  
  4.  
  5. SQL> conn /as sysdba  
  6. 已连接到空闲例程。  
  7. SQL> create spfile from pfile='c:\initdg.ora';  
  8. 文件已创建。  
  9.  
  10. SQL> startup nomount  
  11. ORACLE 例程已经启动。  
  12.  
  13. Total System Global Area  418484224 bytes  
  14. Fixed Size                  1385052 bytes  
  15. Variable Size             327159204 bytes  
  16. Database Buffers           83886080 bytes  
  17. Redo Buffers                6053888 bytes  
  18.  
  19. [oracle@dg3 admin]$ sqlplus sys/123456@dg3 as sysdba  
  20. SQL*Plus: Release 11.2.0.3.0 Production on Mon Apr 30 16:47:26 2012  
  21. Copyright (c) 1982, 2011, Oracle.  All rights reserved.  
  22.  
  23. Connected to:  
  24. Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production  
  25. With the Partitioning, OLAP, Data Mining and Real Application Testing options  
  26.  
  27. SQL> select * from v$version;  
  28.  
  29. BANNER  
  30. --------------------------------------------------------------------------------  
  31. Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production  
  32. PL/SQL Release 11.2.0.3.0 - Production  
  33. CORE    11.2.0.3.0      Production  
  34. TNS for Linux: Version 11.2.0.3.0 - Production  
  35. NLSRTL Version 11.2.0.3.0 - Production  
  36.  
  37. SQL> exit  
  38. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production  
  39. With the Partitioning, OLAP, Data Mining and Real Application Testing options  
  40.  
  41. [oracle@dg3 admin]$ sqlplus sys/123456@dg4 as sysdba  
  42. SQL*Plus: Release 11.2.0.3.0 Production on Mon Apr 30 16:47:32 2012  
  43. Copyright (c) 1982, 2011, Oracle.  All rights reserved.  
  44.  
  45. Connected to:  
  46. Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production  
  47. With the Partitioning, OLAP, Data Mining and Real Application Testing options  
  48.  
  49. SQL> select * from v$version;  
  50.  
  51. BANNER  
  52. --------------------------------------------------------------------------------  
  53. Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production  
  54. PL/SQL Release 11.2.0.3.0 - Production  
  55. CORE    11.2.0.3.0      Production  
  56. TNS for 32-bit Windows: Version 11.2.0.3.0 - Production  
  57. NLSRTL Version 11.2.0.3.0 - Production  
  58.  
  59. SQL> exit  
  60. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production  
  61. With the Partitioning, OLAP, Data Mining and Real Application Testing options 

七:在主库上使用rman进行duplicate操作

[oracle@dg3 ~]$ rman target sys/123456@dg3 auxiliary sys/123456@dg4
Recovery Manager: Release 11.2.0.3.0 - Production on Mon Apr 30 17:16:42 2012
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: DG (DBID=1695308537)
connected to auxiliary database: DG (not mounted)

RMAN> duplicate target database for standby from active database;

Starting Duplicate Db at 2012-04-30-17:16:48
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=10 device type=DISK

contents of Memory Script:
{
   backup as copy reuse
   targetfile  '/u01/app/oracle/product/11.2.0/db1/dbs/orapwdg' auxiliary format 
 'C:\app\oracle\product\11.2.0\dbhome_1\DATABASE\PWDdg.ORA'   ;
}
executing Memory Script

Starting backup at 2012-04-30-17:16:49
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=22 device type=DISK
Finished backup at 2012-04-30-17:16:51

contents of Memory Script:
{
   backup as copy current controlfile for standby auxiliary format  'C:\APP\ORACLE\ORADATA\DG\CONTROL01.CTL';
   restore clone controlfile to  'C:\APP\ORACLE\FAST_RECOVERY_AREA\DG\CONTROL02.CTL' from 
 'C:\APP\ORACLE\ORADATA\DG\CONTROL01.CTL';
}
executing Memory Script

Starting backup at 2012-04-30-17:16:51
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying standby control file
output file name=/u01/app/oracle/product/11.2.0/db1/dbs/snapcf_dg.f tag=TAG20120430T171651 RECID=2

STAMP=781982213
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
Finished backup at 2012-04-30-17:16:58

Starting restore at 2012-04-30-17:16:58
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: copied control file copy
Finished restore at 2012-04-30-17:17:02

contents of Memory Script:
{
   sql clone 'alter database mount standby database';
}
executing Memory Script

sql statement: alter database mount standby database

contents of Memory Script:
{
   set newname for tempfile  1 to 
 "C:\APP\ORACLE\ORADATA\DG\TEMP01.DBF";
   switch clone tempfile all;
   set newname for datafile  1 to 
 "C:\APP\ORACLE\ORADATA\DG\SYSTEM01.DBF";
   set newname for datafile  2 to 
 "C:\APP\ORACLE\ORADATA\DG\SYSAUX01.DBF";
   set newname for datafile  3 to 
 "C:\APP\ORACLE\ORADATA\DG\UNDOTBS01.DBF";
   set newname for datafile  4 to 
 "C:\APP\ORACLE\ORADATA\DG\USERS01.DBF";
   backup as copy reuse
   datafile  1 auxiliary format 
 "C:\APP\ORACLE\ORADATA\DG\SYSTEM01.DBF"   datafile 
 2 auxiliary format 
 "C:\APP\ORACLE\ORADATA\DG\SYSAUX01.DBF"   datafile 
 3 auxiliary format 
 "C:\APP\ORACLE\ORADATA\DG\UNDOTBS01.DBF"   datafile 
 4 auxiliary format 
 "C:\APP\ORACLE\ORADATA\DG\USERS01.DBF"   ;
   sql 'alter system archive log current';
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to C:\APP\ORACLE\ORADATA\DG\TEMP01.DBF in control file

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting backup at 2012-04-30-17:17:12
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/u01/app/oracle/oradata/dg/system01.dbf
output file name=C:\APP\ORACLE\ORADATA\DG\SYSTEM01.DBF tag=TAG20120430T171712
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:02:45
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=/u01/app/oracle/oradata/dg/sysaux01.dbf
output file name=C:\APP\ORACLE\ORADATA\DG\SYSAUX01.DBF tag=TAG20120430T171712
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:02:25
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=/u01/app/oracle/oradata/dg/undotbs01.dbf
output file name=C:\APP\ORACLE\ORADATA\DG\UNDOTBS01.DBF tag=TAG20120430T171712
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=/u01/app/oracle/oradata/dg/users01.dbf
output file name=C:\APP\ORACLE\ORADATA\DG\USERS01.DBF tag=TAG20120430T171712
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 2012-04-30-17:22:51

sql statement: alter system archive log current

contents of Memory Script:
{
   switch clone datafile all;
}
executing Memory Script

datafile 1 switched to datafile copy
input datafile copy RECID=2 STAMP=781982566 file name=C:\APP\ORACLE\ORADATA\DG\SYSTEM01.DBF
datafile 2 switched to datafile copy
input datafile copy RECID=3 STAMP=781982566 file name=C:\APP\ORACLE\ORADATA\DG\SYSAUX01.DBF
datafile 3 switched to datafile copy
input datafile copy RECID=4 STAMP=781982566 file name=C:\APP\ORACLE\ORADATA\DG\UNDOTBS01.DBF
datafile 4 switched to datafile copy
input datafile copy RECID=5 STAMP=781982567 file name=C:\APP\ORACLE\ORADATA\DG\USERS01.DBF
Finished Duplicate Db at 2012-04-30-17:23:50

八:检查主库的数据文件和日志文件,将备库置于ADG模式下


  1. [oracle@dg3 ~]$ sqlplus sys/123456@dg4 as sysdba  
  2. SQL*Plus: Release 11.2.0.3.0 Production on Mon Apr 30 17:24:59 2012  
  3. Copyright (c) 1982, 2011, Oracle.  All rights reserved.  
  4.  
  5. Connected to:  
  6. Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production  
  7. With the Partitioning, OLAP, Data Mining and Real Application Testing options  
  8.  
  9. SQL> select member from v$logfile;  
  10.  
  11. MEMBER  
  12. --------------------------------------------------------------------------------  
  13. C:\APP\ORACLE\ORADATA\DG\REDO03.LOG  
  14. C:\APP\ORACLE\ORADATA\DG\REDO02.LOG  
  15. C:\APP\ORACLE\ORADATA\DG\REDO01.LOG  
  16. C:\APP\ORACLE\ORADATA\DG\STANDBY04.DBF  
  17. C:\APP\ORACLE\ORADATA\DG\STANDBY05.DBF  
  18. C:\APP\ORACLE\ORADATA\DG\STANDBY06.DBF  
  19. C:\APP\ORACLE\ORADATA\DG\STANDBY07.DBF  
  20. 7 rows selected.  
  21.  
  22. SQL> select name from v$datafile;  
  23.  
  24. NAME  
  25. --------------------------------------------------------------------------------  
  26. C:\APP\ORACLE\ORADATA\DG\SYSTEM01.DBF  
  27. C:\APP\ORACLE\ORADATA\DG\SYSAUX01.DBF  
  28. C:\APP\ORACLE\ORADATA\DG\UNDOTBS01.DBF  
  29. C:\APP\ORACLE\ORADATA\DG\USERS01.DBF  
  30.  
  31. SQL> select open_mode,database_role,db_unique_name from v$database;  
  32.  
  33. OPEN_MODE            DATABASE_ROLE    DB_UNIQUE_NAME  
  34. -------------------- ---------------- ------------------------------  
  35. MOUNTED              PHYSICAL STANDBY dg4  
  36.  
  37. SQL> alter database open;  
  38. Database altered.  
  39.  
  40. SQL> select open_mode,database_role,db_unique_name from v$database;  
  41.  
  42. OPEN_MODE            DATABASE_ROLE    DB_UNIQUE_NAME  
  43. -------------------- ---------------- ------------------------------  
  44. READ ONLY            PHYSICAL STANDBY dg4  
  45.  
  46. SQL> alter database recover managed standby database using current logfile disconnect from session;  
  47. Database altered.  
  48.  
  49. SQL> select open_mode,database_role,db_unique_name from v$database;  
  50.  
  51. OPEN_MODE            DATABASE_ROLE    DB_UNIQUE_NAME  
  52. -------------------- ---------------- ------------------------------  
  53. READ ONLY WITH APPLY PHYSICAL STANDBY dg4  
  54.  
  55. SQL> archive log list;  
  56. Database log mode              Archive Mode  
  57. Automatic archival             Enabled  
  58. Archive destination            c:\app\oracle\standbylog  
  59. Oldest online log sequence     14  
  60. Next log sequence to archive   0  
  61. Current log sequence           14  
  62. SQL> select applied,sequence# from v$archived_log where sequence# >10;  
  63.  
  64. APPLIED    SEQUENCE#  
  65. --------- ----------  
  66. YES               12  
  67. YES               11  
  68. IN-MEMORY         13 

九:测试数据是否实时同步


  1. SQL> archive log list;  
  2. Database log mode              Archive Mode  
  3. Automatic archival             Enabled  
  4. Archive destination            /u01/app/oracle/standbylog  
  5. Oldest online log sequence     12  
  6. Next log sequence to archive   14  
  7. Current log sequence           14  
  8.  
  9. SQL> create table t as select * from v$database;  
  10. Table created.  
  11.  
  12. SQL> conn sys/123456@dg4 as sysdba  
  13. Connected.  
  14. SQL> desc t;  
  15.  Name                                      Null?    Type  
  16.  ----------------------------------------- -------- ----------------------------  
  17.  DBID                                               NUMBER  
  18.  NAME                                               VARCHAR2(9)  
  19.  CREATED                                            DATE  
  20.  RESETLOGS_CHANGE#                                  NUMBER  
  21.  RESETLOGS_TIME                                     DATE  
  22.  PRIOR_RESETLOGS_CHANGE#                            NUMBER  
  23.  PRIOR_RESETLOGS_TIME                               DATE  
  24.  LOG_MODE                                           VARCHAR2(12)  
  25.  CHECKPOINT_CHANGE#                                 NUMBER  
  26.  ARCHIVE_CHANGE#                                    NUMBER  
  27.  CONTROLFILE_TYPE                                   VARCHAR2(7)  
  28.  CONTROLFILE_CREATED                                DATE  
  29.  CONTROLFILE_SEQUENCE#                              NUMBER  
  30.  CONTROLFILE_CHANGE#                                NUMBER  
  31.  CONTROLFILE_TIME                                   DATE  
  32.  OPEN_RESETLOGS                                     VARCHAR2(11)  
  33.  VERSION_TIME                                       DATE  
  34.  OPEN_MODE                                          VARCHAR2(20)  
  35.  PROTECTION_MODE                                    VARCHAR2(20)  
  36.  PROTECTION_LEVEL                                   VARCHAR2(20)  
  37.  REMOTE_ARCHIVE                                     VARCHAR2(8)  
  38.  ACTIVATION#                                        NUMBER  
  39.  SWITCHOVER#                                        NUMBER  
  40.  DATABASE_ROLE                                      VARCHAR2(16)  
  41.  ARCHIVELOG_CHANGE#                                 NUMBER  
  42.  ARCHIVELOG_COMPRESSION                             VARCHAR2(8)  
  43.  SWITCHOVER_STATUS                                  VARCHAR2(20)  
  44.  DATAGUARD_BROKER                                   VARCHAR2(8)  
  45.  GUARD_STATUS                                       VARCHAR2(7)  
  46.  SUPPLEMENTAL_LOG_DATA_MIN                          VARCHAR2(8)  
  47.  SUPPLEMENTAL_LOG_DATA_PK                           VARCHAR2(3)  
  48.  SUPPLEMENTAL_LOG_DATA_UI                           VARCHAR2(3)  
  49.  FORCE_LOGGING                                      VARCHAR2(3)  
  50.  PLATFORM_ID                                        NUMBER  
  51.  PLATFORM_NAME                                      VARCHAR2(101)  
  52.  RECOVERY_TARGET_INCARNATION#                       NUMBER  
  53.  LAST_OPEN_INCARNATION#                             NUMBER  
  54.  CURRENT_SCN                                        NUMBER  
  55.  FLASHBACK_ON                                       VARCHAR2(18)  
  56.  SUPPLEMENTAL_LOG_DATA_FK                           VARCHAR2(3)  
  57.  SUPPLEMENTAL_LOG_DATA_ALL                          VARCHAR2(3)  
  58.  DB_UNIQUE_NAME                                     VARCHAR2(30)  
  59.  STANDBY_BECAME_PRIMARY_SCN                         NUMBER  
  60.  FS_FAILOVER_STATUS                                 VARCHAR2(22)  
  61.  FS_FAILOVER_CURRENT_TARGET                         VARCHAR2(30)  
  62.  FS_FAILOVER_THRESHOLD                              NUMBER  
  63.  FS_FAILOVER_OBSERVER_PRESENT                       VARCHAR2(7)  
  64.  FS_FAILOVER_OBSERVER_HOST                          VARCHAR2(512)  
  65.  CONTROLFILE_CONVERTED                              VARCHAR2(3)  
  66.  PRIMARY_DB_UNIQUE_NAME                             VARCHAR2(30)  
  67.  SUPPLEMENTAL_LOG_DATA_PL                           VARCHAR2(3)  
  68.  MIN_REQUIRED_CAPTURE_CHANGE#                       NUMBER 
本文转自斩月博客51CTO博客,原文链接http://blog.51cto.com/ylw6006/849909如需转载请自行联系原作者

ylw6006
上一篇:【月刊】交互式分析(Hologres)2020年10月刊


下一篇:阿里云自助建站的方法-------阿里云心选建站