--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