userdof limit exceededd...

机器翻滴垃圾!一派胡言!
您的举报已经提交成功,我们将尽快处理,谢谢!
客户未能超出限制(client_failure_limit_exceeded)。.
从您的IP地址太多的请求(11.68.222。三十)都失败了。
请确认服...
可能你的信息被上传了
打开msconfig给关掉
大家还关注
(window.slotbydup=window.slotbydup || []).push({
id: '2081942',
container: s,
size: '1000,60',
display: 'inlay-fix'思静极的QQ空间-使用mod_cband管理Apache2带宽和流量-腾讯博客-Qzone
思静极的博客
http://6959114.
不要用你的美貌,挑战我的智慧!
转载到我空间
复制本文网址 隐藏签名档 小字体
使用mod_cband管理Apache2带宽和流量
评论/阅读(/)
本文地址: /blog/0817461
mod_cband是一个通过Apache 2模块来解决限制用户和虚拟主机带宽问题的应用,当前版本可以调整虚拟主机和用户带宽限额,最高下载速度(like in mod_bandwidth),每秒访问请求速度和最高并发访问ip连接数(like in mod_limitipconn)。 安装 wgettar cd mod_cband-0.9.7.3./configure --with-apxs=/usr/local/apache2/bin/apxsmake sudo make install安装完成后会提示: [activating module `cband’ in /usr/local/etc/apache2/httpd.conf]此时cband_module已经自动添加到你的httpd.conf文件中并开启了。 最好手动检查,下面的语句是否存在: LoadModule cband_module&&&&&& modules/mod_cband.so配置mod_cband下面的指令全部在httpd.conf中更改。 各种指令中可以使用的单位:传输速度限制单位: kbps, Mbps, Gbps- 每秒传输的比特数, 分别为: 24 和 24 bps kb/s , MB/s, Gb/s-每秒传输的字节数, 分别为: 24 和 24 b/s 默认单位是kbps 传输容量限额单位: K,M,G- 分别为: 00 和 00 字节 Ki,Mi,Gi - 分别为: 24 和 24 字节 默认单位是K 时间限额单位: S , M , H , D, W- 秒,分钟,小时,天,周; 分别为: 1,60,,604800 秒 默认单位是秒 指令详解指令名称:CBandDefaultExceededURL描 述:指定当mod_cband侦测到发生虚拟主机或用用传输超限发生成,将把所有客户发起的请求重定向到的网址 注 意: 如果你没有指定要跳转的URL,则发送标准 503:Service Unavailable出错信息 配置位置: Server config 语 法: CBandDefaultExceededURL URL 指令名称:CBandDefaultExceededCode描 述:当超限发生时,发给用户的http错误码 配置位置:Server config 语 法:CBandDefaultExceededCode HTTP_CODE 例 子:CBandDefaultExceededCode 509 指令名称:CBandScoreFlushPeriod描 述:为虚拟主机或用户设定一个请求数阀值,在达到阀值时将把请求数写到scoreboard文件中。 使用这个参数将有助于提高mod_cband的性能。 默 认 值:1 配置位置:Server config 语 法:CBandScoreFlushPeriod number_of_requests(请求数) 例 子:CBandScoreFlushPeriod 100 任意虚拟主机或用户,在达到指定的请求数之后,将被记入scoreboard 指令名称:CBandSpeed描 述:为虚拟主机设定最大传输速度 配置位置:&Virtualhost& 语 法:CBandSpeed kbps rps max_conn kbps - 最大的传输速度:[kMG]bps 或都[kMG]B/srps&&- 每秒的最大请求数max_conn- 最大并发连接数例 子:CBandSpeed
设定最大传速度为: 1024kbps (每秒
位元), 最大每秒 10个请求和 最多30个并发连接 注 意:从 0.9.6.0 版开始支持这个功能 指令名称:CBandRemoteSpeed描 述:指定任意远程客户端的最大速度 配置位置:&Virtualhost& 语 法:CBandRemoteSpeed kbps rps max_conn kpbs - 最大传输速度: [kMG] bps 或 [kMG] B/srps -&&每秒的最大请求数max_conn- 最大并发连接例 子:BandRemoteSpeed 20kb/s 33 最大速度为 20kB/s(20*1024 bytes/秒), 每秒最多接受2个远端客户请求和 3个并发连接 注 意:从 0.9.6.1-rc2开始支持这个功能 指令名称:CBandClassRemoteSpeed描 述:为特定地址段的远端客户指定最大的速度 配置位置:&Virtualhost& 语 法:CBandClassRemoteSpeed class_name kpbs rps &&&&&& class_name- 已定义的地址类名&&&&&& kbps - 最大传输速度:kbps或kB/s&&&&&& rps- 每秒的最大请求数&&&&&& max_conn- 最大并发连接数例 子:&CBandClass googlebot_class& &&&&&& CBandClassDst 66.249.64/24&&&&&& CBandClassDst 66.249.65/24&&&&&& CBandClassDst 66.249.79/24&& &/CBandClass&&& CBandClassRemoteSpeed googlebot_class 20kb/s 23&&&&&&设定最大的传输速度为: 20kB/s( 20*1024bytes/s), 在指了地址范围内(googlebot_class)的远端客户中,每秒只接受2个请求和 3并发连接 注 意:从 0.9.6.1-rc 2开始支持这一功能 指令名称:CBandRandomPulse描 述:r.p.g.开关 r.p.g.是mod_cband速度限制的一种方式。它指定了连接检测采样的方式。打开此功能,将持续滚动采样。如果带宽和CPU占用不稳定的时候,关掉此功能。 配置位置:Global 语 法:CBandRandomPulse ON/OFF 指令名称:CBandLimit描 述:限制虚拟主机的流量 配置位置:&Virtualhost& 语 法:CBandLimit limit &&&&&&&&&&&&流量限制单位,可以用K、M、G、Ki、Mi、Gi例 子:CBandLimit 10M 限制流量为10M CBandLimit 10Mi 限制流量为10Mi:10*bytes 指令名称:CBandClassLimit描 述:定义虚拟主机目标类别的流量 配置位置: &Virtualhost& 语 法:CBandClassLimit class_name limit &&&&&&&&&&&& class_name- 已定义的类别名称&&&&&&&&&&&& limit - 流量限制单位,可以用K、M、G、Ki、Mi、Gi指令名称:CBandExceededURL描 述: 指定当虚拟主机超出带宽或流量时,跳转的URL。提示:如果没有配置此项,将发送标准的503。 配置位置: &Virtualhost& 语 法:CBandExceededURL 网址 指令名称:CBandExceededSpeed描 述: 定义当虚拟主机流量或带宽超出限制时,mod_cband将调节的最大速度 配置位置: &Virtualhost& 语 法:CBandExceededSpeed kbps rps max_conn &&&&&&&&&&&& kbps - 最大传送速度,kbps或kB/s&&&&&&&&&&&& rps- 每秒最大请求数&&&&&&&&&&&& max_conn- 最大并发连接数注 意: 从 0.9.6.0 开始支持指令名称:CBandScoreboard描 述:指定虚拟主机的scoreboard文件 配置位置:&Virtualhost& 语 法:CBandScoreboard path 注 意: 路径对于Apache用户必须可写 指令名称:CBandPeriod描 述:定义虚拟主机使用情况重置的周期 配置位置:&Virtualhost& 语 法:CBandPeriod period &&&&&&&&&&&& 可用单位:S(秒)、M(分)、H(小时)、D(天)、W(周)例 子:CBandPeriod 1W //每周重置 &&&&&&&&&&&& CBandPeriod 14D //每14天重置&&&&&&&&&&&& CBandPeriod 60M //每小时重置&&&&&&指令名称:CBandPeriodSlice描 述:定义CBandPeriod周期内,分部分计算的时间长度 默 认 值:slice_len=limit 配置位置:&Virtualhost& 语 法:CBandPeriodSlice slice_length 例 子:CBandLimit 100G &&&&&&&&&&&& CBandPeriod 4W&&&&&&&&&&&& CBandPeriodSlice 1W一个周期将被分成4个小部分(4周/1周=4)。每部分限制流量100G/4=25G。一周之后slice限制将是50G,两周后将是75G... 指令名称:&CBandUser&描 述:定义一个新的 cband 用户 配置位置:Server config 语 法:&CBandUser user_name&指令名称:CBandUserSpeed描 述:定义cband用户的最大带宽 配置位置:&CBandUser& 语 法:CBandUserSpeed 每秒千个位元组 rps max_conn &&&&&&&&&&&& kbps - 最大速度:kbps或者kb/s&&&&&&&&&&&& rps- 每秒请求数&&&&&&&&&&&& max_conn- 最大连接数例 子:CBandUserSpeed 100kb/s 105 定义用户的最大熟读为100kB/s,每秒最多10个请求,最大连接数为5 注 意:从 0.9.6.0 开始支持指令名称:CBandUserLimit描 述:指定cband user的流量 配置位置:&CBandUser& 语 法:CBandUserLimit limit &&&&&&&&&&&& limit - 流量可用单位K、M、G、Ki、Mi、Gi例 子: CBandUserLimit 10M指定用户流量为10MCBandUserLimit 10Mi指定用户流量为10Mi指令名称:CBandUserClassLimit描 述: 指定cband user类的流量 配置位置:&CBandUser& 语 法:CBandUserClassLimit class_name limit &&&&&&&&&&&& class_name- 类名称&&&&&&&&&&&& limit - 流量大小单位,可用K、M、G、Ki、Mi、Gi指令名称:CBandUserExceededURL描 述: 指定当cband user超出限制时,跳转的URL 注 意: 如果没有定义此项,将发送标准的503 配置位置:&CBandUser& 语 法:CBandUserExceededURL URL 指令名称:CBandUserExceededSpeed描 述: 定义当cband user超出限制时,mod_cband将调节的速度 注 意:只有当CBandUserExceededURL没有设定时,此项才生效 配置位置:&CBandUser& 语 法:CBandUserExceededSpeed kbps rps max_conn &&&&&&&&&&&& kbps - 最大速度:kpbs或kb/s&&&&&&&&&&&& rps- 每秒请求数&&&&&&&&&&&& max_conn- 最大并发数注 意:从 0.9.6.0 开始支持 指令名称:CBandUserScoreboard描 述: 定义用户的scoreboard文件 配置位置:&CBandUser& 语 法:CBandUserScoreboard path 注 意:目录必须允许apache用户写入 指令名称:CBandUserPeriod描 述: 定义cband user计算周期 配置位置:&CBandUser& 语 法:CBandUserPeriod period &&&&&&&&&&&& period - 可用单位S(秒)、M(分)、H(小时)、D(天)、W(周)例 子: CBandUserPeriod 1W &&&&&&&&&&&& CBandUserPeriod 14D&&&&&&&&&&&& CBandUserPeriod 60M&&&&&&指令名称:CBandUserPeriodSlice描 述:定义CBandUserPeriod的分割 默 认 值:slice_len=limit 配置位置:&CBandUser& 语 法:CBandUserPeriodSlice slice_length 例 子:CBandUserLimit 100G &&&&&&&& CBandUserPeriod 4W&&&&&&&& CBandUserPeriodSlice 1WCBandUserPeriod将被分割成4个部分(4W/1W=4)。每部分限制流量100G/4=25G。一周之后部分限制将为50G,两周后为75G... 状态管理配置实例如果要观察实时的流量、使用情况、用户、scoreboard,添加以下内容到配置文件: &Location /cband-status&&&&&&&SetHandler cband-status&/Location&&Location /cband-status-me&&&&&&&SetHandler cband-status-me&/Location&这样,你就可以通过以下地址来访问 在0.9.5-rc1之后的版本中,可以通过XML格式来观察流量带宽配置实例&VirtualHost *:80&&& DocumentRoot /var/www/xyz.org/&& ServerName xyz.org&& CustomLog /var/log/apache2/xyz.org.access combined&& ErrorLog /var/log/apache2/xyz.org.access.error&& RewriteEngine On&& RewriteOptions inherit&& # 本虚拟机最大带宽为:1024kbps&& # 本虚拟机每秒最多能接受10个请求&& # 本虚拟机最多30个并发连接&& CBandSpeed &&&& # 每个远程客户端最大带宽10kB/s,每秒最多3个请求,最大连接为2个&& CBandRemoteSpeed 10kb/s 3 2&&&& # 对于googlebot_class类的远程用户,最大带宽为20kB/s,每秒最多2个请求,最大连接为3个&& CBandClassRemoteSpeed googlebot_class 20kb/s 2 3&/VirtualHost&流量限制配置实例按虚拟主机进行流量配置下面,你可以订制虚拟主机的流量限制、URL和scoreboard文件 # 定义超出流量之后跳转的URLCBandDefaultExceededURLCBandDefaultExceededURL&&&&http:// haha.org/bandwidth_exceeded.html&VirtualHost *:80&&& DocumentRoot /var/www/xyz.org/&& ServerName xyz.org&& CustomLog /var/log/apache2/xyz.org.access combined&& ErrorLog /var/log/apache2/xyz.org.access.error&& RewriteEngine On&& RewriteOptions inherit&& # 流量限制为100M&& CBandLimit 100000&& # 当超过流量时,跳转URL到&& CBandExceededURL && # 虚拟主机的scoreboard文件&& CBandScoreboard /var/run/apache2/xyz.org.scoreboard&&&& # scoreboard清空周期(30分钟),仅在0.9.5-rc2之后版本支持&& CBandPeriod 30M&/VirtualHost&按用户指定流量在0.9.1版之后,你可以指定用户限制然后将虚拟主机分配给用户 # 定义用户‘dembol’&CBandUser dembol&&& # 限制用户'dembol'的流量为200MB&& CBandUserLimit 200000&& # 如果用户超出限制,跳转到URLhttp://abc.org/bandwidth_exceeded.html&& CBandUserExceededURL && # 用户的scoreboard文件&& CBandUserScoreboard /var/run/apache2/dembol.scoreboard&&&& # 清空scoreboard的周期&& # (only in &=0.9.5-rc2)&& CBandUserPeriod 5W&/CBandUser&# 将虚拟主机‘xyz.org’分配给‘dembol’用户&VirtualHost *:80&&& ServerName xyz.org&& # 指定虚拟主机的所有者&& CBandUser dembol&/VirtualHost&# 将虚拟主机‘aga.org’分配给‘dembol’用户&VirtualHost *:80&&& ServerName aga.org&& # 指定虚拟主机的所有者&& CBandUser dembol&/VirtualHost&按用户和虚拟主机混合方式指定流量和带宽在0.9.1版之后,你可以混合用户和虚拟主机方式来指定流量和带宽 # 定义用户 “dembol”&CBandUser dembol&&& # “dembol”用户流量限制为200MB&& CBandUserLimit 200000&& #如果超出限制,跳转到URLhttp://abc.org/bandwidth_exceeded.html&& CBandUserExceededURL && # 用户的scoreboard文件&& CBandUserScoreboard /var/run/apache2/dembol.scoreboard&&&& # 清空scoreboard的周期(4天)&& # (only in &=0.9.5-rc2)&& CBandUserPeriod 4D&/CBandUser&# 将虚拟主机“xyz.org”分配给用户“dembol”&VirtualHost *:80&&& ServerName xyz.org&& # 指定虚拟主机的所有者&& CBandUser dembol&&&& # 限制此虚拟主机流量为100MB&& CBandLimit 100000&& # 如果超出限制,跳转到URLhttp://abc.org/bandwidth_exceeded.html&& CBandExceededURL && # 虚拟主机的scoreboard文件&& CBandScoreboard /var/run/apache2/xyz.org.scoreboard&&&& # a period of time after which the scoreboard will be cleared (50 minutes)&& #清空scoreboard的周期(50分钟)&& CBandPeriod 50M&/VirtualHost&# 将虚拟主机“aga.org”分配给用户“dembol”&VirtualHost *:80&&& ServerName aga.org&& #指定虚拟主机的所有者&& CBandUser dembol&/VirtualHost&按远程目标指定流量和带宽在0.9.5-rc1之后,你可以通过来定义远程目标类来指定类的流量和带宽。同时也可以定义CBandClassLimit和CBandUserClassLimit来定义不同的类 # define &class_1&&CBandClas class_1&&& CBandClassDst 217.172.231.67&& CBandClassDst 127/8&& CBandClassDst 192.168.0.0/24&& CBandClassDst 10.0.0.20&/CBandClass&# 定义 'class_2'&CBandClas class_2&&& CBandClassDst 192.168.100.100&& CBandClassDst 153.19/16&/CBandClass&&CBandUser dembol&&& CBandUserLimit 1000000&& CBandUserExceededURL http:// edns.pl/bandwidth_exceeded.html&& CBandUserScoreboard/home/ dembol/write/user.dembol.scoreboard&&&& # &class_2&限制流量500MB&& CBandUserClassLimit class_2 500000&/CBandUser&&VirtualHost*:80&&& ...&& CBandUser dembol&&&& # &class_1&限制流量1GB&& CBandClassLimit class_1 1000000&&&& # 定义scoreboard的清空时间为120秒(仅限0.9.5-rc2以上版本&& CBandPeriod 120S&/VirtualHost&完整配置实例&& # 可以通过&& SetHandler cband-status&&&& # 超出限制,跳转到google&& CBandDefaultExceededURL && # 定义类别&& CBandClassDst 217.172.231.67&& CBandClassDst 127/8&& CBandClassDst 192.168.0.0/24&& CBandClassDst 10.0.0.20&& CBandClassDst 192.168.100.100&& CBandClassDst 153.19/16&& CBandClassDst 10.13/16&&&& # 定义用户&& CBandUserLimit 100000&& CBandUserExceededURL && CBandUserScoreboard /home/dembol/write/user.dembol.scoreboard&& CBandUserPeriod 10W&&&& CBandUserLimit 1000000&& CBandUserExceededURL &&&&CBandUserScoreboard /home/dembol/write/user.dembolek.scoreboard&& CBandUserClassLimit class_1 50000&& CBandUserPeriod 20H&& CBandUserLimit && CBandUserExceededURL && CBandUserScoreboard /home/dembol/write/user.dembol.nasa.pl.scoreboard&& CBandUserClassLimit class_2 3000&& CBandUserClassLimit class_3 10000&& CBandUserPeriod 2H&&NameVirtualHost *:80DocumentRoot /home/dembol/public_html/dembol.nasa.pl/ServerName dembol.nasa.plServerAlias *.dembol.nasa.plSetenv VLOG /home/dembol/public_html/logs/dembol.nasa.pl.accessCustomLog /home/dembol/public_html/logs/dembol.nasa.pl.access combinedErrorLog /home/dembol/public_html/logs/dembol.nasa.pl.error# 设定虚拟主机的cband&& CBandLimit && CBandUser dembol.nasa.pl&& CBandExceededURL && CBandScoreboard /home/dembol/write/dembol.nasa.pl.scoreboard&& CBandClassLimit class_1 && CBandPeriod 200SDocumentRoot /home/dembol/public_html/dembol.nasa.pl/ServerName dembol.eu.orgServerAlias *.dembol.eu.orgSetenv VLOG /home/dembol/public_html/logs/dembol.eu.org.accessCustomLog /home/dembol/public_html/logs/dembol.eu.org.access combinedErrorLog /home/dembol/public_html/logs/dembol.eu.org.error# 设定虚拟主机的cband&& CBandUser dembolek&& CBandLimit 10000&& CBandExceededURL && CBandScoreboard /home/dembolek/write/dembol.eu.org.scoreboard&& CBandClassLimit class_1 700000&& CBandClassLimit class_2 100000&& CBandClassLimit class_3 500000&& CBandPeriod 5DDocumentRoot /home/dembol/public_html/dembol.nasa.pl/cvs_aliasServerName cvs.cband.linux.pl:80Setenv VLOG /home/dembol/public_html/logs/cvs.cband.linux.pl.accessCustomLog /home/dembol/public_html/logs/cvs.cband.linux.pl.access&&combinedErrorLog /home/dembol/public_html/logs/cvs.cband.linux.pl.error# 设定虚拟主机的cband&& CBandUser dembol&& CBandLimit 100000&& CBandExceededURL && CBandScoreboard /home/dembol/write/dembol.eu.org.scoreboard&& CBandClassLimit class_3 20000&& CBandPeriod 1W我的配置CBandScoreFlushPeriod 1CBandRandomPulse On&VirtualHost *:80&&&&&ServerAdmin a@b.c #可以省略&&&&DocumentRoot /var/spool/www&&#可以省略&&&&ServerName squid&&&&# 100MB virtualhost bandwidth limit&&&&CBandLimit 100M&&&&# Maximal 1024kbps speed for this virtualhost&&&&# Maximal 10 requests per second for this virtualhost&&&&# Maximal 30 open connections for this virtualhost&&&&CBandSpeed &&&&# Maximal 10kB/s speed, 3 requests/s and 2 open connections for any remote client&&&&CBandRemoteSpeed 10kb/s 3 2&&&&# a period of time after which the scoreboard will be cleared (4 weeks)&&&&CBandPeriod 4W&Location /cband-status&&&&&#Then you can access the status page with a URL&&like:&&&&SetHandler cband-status&/Location&&Location&&&&&#Then you can access the status page with a URL&&like:&&&&SetHandler cband-status-me&/Location&&/VirtualHost&取自&&
我空间的其他文章:使用resource_limit及profile限制用户连接
使用resource_limit及profile限制用户连接
& 性能是一个永恒的话题,那就是如何使用更少的资源以达到更高效的性能。参数RESOURCE_LIMIT是一个用于控制用户对于数据库资源使用的参数,当值为true的时候即为启用,否则禁用。该参数结合profile来可以控制多种资源的使用,如CPU_PER_SESSION, CONNECT_TIME,LOGICAL_READS_PER_SESSION,
PRIVATE_SGA等等从而达到到节省资源来实现高效性能。本文描述了数据资源限制并演示了IDLE_TIME及SESSIONS_PER_USER的用法。
1、数据库资源限制的主要步骤
Implemented by&
& & &* Setting RESOURCE_LIMIT = TRUE in the database startup parameter file (spfile or pfile)&
& & &* Creating or modifying existing user profiles (DBA_PROFILES) to have one or more resource limit
& & &* Assigning a profile to a user whose resources are wished to be limited
It could happen that if the idle_time has been set on the DEFAULT profile, this can lead to an MTS dispatchers being set to 'sniped' and then getting 'cleaned up' via the shell script.
The removal of the dispatcher will result in other sessions 'dying' .In that case, If you are to implement resource limits, may be advisable to create new profiles that be assigned to users and not to change the characteristics of DEFAULT.
Alternatively, if you do change DEFAULT, ensure that all the properties that you have affected have been fully tested in a development environment.
用户超出限制后的完成的动作
When a resource limit is exceeded (for example IDLE_TIME) ... PMON does the following&
& & &* Mark the V$SESSION as SNIPED&
& & &* Clean up the database resources for the session
& & &* Remove the V$SESSION entry
2、资源限制的配置
--演示环境 &
SQL& select * from v$version where rownum&2; &
-------------------------------------------------------------------------------- &
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production &
--查看参数resource_limit &
SQL& show parameter resource_limit &
NAME & & & & & & & & & & & & & & & & TYPE & & & &VALUE &
------------------------------------ ----------- ------------------------------ &
resource_limit & & & & & & & & & & & boolean & & FALSE &
--修改参数resource_limit为true &
SQL& alter system set resource_limit= &
System altered. &
SQL& show parameter resource_limit &
NAME & & & & & & & & & & & & & & & & TYPE & & & &VALUE &
------------------------------------ ----------- ------------------------------ &
resource_limit & & & & & & & & & & & boolean & & TRUE &
--创建profile,其idle_time为3分钟 &
SQL& create profile app_user limit idle_time 3; &&
Profile created. &
--修改profile,限制每个用户只能开一个session &
SQL& alter profile app_user limit sessions_per_user 1; &
Profile altered. &
--将用户指派给特定的profile &
SQL& alter user scott profile app_ &
User altered. &
--查看刚刚创建的profile,查询结果中的RESOURCE_NAME都可以作相应的设置或修改 &
SQL& select * from dba_profiles where profile='APP_USER'; &
PROFILE & & & & & & & & & & & &RESOURCE_NAME & & & & & & & & & &RESOURCE LIMIT &
------------------------------ -------------------------------- -------- ---------------------------------------- &
APP_USER & & & & & & & & & & & COMPOSITE_LIMIT & & & & & & & & &KERNEL & DEFAULT &
APP_USER & & & & & & & & & & & SESSIONS_PER_USER & & & & & & & &KERNEL & 1 &
APP_USER & & & & & & & & & & & CPU_PER_SESSION & & & & & & & & &KERNEL & DEFAULT &
APP_USER & & & & & & & & & & & CPU_PER_CALL & & & & & & & & & & KERNEL & DEFAULT &
APP_USER & & & & & & & & & & & LOGICAL_READS_PER_SESSION & & & &KERNEL & DEFAULT &
APP_USER & & & & & & & & & & & LOGICAL_READS_PER_CALL & & & & & KERNEL & DEFAULT &
APP_USER & & & & & & & & & & & IDLE_TIME & & & & & & & & & & & &KERNEL & 3 &
APP_USER & & & & & & & & & & & CONNECT_TIME & & & & & & & & & & KERNEL & DEFAULT &
APP_USER & & & & & & & & & & & PRIVATE_SGA & & & & & & & & & & &KERNEL & DEFAULT &
APP_USER & & & & & & & & & & & FAILED_LOGIN_ATTEMPTS & & & & & &PASSWORD DEFAULT &
APP_USER & & & & & & & & & & & PASSWORD_LIFE_TIME & & & & & & & PASSWORD DEFAULT &
APP_USER & & & & & & & & & & & PASSWORD_REUSE_TIME & & & & & & &PASSWORD DEFAULT &
APP_USER & & & & & & & & & & & PASSWORD_REUSE_MAX & & & & & & & PASSWORD DEFAULT &
APP_USER & & & & & & & & & & & PASSWORD_VERIFY_FUNCTION & & & & PASSWORD DEFAULT &
APP_USER & & & & & & & & & & & PASSWORD_LOCK_TIME & & & & & & & PASSWORD DEFAULT &
APP_USER & & & & & & & & & & & PASSWORD_GRACE_TIME & & & & & & &PASSWORD DEFAULT &
16 rows selected. &
3、演示资源被限制的情形
C:\Users\robinson.cheng&sqlplus scott/tiger@oradb1 &
SQL*Plus: Release 11.2.0.1.0 Production on Wed Jun 26 18:12:10 2013 &
Copyright (c) , Oracle. &All rights reserved. &
SQL& host & & & & & & -----&开启一个session &
Microsoft Windows [Version 6.1.7600] &
Copyright (c) 2009 Microsoft Corporation. &All rights reserved. &
C:\Users\robinson.cheng&sqlplus scott/tiger@oradb1 & ---&尝试开启另一个sessioin &
SQL*Plus: Release 11.2.0.1.0 Production on Wed Jun 26 18:12:21 2013 &
Copyright (c) , Oracle. &All rights reserved. &
ORA-02391: exceeded simultaneous SESSIONS_PER_USER limit & ---&此时收到资源被限制的提示 &
Enter user-name: &
--在服务器端查看session的情形,3分钟后用户scott 的session的状态被置为SNIPED &
SQL& @comm_sess_ &
+----------------------------------------------------+ &
| User Sessions (All) & & & & & & & & & & & & & & & &| &
+----------------------------------------------------+ &
Instance & & SID Serial ID & &Status Oracle User & & O/S User &O/S PID Session Program & & & & Terminal & & & & & & Machine &
--------- ------ --------- --------- ----------- ------------ -------- --------------------- ---------- ------------------- &
oradb & & & & &1 & & & & 5 &INACTIVE & & & & SYS & & & oracle 10090 & &sqlplus@node1.szdb.co & & &pts/1 & & & &
& & & & & & & 35 & & & & 7 & &ACTIVE & & & & &HR & & & &robin 10171 & &sqlplus@SZDB (TNS V1- & & &pts/2 & & & & & & & &SZDB &
& & & & & & & 40 & & & 237 & &SNIPED & & & SCOTT Robinson.Che 13282 & &sqlplus.exe & & & & & & & & PC39 & & 2GOTRADESZ\PC39 &
--获得session的spid &
SQL& @my_spid_from_sid &
Enter value for input_sid: 40 &
& &SID & &SERIAL# SPID &
------ ---------- ------------------------------------- &
& & 40 & & & &237 13282 &
--此时的时间为20:17:54 &
SQL& ho date &
Wed Jun 26 20:17:54 CST 2013 &
--查看scott对应的server process,其进程的启动时间为18:12,过了1个多小时,进程依旧没有被释放 & & &
SQL& ho ps -ef | grep 13282 | grep -v grep &
oracle & 13282 & & 1 &0 18:12 ? & & & &00:00:00 oracleoradb (LOCAL=NO) &
--下面调用shell脚本来杀掉对应的进程 &
SQL& host &
[oracle@node1 ~]$ ./kill_sniped.sh oradb &
[oracle@node1 ~]$ ps -ef | grep 13282 | grep -v grep &
--清除服务器进程的shell脚本 &
[oracle@node1 ~]$ more kill_sniped.sh &&
#!/bin/sh &
export ORACLE_SID=$1 &
tmpfile=/tmp/tmp.$$ &
sqlplus -S /nolog &&EOF &
connect / as sysdba &
set head off feedback off &
spool $tmpfile &
select p.spid from v\$process p,v\$session s &
where s.paddr=p.addr &
and s.status='SNIPED'; &
spool off &
for x in `cat $tmpfile | grep &^[]&` &
& & & & & & & & do &
& & & & & & & & kill -9 $x &
rm $tmpfile &
4、注意事项
& & & If you are running in a shared server environment, you need to be careful not to accidentally kill your dispatchers and/or shared servers. In Oracle 10.2 (or higher) a dedicated connections V$SESSION + V$PROCESS + OS Process can be cleaned up with&
& & & ALTER SYSTEM DISCONNECT SESSION '&SID&,&SERIAL&' IMMEDIATE
At this point in versions prior to 10.2 and for shared server connections the only solution is to kill the session at the OS level (see Kill and ORAKILL above)&
& & &* Windows : use the orakill command .... orakill &ORACLE SID& &Thread ID& (see Note 69882.1 for details)
On occasions we see conditions where a database session has a V$SESSION.STATUS = SNIPED ... and the entry never goes away . This condition can be achieved by implementing Database Resource Limits + Profiles without DCD and allow the database session to exceed the limit in the profile
a、参数RESOURCE_LIMIT = TRUE用于启用数据库资源配置限制
b、profile用于实现资源配置,创建profile或修改已存在的profile来调整各个具体资源配置
c、将profile指派给那些需要限制的用户
d、一旦被限制的用户超出所设定的阀值将收到资源配置相关的错误提示
e、被限制资源的session状态变成sniped
f、被限制资源的session对应的server process并没有被释放,需要手动释放或结合sqlnet.expire_date来进行释放
(window.slotbydup=window.slotbydup || []).push({
id: '2467140',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467141',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467143',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467148',
container: s,
size: '1000,90',
display: 'inlay-fix'

我要回帖

更多关于 dof limit exceeded 的文章

 

随机推荐