Oracle profile usage

Source: Internet
Author: User

Oracle profile usage I. Purpose: The profile in the Oracle system can be used to restrict the database resources that users can use. The create profile command is used to create a profile to restrict the use of database resources, if the profile is assigned to the user, all the database resources that the user can use are limited by the profile. Ii. conditions: To create a profile, you must have the create profile system permission. Specify resource limits for users. required: 1. dynamically use alter system or use the initialization parameter resource_limit to make the resource limit take effect. This change is invalid for password resources and password resources are always available. SQL> show parameter resource_limit Name type value ----------------------------------------------------------------------------- Resource_limit Boolean false SQL> alter system set resource_limit = true; The system has been changed. SQL> show parameter resource_limit; Name type value ----------------------------------------------------------------------------- Resource_limit Boolean true SQL> 2. Use create profile to create a profile that defines the limits on database resources. 3. Use the create user or alter USER command to allocate the profile to the user. Iii. Syntax:
  Iv. Syntax explanation:
Profile: name of the configuration file. Oracle databases force resource restrictions in the following ways: 1. If the user exceeds the session resource limit of connect_time or idle_time, the database rolls back the current transaction and ends the session. When the user executes the command again, the database returns an error, 2. If you attempt to perform operations that exceed other session resource limits, the database will discard the operation, roll back the current transaction, and immediately return an error. After that, you can submit or roll back the current transaction. You must end the session. Tip: You can divide a row into multiple segments, such as one hour (1/24 days) to limit the time. You can specify resource restrictions for users, but the database will only execute the restrictions after the parameters take effect. Unlimited: the user who assigns the profile has no limit on the resource usage. When the password parameter is used, unlimited means that there is no limit on the parameter. Default: if it is set to default, some resource restrictions on the profile are ignored. The initial definition of the default profile is not limited to resources and can be changed through the alter profile command. Resource_parameter Session_per_user: specifies the number of concurrent sessions of a user. Cpu_per_session: Specifies the CPU time limit of the session, in the unit of 1% seconds. Cpu_per_call: Specifies the CPU time limit for one call (resolution, execution, and extraction), in 1% seconds. Connect_time: Specifies the total connection time of a session, in minutes. Idle_time: Specifies the total time for a session to allow continuous inactivity, in minutes. If the duration is exceeded, the session will be disconnected. However, long-running queries and other operations are not restricted. Logical_reads_per_session: specify the number of data blocks that a session can read, including all data blocks read from memory and disk. Logical_read_per_call: specify the maximum number of data blocks that can be read when an SQL statement (parsing, execution, and extraction) call is executed. Private_sga: specify the maximum space that a session can allocate in the Shared Pool (SGA), in bytes. (This restriction is only valid when the Shared Server structure is used. The private space of a session in SGA includes private SQL and PL/SQL, but not shared SQL and PL/SQL ). Composite_limit: Specifies the total resource consumption of a session, in the unit of service units. The Oracle Database calculates the total service units of cpu_per_session, connect_time, logical_reads_per_session, and private-SGA in a favorable way. Password_parameter part: Failed_login_attempts: specifies the maximum number of logon attempts allowed before the account is locked. Password_life_time: specifies the number of days allowed by the same password. If the password_grace_time parameter is specified at the same time, if the password is not changed within grace period, the password will be invalid and the connection to the database will be rejected. If the password_grace_time parameter is not set, the default value of unlimited will throw a database warning, but allow the user to continue the connection. Password_reuse_time and password_reuse_max: these two parameters must be associated. password_reuse_time specifies the number of days before the password cannot be reused, while password_reuse_max specifies the number of times the password has changed before the current password is reused. Both parameters must be set as integers. 1. If an integer is specified for these two parameters, the user cannot reuse the password until the password is changed to the number of times specified by password_reuse_max and later within the time specified by password_reuse_time. For example, if password_reuse_time = 30 and password_reuse_max = 10, you can reuse the password after 30 days. The password must be changed more than 10 times. 2. If one of them is specified as an integer and the other is unlimited, the user can never reuse a password. 3. if one of them is specified as default, Oracle database uses the default value defined in profile. By default, all parameters are set as unlimited in profile. If the default value of profile is not changed, the database always defaults to unlimited. 4. If both parameters are set to unlimited, the database ignores them. Password_lock_time: Specify the account contraction time after the number of failed login attempts reaches, in days. Password_grace_time: specifies the number of days before the database returns a warning. If the database password is not modified in the middle, it will expire. Password_verify_function: this field allows you to pass complex PL/SQL password verification scripts as parameters to the create profile statement. Oracle Database provides a default script, but you can create your own verification rules or use third-party software for verification. For the function name, specify the name of the password verification rule. If it is null, the password verification function is not used. If an expression is specified for the password parameter, the expression can be in any format, except for database scalar queries. V. Example: 1. Create a profile: Create profile new_profile Limit password_reuse_max 10 Password_reuse_time 30; 2. Set profile resource restrictions: Create profile app_user limit Sessions_per_user Unlimited Cpu_per_session Unlimited CPU _ per_call 3000 Connect_time 45 Logical_reads_per_session default Logical_reads_per_call 1000 Private_sga 15 K Composite_limit 5000000; The total resource cost cannot exceed 5 million service units. The formula for calculating the total resource cost is specified by the alter resource cost statement. 3. Set Password restriction profile: Create profile app_users2 limit Failed_login_attempts 5 Password_life_time 60 Password_reuse_time 60 Password_reuse_max 5 Password_verify_function verify_function Pass word_lock_time 1/24 Password_grace_time 10; 4. Allocate the configuration file to the user: SQL> alter user dinya profile app_user; The user has changed. SQL> SQL> alter user dinya profile default; The user has changed. SQL>
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.