首先使用root用户创建一个专有的sybase用户以及sybase的目录
然后切换到sybase用户下进行安装 //切记一定要在sybase用户下面安装
***将安装包上传到sybase目录下使用命令 ./setup -console进行安装
Step1:安装数据库sybase
安装步骤:
1、询问安装地点而显示License信息,因为安装软件显示中文有问题,一般选择“United States of America”而让其显示英文信息。
2、询问是否同意License声明,选择“YES”,表示同意。
3、询问软件安装根目录,输入“/sybase/sybase”。//要安装的目录
4、询问软件安装类型,选择“Full”,即全部安装。
5、确认后,即开始软件的安装。
在软件安装完毕后,继续询问是否配置数据库Server和备份Server等,此时选择全部不配置(后面单独配置),退出软件安装。
安装完成后,为了sybase用户登录时自动装载Sybase相关环境变量,需要在sybase用户HOME目录下编辑“.bash_profile”文件,加入如下两行:
在Red Hat Linux5操作系统上,必须要加LD_POINTER_GUARD环境变量,否则Sybase无法运行,报“Segmentation Fault"错误。需在.bash_profile中增加一行“export LD_POINTER_GUARD=0”。
- . ${HOME}/SYBASE.sh
- export LD_POINTER_GUARD=0
Sybase安装后,
在/etc/hosts文件中添加一行:127.0.0.1 dacsdb
在/etc/sysconfig/network文件中HOSTNAME=" " 一行修改为HOSTNAME=dacsdb
Step2: 创建数据库server: LCDACS_SERVER
1.编辑资源文件srvbuild.LCDACS_SERVER.rs:
- sybinit.release_directory: USE_DEFAULT
- sybinit.product: sqlsrv
- sqlsrv.server_name: LCDACS_SERVER
- sqlsrv.new_config: yes
- sqlsrv.do_add_server: yes
- sqlsrv.network_protocol_list: tcp
- sqlsrv.network_hostname_list: dacsdb
- sqlsrv.network_port_list: 7100
- sqlsrv.server_page_size: 16k
- sqlsrv.force_buildmaster: no
- sqlsrv.master_device_physical_name: /data/sysdata/master.dat
- sqlsrv.master_device_size: 1024
- sqlsrv.master_database_size: 512
- sqlsrv.errorlog: USE_DEFAULT
- sqlsrv.do_upgrade: no
- sqlsrv.sybsystemprocs_device_physical_name:/data/sysdata/sybsystemprocs.dat
- sqlsrv.sybsystemprocs_device_size: 256
- sqlsrv.sybsystemprocs_database_size: 256
- sqlsrv.default_backup_server: BACKUP_LCDACS_SERVER
2.执行rs文件,创建server:
ASE-12_5/bin/srvbuildres -r dacs/srvbuild.LCDACS_SERVER.rs (其中srvbuild.LCDACS_SERVER.rs该文件放在sybase/dacs/文件下)
3. 编辑资源文件 srvbuild.DACS_BACK.rs
- sybinit.release_directory: /sybase/sybase
- sybinit.product: bsrv
- bsrv.server_name: BACKUP_LCDACS_SERVER
- bsrv.new_config: yes
- bsrv.do_add_backup_server: yes
- bsrv.do_upgrade: no
- bsrv.network_protocol_list: tcp
- bsrv.network_hostname_list: dacsdb
- bsrv.network_port_list: 7200
- bsrv.language: USE_DEFAULT
- bsrv.character_set: USE_DEFAULT
- bsrv.tape_config_file: USE_DEFAULT
- bsrv.errorlog: USE_DEFAULT
- sqlsrv.related_sqlsrvr: CPAS_SERVER
- sqlsrv.sa_login: sa
- sqlsrv.sa_password: USE_DEFAULT
4. 创建backup server:
在HOME目录下面执行命令创建back server: ASE-12_5/bin/srvbuildres -r dacs/srvbuild.DACS_BACK.rs
Step3:创建数据库并更改sybase参数
- disk init name ="lcdacs",physname="/data/sysdata/lcdacs.dat",size="2g",dsync=true
- go
- disk init name ="lcdacs_log",physname="/data/sysdata/lcdacs_log.dat",size="2g",dsync=true
- go
- create database LCDACS on lcdacs="30G" log on lcdacs_log="2G"
- go
- sp_addlogin dacs,dacs123,"LCDACS"
- go
- use LCDACS
- go
- sp_changedbowner dacs
- go
- use master
- go
- DISK INIT name = 'tempdbdev01', physname = '/data/sysdata/tempdbdev01.dat' , size = '1G',dsync = 'false'
- go
- DISK INIT name = 'tempdbdev01_log', physname = '/data/sysdata/tempdbdev01_log.dat' , size = '1G',dsync = 'false'
- go
- ALTER DATABASE tempdb ON tempdbdev01 = '1G' LOG ON tempdbdev01_log = '1G'
- go
- USE tempdb
- Go
- EXEC sp_dropsegment 'logsegment', 'tempdb', 'master'
- go
- EXEC sp_dropsegment 'system', 'tempdb', 'master'
- go
- EXEC sp_dropsegment 'default', 'tempdb', 'master'
- Go
- use master
- go
- sp_configure "max memory",0,"1G"
- go
- sp_configure "allocate max shared mem",1
- go
- sp_cacheconfig "default data cache","1G"
- go
- sp_cacheconfig "default data cache","cache_partition=2"
- go
- sp_poolconfig "default data cache","768M","32k"
- go
- sp_configure "procedure cache size",1024000
- go
- sp_cacheconfig "tempdb_cache","1G","mixed"
- go
- sp_bindcache "tempdb_cache",tempdb
- go
- sp_cacheconfig "dacs_cache","1G","mixed"
- go
- sp_bindcache "dacs_cache",LCDACS
- go
- sp_configure "max online engines",15
- go
- sp_configure "number of engines at startup",15
- go
- sp_configure "number of worker processes",16
- go
- sp_configure "max parallel degree",1
- go
- sp_configure "number of user connections",600
- go
- sp_configure "number of locks",10000
- go
- sp_configure "number of open indexes",500
- go
- sp_configure "number of open objects",500
- go
- sp_configure "number of devices",100
- go
- sp_configure "lock scheme",1,datarows
- go
- sp_dboption "LCDACS","trunc log on chkpt",true
- go
重启生效
Step4:创建并追加数据库设备
- disk init name = "dacs_data01", physname="/data/sysdata/dacs_data01",size="1G"
- go
- disk init name = "dacs_index01", physname="/data/sysdata/dacs_index01",size="1G"
- go
- alter database LCDACS on dacs_data01="1G"
- go
- alter database LCDACS on dacs_index01="1G"
- go
Step5:创建并追加段
- use LCDACS
- go
- sp_addsegment dacs_data, LCDACS, lcdacs
- go
- sp_addsegment dacs_index, LCDACS, lcdacs
- go
- sp_extendsegment dacs_data, LCDACS,dacs_data01
- go
- sp_extendsegment dacs_index, LCDACS,dacs_index01
- go
Step 6:创建数据库login。
sa用户登录数据库 isql -Usa -P -SLCDACS_SERVER -w300
原文链接:http://www.cnblogs.com/Mingers/archive/2012/09/18/Linux.html
【编辑推荐】