Restrict the use of database resources by creating a user profile file

Source: Internet
Author: User

Resource list that can be restricted

In the following example, create a test_profile environment file for the user testuser:

Create profile test_profile limit

Failed_login_attempts 3;

Create user testuser identified by abcd1234

Profile test_profile;

Grant create session to testuser;

If the connection to the testuser account fails three times in a row, the account is automatically locked by Oracle. Then, when you enter the correct password for the testuser account, you will receive an error message:

Error: ORA-28000: the account is locked

The environment file is created using the "Create profile" command, which can be modified using the "alter profile" command. The "alter profile" command in the following example is used to modify an existing environment file. In this example, the default environment file of the database is modified to allow the maximum idle time to 1 hour:

Alter profile default or profile file name limit idle_time 60;

-- Set the user's resource configuration file
1. Set the initialization parameter resource_limit = true
2./* create a resource configuration file */
Create profile prfile_name limit session_per_user 2 cpu_per_session 10000 idle_time 60 connect_time 480;

3. Alter user user_name profile profile_name; -- allocate the created profile file to the user

4. Run the command to modify the resource configuration file.
Alter profile default or profile file name limit idle_time 60;

5. Drop profile profile_name; -- Delete profile

/* After a profile is created and specified to a user, you must use cascade to delete it */
Drop profile profile_name cascade;

Alter system set resource_limit = true; --- enable voluntary restriction. The default value is false.

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.