直接搭建逻辑备库oracle,DG搭建逻辑备库

本文详细介绍了在Oracle数据库中搭建逻辑备库的完整过程,包括从物理备库开始,执行必要的数据库操作,如取消备库恢复、强制日志记录、添加附加日志等,直至使用DGMGRL配置并启用逻辑备库,确保了数据保护和高可用性。
摘要由CSDN通过智能技术生成

逻辑备库是在物理备库的基础上搭建的,所以需要先搭建好物理备库。

备库执行如下操作:

[oracle@localhost ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production onFri Nov 7 15:03:30 2014

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to:

Oracle Database 11g Enterprise EditionRelease 11.2.0.3.0 - 64bit Production

With the Partitioning, Oracle LabelSecurity, OLAP, Data Mining,

Oracle Database Vault and Real ApplicationTesting options

SQL>alter database recover managed standby database cancel;

Database altered.

SQL> exit

Disconnected from Oracle Database 11gEnterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, Oracle LabelSecurity, OLAP, Data Mining,

Oracle Database Vault and Real ApplicationTesting options

主库:

[oracle@localhost ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production onFri Nov 7 15:04:46 2014

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to:

Oracle Database 11g Enterprise EditionRelease 11.2.0.3.0 - 64bit Production

With the Partitioning, Oracle LabelSecurity, OLAP, Data Mining,

Oracle Database Vault and Real ApplicationTesting options

SQL> alter database force logging; ---强制日志记录

Database altered.

SQL>alter database add supplemental log data; ----增加附加日志

Database altered.

SQL> exec dbms_logstdby.build; ---脚本

PL/SQL procedure successfully completed.

SQL>

备库

[oracle@localhost ~]$sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production onFri Nov 7 15:11:37 2014

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to:

Oracle Database 11g Enterprise EditionRelease 11.2.0.3.0 - 64bit Production

With the Partitioning, Oracle LabelSecurity, OLAP, Data Mining,

Oracle Database Vault and Real ApplicationTesting options

SQL>alter database recover to logical standby jadl11g;

Database altered.

SQL> shutdown immediate----注意必须一致性性关闭数据库

ORA-01507: database not mounted

ORACLE instance shut down.

SQL> startup mount

ORACLE instance started.

Total System Global Area  626327552 bytes

Fixed Size                  2230952 bytes

Variable Size             268436824 bytes

Database Buffers          352321536 bytes

Redo Buffers                3338240 bytes

Database mounted.

SQL>alter database open resetlogs; *********

Database altered.

SQL> alter database start logical standby apply;

Database altered.

登录DGMGRL:

DGMGRL> createconfiguration dgc as primary database is pjadl11g connect identifier ispjadl11g;

Configuration "dgc" created withprimary database "pjadl11g"

DGMGRL> add database sjadl11g as connect identifier issjadl11g maintained as logical;

Database "sjadl11g" added

DGMGRL>enable configuration

Enabled.

DGMGRL> show configuration

Configuration - dgc

Protection Mode: MaxPerformance

Databases:

pjadl11g - Primary database

sjadl11g - Logical standby database

Fast-Start Failover: DISABLED

Configuration Status:

SUCCESS

至此逻辑备库搭建完毕!!!!!!!

DGMGRL>show configuration verbose;

Configuration - dgc

Protection Mode: MaxPerformance

Databases:

pjadl11g - Primary database

sjadl11g - Logical standby database

Properties:

FastStartFailoverThreshold      ='30'

OperationTimeout                ='30'

FastStartFailoverLagLimit       ='30'

CommunicationTimeout            ='180'

FastStartFailoverAutoReinstate  ='TRUE'

FastStartFailoverPmyShutdown    ='TRUE'

BystandersFollowRoleChange      ='ALL'

Fast-Start Failover: DISABLED

Configuration Status:

SUCCESS

DGMGRL> show database verbose sjadl11g;

Database - sjadl11g

Role:            LOGICAL STANDBY

Intended State:  APPLY-ON

Transport Lag:   0 seconds

Apply Lag:       0 seconds

Instance(s):

jadl11g

Properties:

DGConnectIdentifier             ='sjadl11g'

ObserverConnectIdentifier       =''

LogXptMode                      = 'ASYNC'

DelayMins                       ='0'

Binding                         ='optional'

MaxFailure                      ='0'

MaxConnections                  ='1'

ReopenSecs                      ='300'

NetTimeout                      ='30'

RedoCompression                 ='DISABLE'

LogShipping                     ='ON'

PreferredApplyInstance          = ''

ApplyInstanceTimeout            ='0'

LsbyASkipTxnCfgPr               ='0,0,0'

LsbyDSkipTxnCfgPr               ='0,0,0'

LsbyASkipCfgPr                  =''

LsbyDSkipCfgPr                  =''

LsbyASkipErrorCfgPr             = ''

LsbyDSkipErrorCfgPr             =''

LsbyMaxEventsRecorded           ='0'

LsbyPreserveCommitOrder         =''

LsbyRecordSkipErrors            =''

LsbyRecordSkipDdl               =''

LsbyRecordAppliedDdl            =''

ArchiveLagTarget                ='0'

LogArchiveMaxProcesses          ='4'

LogArchiveMinSucceedDest        ='1'

FastStartFailoverTarget         =''

InconsistentProperties          ='(monitor)'

InconsistentLogXptProps         ='(monitor)'

SendQEntries                    ='(monitor)'

LogXptStatus                    ='(monitor)'

RecvQEntries                    ='(monitor)'

LsbyParameters                  ='(monitor)'

LsbySkipTxnTable                ='(monitor)'

LsbySkipTable                   ='(monitor)'

LsbyFailedTxnInfo               ='(monitor)'

SidName                         ='jadl11g'

StaticConnectIdentifier         ='(DESCRIPTION=(ADDRESS=(PROTOCOL=tc                        =localhost.localdomain)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=sjadl11g_D                        INSTANCE_NAME=jadl11g)(SERVER=DEDICATED)))'

StandbyArchiveLocation          ='USE_DB_RECOVERY_FILE_DEST'

AlternateLocation               = ''

LogArchiveTrace                 ='0'

LogArchiveFormat                ='%t_%s_%r.dbf'

LsbyMaxSga                      ='0'

LsbyMaxServers                  ='0'

TopWaitEvents                   ='(monitor)'

Database Status:

SUCCESS

DGMGRL>edit database sjadl11g set propertylogxptmode='sync';---修改参数 Property"logxptmode" updated

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值