您好,登錄后才能下訂單哦!
-------------------------創建表空間與用戶
創建臨時表空間
CREATE TEMPORARY TABLESPACE test_temp
TEMPFILE '/u01/oracle/product/10.2.0/oradata/orcl/test_temp01.dbf '
SIZE 32M
AUTOEXTEND ON
NEXT 32M MAXSIZE 2048M
EXTENT MANAGEMENT LOCAL;
創建用戶表空間
CREATE TABLESPACE test_data
LOGGING
DATAFILE '/u01/oracle/product/10.2.0/oradata/orcl/my_data01.dbf '
SIZE 32M
AUTOEXTEND ON
NEXT 32M MAXSIZE 2048M
EXTENT MANAGEMENT LOCAL;
創建用戶并制定表空間
CREATE USER username IDENTIFIED BY password
DEFAULT TABLESPACE TEST_DATA
TEMPORARY TABLESPACE TEST_TEMP;
--------------------用戶賦權與查看用戶權限
給用戶授予權限
GRANT
CREATE SESSION, CREATE ANY TABLE , CREATE ANY VIEW , CREATE ANY INDEX , CREATE ANY PROCEDURE ,
ALTER ANY TABLE , ALTER ANY PROCEDURE ,
DROP ANY TABLE , DROP ANY VIEW , DROP ANY INDEX , DROP ANY PROCEDURE ,
SELECT ANY TABLE , INSERT ANY TABLE , UPDATE ANY TABLE , DELETE ANY TABLE
TO username;
將role這個角色授與username,也就是說,使username這個用戶可以管理和使用role所擁有的資源
GRANT role TO username;
查看所有用戶
SELECT * FROM DBA_USERS;
SELECT * FROM ALL_USERS;
SELECT * FROM USER_USERS;
查看用戶系統權限
SELECT * FROM DBA_SYS_PRIVS;
SELECT * FROM USER_SYS_PRIVS;
查看用戶對象或角色權限
SELECT * FROM DBA_TAB_PRIVS;
SELECT * FROM ALL_TAB_PRIVS;
SELECT * FROM USER_TAB_PRIVS;
查看所有角色
SELECT * FROM DBA_ROLES;
查看用戶或角色所擁有的角色
SELECT * FROM DBA_ROLE_PRIVS;
SELECT * FROM USER_ROLE_PRIVS;
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。