Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

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

Unlock user in Oracle10g

How can unlock users in oracle10g?Tell me various possible ways?
0
Vijay Kamble
Asked:
Vijay Kamble
  • 8
  • 4
  • 3
  • +4
1 Solution
 
AnuroopsunddCommented:
ones you login with sys account put below command.
alter user username account unlock;
0
 
AnuroopsunddCommented:
0
 
FaherCommented:
Lets suppose you have a user HR which account is locked, you can unlock that user by following command.

NOte: you need to connect to oracle database via sqlplus using system or sys user

alter user hr account unlock;

or

alter user hr identified by password account unlock; (using this command you are setting new password for that user and unlocking its account
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
Vijay Kamblesoftware engineerAuthor Commented:
when i run command  "alter user sysdba account unlock;"
 it give me error
"SP2-0734: unknown command beginning "lter user ..." - rest of line ignored.
SQL>  alter user sysdba account unlock;
 alter user sysdba account unlock
*
ERROR at line 1:
ORA-01031: insufficient privileges"
0
 
FaherCommented:
sysdba is not any account its privileges. sys user has sysdba pribileges only and this account can not be locked or unlocked as this user is always unlocked because this is super user like root in unix and administrator in windows environment

which user you want to unlock ?
first check which user account account is locked by executing below query

select username from dba_users where account_status='LOCKED';

if there is any user whos account is locked you can unlock that user by executing below command. (lets suppor user abc account is locked)

alter user abc account unlock;


NOTE: Above all command will be executed by sys or system user .

you can check current user by typing command show user on sqlplus
0
 
Vijay Kamblesoftware engineerAuthor Commented:
i am unable to login in sysdba.In user name i type sysdba password sysdba and hotstring is left blank then i am unable to login.
0
 
OP_ZaharinCommented:
- sysdba is not a user. you can login as a SYS user using sysdba privileges as follows in command prompt:

sqlplus sys/<password> as sysdba
0
 
Vijay Kamblesoftware engineerAuthor Commented:
i am still unable to do that?
0
 
OP_ZaharinCommented:
- can you share the error? it might be related to privileges.

- kindly noted that when using command prompt, you need to run it as Administrator (right click on command prompt icon and choose to run as administrator). also add the OS user you login as, in ORA_DBA group - (on windows) Administrative Tool> Local Users and Groups> Groups> ORA_DBA.

- then try the following:

sqlplus sys/<password>@<youroraclesid> as sysdba
0
 
Wasim Akram ShaikCommented:
Some more information on question will help us to resolve your problem quickly author..

Which OS are you using??

What is the version of oracle(this doesn't matter much, just for information)

By Which user have you logged into your OS??

(If it is sysdba, then you don't have to reset the password), can i know the reason why you want to alter sys privileges?

irrespective of your OS, the command expert OPZaharin suggested will work with a little bit modifications(if you are connected to the same machine where in the database is hosted)

sqlplus "/ as sysdba"

here you can issue any user you want(except sysdba as sysdba is a role not a user)

alter user system identified by "<password>"
0
 
Vijay Kamblesoftware engineerAuthor Commented:
1)I AM USING WIN XP
2)ORACLE 10G
3)I AM LOGGING BY USER SCOTT
0
 
OP_ZaharinCommented:
- scott in default doesnt have sysdba privileged. to login as sysdba you need to use SYS user account. and scott doesnt have the privileged to unlock user. you can login as SYSTEM user to unlock user. in command prompt run the following:

sqlplus system/<thesystempassword>


- then in sqlplus execute unlock user statement. if you want to unlock scott user, replace <username> with scott:
alter user <username> account unlock;
0
 
Vijay Kamblesoftware engineerAuthor Commented:
But dont know the SYSTEM user password
0
 
Wasim Akram ShaikCommented:
then go to command prompt

ie. click on start and click on run and type

sqlplus "/ as sysdba"

after this execute the command

alter user <username> account unlock;
0
 
Sherif_KhiderCommented:
logon to the database using sys as sysdba

then the only way is

alter user <username> account unlock;
0
 
Wasim Akram ShaikCommented:
expert Sherif_Khider.. the comment which you had posted has already been suggested.. please don't post duplicate information...
0
 
Vijay Kamblesoftware engineerAuthor Commented:
how can i do in win7..
0
 
Vijay Kamblesoftware engineerAuthor Commented:
i upgrade my os i am using Win7..
0
 
slightwv (䄆 Netminder) Commented:
OS really has nothing to do with the question.

The alter user syntax above is for sqlplus (or sql developer/toad/???).  What OS is running doens't matter.
0
 
Vijay Kamblesoftware engineerAuthor Commented:
sqlplus "/ as sysdba"
this no working ..
i run command prompt then run this command because in win7 this command not working..
0
 
slightwv (䄆 Netminder) Commented:
Define 'not working'.  Are you getting an error message?   Are you getting "command not found"? what?
0
 
Sherif_KhiderCommented:
Dear expert wasimibm the new information in my post is that is the only way , thanks for your attention
0
 
Wasim Akram ShaikCommented:
shouldn't there be a split here..!!!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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