Sybase学习日志



sybase学习点滴

连接
isql -Usa -P -Jcp936
清除与关闭日志
dump transaction fmisdb with truncate_only
dump transaction fmisdb with no_log
修改密码:
sp_password null,longtop,sa
查看阻塞是否结束
sp_logshold
//修改Sybase设备大小
alter database tempdb on master=512


高版本下安装低版本的sybase

                               


    安装高版本SYBASE并删除后,无法安装低版本SYBASE,报如下错误:

Errors occurred during the installation.

Unable to installSybase Adaptive Server Enterprise Suite over Sybase Adaptive ServerEnterprise Suite: Installed product has newer version.
不能在目前版本下安装。在网上一位朋友的指点下解决。

   解决:在/winnt目录下检索出“vpd.properties”文件,对该文件改名或者删除即可。这可是人家的经验所得哦,赶紧收藏记录吧,希望对你有所用。


为sybase12.5重罢sa口令


  今天,做个测试,想把sa口令丢失情况下重罢。

  先停掉服务,而后修改Run_XXX.bat(XXX为服务名)。我的实例如下:

rem
e:/sybase/ASE-12_5/bin/sqlsrvr.exe  -de:/oadb/master.dat -scq -ee:/oadb/cq.log -ie:/sybase/ini -Me:/sybase/ASE-12_5 -psa

直接双击运行该批处理文件,启动数据库。控制台显示口令如下:

00:00000:00001:2005/11/08 15:43:23.56 server  Database 'sybsystemprocs' is now o
nline.

New SSO password for sa:bqsfwvnrpuiib8(此为新口令)


解决Sybase中文问题

解决Sybase中文问题:
(1)JDBC连接串要有字符集设置
jdbc:sybase:Tds:192.168.3.11:5000/Wfis_db?charset=cp936
(2)服务器配置成cp936
(a)使用isql查看当前已经安装的字符集
isql -Usa -Plongtop
>use master
>go
>select id,name from syscharsets
>go
 id  name
 --- ----------------
   0 ascii_8
   1 iso_1
   2 cp850
  20 defaultml
  ......

(41 rows affected)
从列表中看出没有安装cp936字符集

(b)查看当前使用的缺省字符集
>sp_configure "default char"
>go
 Parameter Name                 Default     Memory Used Config Value
         Run Value   Unit                 Type
 ------------------------------ ----------- ----------- ------------
         ----------- -------------------- ----------
 default character set id                 2           0           2
                   2 id                   static

缺省字符集的id是2,查看上面的列表,可以得知是cp850

(c)因为上面的列表中没有安装cp936,所以就安装cp936字符集
进入目录C:/sybase/charsets/cp936
运行命令 charset -Usa -Plongtop binary.srt cp936
运行完成后,系统就安装了cp936字符集

(d)验证是否确实安装了cp936字符集
isql -Usa -Plongtop
>use master
>go
>select id,name from syscharsets
>go
 id  name
 --- ------------------------------
   0 ascii_8
   1 iso_1
   2 cp850
  20 defaultml
 ......

(43 rows affected)
从列表中可以发现已经安装了cp936,id是171

(e)把系统的当前缺省字符集设置为cp936
>sp_configure "default char",171
>go
In changing the default sort order, you have also reconfigured SQL Server's
default character set.
 Parameter Name                 Default     Memory Used Config Value
         Run Value   Unit                 Type
 ------------------------------ ----------- ----------- ------------
         ----------- -------------------- ----------
 default character set id                 2           0         171
                   2 id                   static

(1 row affected)
Configuration option changed. Since the option is static, Adaptive Server must
be rebooted in order for the change to take effect.
Changing the value of 'default character set id' to '171' increases the amount
of memory ASE uses by 6K.
(return status = 0)

(f)重启Sybase服务,使更改生效
第一次重启,系统会对已经存在的数据进行转换,转换完成后自动停止服务,只要再次启动服务就可以了。

(g)更改DB客户端的字符集
DBArtisan中要更改客户端的字符集为cp936才能连接cp936的服务器
通过菜单/Logfile/Options...打开对话框,选择Connection标签,
更改Client Character输入框的值为cp936。

数据库的charset修改为cp936时,使用isql按如下的方式
isql -Usa -Plongtop -Sdbserver -Jcp936

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值