//創(chuàng)建臨時(shí)表空間
create temporary tablespace test_temp
tempfile 'E:\oracle\product\10.2.0\oradata\testserver\test_temp01.dbf'
size 32m
autoextend on
next 32m maxsize 2048m
extent management local;
//創(chuàng)建數(shù)據(jù)表空間
create tablespace test_data
logging
datafile 'E:\oracle\product\10.2.0\oradata\testserver\test_data01.dbf'
size 32m
autoextend on
next 32m maxsize 2048m
extent management local;
//創(chuàng)建用戶并指定表空間
create user testserver_user identified by testserver_user
default tablespace test_data
temporary tablespace test_temp;
//給用戶授予權(quán)限
grant connect,resource to testserver_user;
//以后以該用戶登錄,創(chuàng)建的任何數(shù)據(jù)庫對象都屬于test_temp 和test_data表空間,這就不用在每創(chuàng)建一個(gè)對象給其指定表空間了。