Sybase install on AS4 U5
一、
安装前准备
1.
软件准备
官方网站注册并下载开发版
sybase
:服务端
ase1252_de_linux
和客户端
pcclient_1252 OS
:
RedHat
AS4 U5
Tools
:
Xmanager3.0
企业版
2.
设置共享内存
1)
显示共享内存
# /sbin/sysctl kernel.shmmax
2)
设置共享内存
# /sbin/sysctl -w kernel.shmmax=67108864
(
64*1024*1024
,临时生效,如果不加人
/etc/rc.d/rc.local
)
3)
/etc/rc.d/rc.local
为了保证每次重新启动系统都生效
,
修改如下
,
编辑
/etc/rc.d/rc.local (/etc/init.d/boot.local onSuSE)
末尾加入,保证每次系统重新启动共享内存都是这个数值。
[root@AS4-test cdrom]$ vi /etc/rc.d/rc.local
#!/bin/sh
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
sysctl -w kernel.shmmax=67108864
3.
添加
sybase
用户和软件目录
1)
建立用户
[root@AS4-test ~]# useradd sysbase
[root@AS4-test ~]# passwd sybase
Changing password for user sybase.
New UNIX password:
BAD PASSWORD: it is too simplistic/systematic
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
2)
建立目录
[root@AS4-test ~]# mkdir /opt/sybase-12.5
[root@AS4-test ~]# chown �CR sybase.sybase /opt/sybase-12.5/
[root@AS4-test ~]# cd /opt
[root@AS4-test opt]# ll
total 8
drwxr-xr-x 34 informix informix 4096 Dec 29 11:58 informix
drwxr-xr-x 2 sybase sybase 4096 Jan 8 06:27 sybase-12.5
3)
安装包目录设置
还要保证
sybase
用户对安装包所在的目录拥有所有权
[sybase@AS4-test home]$ ll
total 294532
drwx------ 3 Andy Andy 4096 Dec 29 09:11 Andy
drwxrwxrwx 5 sybase sybase 4096 Jan 8 05:36 cdrom
-rw-r--r-- 1 root root 301281280 Dec 29 09:49 iif.11.50.UC3DE.Linux-RHEL4.tar
drwx------ 5 informix informix 4096 Dec 30 09:50 informix
drwx------ 4 sybase sybase 4096 Jan 8 06:46 sybase
drwx------ 3 sysbase sysbase 4096 Jan 8 06:47 sysbase
[sybase@AS4-test ~]$ cd /home/cdrom/
[sybase@AS4-test cdrom]$ ll
total 380444
drwxrwxrwx 2 sybase sybase 4096 Jul 7 2004 archives
-rw-r--r-- 1 sybase sybase 388514438 Jan 8 05:22 ase1252_de_linux.tgz
drwxrwxrwx 5 sybase sybase 4096 Jan 8 05:56 JVM
-rwxrwxrwx 1 sybase sybase 12 Jul 7 2004 media.inf
-rwxrwxrwx 1 sybase sybase 649647 Jul 7 2004 setup
drwxrwxrwx 5 sybase sybase 4096 Jul 7 2004 suite
[sybase@AS4-test cdrom]$
二、
执行安装任务
安装分成图形界面
和
console
两种方式
1.
图形安装方式
首先操作系统要启用图形界面服务
1)
设置显示变量
[root@AS4-test opt]# xhost
(空格)
+
access control disabled, clients can connect from any host
[root@AS4-test opt]# su �C sybase
(切换到
sybase
用户)
[sybase@AS4-test ~]$ export DISPLAY= 10.8.1 .238:0.0
验证
DISPLAY
变量设置是否生效
[sybase@AS4-test ~]$ env
HOSTNAME=AS4-test
SHELL=/bin/bash
TERM=xterm
HISTSIZE=1000
QTDIR=/usr/lib/qt-3.3
USER=sybase
LS_COLORS=no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:
KDEDIR=/usr
MAIL=/var/spool/mail/sybase
PATH=/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/sybase/bin
INPUTRC=/etc/inputrc
PWD=/home/sybase
LANG=en_US.UTF-8
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
SHLVL=1
HOME=/home/sybase
LOGNAME=sybase
LESSOPEN=|/usr/bin/lesspipe.sh %s
DISPLAY= 10.8.1 .238:0.0
G_BROKEN_FILENAMES=1
_=/bin/env
2)
转到安装目录
/home/cdrom/
,执行
setup
[sybase@AS4-test ~]$ cd /home/cdrom/
[sybase@AS4-test cdrom]$ ls
archives ase1252_de_linux.tgz JVM media.inf setup suite
[sybase@AS4-test cdrom]./ setup
2.
Console
安装方式(主要以此方式为主)
[sybase@AS4-test ~]$ cd /home/cdrom/
1)
选择“
1
”(继续)
[sybase@AS4-test cdrom]$ ./setup -console
InstallShield Wizard
Initializing InstallShield Wizard...
Searching for Java(tm) Virtual Machine...
........
Running InstallShield Wizard...
-------------------------------------------------------------------------------
Welcome to the InstallShield Wizard for Sybase Adaptive Server Enterprise Suite
version 12.5.2 GA
The InstallShield Wizard will install Sybase Adaptive Server Enterprise Suite
on your computer.
To continue, choose Next.
Press 1 for Next, 3 to Cancel or 4 to Redisplay [1] 1
2)
选择安装地区“
36
”(其它地区)
-------------------------------------------------------------------------------
1) Argentina 2) Australia
3) Belgium (English) 4) Belgium (French)
5) Brazil 6) Canada
7) Denmark 8) Europe,Middle East, and Africa - General
9) France (English) 10) France(French)
11) Germany (English) 12) Germany (German)
13) Hong Kong 14) India
15) Italy (English) 16) Italy ( Italy )
17) Japan 18) Korea
19) Malaysia 20) Mexico
21) Netherlands 22) New Zealand
23) Norway 24) People's Republic of China (PRC)
25) Philippines 26) Singapore
27) Spain (English) 28) Spain (Spanish)
29) Sweden 30) Switzerland (English)
31) Switzerland (German) 32) Taiwan
33) Thailand 34) United Kingdom
35) United States of America 36) Any Other Locations
Please enter the number of the location you are installing. (1-37) [1] 36
3)
阅读并接受许可协议
LICENSE AGREEMENT
United States
and Canada
IMPORTANT NOTICE: Read this License Agreement ("Agreement") carefully before
using the enclosed Program. You may Use the Program acquired in the United
States and Canada only, in accordance with the following terms and conditions.
IF YOU DO NOT AGREE TO BE BOUND BY THESE TERMS, YOU MAY NOT USE THE PROGRAM. By
installing or using the Program in any way, You acknowledge that You have read,
understand and agree to the terms of this Agreement. If You do not agree with
these terms, promptly return the Program and package (and all other product
contents, including Documentation) with Your receipt or other proof of purchase
to the entity from which You obtained this product within 30 days and request a
refund. THIS IS A LICENSE AND NOT A SALE .
click the "I agree" button if you wish to install the program.
If You, Your company, or Your public agency have signed a written software
license agreement with Sybase, Inc., or Sybase Canada Limited ("Sybase") or a
4)
输入“
q
”
Press ENTER to read the text [Type q to quit] q
If you cannot read the agreement for the related location, you may not have the
fonts installed on your system to view the agreement properly. If you cannot
read this agreement, go to [url]www.sybase.com/softwarelicenses[/url] and read it there
before agreeing.
5)
同意协议,输入“
y
”
I agree to the terms of the Sybase license for the install location
specified.(Y/N) [N]y
6)
输入“
1
”
Press 1 for Next, 2 for Previous, 3 to Cancel or 4 to Redisplay [1] 1
7)
输入安装目录
/opt/sybase-12.5
Destination Directory [/opt/sybase] /opt/sybase-12.5
8)
输入“
1
”
Press 1 for Next, 2 for Previous, 3 to Cancel or 4 to Redisplay [1] 1
9)
选择安装方式“
1
”(典型安装)
-------------------------------------------------------------------------------
Choose the setup type that best suits your needs.
[X] 1 - Typical
The program will be installed with the suggested configuration.
Recommended for most users.
[ ] 2 - Full
The program will be installed with all the products and features.
[ ] 3 - Custom
The program will be installed with the features you choose.
Recommended for advanced users.
To select an item enter its number, or 0 when you are finished: [0]
回车
(
0
代表安装方式选择完毕,保持默认选择)
注意
:选择其它安装方式,输入相应数字(
1
,
2
,
3
),如选择
2
-------------------------------------------------------------------------------
Choose the setup type that best suits your needs.
[X] 1 - Typical
The program will be installed with the suggested configuration.
Recommended for most users.
[ ] 2 - Full
The program will be installed with all the products and features.
[ ] 3 - Custom
The program will be installed with the features you choose.
Recommended for advanced users.
To select an item enter its number, or 0 when you are finished: [0] 2
[ ] 1 - Typical
The program will be installed with the suggested configuration.
Recommended for most users. [X] 2 - Full
The program will be installed with all the products and features.
[ ] 3 - Custom
The program will be installed with the features you choose.
Recommended for advanced users.
To select an item enter its number, or 0 when you are finished: [0]
回车(选择完毕后回车)
10)
进入下一个步骤,输入“
1
”
Press 1 for Next, 2 for Previous, 3 to Cancel or 4 to Redisplay [1] 1
Performing install checks. Please wait...
Please wait...
-------------------------------------------------------------------------------
Sybase Adaptive Server Enterprise Suite will be installed in the following
location:
/opt/sybase-12.5
with the following features:
Sybase Servers
Adaptive Server Enterprise
ASE Diagnostic Server
Replicator
SQL Remote for ASE
Connectivity
Open Client
Common ctlib files
Common dblib files
ASE Data Providers
Language Modules
jConnect 5.5 for JDBC
jConnect 6.0 for JDBC
11)
输入“回车”
Press ENTER to read the text [Type q to quit]
回车
Shared
ASE Adminstration Tools
Sybase Central
Adaptive Server Plugin
Job Scheduler Templates and Utilities
Sybase Software Asset Management
for a total size:
577.5 MB
12)
输入“
1
”
Press 1 for Next, 2 for Previous, 3 to Cancel or 4 to Redisplay [1]1
Installing Sybase Adaptive Server Enterprise Suite. Please wait...
|-----------|-----------|-----------|------------|
0% 25% 50% 75% 100%
||||||||||||||||||||||||||||||||||||||||||||||||||
Creating uninstaller...
-------------------------------------------------------------------------------
The InstallShield Wizard has successfully installed Sybase Adaptive Server
Enterprise
Suite. Choose Next to continue the wizard.
13)
输入“
1
”
Press 1 for Next, 3 to Cancel or 4 to Redisplay [1]1
-------------------------------------------------------------------------------
The Adaptive Server Enterprise product contains a number of programs in
addition to the Adaptive Server Enterprise database server. At this point in
the installation you can choose to create a new Adaptive Server Enterprise
server installation and to configure Backup Server, XP Server, and Monitor
Server components. If you select the options on this screen, you will be given
the option of specifying configuration options for each server or to allow the
installer to set default values for these on the next screen. If you do not
choose to configure the servers at this time, you can configure them using the
ASE configuration utility at a later time.
Configure New Servers
Please deselect any servers that you do not want to configure now :
[X] 1 - Configure new Adaptive Server
[X] 2 - Configure new Backup Server
[X] 3 - Configure new Monitor Server
[X] 4 - Configure new XP Server
14)
输入“
0
”
To select an item enter its number, or 0 when you are finished [0]:0
Press 1 for Next, 2 for Previous, 3 to Cancel or 4 to Redisplay [1] 1
-------------------------------------------------------------------------------
You have chosen to configure the servers listed below. You can accept default
configuration values or provide customized values for the configuration options
required by each server. If you do not select custom configuration below, this
installer will configure the servers you have selected with default values. If
you accept default values at this time you can change the configuration values
for a server at a later time.
Custom Configure New Servers
Please select the servers that you want to custom configure.
[ ] 1 - Custom configure new Adaptive Server
[ ] 2 - Custom configure new Backup Server
[ ] 3 - Custom configure new Monitor Server
[ ] 4 - Custom configure new XP Server
To select an item enter its number, or 0 when you are finished [0]: 1
[X] 1 - Custom configure new Adaptive Server
[ ] 2 - Custom configure new Backup Server
[ ] 3 - Custom configure new Monitor Server
[ ] 4 - Custom configure new XP Server
To select an item enter its number, or 0 when you are finished [0]: 0
Press 1 for Next, 2 for Previous, 3 to Cancel or 4 to Redisplay [1] 1
[sybase@AS4-test cdrom]$
到此基本安装完成,新建了一个
Custom configure new Adaptive Server
三、
数据库管理
1.
数据库变量设置
将
/opt/sybase-12.5/
目录下的
SYBASE.sh
文件内容复制到
/home/sybase
目录下的
bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
unset USERNAME
以上为文件原有
#!/bin/sh
(注释掉)
SYBASE_ASE="ASE-12_5"
export SYBASE_ASE
LD_LIBRARY_PATH="/opt/sybase-12.5/ASE-12_5/lib":$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
PATH="/opt/sybase-12.5/JS-12_5/bin":$PATH
export PATH
SYBASE_FTS="EFTS-12_5_2"
export SYBASE_FTS
PATH="/opt/sybase-12.5/\$SYBASE_FTS/bin":$PATH
export PATH
export LD_LIBRARY_PATH
PATH="/opt/sybase-12.5/RPL-12_5/bin":$PATH
export PATH
LD_LIBRARY_PATH="/opt/sybase-12.5/SQLRemote/lib":$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
SYBASE_WS="WS-12_5"
export SYBASE_WS
SYBASE="/opt/sybase-12.5"
export SYBASE
SYBASE_OCS="OCS-12_5"
export SYBASE_OCS
PATH="/opt/sybase-12.5/OCS-12_5/bin":$PATH
export PATH
LD_LIBRARY_PATH="/opt/sybase-12.5/OCS-12_5/lib:/opt/sybase-12.5/OCS-12_5/lib3p":$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
LD_LIBRARY_PATH="/opt/sybase-12.5/ODBC-12_5/lib":$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
SYBASE_SYSAM="SYSAM-1_0"
export SYBASE_SYSAM
LM_LICENSE_FILE="/opt/sybase-12.5/SYSAM-1_0/licenses/license.dat"
export LM_LICENSE_FILE
~
2.
启动数据库服务器
[sybase@localhost ~]$startserver
[sybase@SybaseServer ~]$ RUN_LOCALHOST
(
LOCALHOST
为数据库服务器名称)
3.
显示数据库
[sybase@localhost bin]$ showserver
F S UID PID PPID C PRI NI ADDR SZ WCHAN STIME TTY TIME CMD
0 S sybase 18306 18305 0 76 0 - 17277 - 12: 50 pts /1 00:00:00 /opt/sybase-12.5/ASE-12_5/bin/monserver -SLOCALHOST - Usa -P -l/opt/sybase-12.5/ASE-12_5/install/LOCALHOST_MS.log -L/opt/sybase-12.5/ASE-12_5/LOCALHOST_MS.cfg -m/opt/sybase-12.5/ASE-12_5 -MLOCALHOST_MS
0 S sybase 18295 18294 0 77 0 - 2215 - 12: 50 pts /1 00:00:00 /opt/sybase-12.5/ASE-12_5/bin/backupserver -e/opt/sybase-12.5/ASE-12_5/install/LOCALHOST_BS.log -N25 -C20 -M/opt/sybase-12.5/ASE-12_5/bin/sybmultbuf -SLOCALHOST_BS
0 S sybase 18283 18282 0 75 0 - 24434 - 12:49 ? 00:00:14 /opt/sybase-12.5/ASE-12_5/bin/dataserver -sLOCALHOST -d/opt/sybase-12.5/data/master.dat -e/opt/sybase-12.5/ASE-12_5/install/LOCALHOST.log -c/opt/sybase-12.5/ASE-12_5/LOCALHOST.cfg -M/opt/sybase-12.5/ASE-12_5
4.
登录数据库
[sybase@localhost bin]$ isql -SLOCALHOST - Usa -P
Msg 2401, Level 11, State 2:
Server 'LOCALHOST':
Character set conversion is not available between client character set 'utf8'
and server character set 'iso_1'.
No conversions will be done.
1>
注意:
安装后默认,用户名:
sa
密码:空
服务器名称:
LOCALHOST
5.
停止数据库服务器
[sybase@SybaseServer ~]$ isql - Usa -SLOCALHOST -P
Msg 2401, Level 11, State 2:
Server 'LOCALHOST':
Character set conversion is not available between client character set 'utf8'
and server character set 'iso_1'.
No conversions will be done.
1> shutdown with nowait
2> go
Server SHUTDOWN by request.
The SQL Server is terminating this process.
CT-LIBRARY error:
ct_results(): network packet layer: internal net library error: Net-Library operation terminated due to disconnect
[sybase@SybaseServer ~]$ showserver
F S UID PID PPID C PRI NI ADDR SZ WCHAN STIME TTY TIME CMD
0 S sybase 18295 18294 0 77 0 - 2215 - 12: 50 pts /1 00:00:00 /opt/sybase-12.5/ASE-12_5/bin/backupserver -e/opt/sybase-12.5/ASE-12_5/install/LOCALHOST_BS.log -N25 -C20 -M/opt/sybase-12.5/ASE-12_5/bin/sybmultbuf -SLOCALHOST_BS
[sybase@SybaseServer ~]$
四、
客户端连接
1.
安装客户端
安装
pcclient_1252
的
setupconsole
程序组件
在
winxp
中地区选择中华人民共和国
Full
(完全方式)安装
2.
建立连接
指定sybase数据库的IP:端口方式使用sa用户连接,第一次连接密码为空
单击
ok