DG搭建逻辑备库

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

备库执行如下操作:

[[email protected] ~]$ 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

主库:

[[email protected] ~]$ 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>

备库

[[email protected] ~]$ 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

时间: 2024-10-25 13:46:26

DG搭建逻辑备库的相关文章

搭建逻辑备库

1. 搭建物理备库 2. 在物理备库上停止重做应用,如果备库是RAC,则必须停止所有执行以下语句以外的实例 SQL> alter database recover managed standby database cancel; Database altered. 3. 为角色转换准备主库 这一步仅在执行切换时有用 修改初始化参数: alter system set LOG_ARCHIVE_DEST_1='LOCATION=/oradata/arch/ VALID_FOR=(ONLINE_LOG

DG搭建物理备库

搭建过程难免会出现各种错误,所以之前最好做一个备份!!! service iptables stop 关闭防火墙 [[email protected] ~]# setenforce 0 [[email protected] ~]# getenforce Permissive 主库 [[email protected] ~]# su - oracle [[email protected] ~]$ db11g [[email protected] ~]$ sqlplus / as sysdba SQ

『ORACLE』DG搭建时备库的db_name报错

因为搭建DG时备库中的db_name为SBCD,实际应该是主库db_name的PROD1 所以在[主库]执行如下rman操作命令时会报错控制文件记录的数据库名与实际拷贝的数据库名不相同 RMAN> duplicate target database for standby from active database; Starting Duplicate Db at 01-MAY-17using target database control file instead of recovery ca

Dataguard搭建灾备库操作手册

数据库:Oracle11gr2 主库 alter database force logging; alter system set db_unique_name='erpdb' scope=spfile;  --我们让主库db_name=db_unique_name alter system set REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE scope=spfile; alter system set LOG_ARCHIVE_FORMAT='%t_%s_%r.arc

Oracle 11g Data Guard 之逻辑备库角色转换

逻辑备库不复制数据库服务,在进行switchover或者failover时,连接主库服务的中间层将不能连接(因为服务的创建没有被复制),或者连接不正确的版本(因为服务属性的修改没有被复制). Oracle集群不复制管理逻辑备库的服务,必须手动对主库与备库进行同步,具体的详参Oracle集群管理和部署的相关内容. 一.逻辑备库的switchover操作 当进行switchover操作来改变主库和逻辑备库的角色时,总是在主库启动switchover,然后在逻辑备库完成操作,其中的步骤必须按顺序,否则

Dataguard搭建灾备库操作

DJI erpdb库搭建DG 数据库:Oracle11gr2 主库 (下面打井号的不用执行) alter database force logging; alter system set db_unique_name='erp' scope=spfile; --我们让主库db_name=db_unique_name alter system set REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE scope=spfile; alter system set LOG_ARC

搭建物理备库

Primary db configure:1. 开启主库强制日志 查询当前是否强制日志: SQL> select force_logging from v$database;  FOR --- NO  开启强制日志 SQL> alter database force logging;  Database altered.  查询 SQL> select force_logging from v$database;  FOR --- YES2. 开启归档模式 SQL> alter s

pgsql物理复制(pgsql 备库的搭建以及角色互换,提升)

结构图如下: Postgresql早在9.0版本开始支持物理复制,也称为流复制,通过从实例级复制出一个与主库一模一样的备库.流复制同步方式有同步,异步两种,如果主节点和备节点不是很忙,通常异步模式下备库和主库的延迟时间能够控制在毫秒级.物理复制只能复制整个实例. 逻辑复制也成为选择性复制,可以做到基于表级别的复制,选择需要逻辑复制的表,而不是复制实例上的所有数据库的表,10版本不支持内置的逻辑复制,通常使用第三方逻辑复制. WAL日志记录数据库变化,格式为二级制格式,尽管流复制都是基于WAL,但

ORA-21561、ORA-15055、ORA-25253 导致DG备库无法应用归档

昨天去某客户那里做巡检,顺便看一下上次搭建的RAC-DG环境是否正常,不看不知道,一看吓一跳,上次的DG是8月20日运行的,而DG备库从8月31日之后实例就没有开启过,后来询问后才得知,原来那天断过一次电,后来重启了机器.直到今天我过去了,才把实例启动起来.也就是说,从8月31日到今天快1个月的时间,备库一致处于未使用状态. 接着查看备库归档,显然已经缺失了很多了,tnread1 最后一个日志为1661,tnread2 最后一个日志为1324,而此时主库中还保留的最早的日志是9月8日的,thre