Configuring Oracle Database for Shared Server(updating)
2013-06-26 16:25
423 查看
Configuring Oracle Database for Shared Server(updating)
当数据库采用共享服务器形式的时候,客户端请求与数据库的连接分为如下几个步骤:
1)客户端请求与数据库进行连接,监听接受请求,然后分配一个负载比较低的dispatcher进行处理。
2)dispatcher接受到请求后就会把该客户端的请求放入sga的请求队列中。
3)位于large pool或是share pool的共享服务器进程进行开始处理请求队列中的客户端请求信息
4)共享服务器进行把处理完成的请求信息在放入相应队列中
6) 然后再把处理完毕的信息传达给dispatcher进程并开启了客户端与数据库的连接。
The dispatcher can support multiple client connections concurrently. Each client connection is bound to a
virtual circuit, which is a piece of shared memory used by the dispatcher for client database connection requests and replies. The dispatcher places a virtual circuit on a common queue when a request arrives.
另外监听器在共享服务器模式中担任了很大的角色,那就是pmon会定期检查dispatcher的负载情况,然后把地址信息和负载信息给监听进行注册,当客户端在进行连接的时候,监听起会分配一个负载相对较小的dispatcher进行处理。
share server 进程就是通过idle virtual circuit进行inbound和outbound的。
二)设置共享服务器常用的参数;
服务器内存允许在数据库运行状态下对相关参数进行动态修改(alter system)
1)shared_servers;设置共享服务器的最小进程,对于启动共享服务器这是必须要设置的参数,其他可以进行有效选择
2)max_shared_servers;设置共享服务器的最大可以同时启动的共享进程个数,如果指定了该参数,那么数据库会动态通过pmon进程动态开启一定数量和终止一定数据量的进程,但是不能高于该最大值,不能低于shared_servers设置的最小进程。如果没有指定该参数,那么数据库会根据系统memory和请求负载进行动态创建该进程,无最大要求。
3)shared_server_sessions;允许 共享服务器进程可以同时处理session的数量,该参数要和sessions参数具有相关性,如果设置了该参数,那么数据库也可以启动专用服务器模式进行客户端的请求处理工作。
4)dispatchers; 设置有多少个调度进程参与客户端的请求,该参数不能像share server进程那样可以自动管理。
5)max_dispatchers; 目前该参数被保留后续版本使用,设置调度进程的最大值。
6)circuits; 指定一个相当数据的虚电路来进行传输客户端链接的会话处理信息。
三) 开启共享服务器
1)只要shared_servers参数设置为一个非零的数字,那么共享服务器模式就会启动了,如果在参数文件中没有这个静态参数,查看该参数为1,那么共享服务器就开启了,并且会启动一个dispatcher进程。
eg:
SYS@conn#alter system reset shared_servers;
系统已更改。
SYS@conn#show parameter
shared_servers;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
max_shared_servers integer 3
shared_servers integer 1
SYS@conn#alter system reset max_shared_servers;
系统已更改。
SYS@conn#show parameter
max_shared_servers
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
max_shared_servers integer 3
SYS@conn#startup force
ORACLE 例程已经启动。
Total System Global Area
322240512 bytes
Fixed Size 1299652 bytes
Variable Size 197135164 bytes
Database Buffers 113246208 bytes
Redo Buffers 10559488 bytes
数据库装载完毕。
数据库已经打开。
SYS@conn#show parameter shared_servers;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
max_shared_servers integer
shared_servers integer 1
SYS@conn#
oracle@gbh-oracle:~> ps -ef | grep ora_s000_ORCL
oracle 23122 1 0 14:45 ? 00:00:00 ora_s000_ORCL
oracle 23505 23358 0 14:50 pts/0 00:00:00 grep ora_s000_ORCL
oracle@gbh-oracle:~>
eg:
oracle@gbh-oracle:~> exit
exit
SYS@conn#alter
system set shared_servers=0;
系统已更改。
SYS@conn#!ps
-ef | grep ora_s000_ORCL
oracle 23686 10911 0 14:53 pts/0 00:00:00 /bin/bash -c ps -ef | grep ora_s000_ORCL
oracle 23688 23686 0 14:53 pts/0 00:00:00 grep ora_s000_ORCL
SYS@conn#
注意: 1,为了版本兼容,如果shared-servers参数没有在参数文件中进行设置,但是dispatcher信息在参数文件中设置,那么共享服务器进程也会自动开启,默认值为1。可以再这个时候手动执行alter system命令设置为0,进行关闭。
2,如果shared_servers参数和dispatcher参数没有在参数文件中进行设置,那么通过alter system 设置dispatcher是无法启动共享服务器的,还必须设置shared_servers为一个不为0的数。上面的测试就是验证了这个信息。
2)对于max_shared_servers参数指定shared server进程被pmon创建的最大数量,如果没有指定该参数,那么这个数量基于两个限制,1个事process进程数目设置,第2个是系统资源。shared server j进程默认不会超过该数目,但是我们可以通过手动设置让pmon进程强制创建该进程数目。
eg:
SYS@conn#show parameter shared_servers
NAME
TYPE VALUE
------------------------------------ ----------- ------------------------------
max_shared_servers integer
shared_servers integer 0
SYS@conn#show parameter max_shared_servers
NAME
TYPE VALUE
------------------------------------ ----------- ------------------------------
max_shared_servers integer
SYS@conn#alter system set shared_servers=2;
系统已更改。
SYS@conn#alter
system set max_shared_servers=4;
系统已更改。
SYS@conn#show
parameter shared_servers
NAME
TYPE VALUE
------------------------------------ ----------- ------------------------------
max_shared_servers integer 4
shared_servers integer 2
SYS@conn#!ps -ef | grep ora_s
oracle 25295 1 0 15:13 ? 00:00:00 ora_smon_ORCL
oracle 25309 1 0 15:13 ? 00:00:00 ora_smco_ORCL
oracle 27409 1 0 15:45 ? 00:00:00 ora_s000_ORCL
oracle 27411 1 0 15:45 ? 00:00:00 ora_s001_ORCL
oracle 27450 27330 0 15:45 pts/0 00:00:00 /bin/bash -c ps -ef | grep ora_s
oracle 27452 27450 0 15:45 pts/0 00:00:00 /bin/bash -c ps -ef | grep ora_s
SYS@conn#alter
system set shared_servers=10;
系统已更改。
SYS@conn#show
parameter shared_servers;
NAME
TYPE VALUE
------------------------------------ ----------- ------------------------------
max_shared_servers integer 4
shared_servers integer 10
SYS@conn#!ps -ef | grep ora_s
oracle 25295 1 0 15:13 ? 00:00:00 ora_smon_ORCL
oracle 25309 1 0 15:13 ? 00:00:00 ora_smco_ORCL
oracle 27409 1 0 15:45 ? 00:00:00 ora_s000_ORCL
oracle 27411 1 0 15:45 ? 00:00:00 ora_s001_ORCL
oracle 27489 1 0 15:46 ? 00:00:00 ora_s002_ORCL
oracle 27491 1 0 15:46 ? 00:00:00 ora_s003_ORCL
oracle 27493 1 0 15:46 ? 00:00:00 ora_s004_ORCL
oracle 27495 1 0 15:46 ? 00:00:00 ora_s005_ORCL
oracle 27497 1 0 15:46 ? 00:00:00 ora_s006_ORCL
oracle 27499 1 0 15:46 ? 00:00:00 ora_s007_ORCL
oracle 27501 1 0 15:46 ? 00:00:00 ora_s008_ORCL
oracle 27503 1 0 15:46 ? 00:00:00 ora_s009_ORCL
oracle 27506 27330 0 15:46 pts/0 00:00:00 /bin/bash -c ps -ef | grep ora_s
SYS@conn#
l另外提的是,session=(1.1*processes)+5,在这里shared_server_sessions设置的同样和max_shared_servers受process限制一样。
3) 调度进程的设置。
eg:
当数据库采用共享服务器形式的时候,客户端请求与数据库的连接分为如下几个步骤:
1)客户端请求与数据库进行连接,监听接受请求,然后分配一个负载比较低的dispatcher进行处理。
2)dispatcher接受到请求后就会把该客户端的请求放入sga的请求队列中。
3)位于large pool或是share pool的共享服务器进程进行开始处理请求队列中的客户端请求信息
4)共享服务器进行把处理完成的请求信息在放入相应队列中
6) 然后再把处理完毕的信息传达给dispatcher进程并开启了客户端与数据库的连接。
The dispatcher can support multiple client connections concurrently. Each client connection is bound to a
virtual circuit, which is a piece of shared memory used by the dispatcher for client database connection requests and replies. The dispatcher places a virtual circuit on a common queue when a request arrives.
另外监听器在共享服务器模式中担任了很大的角色,那就是pmon会定期检查dispatcher的负载情况,然后把地址信息和负载信息给监听进行注册,当客户端在进行连接的时候,监听起会分配一个负载相对较小的dispatcher进行处理。
share server 进程就是通过idle virtual circuit进行inbound和outbound的。
二)设置共享服务器常用的参数;
服务器内存允许在数据库运行状态下对相关参数进行动态修改(alter system)
1)shared_servers;设置共享服务器的最小进程,对于启动共享服务器这是必须要设置的参数,其他可以进行有效选择
2)max_shared_servers;设置共享服务器的最大可以同时启动的共享进程个数,如果指定了该参数,那么数据库会动态通过pmon进程动态开启一定数量和终止一定数据量的进程,但是不能高于该最大值,不能低于shared_servers设置的最小进程。如果没有指定该参数,那么数据库会根据系统memory和请求负载进行动态创建该进程,无最大要求。
3)shared_server_sessions;允许 共享服务器进程可以同时处理session的数量,该参数要和sessions参数具有相关性,如果设置了该参数,那么数据库也可以启动专用服务器模式进行客户端的请求处理工作。
4)dispatchers; 设置有多少个调度进程参与客户端的请求,该参数不能像share server进程那样可以自动管理。
5)max_dispatchers; 目前该参数被保留后续版本使用,设置调度进程的最大值。
6)circuits; 指定一个相当数据的虚电路来进行传输客户端链接的会话处理信息。
三) 开启共享服务器
1)只要shared_servers参数设置为一个非零的数字,那么共享服务器模式就会启动了,如果在参数文件中没有这个静态参数,查看该参数为1,那么共享服务器就开启了,并且会启动一个dispatcher进程。
eg:
SYS@conn#alter system reset shared_servers;
系统已更改。
SYS@conn#show parameter
shared_servers;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
max_shared_servers integer 3
shared_servers integer 1
SYS@conn#alter system reset max_shared_servers;
系统已更改。
SYS@conn#show parameter
max_shared_servers
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
max_shared_servers integer 3
SYS@conn#startup force
ORACLE 例程已经启动。
Total System Global Area
322240512 bytes
Fixed Size 1299652 bytes
Variable Size 197135164 bytes
Database Buffers 113246208 bytes
Redo Buffers 10559488 bytes
数据库装载完毕。
数据库已经打开。
SYS@conn#show parameter shared_servers;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
max_shared_servers integer
shared_servers integer 1
SYS@conn#
oracle@gbh-oracle:~> ps -ef | grep ora_s000_ORCL
oracle 23122 1 0 14:45 ? 00:00:00 ora_s000_ORCL
oracle 23505 23358 0 14:50 pts/0 00:00:00 grep ora_s000_ORCL
oracle@gbh-oracle:~>
eg:
oracle@gbh-oracle:~> exit
exit
SYS@conn#alter
system set shared_servers=0;
系统已更改。
SYS@conn#!ps
-ef | grep ora_s000_ORCL
oracle 23686 10911 0 14:53 pts/0 00:00:00 /bin/bash -c ps -ef | grep ora_s000_ORCL
oracle 23688 23686 0 14:53 pts/0 00:00:00 grep ora_s000_ORCL
SYS@conn#
注意: 1,为了版本兼容,如果shared-servers参数没有在参数文件中进行设置,但是dispatcher信息在参数文件中设置,那么共享服务器进程也会自动开启,默认值为1。可以再这个时候手动执行alter system命令设置为0,进行关闭。
2,如果shared_servers参数和dispatcher参数没有在参数文件中进行设置,那么通过alter system 设置dispatcher是无法启动共享服务器的,还必须设置shared_servers为一个不为0的数。上面的测试就是验证了这个信息。
2)对于max_shared_servers参数指定shared server进程被pmon创建的最大数量,如果没有指定该参数,那么这个数量基于两个限制,1个事process进程数目设置,第2个是系统资源。shared server j进程默认不会超过该数目,但是我们可以通过手动设置让pmon进程强制创建该进程数目。
eg:
SYS@conn#show parameter shared_servers
NAME
TYPE VALUE
------------------------------------ ----------- ------------------------------
max_shared_servers integer
shared_servers integer 0
SYS@conn#show parameter max_shared_servers
NAME
TYPE VALUE
------------------------------------ ----------- ------------------------------
max_shared_servers integer
SYS@conn#alter system set shared_servers=2;
系统已更改。
SYS@conn#alter
system set max_shared_servers=4;
系统已更改。
SYS@conn#show
parameter shared_servers
NAME
TYPE VALUE
------------------------------------ ----------- ------------------------------
max_shared_servers integer 4
shared_servers integer 2
SYS@conn#!ps -ef | grep ora_s
oracle 25295 1 0 15:13 ? 00:00:00 ora_smon_ORCL
oracle 25309 1 0 15:13 ? 00:00:00 ora_smco_ORCL
oracle 27409 1 0 15:45 ? 00:00:00 ora_s000_ORCL
oracle 27411 1 0 15:45 ? 00:00:00 ora_s001_ORCL
oracle 27450 27330 0 15:45 pts/0 00:00:00 /bin/bash -c ps -ef | grep ora_s
oracle 27452 27450 0 15:45 pts/0 00:00:00 /bin/bash -c ps -ef | grep ora_s
SYS@conn#alter
system set shared_servers=10;
系统已更改。
SYS@conn#show
parameter shared_servers;
NAME
TYPE VALUE
------------------------------------ ----------- ------------------------------
max_shared_servers integer 4
shared_servers integer 10
SYS@conn#!ps -ef | grep ora_s
oracle 25295 1 0 15:13 ? 00:00:00 ora_smon_ORCL
oracle 25309 1 0 15:13 ? 00:00:00 ora_smco_ORCL
oracle 27409 1 0 15:45 ? 00:00:00 ora_s000_ORCL
oracle 27411 1 0 15:45 ? 00:00:00 ora_s001_ORCL
oracle 27489 1 0 15:46 ? 00:00:00 ora_s002_ORCL
oracle 27491 1 0 15:46 ? 00:00:00 ora_s003_ORCL
oracle 27493 1 0 15:46 ? 00:00:00 ora_s004_ORCL
oracle 27495 1 0 15:46 ? 00:00:00 ora_s005_ORCL
oracle 27497 1 0 15:46 ? 00:00:00 ora_s006_ORCL
oracle 27499 1 0 15:46 ? 00:00:00 ora_s007_ORCL
oracle 27501 1 0 15:46 ? 00:00:00 ora_s008_ORCL
oracle 27503 1 0 15:46 ? 00:00:00 ora_s009_ORCL
oracle 27506 27330 0 15:46 pts/0 00:00:00 /bin/bash -c ps -ef | grep ora_s
SYS@conn#
l另外提的是,session=(1.1*processes)+5,在这里shared_server_sessions设置的同样和max_shared_servers受process限制一样。
3) 调度进程的设置。
Attribute | Description |
---|---|
ADDRESS | Specify the network protocol address of the endpoint on which the dispatchers listen. |
DESCRIPTION | Specify the network description of the endpoint on which the dispatchers listen, including the network protocol address. The syntax is as follows: (DESCRIPTION=(ADDRESS=...)) |
PROTOCOL | Specify the network protocol for which the dispatcher generates a listening endpoint. For example: (PROTOCOL=tcp) |
CONNECTIONS | Specify the maximum number of network connections to allow for each dispatcher. |
SESSIONS | Specify the maximum number of network sessions to allow for each dispatcher. |
TICKS | Specify the duration of a TICK in seconds. A TICK is a unit of time in terms of which the connection pool timeout can be specified. Used for connection pooling. |
LISTENER | Specify an alias name for the listeners with which the PMON process registers dispatcher information. Set the alias to a name that is resolved through a naming method. |
MULTIPLEX | Used to enable the Oracle Connection Manager session multiplexing feature. |
POOL | Used to enable connection pooling. |
SERVICE | Specify the service names the dispatchers register with the listeners. |
DISPATCHERS | Specify the initial number of dispatchers to start. |
相关文章推荐
- oracle直接读写ms sqlserver数据库(一)如何下载oracle database gateway for sqlserver
- Configuring vCenter Server Virtual Appliance to use an Oracle database
- Oracle学习系列—Oracle透明网关 for SQL Server
- use ROW_NUMBER() for pagination in Oracle and SQLServer
- DB太大?一键帮你收缩所有DB文件大小(Shrink Files for All Databases in SQL Server)
- Oracle Database Server Architecture: Overview
- Oracle Dedicated server 和 Shared server(专用模式 和 共享模式) 说明
- Oracle Database Server Messages(二) .
- Configuring raw devices (multipath) for Oracle Clusterware 10g Release 2 (10.2.0) on RHEL5-OEL5 [ID
- Oracle WebLogic Server Active GridLink for Oracle Real Application Clusters (RAC) - 1
- 一台pc机win2k上已装了for unix 的oracle817客户端,再安装for NT的oracle817 server?
- Oracle 数据库服务器(database server)、数据库(database)、数据库实例(database instance|instance)
- Create a SQL Server Database on a network shared drive
- ORACLE 11g 透明网关 for SQL Server 安装配置
- Restore SQL Server 2005 error : "The tail of the log for the database "TEST1" has not been backed up."
- Configuring SQL Server 2008 for remote access
- ORACLE的dedicated server和shared server
- Database:在Win2000 Server上彻底卸载Oracle 8.17(转贴)
- Sample Databases for SQL Server 2000/2005
- 【网摘】Oracle Dedicated server 和 Shared server(专用模式 和 共享模式) 说明