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
39.5k355539811
accept rate: 34%


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
24.8k9139295
accept rate: 41%

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:

×143
×23
×15
×7

question asked: 01 Nov '10, 20:14

question was seen: 5,747 times

last updated: 01 Nov '10, 21:02