In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly shows you "oracle 11g dg broker how to open and configure", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "oracle 11g dg broker how to open and configure" this article.
Oracle11g enables db broker to achieve the purpose of managing dg
Make sure the following parameters are set on both sides:
1.SQL > alter system set LOG_ARCHIVE_DEST_1='LOCATION=/data/u01/app/oracle/archive/ VALID_FOR= (ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=db1'
System altered.
2.SQL > ALTER SYSTEM SET LOG_ARCHIVE_DEST_2='SERVICE=db1 LGWR aSYNC VALID_FOR= (ONLINE_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=db1'
System altered.
3.SQL > ALTER SYSTEM SET LOG_FILE_NAME_CONVERT='/data/u01/app/oracle/oradata/db2/','/ data/u01/app/oracle/oradata/db1/' scope = spfile
System altered.
4.SQL > ALTER SYSTEM SET DB_FILE_NAME_CONVERT='/ data/u01/app/oracle/oradata/db2/','/ data/u01/app/oracle/oradata/db1/' scope = spfile
System altered.
5.SQL > ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=AUTO SCOPE=SPFILE
System altered.
6.SQL > ALTER SYSTEM SET FAL_CLIENT = db1 SCOPE=SPFILE
System altered.
7.SQL > ALTER SYSTEM SET FAL_SERVER = db2 SCOPE=SPFILE
System altered.
8. Standby logfile has been added to the main library.
9. SQL > alter database force logging
Database altered.
Premise: main library db2 standby library db1
One: enable db broker
Set each to true on the master and slave libraries.
SQL > alter system set dg_broker_start=true
Master / slave library: parameter dg_broker_config_file. Default is fine. When you create configuration and enable later,
The corresponding files will be generated in this directory!
SQL > show parameter dg_broker_config_file
NAME TYPE VALUE
-
Dg_broker_config_file1 string / data/u01/app/oracle/product/1
1.2.0/dbhome_1/dbs/dr1db2.dat
Dg_broker_config_file2 string / data/u01/app/oracle/product/1
1.2.0/dbhome_1/dbs/dr2db2.dat
Modify the dg_broker_config_file parameter. The default path is used here, or you can specify it yourself. If you are in a RAC environment, this puts the file on the shared storage, and if there is an ASM, you can put it in the ASM.
two。 Listener.ora, the master / slave library, adds the listening service used by db broker switching, because the service name used by dg broker is db_unique_name_DGMGRL. Note: if you do not modify the monitoring, you can also use the original listening. This method is described below.
2.1vim listener.ora, add the red section below! Be sure to pay attention to the format and strict alignment
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP) (HOST = 10.9.21.178) (PORT = 1521))
)
)
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME=db2)
(ORACLE_HOME=/data/u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME=db2))
(SID_DESC=
(GLOBAL_DBNAME=db2_DGMGRL)
(ORACLE_HOME=/data/u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME=db2)
ADR_BASE_LISTENER = / data/u01/app/oracle
2.2 reload listening:
[oracle@beijing-fuli-hadoop-02 admin] $lsnrctl reload
three。 Configure db broker
3.1. Connect to the main library
[oracle@beijing-fuli-hadoop-02 admin] $dgmgrl sys/oracle@db2
3.2. Create configuration
DGMGRL > help
The following commands are available:
Add Adds a standby database to the broker configuration
Connect Connects to an Oracle database instance
Convert Converts a database from one type to another
Create Creates a broker configuration
Disable Disables a configuration, a database, or fast-start failover
Edit Edits a configuration, database, or instance
Enable Enables a configuration, a database, or fast-start failover
Exit Exits the program
Failover Changes a standby database to be the primary database
Help Displays description and syntax for a command
Quit Exits the program
Reinstate Changes a database marked for reinstatement into a viable standby
Rem Comment to be ignored by DGMGRL
Remove Removes a configuration, database, or instance
Show Displays information about a configuration, database, or instance
Shutdown Shuts down a currently running Oracle database instance
Sql Executes a SQL statement
Start Starts the fast-start failover observer
Startup Starts an Oracle database instance
Stop Stops the fast-start failover observer
Switchover Switches roles between a primary and standby database
DGMGRL > help create
Creates a broker configuration
Syntax:
CREATE CONFIGURATION AS
PRIMARY DATABASE IS
CONNECT IDENTIFIER IS
DGMGRL > CREATE CONFIGURATION dbha_c AS PRIMARY DATABASE IS db2 CONNECT IDENTIFIER IS db2
(explanation: dbha_c is a random name, db2 is the only name of the main database, and identifier is is the network service name of tnsnames.ora! You can then delete the created configuration using the following!
DGMGRL > REMOVE CONFIGURATION;)
3.3 add information for the standby library
DGMGRL > help add
DGMGRL > add database 'db1' as connect identifier is' db1' maintained as physical
Database "db1" added
Note that the db1 here in identifier is' db1' is the name of the repository in your tnsnames.ora!
After you add it
Start the CONFIGURATION of this db broker!
DGMGRL > help enable
DGMGRL > ENABLE CONFIGURATION
3.5 View the relevant configuration of db broker
DGMGRL > help show
DGMGRL > SHOW CONFIGURATION
The error is as follows:
DGMGRL > show configuration
Configuration-dbha_c
Protection Mode: MaxPerformance
Databases:
Db2-Primary database
Db1-Physical standby database (disabled)
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
Solution:
Delete the files in this directory of the master-slave library, and then re-create configuration, you can!
SQL > show parameter dg_broker_config_file
NAME TYPE VALUE
-
Dg_broker_config_file1 string / data/u01/app/oracle/product/1
1.2.0/dbhome_1/dbs/dr1db2.dat
Dg_broker_config_file2 string / data/u01/app/oracle/product/1
1.2.0/dbhome_1/dbs/dr2db2.dat
Explanation: what is the role of these two documents?
The following shows normal!
DGMGRL > show configuration
Configuration-dbha_c
Protection Mode: MaxPerformance
Databases:
Db2-Primary database
Db1-Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
View the status of the database:
DGMGRL > show database verbose db1
# pay attention here. The service_name of the connection in broker is _ DGMGRL, so you need to modify the listening above!
If you do not modify the listening file, you can also execute the following command to modify the StaticConnectIdentifier:
DGMGRL > edit database db1 set property StaticConnectIdentifier='(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=beijing-fuli-hadoop-01) (PORT=1521)) (CONNECT_DATA= (SERVICE_NAME=db1) (INSTANCE_NAME=db1) (SERVER=DEDICATED)'
DGMGRL > edit database db2 set property StaticConnectIdentifier=' (DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=beijing-fuli-hadoop-02) (PORT=1521)) (CONNECT_DATA= (SERVICE_NAME=db2) (INSTANCE_NAME=db2) (SERVER=DEDICATED))'
Four: related commands about db broker:
4.1: switch between master and slave!
DGMGRL > help switchover
DGMGRL > switchover to db1
Performing switchover NOW, please wait...
Operation requires a connection to instance "db1" on database "db1"
Connecting to instance "db1"...
Connected.
New primary database "db1" is opening...
Operation requires startup of instance "db2" on database "db2"
Starting instance "db2"...
ORACLE instance started.
Database mounted.
Database opened.
Switchover succeeded, new primary is "db1"
DGMGRL >
4.2: change from library to snapshot state! (provided that flashback database is enabled)
Main library operation
DGMGRL > SHOW CONFIGURATION
DGMGRL > help convert
DGMGRL > CONVERT DATABASE db1 TO SNAPSHOT STANDBY
DGMGRL > SHOW CONFIGURATION
4.3: modify the way dg synchronizes redo, as well as the protection mode!
DGMGRL > help edit
DGMGRL > EDIT DATABASE db2 SET PROPERTY LogXptMode=SYNC;-main library
DGMGRL > EDIT DATABASE db1 SET PROPERTY LogXptMode=SYNC;-prepare the library
DGMGRL > EDIT CONFIGURATION SET PROTECTION MODE AS MaxAvailability;-main library
DGMGRL > EDIT CONFIGURATION SET PROTECTION MODE AS MaxAvailability;-prepare the library
These are all the contents of the article "how to enable and configure oracle 11g dg broker". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.