22

I'm trying to change an oracle password:

alter user FOO identified by 'BAR';

and I'm getting the following back:

Error starting at line 120 in command:
alter user FOO identified by 'BAR'
Error report:
SQL Error: ORA-00988: missing or invalid password(s)
00988. 00000 -  "missing or invalid password(s)"

What's going on?

Lalit Kumar B
  • 47,486
  • 13
  • 97
  • 124
inanutshellus
  • 9,683
  • 9
  • 53
  • 71

3 Answers3

58

Turns out one doesn't put the password in single quotes. Double quotes are required if the password contains some special characters.

alter user FOO identified by 'BAR'; -- Broken
alter user FOO identified by BAR;   -- Works
alter user FOO identified by "BAR"; -- Works
inanutshellus
  • 9,683
  • 9
  • 53
  • 71
  • 3
    Reviewing version 12c, Oracle documents this requirement under [CREATE USER](http://docs.oracle.com/database/121/SQLRF/statements_8003.htm#SQLRF01503) but unfortunately not under [ALTER USER](https://docs.oracle.com/database/121/SQLRF/statements_4003.htm#SQLRF01103). – mysteryegg Sep 14 '17 at 21:25
  • 2
    At least the error could be "unexpected token ' at..." or something... – masterxilo Feb 12 '19 at 14:07
  • 3
    Your comment about double quotes saved me, who uses password without special characters? – MMMagic Nov 18 '19 at 10:44
  • 2
    Double quotes worked in my case, and the password didn't contain special characters, it was a simple 1234 password – Adrián Jaramillo Nov 28 '22 at 00:15
  • @AdriánJaramillo - Right, in that scenario quotes were acceptable but optional. If you'd had special chars, the double quotes would've been required. – inanutshellus May 15 '23 at 18:29
3

alter user davidl identified by "newpassword" replace "oldpassword";

David Lipschitz
  • 104
  • 2
  • 7
0

For me I was altering two users in the same script file, which did not work. I had to alter them in a different script files.

Sql tool: Golden

Zeus
  • 6,386
  • 6
  • 54
  • 89