首先,先确認目前使用者的表空間。 要在system的使用者下 select username,default_tablespace, temporary_tablespace from dba_users where username='MCMIDYL'; 修改預設的表空間 ALTER USER 使用者名 DEFAULT TABLESPACE 表空間名
注意點:
1.如果在PL/SQL 等工具裡打開的話,直接修改下面的代碼中[斜體加粗部分]執行
2.確定路徑存在,比如【D:\oracle\oradata\Oracle9i\】也就是你要儲存檔案的路徑存在
複制代碼代碼如下:
create temporary tablespace user_temp
tempfile 'D:\oracle\oradata\Oracle9i\user_temp.dbf'
size 50m
autoextend on
next 50m maxsize 20480m
extent management local;
複制代碼代碼如下:
create tablespace user_data
logging
datafile 'D:\oracle\oradata\Oracle9i\user_data.dbf'
size 50m
autoextend on
next 50m maxsize 20480m
extent management local;
複制代碼代碼如下:
create user username identified by password
default tablespace user_data
temporary tablespace user_temp;
複制代碼代碼如下:
grant connect,resource,dba to username;
grant create session to op;
grant unlimited tablespace to op;
grant create table to op;
grant drop any table to op;
grant update any table to op;