Oracle builds views, creates users, and grants query permissions

Source: Internet
Author: User

First, the demand

Database has a table car, need to create a view for this table View_car, and create a new user User01, give the query this view permissions

Ii. Steps of implementation

1, the Administrator CLGL login database, the new view View_car:

Create or Replace view View_car as SELECT * from car;

2. New User User01

Create User User01
Identified by "123456";

3, grant the user User01 permission

Grant SELECT on View_car_runtime_b to User01; //Query View permissions
Grant connect to User01; //Connect database permissions
Grant create synonym to User01; //new synonym permission

4, the user User01 login database, can access to the view view_car information

SELECT * from Clgl.view_car; //Query view view_car information, because each time need to add user prefix clgl., very inconvenient, so set a synonym for easy query

5. Create a new alias for the View Clgl.view_car car

Create synonym car for clgl.view_car; //Set Clgl.view_car alias to car

SELECT * from Car; //user can enter car to query data directly

6, to CLGL login database, set the number of user User01 allowed access session

Alter system set Resource_limit=true scope=both sid= ' * '; //Use Resource_limit and profile to restrict user connections
Create profile User01_profile limit Sessions_per_user 1 failed_login_attempts unlimited; //Create a new user Profile:user01_profile
Alter user User01 profile User01_profile; //change user User01 profile to User01_profile
Alter profile user01_profile limit Sessions_per_user 2; //Limit user User01 number of connections to 2

When User01 has more than three access connections, an error is indicated:ora-02391:exceeded simultaneous sessions_per_user limit

Oracle builds views, creates users, and grants query permissions

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.