CentOS 4.8 安装 Sybase ASE 15.0.3
一、安装前的准备工作
以 root 登录,,创建sybase用户、用户组(useradd,groupadd)和安装目录/opt/sybase
# mkdir /opt/sybase
# id sybase
# useradd sybase
# passwd sybase
操作系统共享内存缺省值,对于大多数 Linux 版本为 32MB,Adaptive Server 的最小要求为 64MB。检查可用的操作系统的大小。
# ipcs -lm | grep 'max seg size'
max seg size (kbytes) = 32768
为操作系统共享内存参数选择新的大小。例如,要将共享内存更改为 512MB,可以输入:
# echo '512 * 1024 * 1024'|bc > /proc/sys/kernel/shmmax
检验该更改是否生效:
# ipcs -lm | grep 'max seg size'
max seg size (kbytes) = 524288
若要避免每次重新启动后必须进行此更改,修改/etc/sysctl.conf文件,最后一行加入kernel.shmmax=536870912 内存数(以字节为单位)
# echo kernel.shmmax=536870912 >> /etc/sysctl.conf
# sysctl -p
检测进程占用资源的情况
# pmap pid
数据库软件需要使用libaio包,RedHat as4 默认没有安装
# rpm -qa | grep libaio
# rpm -ivh libaio-*
二、安装 Sybase
进入安装目录,sybase用户安装需要root用户执行 xhost +
# ./setup
注意,图形方式安装过程中“安装方式”选择完全安装,并且安装完成后不配置服务器,结束后手工配置。
把/opt/sybase/SYBASE.sh 拷贝到/etc/profile.d下,这样所有的用户就可以共用sybase的环境变量
# cp SYBASE.sh /etc/profiled.d/
# chmod +x /etc/profiled.d/SYBASE.sh
# . /etc/profiled.d/SYBASE.sh
检查是否成功
# set | grep /opt/
SYBASE=/opt/sybase
SYBASE_JRE6=/opt/sybase/shared/JRE-6_0_6_32BIT
SYBASE_JRE6_32=/opt/sybase/shared/JRE-6_0_6_32BIT
SYBASE_UA=/opt/sybase/UAF-2_0
SYBROOT=/opt/sybase
注意:sybase的 shutdown 命令与操作系统本身的命令冲突,root用户需要到/sbin目录下执行系统的关机命令
执行脚本 srvbuild.adaptive_server.rs 和 srvbuild.backup_server.rs 配置数据库服务器和备份服务器
执行脚本 sqllocres.sqlloc.rs 修改字符编码为cp936
注意:
1、执行前一定修改脚本中的“network_hostname_list”项的实际IP,其它配置可参考
2、执行前转化编码格式:
# dos2unix *.rs
执行脚本
创建 Adaptive Server
# srvbuildres -r srvbuildres.adaptive_server.rs
创建 Backup Server
# srvbuildres -r srvbuildres.backup_server.rs
修改字符集
# sqllocres -r sqllocres.sqlloc.rs
修改字符集的其它方法:
在终端运行asecfg 设置语言 、字符和排序(需要 root 用户执行 xhost +):
选择Localize Adaptive Server(也可以直接运行$SYBASE/bin/sqlloc),并选择Adaptive Server名称
选择安装语言为Us English,
字符集为Code Page 936,
排序方式为Binary ordering, for cp936
检查sybase是否启动,出现 dataserver 和 backupserver 两个进程
# ps -ef|grep sybase
三、创建脚本文件 sybase 管理服务器进程,该脚本仅用于 Redhat Linux
#!/bin/sh
# Source function library.
. /etc/rc.d/init.d/functions
SYBASE=/opt/sybase
if [ -n "${SYBASE}" -a -d "${SYBASE}" ]; then
SYBASE_ASE=`basename $SYBASE/ASE-15_0`
SYBASE_OCS=`basename $SYBASE/OCS-15_0`
PATH="${SYBASE}/${SYBASE_ASE}/bin:${SYBASE}/${SYBASE_OCS}:${SYBASE}/${SYBASE_ASE}/install:${PATH}"
export SYBASE SYBASE_ASE SYBASE_OCS PATH
# See how we were called.
case "$1" in
start)
echo -n "Starting Sybase ASE ... "
( cd ${SYBASE}/${SYBASE_ASE}/install ; \
unset LANG ; unset LC_ALL ; \
for run_server in RUN_* ; do \
su - sybase -c "startserver -f ${SYBASE}/${SYBASE_ASE}/install/${run_server}" > /dev/null 2>&1 ; \
echo -n "${run_server} " ; \
done )
echo
touch /var/lock/subsys/sybase
;;
stop)
echo -n "Shuting down Sybase ASE configured servers: "
killproc dataserver
killproc backupserver
# Add your own openserver applications.
echo
;;
status)
showserver
;;
restart)
$0 stop
$0 start
;;
*)
echo "*** Usage: sybase {start|stop|status|restart}"
exit 1
esac
fi
exit 0
把sybase拷贝到/etc/init.d下
# chkconfig sybase on
这样就会在/etc/rc.3 和/etc/rc.5 连接文件S85sybase,开机自动起动sybase
为了能在关机时自动关sybase
# ln -sf /etc/init.d/sybase /etc/rc0.d/K25sybase
操作方法
# service sybase status
# service sybase start
# service sybase stop
或者执行通用的启动命令
# unset LANG
# startserver -f /opt/sybase/ASE-15_0/install/RUN_PDCSS -f /opt/sybase/ASE-15_0/install/RUN_PDCSS_BS
关闭服务器
# isql -Usa -P -SPDCSS
> shutdown SYB_BACKUP
> go
> shutdown with nowait
四、SYBASE 注册(开发版服务器安装可略过)
用sybase用户登陆
$ /opt/sybase/SYSAM-1_0/bin/startd.sh $SYBASE/SYSAM-1_0
$ cd /opt/sybase/SYSAM-1_0
$ lmgr
输入:
序列号、功能名、功能计数、软件版本、授权代码
Adaptive Server 软件包中提供的认证信息,打印在“Sybase 软件资产管理认证”中。输入了全部许可证以后,单击“完成”!
检验软件是否在运行:
当lmgrd 守护程序启动时,它将自动启动SYBASE守护程序。要检验许可证管理软件是否运行在系统上。使用:
# $SYBASE/SYSAM-1_0/bin/lmutil lmstat -c
继续安装或启动 Adaptive Server 前,先确认 lmgrd 和 SYBASE 在运行,即“up”。
注意:为了保证系统启动时启动SySAM(Sybase 软件资产管理器)许可机制
在:/etc/rc.d/rc.local中加入 : /opt/sybase/SYSAM-1_0/bin/startd.sh /opt/sybase/SYSAM-1_0
五、修改目录权限:
以root用户登录
chown -R sybase:sybase /opt/sybase
chmod 755 -R /opt/sybase
注意,以下对数据库的操作均使用 sybase 用户
六、设置数据库字符集
以sybase 用户登录,启动服务器
检测字符集设置是否cp936
# isql -Usa -P -SPDCSS
> sp_helpsort
如果不是则需要手工设置
# charset -Usa -P -SPDCSS binary.srt cp936
# isql -Usa -P -SPDCSS
> select name,id from syscharsets where
> sp_configure "default character set id",171
重新启动服务器两次,第一次启动会失败
# startserver -f /opt/sybase/ASE-15_0/install/RUN_PDCSS
在服务器设置/opt/sybase/locales/locales.dat中
[linux]
locale = en_US, us_english, cp936
locale = default, us_english, cp936
在客户端也要设置c:\sybase\locales\locales.dat中
[linux]最上和最下一行把iso_1 改成cp936这样一来,在客户端才能显示中文

MySQL is suitable for beginners to learn database skills. 1. Install MySQL server and client tools. 2. Understand basic SQL queries, such as SELECT. 3. Master data operations: create tables, insert, update, and delete data. 4. Learn advanced skills: subquery and window functions. 5. Debugging and optimization: Check syntax, use indexes, avoid SELECT*, and use LIMIT.

MySQL efficiently manages structured data through table structure and SQL query, and implements inter-table relationships through foreign keys. 1. Define the data format and type when creating a table. 2. Use foreign keys to establish relationships between tables. 3. Improve performance through indexing and query optimization. 4. Regularly backup and monitor databases to ensure data security and performance optimization.

MySQL is an open source relational database management system that is widely used in Web development. Its key features include: 1. Supports multiple storage engines, such as InnoDB and MyISAM, suitable for different scenarios; 2. Provides master-slave replication functions to facilitate load balancing and data backup; 3. Improve query efficiency through query optimization and index use.

SQL is used to interact with MySQL database to realize data addition, deletion, modification, inspection and database design. 1) SQL performs data operations through SELECT, INSERT, UPDATE, DELETE statements; 2) Use CREATE, ALTER, DROP statements for database design and management; 3) Complex queries and data analysis are implemented through SQL to improve business decision-making efficiency.

The basic operations of MySQL include creating databases, tables, and using SQL to perform CRUD operations on data. 1. Create a database: CREATEDATABASEmy_first_db; 2. Create a table: CREATETABLEbooks(idINTAUTO_INCREMENTPRIMARYKEY, titleVARCHAR(100)NOTNULL, authorVARCHAR(100)NOTNULL, published_yearINT); 3. Insert data: INSERTINTObooks(title, author, published_year)VA

The main role of MySQL in web applications is to store and manage data. 1.MySQL efficiently processes user information, product catalogs, transaction records and other data. 2. Through SQL query, developers can extract information from the database to generate dynamic content. 3.MySQL works based on the client-server model to ensure acceptable query speed.

The steps to build a MySQL database include: 1. Create a database and table, 2. Insert data, and 3. Conduct queries. First, use the CREATEDATABASE and CREATETABLE statements to create the database and table, then use the INSERTINTO statement to insert the data, and finally use the SELECT statement to query the data.

MySQL is suitable for beginners because it is easy to use and powerful. 1.MySQL is a relational database, and uses SQL for CRUD operations. 2. It is simple to install and requires the root user password to be configured. 3. Use INSERT, UPDATE, DELETE, and SELECT to perform data operations. 4. ORDERBY, WHERE and JOIN can be used for complex queries. 5. Debugging requires checking the syntax and use EXPLAIN to analyze the query. 6. Optimization suggestions include using indexes, choosing the right data type and good programming habits.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Dreamweaver CS6
Visual web development tools