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:

  1. Are these according statements identical in their semantics (when omiting a particular login policy)?

  2. Am I supposed to use the USER statements for newer development (i.e. when compatibiitiy with pre-V11 databases is not necessary)?

asked 01 Nov '10, 20:14

Volker%20Barth's gravatar image

Volker Barth
30.8k308456665
accept rate: 32%


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.

permanent link

answered 01 Nov '10, 21:02

Mark%20Culp's gravatar image

Mark Culp
23.2k9132272
accept rate: 40%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×137
×17
×13
×5

question asked: 01 Nov '10, 20:14

question was seen: 4,336 times

last updated: 01 Nov '10, 21:02