1.首先需要查詢 服務(wù)器表空間的存儲(chǔ)位置
select tablespace_name,
file_name,
bytes/1024/1024 file_size,autoextensible
from dba_temp_files;
C:\APP\ADMINISTRATOR\ORADATA\CUST\TEMP01.DBF
2.創(chuàng)建臨時(shí)表空間
創(chuàng)建用戶之前要?jiǎng)?chuàng)建"臨時(shí)表空間"
若不創(chuàng)建則默認(rèn)的臨時(shí)表空間為
temp
。
create temporary tablespace test_temp
tempfile 'D:\Database\Oracle\test\test_temp.dbf'
size 32m
autoextend on
next 32m maxsize unlimited
extent management local;
3.創(chuàng)建表空間
創(chuàng)建用戶之前先要?jiǎng)?chuàng)建數(shù)據(jù)表空間
若沒有創(chuàng)建則默認(rèn)永久性表空間是
system
棍厌。
create tablespace test_data
logging
datafile 'D:\Database\Oracle\test\test_data.dbf'
size 32m
autoextend on
next 32m maxsize unlimited
extent management local;
4.創(chuàng)建用戶
現(xiàn)在建好了表空間拥刻,下面就可以創(chuàng)建用戶了:
create user test identified by manager
account unlock
default tablespace test_data
temporary tablespace test_temp;
5.授權(quán)給用戶
grant connect,resource to test;
grant dba to test;