Oracle limits the number of connections of an IP address in database management. It may limit the number of connections from an IP address to the database or the number of connections from a user to the database. To limit the number of connections to the database, we can start with the profile of the database and use the profile feature to meet this requirement. Www.2cto.com can use the logon database trigger to limit the number of connections to the IP address to access the database. Each new session login records the IP in the client_info of vrsession, and then count the number of all qualified sessions. If the number of qualified sessions exceeds, the session is disconnected directly. However, if this session is restricted to database connection, it can only take effect for non-dba users. Dba users only write a warning message in alert. log. The trigger code for implementing this function at www.2cto.com is as follows: SQL code create or replace trigger logon_audit after logon on database declare /*************************** **************************************** * ************** NAME: logon_audit PURPOSE: restrict the number of connections from an IP address to a database instance. If the limit is exceeded, an error occurs or an alarm is reported. NOTES: 1. Use sys to submit data to the database 2. Use the logon database trigger to implement www.2cto.com ************************ **************************************** * ****************** // according to the plan, define three types of variable names: number, string, date */I _sessions number; I _sessions_limited number: = 30; str_userip varchar2 (15): = '192. 168.15.148 '; t_t_ip_limited exception; begin dbms_application_info.set_client_info (sys_context ('userenv', 'IP _ address' ); Select count (*) into I _sessions from v $ session where client_info = str_userip; if (I _sessions> I _sessions_limited) then raise effect_ip_limited; end if; exception when effect_ip_limited then raise_application_error (-20003, 'IP: '| str_userip |' the number of connections is limited! '); End logon_audit; Source http://mikixiyou.iteye.com/blog/1705838