我們將介紹Linux下Sybase數據庫安裝注意的問題,包括安裝地點的詢問,安裝之後進行優化的步驟等等。
首先使用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