創(chuàng)建臨時表空間創(chuàng)建臨時表空間
CREATE TEMPORARY TABLESPACE test_temp
TEMPFILE 'C:oracleproduct10.1.0oradataorcltest_temp01.dbf'
SIZE 32M
AUTOEXTEND ON
NEXT 32M MAXSIZE 2048M
EXTENT MANAGEMENT LOCAL;
創(chuàng)建表空間
CREATE TABLESPACE HISTDB
datafile 'D:oracleproduct10.2.0oradataZJGIStest_temp03.dbf'
SIZE 32M
AUTOEXTEND ON
NEXT 32M MAXSIZE 2048M
EXTENT MANAGEMENT LOCAL;
創(chuàng)建用戶并指定表空間
CREATE USER username IDENTIFIED BY password
DEFAULT TABLESPACE TEST_DATA
TEMPORARY TABLESPACE TEST_TEMP;
給用戶授予權(quán)限
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;
..........................
/*分為四步 */
/*第1步:創(chuàng)建臨時表空間 */
create temporary tablespace user_temp
tempfile 'D:oracleoradataOracle9iuser_temp.dbf'
size 50m
autoextend on
next 50m maxsize 20480m
extent management local;
/*第2步:創(chuàng)建數(shù)據(jù)表空間 */
create tablespace user_data
logging
datafile 'D:oracleoradataOracle9iuser_data.dbf'
size 50m
autoextend on
next 50m maxsize 20480m
extent management local;
/*第3步:創(chuàng)建用戶并指定表空間 */
create user username identified by password
default tablespace user_data
temporary tablespace user_temp;
/*第4步:給用戶授予權(quán)限 */
grant connect,resource,dba to username;
----------------------------------------------------------------------------------------------------------
-----------------------------------------------查看用戶權(quán)限---------------------------------------------------------
查看所有用戶
查看所有用戶
SELECT * FROM DBA_USERS;
SELECT * FROM ALL_USERS;
SELECT * FROM USER_USERS;
查看用戶系統(tǒng)權(quán)限
查看用戶系統(tǒng)權(quán)限
SELECT * FROM DBA_SYS_PRIVS;
SELECT * FROM USER_SYS_PRIVS;
查看用戶對象或角色權(quán)限
查看用戶對象權(quán)限
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;
刪除新建用戶
刪除用戶
drop user username
刪新建表空間
刪除用戶
drop tablespace tablespaceName
更多信息請查看IT技術(shù)專欄