oracle建立一個資料表空間和使用者來測試,oracle建立資料表空間
首先對錶空間作如下說明
暫存資料表空間:是在做大資料量排序時,分組操作時用的,正常這些都是在記憶體中完成的,但在大資料量排序處理時,記憶體不夠用的情況下就會用到暫存資料表空間,這裡是不存放表的,有點類似於作業系統中的虛擬記憶體概念。
資料資料表空間:是存放表、索引等資料檔案的資料表空間,順帶說下最好把表和索引分在不同的資料表空間中,這樣效能會好很多。
使用者指定資料表空間:其實只是對使用者建表時候的資料表空間設定一個預設值,就是說這個user在建表時如果不指定資料表空間,就預設儲存在使用者指定的資料表空間下,但如果指定資料表空間,還是可以使用其他資料表空間的。而且如果其他使用者被授予許可權依然可以使用這個資料表空間。
作為一般使用者我們就建立一個資料資料表空間再分配給一個使用者就可以了
--建立使用者
create user eh identified by "123";
--授予許可權
grant connect,resource to eh;
--建立資料表空間
create tablespace eh_temp_tablespace
datafile 'd:/oracle_tablespace/eh_temp_tablespace.dbf'
size 800m
autoextend on next 5m
maxsize 3000m
--授予使用者使用資料表空間的許可權
alter user eh quota unlimited on eh_temp_tablespace
或者 alter user eh quota *M on eh_temp_tablespace
--刪除資料表空間
drop tablespace eh_temp_tablespace including contents and datafiles
Oracle92怎建立一個資料表空間與使用者,具體步驟?
//建立暫存資料表空間
create temporary tablespace user_temp
tempfile 'D:\oracle\oradata\Oracle9i\user_temp.dbf'
size 50m autoextend on next 50m maxsize 20480m
extent management local;
//建立資料資料表空間
create tablespace test_data
logging datafile 'D:\oracle\oradata\Oracle9i\user_data.dbf'
size 50m autoextend on next 50m maxsize 20480m
extent management local;
//建立使用者並指定資料表空間
create user username identified by password default tablespace user_data
temporary tablespace user_temp;
//給使用者授予許可權
grant connect,resource to username;
刪除使用者命令
drop user user_name cascade;
怎在oracle中建立帶有一個新使用者
先建立一個資料表空間 在資料表空間裡建立使用者 如:
create tablespace (tablespace_name) datafile '資料表空間路徑' size (空間大小);
create user (user_name) identified by (password) default tablespace tablespace_name;
grant 許可權1,許可權2 to user_name;