Oracle建立使用者及刪除使用者都是我們經常會用到的,下面就以執行個體的形式為您介紹Oracle建立使用者及刪除使用者的實現過程,希望對您能有所協助。
Oracle建立使用者執行個體:
首先,使用sys使用者登陸sqlplus,然後建立使用者名稱密碼均為test的使用者,資料表空間為users
後給test賦resource,connect,dba許可權
Cmd代碼
- D:\>sqlplus /nolog
-
- SQL*Plus: Release 9.2.0.1.0 - Production on 星期二 1月 26 13:34:09 2010
-
- Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
-
- SQL> conn / as sysdba;
- 已串連。
- SQL> create user test identified by test default tablespace users;
-
- 使用者已建立
-
- SQL> grant resource,connect,dba to test;
-
- 授權成功。
-
- SQL> commit;
-
- 提交完成。
-
- SQL>
-
- D:\>sqlplus /nolog
-
- SQL*Plus: Release 9.2.0.1.0 - Production on 星期二 1月 26 13:34:09 2010
-
- Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
-
- SQL> conn / as sysdba;
- 已串連。
- SQL> create user test identified by test default tablespace users;
-
- 使用者已建立
-
- SQL> grant resource,connect,dba to test;
-
- 授權成功。
-
- SQL> commit;
-
- 提交完成。
-
- SQL>
-
刪除使用者執行個體:
刪除使用者後邊必須跟cascade,否則失敗
Sql代碼
- SQL> drop user test cascade;
-
- 使用者已丟棄
-
- SQL>
-
- SQL> drop user test cascade;
-
- 使用者已丟棄
-
- SQL>