on 2010 Nov 01 8:14 PM
For all SA versions, one can manage user accounts and passwords with
GRANT CONNECT TO MyUser IDENTIFIED BY "MyPwd";
If the user already exists, it is used (possibly by the user herself) to change the password:
GRANT CONNECT TO MyUser IDENTIFIED BY "MyNewPwd";
Users get dropped (with all their database objects) with
REVOKE CONNECT FROM MyUser;
Starting with SA 11, one can additionally use CREATE/ALTER/DROP USER for the same purpose (and furthermore, to map a login policy and the like):
CREATE USER MyUser IDENTIFIED BY "MyPwd";
ALTER USER MyUser IDENTIFIED BY "MyNewPwd";
DROP USER MyUser;
Questions:
Are these according statements identical in their semantics (when omiting a particular login policy)?
Am I supposed to use the USER statements for newer development (i.e. when compatibiitiy with pre-V11 databases is not necessary)?
Request clarification before answering.
The CREATE/ALTER/DROP USER statements are simply a more modern form of the GRANT CONNECT statement with the added feature that the CREATE/ALTER USER statements can define/alter login policy for the user.
There is no difference between CREATE USER and GRANT CONNECT if you are not defining a login policy for a user. You can in fact switch between these two forms without any issue.
For new development it is really your choice. I would like to say that it would be nice to deprecate the GRANT CONNECT statement (for purely an attempt to keep the language "clean") but I cannot see this happening any time soon.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
41 | |
15 | |
10 | |
9 | |
6 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.