ORA-16625,ORA-16603,broker

本文详细介绍了解决Oracle DataGuard中ORA-16603错误的方法,包括禁用和重新启用DataGuard代理,删除配置文件,以及创建和启用DataGuard配置的过程。通过示例展示了如何进行数据库角色的切换。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

DGMGRL> show configuration

 

Configuration - dg

 

  Protection Mode: MaxPerformance

  Databases:

    ogg2 - Primary database

    ogg1 - Physical standby database (disabled)

 

Fast-Start Failover: DISABLED

 

Configuration Status:

SUCCESS

 

DGMGRL> show database verbose ogg1

 

Database Status:

DGM-17016: failed to retrieve status for database "ogg1"

ORA-16603: Data Guard broker detected a mismatch in configuration ID

ORA-16625: cannot reach database "ogg1"

 

 

解决办法:

可以解决ORA-16603 和 ORA-16652错误。

 

 

 

主备库都执行:

1.  alter system set DG_BROKER_START=false;

2.删除如下的文件

14:45:50 SQL> show parameter DG_BROKER_CONFIG

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

dg_broker_config_file1               string      /u01/app/oracle/product/11.2.0

                                                 /dbhome_1/dbs/dr1oradgphy.dat

dg_broker_config_file2               string      /u01/app/oracle/product/11.2.0

                                                 /dbhome_1/dbs/dr2oradgphy.dat

 

3.  alter system set DG_BROKER_START=true;

 

[oracle@rhel6_lhr admin]$ oerr ora 16603

16603, 00000, "Data Guard broker detected a mismatch in configuration ID"

// *Cause:  There was a mismatch in configuration unique ID. This could occur

//          if the original configuration was re-created while this database

//          was disconnected from the network or the same database was added

//          to two different Data Guard broker configurations.

// *Action: Make sure the database belongs to only one broker configuration.

//          Shut down the broker by setting the DG_BROKER_START initialization

//          parameter to false. Then remove the Data Guard broker configuration

//          files. Finally restart the broker by setting the DG_BROKER_START

//          initialization parameter to true.

 

4.[oracle@rhel6_lhr admin]$ ll  /u01/app/oracle/product/11.2.0/dbhome_1/dbs/dr*

-rw-r----- 1 oracle asmadmin 16384 Sep 28 12:11 /u01/app/oracle/product/11.2.0/dbhome_1/dbs/dr1oradg11g.dat

-rw-r----- 1 oracle asmadmin 16384 Sep 28 14:47 /u01/app/oracle/product/11.2.0/dbhome_1/dbs/dr1oradgphy.dat

-rw-r----- 1 oracle asmadmin 16384 Sep 28 12:10 /u01/app/oracle/product/11.2.0/dbhome_1/dbs/dr2oradg11g.dat

-rw-r----- 1 oracle asmadmin 16384 Sep 28 14:47 /u01/app/oracle/product/11.2.0/dbhome_1/dbs/dr2oradgphy.dat

5.[oracle@rhel6_lhr admin]$ rm -rf   /u01/app/oracle/product/11.2.0/dbhome_1/dbs/dr*

 

[oracle@rhel6_lhr ~]$ dgmgrl sys/lhr@tns_oradgphy_dgmgrl

DGMGRL for Linux: Version 11.2.0.3.0 - 64bit Production

 

Copyright (c) 2000, 2009, Oracle. All rights reserved.

 

欢迎使用 DGMGRL, 要获取有关信息请键入 "help"。

已连接。

DGMGRL> show configuration;

ORA-16532: Data Guard 中介配置不存在

 

配置详细资料不能由 DGMGRL 确定

DGMGRL>

DGMGRL>

DGMGRL> create configuration ‘fsf_oradg11g_lhr‘ as

> primary database is ‘oradgphy‘

> connect identifier is tns_oradgphy_dgmgrl;

 

add database ‘oradg11g‘ as

connect identifier is tns_oradg11g_dgmgrl

maintained as physical;

 

已创建配置 "fsf_oradg11g_lhr", 其中主数据库为 "oradgphy"

DGMGRL> DGMGRL> > > 已添加数据库 "oradg11g"

DGMGRL> DGMGRL>

DGMGRL>

DGMGRL>

DGMGRL>

DGMGRL>

DGMGRL>

DGMGRL>

DGMGRL>  show configuration

 

配置 - fsf_oradg11g_lhr

 

  保护模式:        MaxPerformance

  数据库:

    oradgphy - 主数据库

    oradg11g - 物理备用数据库

 

快速启动故障转移: DISABLED

 

配置状态:

DISABLED

 

DGMGRL> enable configuration

已启用。

DGMGRL>  show configuration

 

配置 - fsf_oradg11g_lhr

 

  保护模式:        MaxPerformance

  数据库:

    oradgphy - 主数据库

    oradg11g - 物理备用数据库

 

快速启动故障转移: DISABLED

 

配置状态:

SUCCESS

 

DGMGRL> switchover to oradg11g

立即执行切换, 请稍候...

新的主数据库 "oradg11g" 正在打开...

操作要求关闭实例 "oradgphy" (在数据库 "oradgphy" 上)

正在关闭实例 "oradgphy"...

ORACLE 例程已经关闭。

操作要求启动实例 "oradgphy" (在数据库 "oradgphy" 上)

正在启动实例 "oradgphy"...

ORACLE 例程已经启动。

数据库装载完毕。

数据库已经打开。

切换成功, 新的主数据库为 "oradg11g"

DGMGRL> show configuration

 

配置 - fsf_oradg11g_lhr

 

  保护模式:        MaxPerformance

  数据库:

    oradg11g - 主数据库

    oradgphy - 物理备用数据库

 

快速启动故障转移: DISABLED

 

配置状态:

SUCCESS

 

DGMGRL>

<think>嗯,用户需要解决Oracle数据库账户被锁定的问题,具体错误是ORA-28000。用户可能是个DBA或者运维人员,遇到了账户被锁导致应用无法连接的情况,显得比较着急。从ta直接引用三个技术文档看,应该具备一定技术基础,但可能对ADG环境下的账户同步机制不熟悉。 先梳理核心问题点:主库解锁后备库未同步。根据引用[1]和[2],这通常发生在ADG备库环境,根本原因是备库处于只读模式时无法执行账户状态变更。需要特别注意引用[1]中Note 1600401.1提到的关键机制——ADG不会自动同步密码文件。 处理方案要分三个层面设计: 首先是基础解锁操作,这个比较简单,用alter user解锁就行。但用户可能已经试过无效,所以重点在第二点:ADG环境下的特殊处理。这里需要引用[1]的解决方案,强调必须重建密码文件并重启备库。最后补充预防措施,比如密码过期策略和失败登录限制,引用[2]提到过这个案例。 用户引用[3]关于ORACLE_OCM的内容虽然相关度不高,但说明ta可能还遇到系统账户被锁的情况,所以在预防措施里补充了系统账户的处理建议。最后生成的三个问题都紧扣ADG环境特性,特别是第三个问题特意关联了Data Guard Broker,因为实际运维中很多人会忽略这个工具的状态检查。</think>以下是解决 Oracle 数据库账户锁定错误(ORA-28000)的完整方案: ### 一、错误原因分析 1. **账户锁定机制触发** - 密码连续输入错误超过 `FAILED_LOGIN_ATTEMPTS` 限制(默认 10 次)[^1] - 密码过期未及时修改 - 管理员手动执行 `ALTER USER ... ACCOUNT LOCK` 命令 2. **ADG 备库特殊场景** 在 Active Data Guard 环境中,主库解锁账户后,备库因**只读模式**无法同步账户状态,导致备库仍报错 ORA-28000[^1][^2]。 --- ### 二、解决方案 #### ▶ 常规解锁步骤(单实例/主库) ```sql -- 1. 检查锁定状态 SELECT username, account_status FROM dba_users WHERE username = 'YOUR_USERNAME'; -- 替换为实际用户名 -- 2. 解锁账户 ALTER USER your_username ACCOUNT UNLOCK; -- 3. 重置密码(可选) ALTER USER your_username IDENTIFIED BY "new_password"; ``` #### ▶ ADG 备库解锁方案 需在**主库**执行操作并同步至备库: 1. **主库操作** ```sql ALTER USER your_username ACCOUNT UNLOCK; ``` 2. **备库强制同步** ```sql -- 重启备库(需维护窗口) SHUTDOWN IMMEDIATE; STARTUP MOUNT; ALTER DATABASE OPEN; -- 重建密码文件(关键步骤)[^1] $ orapwd file=$ORACLE_HOME/dbs/orapwSID password=<sys_pwd> force=y ``` --- ### 三、预防措施 1. **调整密码策略** ```sql -- 增加失败尝试次数 ALTER PROFILE DEFAULT LIMIT FAILED_LOGIN_ATTEMPTS 20; -- 取消密码过期 ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED; ``` 2. **系统账户处理** 对 `ORACLE_OCM` 等系统账户,若无需登录可直接锁定[^3]: ```sql ALTER USER ORACLE_OCM ACCOUNT LOCK; ``` --- ### 四、故障排查流程图 ```mermaid graph TD A[报错 ORA-28000] --> B{环境类型} B -->|单实例/主库| C[直接解锁账户] B -->|ADG 备库| D[主库解锁+备库重启] D --> E[重建密码文件] E --> F[验证备库连接] ``` > ⚠️ **注意**:生产环境操作前务必备份密码文件,ADG 备库重启需协调维护窗口。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值