码迷,mamicode.com
首页 > 数据库 > 详细

suse系统 sybase 12.5建库

时间:2017-04-03 21:14:10      阅读:248      评论:0      收藏:0      [点我收藏+]

标签:nbsp   数据库   trunc   disk   安装   ase   dev   power   linux   

在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建库

标签:nbsp   数据库   trunc   disk   安装   ase   dev   power   linux   

原文地址:http://www.cnblogs.com/yangxuming/p/6663628.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!