Что такое sid oracle
Что такое sid oracle
Identifying Which Session to Terminate
To identify which session to terminate, specify the session’s index number and serial number. To identify the index (SID) and serial number of a session, query the V$SESSION dynamic performance view.
������: ������ ��������=> Dallas,TX
���������: 347
A unique name for an Oracle instance. To switch between Oracle databases, users must specify the desired SID. The SID is included in the CONNECT DATA parts of the connect descriptor in a tnsnames.ora file, and in the definition of the network listener in a listener.ora file.
Instance
Every running Oracle database is associated with an Oracle instance. When a database is started on a database server (regardless of computer type), Oracle allocates a memory area called System Global Area (SGA) and starts an Oracle process. This combination of SGA and an Oracle process is called an instance. The memory and the process of an instance manage the associated database’s data efficiently and serve the one or more database users.
| ||||
Oleg Afanasiev Member Database Identification by Service Name Rather than SID Prior to Oracle8i, an Oracle database service was identified by an Oracle System Identifier (SID), a name that identifies a specific instance of a database. Clients connected to a database instance by specifying the SID in the connect descriptor. This naming scheme did not distinguish services from instances. In Oracle8i, a new naming scheme has been implemented. Because an Oracle database can span multiple computers, both the service as a whole and each of its instances are specified. A database service is now identified by its service name with the SERVICE_NAMES parameter in the initialization parameter file. SERVICE_NAMES specifies the name of the highest-level view of Oracle database service, which can span instances and nodes. SERVICE_NAMES is defaulted to the global database name, a name comprised of the database name (DB_NAME) and domain name (DB_DOMAIN). Что такое sid oracleThe database name is comprised of various strings and must contain only permitted characters. Review the following guidelines when selecting a database name. The database name input field sets the following Oracle initialization parameter values: In Oracle RAC environments, the database name ( DB_UNIQUE_NAME ) portion is a string of no more than 30 characters that can contain alphanumeric, underscore (_), dollar ($), and pound (#) characters, but must begin with an alphabetic character. No other special characters are permitted in a database name. The DB_NAME parameter for a database is set to the first 8 characters of the database name. The domain portion of the global database name ( DB_DOMAIN ) can be no more than 128 characters. Domain names using underscores (_) are not allowed. The values for DB_UNIQUE_NAME.DB_DOMAIN in its entirety must be unique within the enterprise. Database Name and ORACLE_SID The Oracle Service Identifier (SID) prefix is the first 8 characters of the database name. The SID prefix can contain only the characters a-z, A-Z, and 0-9. The SID prefix cannot contain operating system special characters, so if you use special characters in the first 8 characters of the database name, then these special characters are omitted in the SID prefix. There is a single SID prefix for every database. The SID prefix for a database must be unique within the cluster. Example 2-1 Global Database Name and Related Initialization Parameters 2 Identifying and Accessing the DatabaseThis chapter explains how databases are identified and how clients access them. This chapter contains the following topics: Understanding Database InstancesFigure 2-1 One Instance for Each Database
Some hardware architectures allow multiple computers to share access to data, software, or peripheral devices. Oracle Real Application Clusters (Oracle RAC) (Oracle RAC) can take advantage of such architecture by running multiple instances on different computers that share a single physical database. Figure 2-2 Multiple Instances Associated with an Oracle RAC Database
Understanding Database ServicesFigure 2-3 One Service for Each Database
A service name can identify multiple database instances, and an instance can belong to multiple services. For this reason, the listener acts as a mediator between the client and instances and routes the connection request to the appropriate instance. Clients connecting to a service need not specify which instance they require. Figure 2-4 shows clients connecting to multiple services associated with one database. Figure 2-4 Multiple Services Associated with One Database
Associating multiple services with one database enables the following functionality: A single database can be identified different ways by different clients. A database administrator can limit or reserve system resources. This level of control enables better allocation of resources to clients requesting one of these services. Oracle Database Administrator’s Guide for additional information about initialization parameters Oracle Database SQL Reference for additional information about the ALTER SYSTEM statement Oracle Database Reference for additional information about the SERVICE_NAMES parameter Oracle Database PL/SQL Packages and Types Reference for additional information about the DBMS_SERVICE package. Connecting to a Database ServiceThe following example shows the tnsnames.ora entry for the preceding Easy Connect connect descriptor and database service: This section contains the following topics: About Connect DescriptorsA connect descriptor is comprised of one or more protocol addresses of the listener and the connect information for the destination service in the tnsnames.ora file. Example 2-1 shows a connect descriptor mapped to the sales database. Example 2-1 Connect Descriptor As shown in Example 2-1, the connect descriptor contains the following parameters: The ADDRESS section contains the following: PROTOCOL parameter, which identifies the listener protocol address. The protocol is tcp for TCP/IP. The CONNECT_DATA section contains the following: INSTANCE_NAME parameter, which identifies the database instance. The instance name is optional. The INSTANCE_NAME parameter in the initialization parameter file defaults to the SID entered during installation or database creation. About IPv6 Addresses in Connect DescriptorsA host can use IP version 4 (IPv4) and IP version 6 (IPv6) interfaces. IPv6 addresses and host names that resolve to IPv6 addresses are usable in the HOST parameter of a TNS connect address, which can be obtained through any of the supported Net naming methods listed in Table 2-1. End-to-end connectivity using IPv6 in Oracle Database 11 g requires the following configuration: The client TNS connect address must connect to the Oracle Net Listener on the IPv6 endpoint. The database instance configured for Oracle Net Listener must listen for connection requests on IPv6 endpoints. For a given host name, Oracle Net attempts to connect to all IP addresses returned by Domain Name System (DNS) name resolution until a successful connection is established or all addresses have been attempted. Suppose that in Example 2-1 the sales-server host is an IPv4-only host that is accepting client connections. DNS maps sales-server to the following IP addresses: IPv6 address 2001:0DB8:0:0::200C:417A IPv4 address 192.168.2.213 In this case, Oracle Net first tries to connect on the IPv6 address because it is first in the DNS list. In this example sales-server does not support IPv6 connectivity, so this attempt fails. Oracle Net proceeds to connect to the IPv4 address, which succeeds. About the Protocol AddressThe preceding example shows a TCP/IP protocol address that specifies the host of the listener and a port number. Client connect descriptors configured with this same protocol address can send connection requests to this listener. About Service RegistrationSpecifying an Instance NameSpecifying a Service HandlerWhen the listener receives the client request, it selects one of the registered service handlers. Depending on the type of handler selected, the communication protocol used, and the operating system of the database server, the listener performs one of the following actions: Hands the connect request directly off to a dispatcher. Sends a redirect message back to the client with the location of the dispatcher or dedicated server process. The client then connects directly to the dispatcher or dedicated server process. Spawns a dedicated server process and passes the client connection to the dedicated server process. After the listener has completed the connection operation for the client, the client communicates directly with the Oracle database without the listener’s involvement. The listener resumes listening for incoming network sessions. The following are considerations when specifying service handlers: If database resident connection pooling is enabled on the server, then specify (SERVER=pooled) to get a connection from the pool. If database resident connection pooling is not enabled on the server, then the client request is rejected, and the user receives an error message. «Understanding Service Handlers» for a description about these service handler types «About the Listener and Connection Requests» for a discussion about how the listener works with service handlers Oracle Call Interface Programmer’s Guide and Oracle Database Administrator’s Guide for additional information about enabling and configuring database resident connection pooling Understanding Service HandlersService handlers act as connection points to an Oracle database. A service handler can be a shared server process or a dedicated server process, or pooled. This section contains the following topics: About DispatchersThe shared server architecture uses a dispatcher process to direct client connections to a common request queue. An idle shared server process from a shared pool of server processes picks up a request from the common queue. This approach enables a small pool of server processes to serve a large number of clients. A significant advantage of the shared server model over the dedicated server model is reduced system resources, enabling support of an increased number of users. The listener uses the dispatcher as a type of service handler to which it can direct client requests. When a client request arrives, the listener performs one of the following actions: Hands the connection request directly to a dispatcher. Issues a redirect message to the client, containing the protocol address of a dispatcher. The client then terminates the network session to the listener and establishes a network session to the dispatcher, using the network address provided in the redirect message. The listener uses direct hand off whenever possible. Redirect messages are used, for example, when dispatchers are remote to the listener. Figure 2-5 shows the listener handing a connection request directly to a dispatcher. The listener receives a client connection request. The listener hands the connect request directly to the dispatcher. The client is now connected to the dispatcher. Figure 2-5 Direct Hand-Off to a Dispatcher
Figure 2-6 shows the role of a dispatcher in a redirected connection. The listener receives a client connection request. The listener provides the location of the dispatcher to the client in a redirect message. The client connects directly to the dispatcher. Figure 2-6 Redirected Connection to a Dispatcher
About Dedicated Server ProcessesIn a dedicated server configuration, the listener starts a separate dedicated server process for each incoming client connection request dedicated to servicing the client. After the session is complete, the dedicated server process terminates. Because a dedicated server process has to be started for each connection, this configuration may require more system resources than shared server configurations. A dedicated server process is a type of service handler that the listener starts when it receives a client request. To complete a client/server connection, one of the following actions occurs: The dedicated server inherits the connection request from the listener. The dedicated server informs the listener of its listening protocol address. The listener passes the protocol address to the client in a redirect message and terminates the connection. The client connects to the dedicated server directly using the protocol address. One of the preceding actions is selected based on the operating system and the transport protocol. If the client and database exist on the same computer, then a client connection can be passed directly to a dedicated server process without going through the listener. This is known as a bequeath protocol. The application initiating the session spawns a dedicated server process for the connection request. This happens automatically if the application used to start the database is on the same computer as the database. In order for remote clients to connect to dedicated servers, the listener and the database instance must be running on the same computer. Figure 2-7 shows the listener passing a client connection request to a dedicated server process. The listener receives a client connection request. The listener starts a dedicated server process, and the dedicated server inherits the connection request from the listener. The client is now connected directly to the dedicated server. Figure 2-7 Connection to a Dedicated Server Process
Figure 2-8 shows the role of a dedicated server in a redirected connection. The listener receives a client connection request. The listener starts a dedicated server process. The listener provides the location of the dedicated server process to the client in a redirect message. The client connects directly to the dedicated server. Figure 2-8 Redirected Connection to a Dedicated Server Process
About Database Resident Connection PoolingDatabase resident connection pooling provides a connection pool in the database server for typical Web application usage scenarios in which an application acquires a database connection, works on it for a relatively short duration, and then releases it. Database resident connection pooling pools «dedicated» servers. A pooled server is the equivalent of a server foreground process and a database session combined. Database resident connection pooling complements middle-tier connection pools that share connections between threads in a middle-tier process. In addition, it enables sharing of database connections across middle-tier processes on the same middle-tier host and even across middle-tier hosts. This results in significant reduction in key database resources needed to support a large number of client connections, thereby reducing the database tier memory footprint and boosting the scalability of both middle-tier and database tiers. Having a pool of readily available servers has the additional benefit of reducing the cost of creating and closing client connections. Database resident connection pooling provides pooling for dedicated connection s across client applications and processes. This feature is useful for applications that must maintain persistent connections to the database and optimize server resources (such as memory). Clients obtaining connections out of the database resident connection pool are persistently connected to a background process, the connection broker, instead of the dedicated servers. The connection broker implements the pool functionality and performs the multiplexing of inbound connections from the clients to a pool of dedicated servers with sessions. When a client must perform database work, the connection broker picks up a dedicated server from the pool and assigns it to the client. Subsequently, the client is directly connected to the dedicated server until the request is served. After the server finishes processing the client request, the server goes back into the pool and the connection from the client is restored to the connection broker. Figure 2-9 Dedicated Server Processes Handling Connections Through the Connection Broker Process
Understanding Naming MethodsNetwork route to the service, including the location of the listener through a protocol address The following CONNECT command uses a connect string that has a complete connect descriptor as the connect identifier instead of a net service name. The string should be entered on a single line. It is shown on two lines because of page width. When net service name sales is used, connection processing takes place by first mapping sales to the connect descriptor. This mapped information is accessed by naming method s. The following naming methods are available: Easy Connect naming Choosing a Naming MethodSelecting the appropriate naming method for mapping names to connect descriptors depends upon the size of the organization. For a small organization with only a few databases, use Easy Connect naming to make TCP/IP connections with the host name of the database server or local naming to store names in tnsnames.ora file on the clients. For large organizations with several databases, use directory naming to store names in a centralized directory server. For an Internet network, configure the application Web servers needed to connect to the databases with the local naming method. Table 2-1 summarizes the relative advantages and disadvantages of each naming method and provides recommendations for using them in the network. Table 2-1 Naming Methods: Advantages and Disadvantages
|