Oracle: Create, ALTER, GRANT, revoke operation exercises for users

Source: Internet
Author: User

--Create a User Yong2,yong2 table space for users, a temporary tablespace of temp,users tablespace size of 10M, the password immediately expires, the user locked.

CREATE USER Yong2
Identified by Qwer
DEFAULT tablespace Users
Temporary Tablespace Temp
QUOTA 10m on users
PASSWORD EXPIRE
Account LOCK;

--Modify the yong2 password to inspur123 and unlock the user.

ALTER USER yong2 identified by inspur123;
ALTER USER yong2 account UNLOCK;

--Give user yong2 permission to create a session
GRANT create session to Yong2;

--Give the user yong2 to reclaim the permission to create the session
REVOKE create session from Yong2;
--Object permissions operation
--YONG2 grant permission to query the EMP table
GRANT Select on Scott.emp to Yong2
--Test query
SELECT * from Scott.emp;
--Revoke object permissions
REVOKE Select on Scott.emp from Yong2

--How to query what permissions a user has
--Query system permissions
SELECT * from Dba_sys_privs WHERE grantee= ' yong2 '
--Query Object permissions
SELECT * from Dba_tab_privs WHERE grantee= ' yong2 '

Oracle: Create, ALTER, GRANT, revoke operation exercises for users

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.