The application workload can be defined as services in Oracle 10 Gb, also known as services. It can be used in a single instance or separately used and managed in RAC. Therefore, the entire database load can be divided into multiple different services. The management service can simplify the management of users or sessions. Second, the importance of services is reflected in RAC for load balancing and failover. This article describes what services are, the benefits of using services, and how to use services.
1. services and service_name
Services
For client applications, you only need to care about the services provided by the database, without knowing which database or instance it is connected.
Therefore, we can create one or more services on the database server for use by clients. It is a general term for one or more service_names.
For these services, Oracle registers them to the listener for external connection.
You can use lsnrctl status [listener_name] to view how many instances under the current service respond to the service.
You can also use lsnrctl service [listener_name] to view more detailed information, including the current connection status, ip address, and port number.
Service_name
The service name that the client connects to the instance. In Oracle 8i, the concept of service_name is proposed, which is usually used to replace ORACLE_SID in tnsnames. ora.
After 9i, we recommend that you use service_name instead of SID in Oracle.
Different user connections can be distinguished by defining different service names. The default format of this parameter is db_name.domain_name.
The following is the tnsnames. ora of a client. Two different connection identifiers use ORACLE_SID and one uses SERVICE_NAME. Both methods are feasible.
SYBO2SZ_SID =
(DESCRIPTION =
(ADDRESS =
(PROTOCOL = TCP)
(HOST = 192.168.7.2)
(PORT = 1915)
)
(CONNECT_DATA =
(ORACLE_SID = SYBO2SZ) # ORACLE_SID = <> or SID = <>
)
)
SYBO2SZ =
(DESCRIPTION =
(ADDRESS =
(PROTOCOL = TCP)
(HOST = 192.168.7.2)
(PORT = 1915)
)
(CONNECT_DATA =
(SERVICE_NAME = SYBO2SZ) # SERVICE_NAME is recommended after Oracle 9i
)
)