oracle創建臨時表空間、用戶表空間、創建用戶關聯表空間、授權等總結
1、創建臨時表空間
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;
一般從第二步開始就可以
2、創建用戶表空間
CREATE TABLESPACE gzjssapce
LOGGING
DATAFILE 'E:\oracle\product\10.2.0\oradata\orcl\gzjs.DBF'
SIZE 32M
AUTOEXTEND ON
NEXT 32M MAXSIZE 2048M
EXTENT MANAGEMENT LOCAL;
3、創建用戶並制定表空間
CREATE USER gzjs IDENTIFIED BY password
DEFAULT TABLESPACE gzjssapce
4、給用戶授權
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 gzjs ;
5、防止當前用戶過度占用表空間
alter user gzjs quota unlimited on users;
6、授予DBA權限
grant connect,resource,dba to gzjs;
7、注意事項:導入DBA權限導出的數據庫文件時,一定要賦予新用戶DBA權限才可以成功導入