Monitor:
Personal understanding: Originally wanted to configure the TNS total by the scan IP 12545, then through the VIP to configure TNS
The monitoring of the 11g RAC is created during installation and is monitored by the grid user, and the Listener.ora file is in the $oracle_home/network/admin directory. There are ASM instances and DB instances in the RAC.
[Email protected] ~]$ sqlplus "/as sysasm"
Sql> show parameter Listen;
NAME TYPE VALUE
---------------- ----------- ------------------------------
Listener_networks string
Local_listener string (description= (address_list= (address= (protocol=tcp) (host=node1-vip) (port=15 21)))
Remote_listener string
[Email protected] ~]$ sqlplus "/as sysasm"
Sql> show parameter Listen;
NAME TYPE VALUE
---------------- ----------- ------------------------------
Listener_networks string
Local_listener string (description= (address_list= (address= (protocol=tcp) (host=node2-vip) (port=15 21)))
Remote_listener string
To view the listening status:
Node 1:
[Email protected] ~]$ lsnrctl status
Lsnrctl for linux:version 11.2.0.1.0-production on 18-jan-2016 06:09:17
Copyright (c) 1991, Oracle. All rights reserved.
Connecting to (Description= (address= (PROTOCOL=IPC) (Key=listener)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version Tnslsnr for Linux:version 11.2.0.1.0-production
Start Date 18-jan-2016 00:15:53
Uptime 0 days 5 hr. Min. sec
Trace level off
Security on:local OS Authentication
SNMP OFF
Listener Parameter File/u01/11.2.0/grid/network/admin/listener.ora
Listener Log File/u01/app/oracle/diag/tnslsnr/node1/listener/alert/log.xml
Listening Endpoints Summary ...
(Description= (address= (PROTOCOL=IPC) (Key=listener)))
(Description= (address= (protocol=tcp) (host=127.0.0.1) (port=1521)))
(Description= (address= (protocol=tcp) (host=192.168.56.201) (port=1521)))
Services Summary ...
Service "+asm" has 1 instance (s).
Instance "+asm1", status ready, have 1 handler (s) for the This service ...
Service "RACDB" has 1 instance (s).
Instance "RACDB1", status ready, have 1 handler (s) for the This service ...
Service "Racdbxdb" has 1 instance (s).
Instance "RACDB1", status ready, have 1 handler (s) for the This service ...
(Red section, if the host in the DB instance does not have a VIP address configured, it will not be displayed)
The command completed successfully
Node 2:
[Email protected] ~]$ lsnrctl status
Lsnrctl for linux:version 11.2.0.1.0-production on 18-jan-2016 06:10:51
Copyright (c) 1991, Oracle. All rights reserved.
Connecting to (Description= (address= (PROTOCOL=IPC) (Key=listener)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version Tnslsnr for Linux:version 11.2.0.1.0-production
Start Date 18-jan-2016 00:15:54
Uptime 0 days 5 hr. Min. sec
Trace level off
Security on:local OS Authentication
SNMP OFF
Listener Parameter File/u01/11.2.0/grid/network/admin/listener.ora
Listener Log File/u01/app/oracle/diag/tnslsnr/node2/listener/alert/log.xml
Listening Endpoints Summary ...
(Description= (address= (PROTOCOL=IPC) (Key=listener)))
(Description= (address= (protocol=tcp) (host=127.0.0.1) (port=1521)))
(Description= (address= (protocol=tcp) (host=192.168.56.202) (port=1521)))
Services Summary ...
Service "+asm" has 1 instance (s).
Instance "+asm2", status ready, have 1 handler (s) for the This service ...
Service "RACDB" has 1 instance (s).
Instance "RACDB2", status ready, have 1 handler (s) for the This service ...
Service "Racdbxdb" has 1 instance (s).
Instance "RACDB2", status ready, have 1 handler (s) for the This service ...
The command completed successfully
To view the listener configuration for an Oracle instance:
[Email protected] ~]$ sqlplus "/as sysdba"
Sql> show parameter listen;
NAME TYPE &NBS P value
----------------- -----------------------------------------
Listener_networks string , &NB Sp (this location cannot be configured for scan IP , tried not to line, originally wanted to configure TNS via scan IP
Local_listener string & nbsp (Description= (address_list= (address= (protocol=tcp) (Host=node2-vip ) (port= 1521)))
Remote_listener string rac-scan:1521
[Email protected] ~]$ sqlplus "/as sysdba"
Sql> show parameter Listen;
NAME TYPE VALUE
----------------- ----------- ------------------------------
Listener_networks string
Local_listener string (description= (address_list= (address= (protocol=tcp) (host=node1-vip) (PORT =1521))))
Remote_listener string rac-scan:1521
You can modify the parameters by using the following statement:
alter system set Local_listener = ' (description= (address_list= (address= (protocol=tcp) (HOST=NODE1-VIP) (port=1521 ))) ' Scope=both sid= ' RACDB1 ';
alter system register;
TNS:The first type:
RAC =
(DESCRIPTION =
(Address_list =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.56.201) (PORT = 1521))
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.56.202) (PORT = 1521))
)
(Connect_data =
(service_name = racdb)
)
)
In this case, the connected instance hangs and disconnects the other instance.
The second type: TAF (Transparent application Failover):
11g Document location: Database administration->network management->local naming Parameters (Tnsname.ora),
Search Retries->oracle Database Net Services Administrator ' s Guide
Basic:rac=
(description=
(Address_list =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.56.201) (PORT = 1521))
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.56.202) (PORT = 1521))
)
(load_balance = ON)
(Connect_data=
(SERVICE_NAME=RACDB)
(failover_mode=
(Type=select) – There are session and select (select Query 1w, return 1k, hang up, reconnect return 9k,session) two
(Method=basic)
(RETRIES=20)
(delay=15)
)
)
)
--If the connected instance hangs, reestablish the connection without first disconnecting.
Preconnect:
rac1=
(description=
(address=
(PROTOCOL=TCP)
(host=192.168.56.201)
(port=1521))
(Connect_data=
(SERVICE_NAME=RACDB)
(INSTANCE_NAME=RACDB1)
(failover_mode=
(BACKUP=RAC2)
(Type=select)
(Method=preconnect))))
Rac2=
(description=
(address=
(PROTOCOL=TCP)
(host=192.168.56.201)
(port=1521))
(Connect_data=
(SERVICE_NAME=RACDB)
(Instance_name=sales2)
(failover_mode=
(BACKUP=RACDB2)
(Type=select)
(Method=preconnect))))
-Switch fast, but waste resources. Establish the connection first.
The above way for the client, the following way for the server side.
Third: Create a service (Oracle user)
Srvctl add service–d racdb–s haha–r ' racdb2,racdb1 ' –P basic
Start the service
Srvctl Start Service–d racdb–s HAHA
Show parameter service; haha is not racdb.
Modify by function
Begin
Dbms_service.modify_service (service_name = ' HAHA ',
Failover_method = ' Dbms_service.failover_method_basic ',
Failover_type = ' Dbms_service.failover_type_select ',
Failover_retries = 180,
Failover_delay = 5);
End
View service process: Crs_stat-t list with no haha process
Client Configuration TNS
Rac-taf =
(DESCRIPTION =
(Address_list =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.56.201) (PORT = 1521))
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.56.202) (PORT = 1521))
)
(Connect_data =
(service_name = HAHA)
)
)
Srvctl
Srvctl Status Database–d racdb
Srvctl Status Instance–d racdb–i RACDB1
Srvctl Stop Instance–d racdb–i RACDB2
RAC Monitoring and TNS