Chinaunix首页 | 论坛 | 博客
  • 博客访问: 661516
  • 博文数量: 291
  • 博客积分: 10025
  • 博客等级: 上将
  • 技术积分: 2400
  • 用 户 组: 普通用户
  • 注册时间: 2004-12-04 12:04
文章分类

全部博文(291)

文章存档

2008年(102)

2007年(112)

2006年(75)

2004年(2)

我的朋友

分类: Sybase

2006-08-18 00:08:45

If you forgot your sa password, you can recovery it by using dataserver utility's -psa option.

another important scenario recovery will make sense is in today's very popular storage snapshot. you can take snapshot of production host, then mount the snapshot to a tertiary host, now you can do any work you like on the snapshot host, without snapshot, you should do heavy duty work only in night.

but database administrator is often not reluctant to tell you the sa password, in this case, you can get a new-generated password by -psa option, now you can full control your ASE.

please notice sybase will not store the new password in error log file. so you must get it from the stdin mixed with stderr.

below is how to do it:

first add -psa to your RUN_SERVER file

below is a sample file:

#!/bin/sh
#
# ASE page size (KB): 2048
# Master device path: /dev/rlv_master5
# Error log path: /sybase5/ASE-12_5/install/SNAPSHOT.log
# Configuration file path: /sybase5/ASE-12_5/SNAPSHOT.cfg
# Directory for shared memory files: /sybase5/ASE-12_5
# Adaptive Server name: SNAPSHOT
#
/sybase5/ASE-12_5/bin/dataserver \
-d/dev/rlv_master5 \
-e/sybase5/ASE-12_5/install/SNAPSHOT.log \
-c/sybase5/ASE-12_5/SNAPSHOT.cfg \
-M/sybase5/ASE-12_5 \
-sSNAPSHOT \
-psa \

 

 

then start sybase ASE:

su - $SYBASEUSER -c "cd ASE-12_5/install;startserver -f RUN_SNAPSHOT > $TMPSTARTLOG 2>&1"

# please wait until ASE is fully started

......

# The line include new generated sa password looks like below:

# New SSO password for sa: ************
SAPASSWORD=`grep "
New SSO password for sa" $TMPSTARTLOG|awk -F: '{print $NF}'`

 

阅读(895) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~