View the relationship between instance names and node names under RAC
Oracle provides a global data dictionary view, GV $ instance, which can be used to query the relationship between Instance name and node name.
SQL> select instance_name, instance_number, host_name from GV $ instance;
Instance_name instance_number host_name
-------------------------------------------------
Orcl1 1 node_a
Orcl2 2 node_ B
Due to the importance of private networks, the adjustment after installation may be necessary in some cases. For example
To increase bandwidth or set up multiple interconnected networks. In particular, the RAC database sets a parameter used to specify the internal interconnection.
Cluster_interconnects is used to specify the private network in the Cluster:
This parameter is generally not recommended in the RAC environment. However, after some changes are made to the network configuration (such as adding an Internet card ),
Setting is necessary. In the following example, the originally used Intranet is 10.0.0.91/92, and you want to extend the internal network
10.0.0.91/92 and 255.0.0.1/2.
SQL> alter system set cluster_interconnects = '10. 0.0.91: 255.0.0.1 'scope = spfile SID = 'orcl1 ';
SQL> alter system set cluster_interconnects = '10. 0.0.91: 255.0.0.1 'scope = spfile SID = 'orcly ';
Multiple NICs are separated by colons, and the change range must be specified as spfile. (Of course, the specific operation can be performed in
RAC is completed on any node, because the same parameter file is changed ). After the system restarts, the above two NICS will be used for the private network, that is, IPC
Internal communication. This can be found in the warning file of the database.
Roles for dividing cluster nodes
Each node in the RAC cluster can also be configured with the same role as hacmp: master node and slave node. By default, all RAC nodes have
The same role, that is, all are the master node to receive user connection and access. But it can also be on two nodes (only two nodes, multiple nodes do not have this function)
In the cluster environment, one node is set as the master node, and the other as the slave node.
The method is to set the active_instance_count parameter, which defaults to '1', as shown in the following query results:
SQL> show parameters active_instance_count
Name type value
------------------------------------------------------------------
Active_instance_count interger
If active_instance_count is set to 1 on all nodes, the first instance started as the master node during the RAC startup process,
Users are allowed to access and use the instance. The second instance is used as a backup instance. Users can access and use the instance only when the master instance fails. If the original
Is used as a slave node.
SQL> alter sytem set active_instance_count = 1 Scope = spfile SID = '*';
system alerted.
the change takes effect after the system is restarted. The following query shows the node role information:
SQL> select instance_number, instance_name, instance_role from GV $ instance;
Instance_number instance_name instance_role
--------------------------------------------------------------
1 orcl1 secondary_instance
2 orcl2 primary_isntance
If active_instance_count is set to be greater than or equal to the number of instances 2, all nodes are the primary nodes.
|
You can use the srvctl config command to retrieve information stored in the cluster database in OCR, for example
The following query shows the installation information of the cctt database on two nodes.
$ Srvctl config database-D cctt
Cctt1 cctt1/Oracle/product/DB
Cctt2 cctt2/Oracle/product/DB
|
Use srvctl to manage ASM
Srvctl can use the status command to view the service status of ASM and use commands similar to start and stop to manage ASM components.
The following example shows that the instance cctt1 is running on the cctt1 node, and the ASM instance asm2 is running on the cctt2 node.
Srvctl status ASM-N cctt1
$ Srvctl status ASM-N cctt1
ASM instance + ASM1 is running on node cctt1.
$ Srvctl status ASM-N cctt2
ASM instance + asm2 is running on node cctt2.
| |
$ Crs_stat-T
Name type target State host
------------------------------------------------------------
Ora... t1.inst application offline
Ora... t2.inst application online cctt2
Ora. cctt. DB application online cctt1
Ora... tt1.srv application online offline
Ora... tt2.srv application online cctt2
Ora... TAF. CS application online cctt1
Ora... sm1.asm application online cctt1
Ora... t1.lsnr application online cctt1
Ora. cctt1.gsd application online cctt1
Ora. cctt1.ons application online cctt1
Ora. cctt1.vip application online cctt1
Ora... sm2.asm application online cctt2
Ora... t2.lsnr application online cctt2
Ora. cctt2.gsd application online cctt2
Ora. cctt2.ons application online cctt2
Ora. cctt2.vip application online cctt2
$ Srvctl start instance-D cctt-I cctt1
$ Crs_stat-T
Name type target State host
------------------------------------------------------------
Ora... t1.inst application online cctt1
Ora... t2.inst application online cctt2
Ora. cctt. DB application online cctt1
Ora... tt1.srv application online cctt1
Ora... tt2.srv application online cctt2
Ora... TAF. CS application online cctt1
Ora... sm1.asm application online cctt1
Ora... t1.lsnr application online cctt1
Ora. cctt1.gsd application online cctt1
Ora. cctt1.ons application online cctt1
Ora. cctt1.vip application online cctt1
Ora... sm2.asm application online cctt2
Ora... t2.lsnr application online cctt2
Ora. cctt2.gsd application online cctt2
Ora. cctt2.ons application online cctt2
Ora. cctt2.vip application online cctt2