Oracle創(chuàng)建用戶(hù)及刪除用戶(hù)的實(shí)例
Oracle創(chuàng)建用戶(hù)及刪除用戶(hù)都是我們經(jīng)常會(huì)用到的,下面就以實(shí)例的形式為您介紹Oracle創(chuàng)建用戶(hù)及刪除用戶(hù)的實(shí)現(xiàn)過(guò)程,希望對(duì)您能有所幫助。
Oracle創(chuàng)建用戶(hù)實(shí)例:
首先,使用sys用戶(hù)登陸sqlplus,然后新建用戶(hù)名密碼均為test的用戶(hù),表空間為users
后給test賦resource,connect,dba權(quán)限
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;
- 用戶(hù)已創(chuàng)建
- SQL> grant resource,connect,dba to test;
- 授權(quán)成功。
- 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;
- 用戶(hù)已創(chuàng)建
- SQL> grant resource,connect,dba to test;
- 授權(quán)成功。
- SQL> commit;
- 提交完成。
- SQL>
刪除用戶(hù)實(shí)例:
刪除用戶(hù)后邊必須跟cascade,否則失敗
Sql代碼
- SQL> drop user test cascade;
- 用戶(hù)已丟棄
- SQL>
- SQL> drop user test cascade;
- 用戶(hù)已丟棄
- SQL>
【編輯推薦】