Oracle Create delete User sample sharing (Oracle Delete user command and authorization) _oracle

Source: Internet
Author: User
Tags dba

1, Oracle users add

Copy Code code as follows:

Create user Lisi identified by Lisi;

Note: Create user is creating database users, followed by user name, identified by is set user password

2, the "connection" database permissions to grant new users Lisi

Copy Code code as follows:

Grant connect to Lisi;

Note: Keywords for grant:oracle database authorization
Connect:oracle a default role for a database, only the permissions on the database on which it is connected

3, the Scott User's table authorized to Lisi users

Copy Code code as follows:

Grant SELECT on EMP to Lisi;

Problem in Pl/sql: The dynamic execution table is inaccessible, and automatic statistics for this reply are prohibited. In the Executive menu you can disable statistics, or get a choice in V$session,v$sesstat and V$statname.
Solution:

Copy Code code as follows:

Grant SELECT on v_$session to user name;
Grant SELECT on V_$sesstat to user name;
Grant SELECT on V_$statname to user name;

4. Reclaim User Rights

Copy Code code as follows:

Revoke select on EMP from Lisi;

5, User Password modification
Login with Lisi account

Copy Code code as follows:

Alter user Lisi identified by password;

6, the user deletes
Drop user user name;
or Drop user username cascade (This will delete the table associated with the user)

7, the database permissions and Roles
① to see what permissions the database user has

Copy Code code as follows:

SELECT * from Session_privs;

Note: Session_privs is a dictionary of Oracle databases, and the dictionary table is actually Oracle's internal table (already exists without creation). This table can see many permissions, such as creating tables.

② View the roles owned by the database user itself

Copy Code code as follows:

SELECT * from User_role_privs;

③ to see what permissions the Connect role (DBA can perform)

Copy Code code as follows:

SELECT * from Dba_sys_privs where grantee= ' CONNECT ';

Note: The database has a lot of permissions and roles, because of the limited effort, just remember 3 characters, that is, connect, RESOURCE, DBA role
When creating a database for a developer, you should authorize connect, resource two roles for him.

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.