Oracle 基礎溫習1 建立表空間和新使用者

starive發表於2014-01-31
昨天安裝好了EX後,今天繼續基礎溫習。

用system登陸進去後,然後再檢視當前在哪個 表空間下:
  SQL>select username,default_tablespace from user_users;     

發現螢幕間距太小,所以自己要把設定一下寬度:
set line 300


select username, default_tablespace from user_users之行之後發現沒有找到我昨天建立的 表空間gaospace, 但是select * from student; 到時可以執行,

解答: 目前的使用者是system, 應該是預設表空間是system,所以我要切換到 gaospace:

感覺好不爽啊,自己新建立一個使用者: zhangsan。然後每次就可以用自己的使用者管理自己的表空間了。
在使用者 system下:
create user zhangsan identified by oracle;
對了還要授予一系列的許可權,如下:
grant create session to zhangsan;
grant create table to zhangsan;//授予建立表的許可權 
grante drop table to zhangsan;//授予刪除表的許可權 
grant insert table to zhangsan;//插入表的許可權 
................

太麻煩了,乾脆一個語句:
grant all to gaoyu;

建立新表空間starive, 和臨時表空間 和使用者:
create temporary tablespace starive_temp 
tempfile 'F:\Oraclesoftware\DISK1\datafiles\starivetemp001.dbf
size 50m 
autoextend on 
next 32m maxsize 2048m
extent management local;

建立新使用者starive:
create user starive identified by oracle
default tablespace starivespace 
temporary tablespace starive_temp; 

以後就用新使用者 starive 來進行學習oracle。



來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26435490/viewspace-1076656/,如需轉載,請註明出處,否則將追究法律責任。

相關文章