oracle grant 語句的GRANT privilige TO user IDENTIFIED BY password 語法

msdnchina發表於2011-10-08

在D:oracleproduct10.2.0db_1RDBMSADMINutlsampl.sql下,有如下的語句:
DROP USER SCOTT CASCADE;
DROP USER ADAMS CASCADE;
DROP USER JONES CASCADE;
DROP USER CLARK CASCADE;
DROP USER BLAKE CASCADE;
GRANT CONNECT,RESOURCE,UNLIMITED TABLESPACE TO SCOTT IDENTIFIED BY TIGER;
DROP PUBLIC SYNONYM PARTS;

CONNECT SCOTT/TIGER

CREATE TABLE DEPT
(DEPTNO NUMBER(2) CONSTRAINT PK_DEPT PRIMARY KEY,
DNAME VARCHAR2(14) ,
LOC VARCHAR2(13) ) ;

這個GRANT privilige TO user IDENTIFIED BY password 語法,其實是會建立user使用者並且設定其密碼為password,請參考oracle官方的sql reference:

IDENTIFIED BY Clause

Use the IDENTIFIED BY clause to specifically identify an existing user by password or to create a nonexistent user. This clause is not valid if the grantee is a role or PUBLIC. If the user specified in the grantee_clause does not exist, then the database creates the user with the password and with the privileges and roles specified in this clause.

[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/161195/viewspace-1055512/,如需轉載,請註明出處,否則將追究法律責任。

相關文章