2.在建立用戶以前,先要建立表空間:html
其格式爲:格式: create tablespace 表間名 datafile '數據文件名' size 表空間大小;java
如:數據庫
SQL> create tablespace news_tablespace datafile 'D:\oracle\product\10.1.0\oradata\lms_card\lms_card.dbf' size 500M;oracle
其中'news_tablespace'是你自定義的表空間名稱,能夠任意取名;'F:\oracle\product\10.1.0\oradata \news\news_data.dbf'是數據文件的存放位置,'news_data.dbf'文件名也是任意取;'size 500M'是指定該數據文件的大小,也就是表空間的大小。ide
3.如今建好了名爲'news_tablespace'的表空間,下面就能夠建立用戶了:spa
其格式爲:格式: create user 用戶名 identified by 密碼 default tablespace 表空間表;.net
如:htm
SQL> create user test identified by test default tablespace news_tablespace;blog
默認表空間'default tablespace'使用上面建立的表空間。get
4.接着受權給新建的用戶:
SQL> grant connect,resource to news; --表示把 connect,resource權限授予news用戶
SQL> grant dba to news; --表示把 dba權限授予給news用戶
受權成功。
ok! 數據庫用戶建立完成,如今你就可使用該用戶建立數據表了!
轉載