標籤:style blog http color java 使用 strong io
建立暫存資料表空間
CREATE TEMPORARY TABLESPACE test_temp
TEMPFILE ‘C:\oracle\product\10.1.0\oradata\orcl\test_temp01.dbf‘
SIZE 32M
AUTOEXTEND ON
NEXT 32M MAXSIZE 2048M
EXTENT MANAGEMENT LOCAL;
建立使用者資料表空間
CREATE TABLESPACE test_data
LOGGING
DATAFILE ‘C:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\TEST_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;
-------遇到no privileges on tablespace ‘tablespace ‘
alter user userquota 10M[unlimited] on tablespace;