1.建立Oracle表空間與使用者
Oracle資料庫不像MySQL資料庫,一個使用者可以管理多個資料庫,對Oracle來說,一個使用者隻對應一個資料庫,而新建立的使用者是沒有任何資源和權限的,是以需要管理者使用者為其配置設定資源權限.而建立使用者時,需要為使用者指定表空間.
(1) 由于scott權限不夠,不能建立使用者,另外因為其他較高權限的賬号密碼忘記了,是以這裡補充一下Oracle更改密碼的方法:
A.在控制台輸入`sqlplus scott/[email protected]:1521/orcl `連接配接Oracle;
B.輸入`conn /as sysdba`以DBA角色登入;
C.連接配接成功後,輸入“select username from all_users”檢視使用者清單。
D.若修改某一個使用者密碼, 修改使用者密碼 格式為:alter user 使用者名 identified by 新密碼;
(2) 使用使用者system登入PL/SQL Developer,建立表空間和使用者
create tablespace casic_smart datafile 'C:\oracle\product\10.2.0\oradata\orcl\casic_smart.dbf' size m;
create user tianzhi_smart identified by tianzhi_smart default tablespace casic_smart quota m on users;
grant all privileges to tianzhi_smart;
2.删除Oracle資料庫(使用者)
删除oracle資料庫其實也就是删除oracle使用者,因為在oracle中資料庫與使用者是一一對應的.而删除資料庫(使用者)之後,再建立使用者,就相當于清空了資料庫裡面的資料.
<!-- 以管理者使用者登入 -->
sqlplus /nolog
conn /as sysdba;
<!-- 删除資料庫(使用者) -->
drop user test1 cascade;
<!-- 建立表空間 -->
create tablespace casic_smart datafile 'C:\oracle\product\10.2.0\oradata\orcl\casic_smart.dbf' size 1000m;
<!-- 建立使用者,并指定表空間 -->
<!-- 有些是沒有指定表空間的,不知是否可行,未嘗試,保險起見還是按下面方式來 -->
create user test1 identified by pwd1 default tablespace casic_smart quota 500m on users;
<!-- 授予權限 -->
grant all privileges to test1 ;
聲明:
1.請尊重作者辛勞整理,轉載請注明博文出處.
2.如果你發現博文中存在一些錯誤,還請你不吝筆墨,批評指教.謝謝!