环境:
OS:Centos 7
DB:19.3.0.0
拓扑结构:1主1从 observer单独机器
1.删除配置
在observer机器上登录主库,登录从库应该也是可以的
[oracle@19c-slaveb admin]$ dgmgrl sys/oracle@tnsslnngk; DGMGRL for Linux: Release 19.0.0.0.0 - Production on Wed Feb 1 02:41:17 2023 Version 19.3.0.0.0 Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved. Welcome to DGMGRL, type "help" for information. Connected to "slnngk" Connected as SYSDBA. DGMGRL> remove configuration; Removed configuration
从日志看到主从库自动修改fal_server和log_archive_config参数了,同时发现主库也删除了log_archive_dest_2配置
ALTER SYSTEM SET log_archive_dest_2='' SCOPE=BOTH; 2023-02-01T02:49:40.159366-05:00 ALTER SYSTEM SET log_archive_config='nodg_config' SCOPE=BOTH; 2023-02-01T02:49:40.166321-05:00 ALTER SYSTEM SET fal_server='' SCOPE=BOTH; SQL> show parameters log_archive_config; NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ log_archive_config SQL> show parameters fal; NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ fal_client string TNSSLAVEA fal_server string SQL>
但是从库的应用进程还是存在的
SQL> select process,status from v$managed_standby; PROCESS STATUS --------- ------------ ARCH CONNECTED DGRD ALLOCATED DGRD ALLOCATED ARCH CONNECTED ARCH CONNECTED ARCH CONNECTED RFS IDLE RFS IDLE RFS IDLE MRP0 APPLYING_LOG 10 rows selected.
19C与11G不同,11G删除配置后应用进程会自动停掉
2.主从库修改dg_broker参数
主从库都进行修改
SQL> connect / as sysdba
Connected.
SQL> alter system set dg_broker_start=false scope=both;
System altered.
3.删除元数据文件
主库:
SQL> show parameter dg_broker NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ dg_broker_config_file1 string /u01/app/oracle/product/19.3.0.0/db_1/dbs/dr1slnngk.dat dg_broker_config_file2 string /u01/app/oracle/product/19.3.0.0/db_1/dbs/dr2slnngk.dat dg_broker_start boolean FALSE oracle账号下执行删除 rm /u01/app/oracle/product/19.3.0.0/db_1/dbs/dr1slnngk.dat rm /u01/app/oracle/product/19.3.0.0/db_1/dbs/dr2slnngk.dat
从库:
SQL> show parameter dg_broker NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ dg_broker_config_file1 string /u01/app/oracle/product/19.3.0.0/db_1/dbs/dr1slavea.dat dg_broker_config_file2 string /u01/app/oracle/product/19.3.0.0/db_1/dbs/dr2slavea.dat dg_broker_start boolean FALSE SQL> 删除 rm /u01/app/oracle/product/19.3.0.0/db_1/dbs/dr1slavea.dat rm /u01/app/oracle/product/19.3.0.0/db_1/dbs/dr2slavea.dat
同时主从库设置如下参数为空
alter system set dg_broker_config_file1 =' ' scope=both; ##很奇怪这里是1个空格
alter system set dg_broker_config_file2 =' ' scope=both; ##这里是2个空格才成功
否则一直修改不成功
SQL> alter system set dg_broker_config_file1 ='' scope=both;
alter system set dg_broker_config_file1 ='' scope=both
*
ERROR at line 1:
ORA-32017: failure in updating SPFILE
ORA-02097: parameter cannot be modified because specified value is invalid
4.从新修改主从参数改成手工维护
主库参数
alter system set log_archive_dest_2= 'service=tnsslavea async valid_for=(online_logfiles,primary_role) db_unique_name=slavea' scope=both;
alter system set fal_server=tnsslavea scope=both;
alter system set fal_client=tnsslnngk scope=both;
alter system set log_archive_config='dg_config=(slnngk,slavea)' scope=both;
备库参数
alter system set log_archive_dest_2= 'service=tnsslnngk async valid_for=(online_logfiles,primary_role) db_unique_name=slnngk' scope=both;
alter system set fal_server=tnsslnngk scope=both;
alter system set fal_client=tnsslavea scope=both;
alter system set log_archive_config='dg_config=(slnngk,slavea)' scope=both;
-- The End --
标签:set,dg,broker,system,dataguard,dgbroker,config,alter,19C From: https://www.cnblogs.com/hxlasky/p/17083243.html