关于ORA问题的分析和解决其实是一个很好的学习思路,抓住一个每一个ORA错误,然后进一步分析一些原因,总结,总会有不一样的收获
关于ORA问题的分析和解决其实是一个很好的学习思路,抓住一个每一个ORA错误,然后进一步分析一些原因,总结,总会有不一样的收获,还是那句话,任何问题背后都是有原因的。
今天早上,开发的同事反馈说客户端中抛出了ORA错误。
ORA-02391: exceeded simultaneous SESSIONS_PER_USER limit
希望我们能够帮忙看看是什么原因,怎么修复一下。
这个问题其实还是比较清晰的,就是在我们设置的profile中会定义对应session数限制,比如存在用户test,sessions_per_user为50,则test用户最多使用50个session.
默认的profile是DEFAULT ,在创建数据库之后会做基本的初始化,比如密码的过期时间等等
SQL> select *from DBA_PROFILES WHERE PROFILE='DEFAULT'
PROFILE RESOURCE_NAME RESOURCE LIMIT
------------------------------ -------------------------------- -------- ----------------------------------------
DEFAULT COMPOSITE_LIMIT KERNEL UNLIMITED
DEFAULT SESSIONS_PER_USER KERNEL UNLIMITED
DEFAULT CPU_PER_SESSION KERNEL UNLIMITED
DEFAULT CPU_PER_CALL KERNEL UNLIMITED
DEFAULT LOGICAL_READS_PER_SESSION KERNEL UNLIMITED
DEFAULT LOGICAL_READS_PER_CALL KERNEL UNLIMITED
DEFAULT IDLE_TIME KERNEL UNLIMITED
DEFAULT CONNECT_TIME KERNEL UNLIMITED
DEFAULT PRIVATE_SGA KERNEL UNLIMITED
DEFAULT FAILED_LOGIN_ATTEMPTS PASSWORD UNLIMITED
DEFAULT PASSWORD_LIFE_TIME PASSWORD UNLIMITED
DEFAULT PASSWORD_REUSE_TIME PASSWORD UNLIMITED
DEFAULT PASSWORD_REUSE_MAX PASSWORD UNLIMITED
DEFAULT PASSWORD_VERIFY_FUNCTION PASSWORD NULL
DEFAULT PASSWORD_LOCK_TIME PASSWORD UNLIMITED
DEFAULT PASSWORD_GRACE_TIME PASSWORD UNLIMITED
默认的profile DEFAULT中sessions_per_user是Unlimited,但是实际中我们为了限制资源的使用,还是会自定义profile,其实还是基于profile DEFAULT
sql> select username,profile from dba_users where username=’ USER_TEST’;
USERNAME PROFILE
------------------------------ ------------------------------
USER_TEST APP_TEST
这个时候可以看到对应的最大session数就是20了。
SQL> select * from dba_profiles where profile='APP_TEST';
PROFILE RESOURCE_NAME RESOURCE LIMIT
------------------ -------------------------------- -------- ----------------------------------------
APP_TEST COMPOSITE_LIMIT KERNEL DEFAULT
APP_TEST SESSIONS_PER_USER KERNEL 20
APP_TEST CPU_PER_SESSION KERNEL DEFAULT
APP_TEST CPU_PER_CALL KERNEL DEFAULT
APP_TEST LOGICAL_READS_PER_SESSION KERNEL DEFAULT
APP_TEST LOGICAL_READS_PER_CALL KERNEL DEFAULT
APP_TEST IDLE_TIME KERNEL DEFAULT
APP_TEST CONNECT_TIME KERNEL DEFAULT
APP_TEST PRIVATE_SGA KERNEL DEFAULT
APP_TEST FAILED_LOGIN_ATTEMPTS PASSWORD DEFAULT
APP_TEST PASSWORD_LIFE_TIME PASSWORD DEFAULT
APP_TEST PASSWORD_REUSE_TIME PASSWORD DEFAULT
APP_TEST PASSWORD_REUSE_MAX PASSWORD DEFAULT
APP_TEST PASSWORD_VERIFY_FUNCTION PASSWORD DEFAULT
APP_TEST PASSWORD_LOCK_TIME PASSWORD DEFAULT
APP_TEST PASSWORD_GRACE_TIME PASSWORD DEFAULT
基本知识介绍完毕。

Mastering the method of adding MySQL users is crucial for database administrators and developers because it ensures the security and access control of the database. 1) Create a new user using the CREATEUSER command, 2) Assign permissions through the GRANT command, 3) Use FLUSHPRIVILEGES to ensure permissions take effect, 4) Regularly audit and clean user accounts to maintain performance and security.

ChooseCHARforfixed-lengthdata,VARCHARforvariable-lengthdata,andTEXTforlargetextfields.1)CHARisefficientforconsistent-lengthdatalikecodes.2)VARCHARsuitsvariable-lengthdatalikenames,balancingflexibilityandperformance.3)TEXTisidealforlargetextslikeartic

Best practices for handling string data types and indexes in MySQL include: 1) Selecting the appropriate string type, such as CHAR for fixed length, VARCHAR for variable length, and TEXT for large text; 2) Be cautious in indexing, avoid over-indexing, and create indexes for common queries; 3) Use prefix indexes and full-text indexes to optimize long string searches; 4) Regularly monitor and optimize indexes to keep indexes small and efficient. Through these methods, we can balance read and write performance and improve database efficiency.

ToaddauserremotelytoMySQL,followthesesteps:1)ConnecttoMySQLasroot,2)Createanewuserwithremoteaccess,3)Grantnecessaryprivileges,and4)Flushprivileges.BecautiousofsecurityrisksbylimitingprivilegesandaccesstospecificIPs,ensuringstrongpasswords,andmonitori

TostorestringsefficientlyinMySQL,choosetherightdatatypebasedonyourneeds:1)UseCHARforfixed-lengthstringslikecountrycodes.2)UseVARCHARforvariable-lengthstringslikenames.3)UseTEXTforlong-formtextcontent.4)UseBLOBforbinarydatalikeimages.Considerstorageov

When selecting MySQL's BLOB and TEXT data types, BLOB is suitable for storing binary data, and TEXT is suitable for storing text data. 1) BLOB is suitable for binary data such as pictures and audio, 2) TEXT is suitable for text data such as articles and comments. When choosing, data properties and performance optimization must be considered.

No,youshouldnotusetherootuserinMySQLforyourproduct.Instead,createspecificuserswithlimitedprivilegestoenhancesecurityandperformance:1)Createanewuserwithastrongpassword,2)Grantonlynecessarypermissionstothisuser,3)Regularlyreviewandupdateuserpermissions

MySQLstringdatatypesshouldbechosenbasedondatacharacteristicsandusecases:1)UseCHARforfixed-lengthstringslikecountrycodes.2)UseVARCHARforvariable-lengthstringslikenames.3)UseBINARYorVARBINARYforbinarydatalikecryptographickeys.4)UseBLOBorTEXTforlargeuns


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Dreamweaver Mac version
Visual web development tools

Notepad++7.3.1
Easy-to-use and free code editor

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment
