Naskov.com
Home Family Faith Origins Contact

To create a database in Sybase:
#
#You must be loged in as system administrator 'sa'
#
isql -Usa -P
#


#
#Figure out the lagrest used device number
#	use the next highest unused number
#	for the 'disk init' command
#
select distinct low/16777216 from sysdevices order by low
go
#


#
#Create the device for the database
#	the device will be 1GB in size
#	500000 * 2k(page size) = 1GB
#NOTE for Syb12.0 - the bisk init command can have
#	a 'dsync = true' option which enables a safer
#	use of flat files as database devices
#
disk init name = "Titan40", physname = "/home/data_sybase/titan40.dat", vdevno = 3, size = 500000
go
#


#
#You can create a separate device for the database transaction
#	log, but it is not mandatory. The same command
#	as above is used.
#In order to create the database the following command is used
#	The number after the 'on' clause specifies how many MB
#	to use from that speciffic device. In this case we use
#	The full GB.
#
create database titan40 on Titan40 = 1000
go
#

#
#The following syntax can be used if a separate device is present
#	for the transaction log
#
#create database titan40 on Titan40 = 1000 log on Titan40log = 500
#


#
#Add a login into the sybase server
#	the syntax specifes the username, password and
#	default database in that order
#
sp_addlogin "titan40", "titan40", titan40
go
#


#
#Make the new user the owner of the newly created database
#
use titan40
go
sp_changedbowner titan40
go
#


#
#VOILA - you are now ready to use your new database
#	with the new user
#
Page viewed times. Page cmposed in ms...
Site design concept by Barry Hus