表空間定義
??????? 表空間是為了統(tǒng)一ORACLE物理和邏輯上的結(jié)構(gòu)而專門建立的,從物理上來說,
一個(gè)表空間是由具體的一個(gè)或多個(gè)磁盤上數(shù)據(jù)文件構(gòu)成的(至少1對(duì)1,可以1對(duì)
多),從邏輯上來說一個(gè)表空間是由具體的一個(gè)或多個(gè)用戶模式下的表,索引等等
里面的數(shù)據(jù)所構(gòu)成的。
創(chuàng)建表空間:首先連接到擁有dba權(quán)限的用戶下、例如system
SQL> create tablespace baicheng datafile 'f:\baicheng.dbf' size 25M;
Tablespace created
創(chuàng)建用戶:用戶名yuge、 用戶密碼yuge、 所在表空間baicheng
SQL> create user yuge
2 identified by yuge
3 default tablespace baicheng;
授權(quán)給用戶(grant resource,connect,dba,sysdba to test)
SQL> grant connect to yuge;
Grant succeeded
SQL> grant resource to yuge;
Grant succeeded
收回權(quán)限
SQL> revoke connect from yuge;
Revoke succeeded
SQL> revoke resource from yuge;
Revoke succeeded
刪除用戶(加cascade的話,這樣連用戶自己創(chuàng)建的表也一起刪除,如果不加就只是刪除當(dāng)前用戶)
SQL> drop user yuge cascade;
User dropped
刪除表空間(drop tablespace?baicheng including contents and datafiles;連帶BAICHENG.DBF文件一起刪除)
SQL> drop tablespace baicheng;
Tablespace dropped