標籤:
--查資料表空間的名稱和大小
SELECT t.tablespace_name, round(SUM(bytes / (1024 * 1024)), 0) ts_size FROM dba_tablespaces t, dba_data_files d WHERE t.tablespace_name = d.tablespace_name GROUP BY t.tablespace_name;
--尋找資料表空間的實體名稱
SELECT tablespace_name,
file_id,
file_name,
round(bytes / (1024* 1024), 0) total_space
FROM dba_data_files
ORDER BYtablespace_name;
--建立暫存資料表空間
create temporary tablespace xxx_temp
tepmfile ‘暫存資料表空間存放的路徑\xxx_temp.dbf‘
size 50m --指定初始值大小
autoextend on next 50m --超出50m之後將以50m自增
maxsize 20480m extent management local;
--建立資料表空間
create tablespace xxx_data
logging
datafile ‘資料表空間存放路徑\xxx_data.dbf‘
size 50m
maxsize 20480--指定最大值
extent management local;
--建立使用者並且指定資料表空間
create user xxx identified by xxxxs
default tablespace xxx_data--指定預設資料表空間
temporary tablespace xxx_temp;--z指定暫存資料表空間
--給建立的使用者授予許可權
grant connect,resource,dba to xxx;
Oracle建立使用者