Monday, March 19, 2007

Sybase "sa" Passwords Recovery

1. kill the sybase server

2. edit $SYBASE/ASE-12_5/install/RUN_ file

3. add "-psa" :
#!/bin/sh
#

# ASE page size (KB): 2k # Master device path: /home/sybase/data/master.dat
# Error log path: /home/sybase/ASE-12_5/install/SUN1.log
# Configuration file path: /home/sybase/ASE-12_5/SUN1.cfg

# Directory for shared memory files: /home/sybase/ASE-12_5
# Adaptive Server name: SUN1

# /home/sybase/ASE-12_5/bin/dataserver \
-d/home/sybase/data/master.dat \

-e/home/sybase/ASE-12_5/install/SUN1.log \
-c/home/sybase/ASE-12_5/spxh2_train.cfg \
-M/home/sybase/ASE-12_5 -psa \
-sSUN1 \


4. start the sybase server
./startserver -f RUN_

for example:
.....
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 <-- find this line
.....

5. login sybase: isql -S -Usa -Ptmfyrkdwpibung

6. change sa password: sp_password tmfyrkdwpibung,newpasswd

7. shutdown sybase

8. fallback RUN_ file

9. start sybase again

OK now! =)