[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3350
  • Last Modified:

Changing password in SQL Plus?

Hello, silly question... I know... but I can't seem to get this to work... I looked it up on google and found the syntax:

Alter user username identified by "password";

But this doesn't work... when I put it in I get this error:
ERROR at line 1:
ORA-28221: REPLACE not specified

Can someone give me the exact syntax for this?

Thanks!
0
Roxanne25
Asked:
Roxanne25
  • 3
  • 2
  • 2
  • +1
1 Solution
 
schwertnerCommented:
as user SYS:

ALTER USER scott IDENTIFIED BY lion;

Sometimes by copy paste one get such strange errors.
0
 
Roxanne25Author Commented:
I don't have user sys... I'm logged into the oracle system with my login and I want to change my password as it is expiring soon and I have to change it.
0
 
schwertnerCommented:
You can alter his own password. But not others.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
ZopiloteCommented:
Hi,
The REPLACE keyword is new to Oracle 9.2. In previous versions of Oracle, any user could change their password using the ALTER USER... statement. Keep in mind that this includes ALL users regardless if they have the ALTER USER system privilege

connect roxanne/roxannepwd;
alter user roxanne identified by newpass replace roxannepwd;


Z;D
0
 
oratimCommented:
from the SQL prompt type

SQL> password

you will be prompted to enter your old paswrod, then new password, the confirm new password
0
 
Roxanne25Author Commented:
Thanks Zopilote!  That was the thing I was missing! :)
0
 
Roxanne25Author Commented:
oratim,

That does not work for oracle 9i, sorry forgot to mention which version I was using.
0
 
ZopiloteCommented:
"The REPLACE keyword is new to Oracle 9.2. In previous versions of Oracle, any user could change their password using the ALTER USER... statement. Keep in mind that this includes ALL users regardless if they have the ALTER USER system privilege"
Extracted from Jeff Hunter's site. http://www.idevelopment.info/

Z;D
0
 
oratimCommented:
no problem

glad you got an answer

tim
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now