使用plsql創建oracle數據庫的表空間和用戶,並授權的語句。
1.創建表空間:
說明:datafile是指定創建位置,指向oracle數據庫的默認位置;
autoextend 設置容量為自動增長,50M是自增的大小
create tablespace TEST datafile 'E:/app/Administrator/oradata/orcl/TEST' size 1M autoextend on next 50M maxsize unlimited;
2.創建新的用戶:
說明:identified by后為用戶登錄密碼;
default tablespace為默認表空間;
profile設為系統默認;
ACCOUNT UNLOCK解鎖用戶;
create user TEST identified by "123" default tablespace TEST profile DEFAULT ACCOUNT UNLOCK;
3.授限:
說明:分別給用戶授dba權限和表空間授無限增長權限
grant dba to TEST; grant unlimited tablespace to TEST;