0% found this document useful (0 votes)
16 views3 pages

Sybase Database and Table Creation Guide

The document outlines a series of SQL commands for initializing disks, creating databases, and managing system tables in a Sybase environment. It includes commands for creating and altering databases, initializing data and log devices, and inserting data into a customer table. Additionally, it provides configurations for system tables and caching settings.

Uploaded by

notifierstock
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views3 pages

Sybase Database and Table Creation Guide

The document outlines a series of SQL commands for initializing disks, creating databases, and managing system tables in a Sybase environment. It includes commands for creating and altering databases, initializing data and log devices, and inserting data into a customer table. Additionally, it provides configurations for system tables and caching settings.

Uploaded by

notifierstock
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

disk init name ='data_dev01', physname ='/home/sybase/sybase/devices/data_dev01',

size = '500M',dsync = true


go

disk init name ='log_dev01', physname ='/home/sybase/sybase/devices/log_dev01',


size = '500M',dsync = true
go

CREATE DATABASE ratings ON data_dev01 = '100M'


LOG ON log_dev01 = '50M'

alter database ratings on data_dev01 ="100M"


LOG ON log_dev01 = '50M'

disk init name ='data_dev02', physname ='/home/sybase/sybase/devices/data_dev02',


size = '500M',dsync = true
go

disk init name ='log_dev02', physname ='/home/sybase/sybase/devices/log_dev02',


size = '500M',dsync = true
go

disk init name ='data_dev03', physname ='/home/sybase/sybase/devices/data_dev03',


size = '500M',dsync = true
go

disk init name ='log_dev03', physname ='/home/sybase/sybase/devices/log_dev03',


size = '500M',dsync = true
go

disk init name ='data_dev04', physname ='/home/sybase/sybase/devices/data_dev04',


size = '500M',dsync = true
go

disk init name ='log_dev04', physname ='/home/sybase/sybase/devices/log_dev04',


size = '500M',dsync = true
go

disk init name ='data_dev05', physname ='/home/sybase/sybase/devices/data_dev05',


size = '500M',dsync = true
go

disk init name ='log_dev05', physname ='/home/sybase/sybase/devices/log_dev05',


size = '500M',dsync = true
go

create database ratings1 on data_dev02 = "100M"


LOG ON log_dev02 = "50M"

alter database ratings1 on data_dev02 ="100M"


LOG ON log_dev02 = '50M'

create database ratings1 on data_dev02 = "100M"


LOG ON log_dev02 = "50M"
alter database ratings1 on data_dev02 ="100M"
LOG ON log_dev02 = '50M'

allow updates to system tables = DEFAULT to 1 and change it to 0 once task is


[Link] make changes to system tables enable & disable it .

number of open partitions = DEFAULT


number of open databases = DEFAULT
number of open objects = DEFAULT

sp_poolconfig 'default data cache', '2M', '16K' - create 16k pool and assign 2mb
size

select name from sysobjects

CREATE TABLE customer (


id INT,
name VARCHAR(30),
country VARCHAR(10)
)
GO

DECLARE @id INT


SELECT @id = 1

WHILE @id >= 1 AND @id <= 1000


BEGIN
INSERT INTO customer (id, name, country)
VALUES (
@id,
'siva' + CONVERT(VARCHAR(5), @id),
'India'
)

SELECT @id = @id + 1


END
GO

1> sp_spaceused customer


2> go
name rowtotal reserved data index_size unused
-------- -------- -------- ---- ---------- ------
customer 1000 0 MB 0 MB 0 MB 0 MB

(1 row affected)
(return status = 0)
1> sp_help customer
2> go
Name Owner Object_type Object_status Create_date
-------- ----- ----------- ------------- -------------------
customer dbo user table -- none -- Dec 24 2025 8:27PM
(1 row affected)

setuser 'dbo'
go

IF EXISTS (SELECT 1 FROM sysobjects o, sysusers u WHERE [Link]=[Link] AND [Link] =


'customer' AND [Link] = 'dbo' AND [Link] = 'U')
drop table customer

IF (@@error != 0)
BEGIN
PRINT 'Error CREATING table "[Link]"'
SELECT syb_quit()
END
go

create table customer (


id int not null,
name varchar(30) not null,
country varchar(10) not null
)
lock allpages
with dml_logging = full
on 'default'
go

setuser
go

You might also like