Oracle new users set permissions for users

Source: Internet
Author: User

-- Select * From dba_users; queryDatabaseAll users in

-- Alter user test_select account lock; lock the user

-- Alter user test_select account unlock; unlock the user

-- Create user xujin identified by xujin; create a user

-- Grant create tablespace to xujin; Authorize

-- Grant select on tabel1 to xujin; Authorize Query

-- Grant update on Table1 to xujin;

-- Grant execute on procedure1 to xujin authorized Stored Procedure

-- Grant update on Table1 to xujin with grant option; grant the update permission to the xujin user, and the user can continue to grant permissions;

-- Revoke permissions

-- Revoke select on Table1 from xujin1; revoke the Select Table query permission;

-- Revoke all on Table1 from xujin;

/* Grant connect to xujin;

Revoke connect from xujin

Grant select on xezf. pai_alarm to xujin;

Revoke select on xezf. wash_alarm from xujin ;*/

-- Select table_name, privilege from dba_tab_privs where grantee = 'xujin' query object permissions of a user

-- Select * From dba_sys_privs where grantee = 'xujin' query system permissions of a user

-- Select * From session_privs -- System Permissions Valid for money sessions

-- Role

-- Create role xujin1; -- create an xujin1 role

-- Grant insert on xezf. Into _alarm to xujin1; insert table Information

-- Revoke insert on xezf. Revoke _alarm from xujin1; revoke the permission of the xujin1 role

-- Grant xujin1 to xujin; grant the role permission to xujin;

-- Create role xujin2;

-- Grant xujin1 to xujin2; Authorize xujin1 to xujin2;

-- Alter user xujin default xujin1, xujin2; modify user default roles

-- Drop role xujin1; Delete role 1;

-- Select * From role_sys_privs where role = xujin1;

-- View the system permissions under the role Xu Jin 1;

-- Select granted_role, admin_option from role_role_privs where role = 'xujin2 ';

-- View the role permissions under the xujin1 role

-- Select * From role_sys_privs where role = 'xujin2 ';

-- Select table_name, privilege from role_tab_privs where role = 'xujin1 ';

-- Select * From dba_role_privs where grantee = 'xujin' -- check the number of roles under a user;

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.