首页 > 代码库 > suse系统 sybase 12.5建库
suse系统 sybase 12.5建库
在linux系统已经安装sybase 12.5之后,可以在命令行
执行 isql -Usa -P密码 -i 脚本文件(如下)
以下是脚本内容:(创建为yxmdb的库和user001,密码是123456的数据库用户)
declare @vdevno int
select @vdevno=1+max(low/power(2,24)) from master..sysdevices
disk init name= "YXMDevice",
physname="/home/sybase/data/YXMDevice", vdevno=@vdevno,size=2048000
select @vdevno=@vdevno+1
disk init name= "YXMLogDevice",
physname="/home/sybase/data/YXMLogDevice", vdevno=@vdevno,size=1024000
print ‘Disk init YXMDevice 2000M OK‘
print ‘Disk init YXMLogDevice 1000M OK‘
go
sp_dboption "model","select into/bulkcopy",true
go
sp_dboption "model","trunc log on chkpt",true
go
sp_dboption "model","allow nulls by default",true
go
sp_dboption "tempdb","select into/bulkcopy",true
go
sp_dboption "tempdb","trunc log on chkpt",true
go
sp_dboption "tempdb","allow nulls by default",true
go
use model
go
checkpoint
go
use tempdb
go
checkpoint
go
use master
go
print ‘Create database yxmdb ...‘
go
/*
* data 4000M
* log 2000M
*/
create database yxmdb on YXMDevice=4000 log on YXMLogDevice=2000
go
print ‘Create database yxmdb OK!‘
go
sp_addlogin "user001","123456","yxmdb"
go
sp_adduser user001
go
use yxmdb
go
sp_changedbowner user001
go
use yxmdb
go
checkpoint
go
print ‘Create user user001 OK!‘
go
suse系统 sybase 12.5建库