select /*+ connect_by_filtering index(sysauth$ i_sysauth1) */ privilege#, bitand(nvl(option$, 0), 8), grantee#, level from sysauth$ connect by grantee#=prior privilege# and privilege#>0 start with grantee#=:1 and privilege#>0
的問題。 (一) 測試環(huán)境,并接入EasyDB數(shù)據(jù)庫管控軟件
sys@ORCL> select * from v$version;BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE 11.2.0.4.0 Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Productionsys@ORCL> show parameter auditNAME TYPE VALUE
------------------------------------ ----------- ------------------------------
audit_file_dest string /u01/app/oracle/admin/orcl/adump
audit_sys_operations boolean FALSE
audit_syslog_level string
audit_trail string DBsys@ORCL> show parameter cursor_sharingNAME TYPE VALUE
------------------------------------ ----------- ------------------------------
cursor_sharing string EXACT
(二) 簡單編寫shell腳本,發(fā)起大量數(shù)據(jù)庫連接
#more /home/oracle/connect.sh for i in {1..200000}
dofor j in {1..40}do sh /home/oracle/conn.shdone
done#more /home/oracle/conn.sh
#只執(zhí)行簡單的查詢操作,之后退出sqlplus baiyang/oracle@orcl << EOFselect * from v\$version;exit;EOF#發(fā)起多個job執(zhí)行,加大并發(fā),執(zhí)行將近一個小時 nohup sh connect.sh > /dev/null 2>&1&
(6) 通過測試,重新了數(shù)據(jù)庫問題,并驗證在未執(zhí)行 set role 時,同樣會導致; 客戶應用程序存在大量短連接,這會導致數(shù)據(jù)庫、服務器資源飆升,并且會導致監(jiān)聽無法響應更多請求; 因客戶的程序已經(jīng)找不到開發(fā)商,目前很難對應用程序進行排查; cursor_sharing=FORCE,雖然會帶來一些優(yōu)勢,但官方不建議將此作為長久的優(yōu)化方式; 提醒客戶更新業(yè)務架構(gòu),使用長連接,并且自主掌握核心代碼。