isql -Dxxx -Uxxx -P111111 用isql连接数据库发现数据库没有启动。
如何启动sybase数据库?
[TA_SYBASE][/home/bta]su - sybase //切换到sybase用户。
Password: handsome
[sybase@yudj ~]$ pwd
/sdb1/sybase
//说明:sdb1为挂载虚拟机磁盘。
/////sdb1/sybase/ASE-12_5/install在这个路径下启动sybase.
[sybase@yudj ~]$ ls
ASE-12_5 OCS-12_5 SYBASE.csh _jvm data jConnect-5_5 media.inf sybcent41
ASEP ODBC-12_5 SYBASE.env charsets installed jConnect-6_0 setup uninstall
HSFSS_SYBASE.cfg RPL-12_5 SYBASE.sh collate interf.old locales shared-1_0 vpd.properties
JS-12_5 SQLRemote SYSAM-1_0 config interfaces log.txt sybase
[sybase@yudj ~]$ cd ASE-12_5
[sybase@yudj ASE-12_5]$ ls
HSFSS_SYBASE.001 HSFSS_SYBASE.007 HSFSS_SYBASE.013 HSFSS_SYBASE.019 HSFSS_SYBASE.bak certificates scripts
HSFSS_SYBASE.002 HSFSS_SYBASE.008 HSFSS_SYBASE.014 HSFSS_SYBASE.020 HSFSS_SYBASE.cfg debugger sqlsrv.res
HSFSS_SYBASE.003 HSFSS_SYBASE.009 HSFSS_SYBASE.015 HSFSS_SYBASE.021 HSFSS_SYBASE.krg init sybhelp
HSFSS_SYBASE.004 HSFSS_SYBASE.010 HSFSS_SYBASE.016 HSFSS_SYBASE.022 HSFSS_SYBASE.srg0 install symlib
HSFSS_SYBASE.005 HSFSS_SYBASE.011 HSFSS_SYBASE.017 HSFSS_SYBASE.023 bin lib upgrade
HSFSS_SYBASE.006 HSFSS_SYBASE.012 HSFSS_SYBASE.018 HSFSS_SYBASE.024 bsrv.res sample xappdefaults
[sybase@yudj ASE-12_5]$ cd install
[sybase@yudj install]$ ls
HSFSS_SYBASE.log RUN_HSFSS_SYBASE SPR auditinit.sym setperm_monserv startserver sybinit.err
HSFSS_SYBASE_BS.log RUN_HSFSS_SYBASE_BS auditinit setperm_all showserver sybhauser veritas
[sybase@yudj install]$ RUN_HSFSS_SYBASE
启动成功为:
00:00000:00001:2014/05/06 00:50:36.88 server Master device size: 30 megabytes, or 15360 virtual pages. (A virtual page is 2048 bytes.)
---------------------------------------------------------------------------------------------------------------------
[root@yudj ~]# df
Filesystem 1K-块 已用 可用 已用% 挂载点
/dev/mapper/VolGroup00-LogVol00
5482948 2501756 2702664 49% /
/dev/sda1 101086 9145 86722 10% /boot
none 150364 0 150364 0% /dev/shm
[root@yudj ~]# mount /dev/sdb1 /sdb1 //执行挂载命令。
--------------------------------------------------------------------------------------------------------------------
如何查看sybase数据库连接的端口?
用syase用户登录:
[TA_SYBASE][/home/bta]su - sybase
Password:
[sybase@yudj ~]$
[sybase@yudj ~]$ pwd
/sdb1/sybase
[sybase@yudj ~]$ ls
ASE-12_5 OCS-12_5 SYBASE.csh _jvm data jConnect-5_5 media.inf sybcent41
ASEP ODBC-12_5 SYBASE.env charsets installed jConnect-6_0 setup uninstall
HSFSS_SYBASE.cfg RPL-12_5 SYBASE.sh collate interf.old locales shared-1_0 vpd.properties
JS-12_5 SQLRemote SYSAM-1_0 config interfaces log.txt sybase
看到interfaces这个文件名:
[sybase@yudj ~]$ vi interfaces
HSFSS_SYBASE
master tcp ether 192.168.236.128 61001
query tcp ether 192.168.236.128 61001
HSFSS_SYBASE_BS
master tcp ether yudj 61002
query tcp ether yudj 61002
HSFSS_SYBASE下面的就是看到主机的ip地址和数据库连接的端口。
-----------------------------------------------------------------------------------------------------------------------
如果主机的ip地址发生了变化,需要修改两个文件。
1.就是上面的interfaces文件中的ip地址。
2。用root用户修改/etc/hosts文件。将hosts文件中的ip地址改成目前新的主机地址。
[TA_SYBASE][/home/bta]su - root
Password:
[root@yudj ~]# cd /etc
[root@yudj etc]# vi hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost
192.168.236.128 yudj.hsjr yudj