登陸管理員最高權限帳號sql
cmd輸入sqlplus 回車,或者直接打開sqlplus數據庫
用戶名:syssession
密碼:sys as sysdbaapp
1.首先,建立(新)用戶:
create user username identified by password;
username:新用戶名的用戶名
password: 新用戶的密碼
也能夠不建立新用戶,而仍然用之前的用戶,如:繼續利用scott用戶
2.建立表空間:
create tablespace tablespacename datafile 'd:\data.dbf' size xxxm;
tablespacename:表空間的名字
d:\data.dbf':表空間的存儲位置
xxx表空間的大小,m單位爲兆(M)ide
3.將空間分配給用戶:
alter user username default tablespace tablespacename;
將名字爲tablespacename的表空間分配給username
4.給用戶受權:
grant create session,create table,unlimited tablespace to username;
5.而後再以樓主本身建立的用戶登陸,登陸以後建立表便可。
conn username/password;
每步執行的sql:(sjzx是數據庫名、用戶名、密碼、表空間名)spa
(1)create user sjzx identified by sjzxcmd
(2)create tablespace sjzx datafile 'D:\db\app\oradata\orcl\sjzx.dbf' size 100m autoextend on next 32m maxsize 2048mit
(3)alter user sjzx default tablespace sjzxio
(4)grant create session,create table,unlimited tablespace to sjzxtable
完整步驟:
--建立兩個數據庫的文件
create tablespace spsy_data
logging
datafile 'D:\orcal11\oradata\orcl\spsy_data.dbf'
size 100m
autoextend on
next 10m maxsize unlimited
extent management local;
create temporary tablespace spsy_temp
tempfile 'D:\orcal11\oradata\orcl\spsy_temp.dbf'
size 100m
autoextend on
next 10m maxsize 500m
extent management local;
--建立用戶與上面建立的文件造成映射關係
create user spsy identified by 000000 default tablespace spsy_data temporary tablespace spsy_temp;
--添加權限grant connect,resource,dba to spsy;