2.在創建用戶之前,先要創建表空間:
其格式為:格式: create tablespace 表間名 datafile '數據文件名' size 表空間大小;
如:
SQL> create tablespace news_tablespace datafile 'D:\oracle\product\10.1.0\oradata\lms_card\lms_card.dbf' size 500M;
其中'news_tablespace'是你自定義的表空間名稱,可以任意取名;'F:\oracle\product\10.1.0\oradata \news\news_data.dbf'是數據文件的存放位置,'news_data.dbf'文件名也是任意取;'size 500M'是指定該數據文件的大小,也就是表空間的大小。
3.現在建好了名為'news_tablespace'的表空間,下面就可以創建用戶了:
其格式為:格式: create user 用戶名 identified by 密碼 default tablespace 表空間表;
如:
SQL> create user test identified by test default tablespace news_tablespace;
默認表空間'default tablespace'使用上面創建的表空間。
4.接著授權給新建的用戶:
SQL> grant connect,resource to news; --表示把 connect,resource權限授予news用戶
SQL> grant dba to news; --表示把 dba權限授予給news用戶
授權成功。
ok! 數據庫用戶創建完成,現在你就可以使用該用戶創建數據表了!
轉載
天蒼蒼,野茫茫,風吹草底見牛羊