Simpler Navigation for Servers and Operating Systems
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
Showing results for 
Search instead for 
Did you mean: 

Lock account for SA

Go to solution
Valkiria Santos
Frequent Advisor

Lock account for SA

Hello all,

Can anybody help me? After apply security system in my Sybase??s Database, I mistake my sa??s password and the system lock my account. How I can enable my password or user SA for Sybase?

Stefan Farrelly
Honored Contributor

Re: Lock account for SA

If its your unix account youre talking about then to unlock it do;

/usr/lbin/modprpw -k
Im from Palmerston North, New Zealand, but somehow ended up in London...
Valkiria Santos
Frequent Advisor

Re: Lock account for SA

My account was locked in database, not in OS.

James Beamish-White
Trusted Contributor

Re: Lock account for SA

Found this on a newsgroup...

If the server is actually running, then you need to stop it. We know that the only accounts that can stop the server in a nice manner are not available, so it has to be some sort of kill. You can try:

kill -15

(they are identical) which is designed to be caught by ASE, which then performs the equivalent of shutdown with nowait. If ASE does not die, and you should give it a little while to catch and act on the signal, then you might have to try other measures, which is probably kill -9. Note that if you have tables with identity columns, most of these will jump alarmingly, unless you are using ASE 12.5 and the identity interval is set to 1.

Once down, edit the RUN_SERVER file ( RUN_SERVER.bat on NT) and add "-psa" (it
is important not to leave a space between the"-p" and the "sa", and that it is
all lower-case) to the end of the dataserver or sqlsrvr.exe line. You will end
up with a file that looks a bit like:
# Adaptive Server name: N_UTSIRE
# Master device path: /data/sybase/databases/N_UTSIRE/master.dat
# Error log path: /opt/sybase-11.9.2/install/N_UTSIRE.log
# Directory for shared memory files: /opt/sybase-11.9.2
# Regenerate sa password -psa
/opt/sybase-11.9.2/bin/dataserver -sN_UTSIRE -d/data/sybase/databases/N_UTSIRE/master.dat -e/opt/sybase-11.9.2/install/N_UTSIRE.log -M/opt/sybase-11.9.2 -psa
(I add the line mentioning the regenerate, so that if I need to do this in a moment of extreme pressure it is there in front of my nose.

Now, start the server again and you should see the following on the screen:
00:00000:00001:2001/05/26 18:29:21.39 server 'bin_iso_1' (ID = 50)
00:00000:00001:2001/05/26 18:29:21.39 server on top of default character set:
00:00000:00001:2001/05/26 18:29:21.39 server 'iso_1' (ID = 1).
00:00000:00001:2001/05/26 18:29:21.39 server Loaded default Unilib conversion handle.

New SSO password for sa:tmfyrkdwpibung

Note that it is not written to the log file, so keep your eyes peeled.

Remember to remove the "-psa" from the "RUN" file before you start the server again or else the password will be changed again for you.
GARDENOFEDEN> create light
Valkiria Santos
Frequent Advisor

Re: Lock account for SA

Thanks James, you solve my problem! :-)