How to create physical devices in Sybase

Sybase devices are storage areas, which are necessary for creating databases. A database can have one or more devices and single device can be used for multiple databases. The device information is stored in master database. When we install server, master device which is used for master database and sysprocsdev which is used for sybsysteprocs are created automatically. We can create devices using disk init command.

Syntax:

disk init
name = “device_name”,
physname = { ‘physical_name’ | ‘cache_name’}
skip_alloc={true | false},
[vdevno = virtual_device_number,]
size = number_of_blocks
[, type = ‘inmemory’ ]
[, vstart = virtual_address
, cntrltype = controller_number]
[, dsync = {true | false}]
[, directio = {true | false}]
[, instance = “instance_name”]

Options:

Option Description
name Is the logical device name. Must be enclosed in the quotes.
physnanme Physical(raw) file name of actual storage of device.
size Size of the device. It can be k,m,g,t
vdevno Unique virtual number for each device.
skill_alloc It is boolean paramter. If set it is true, we can avoid initialiation pages with zeros.
vstart Virtual address
dsync To flush the database devices
directio To transfer data directly to disk, bypassing the OS buffer cache.

Creating Devices:
Here we are creating two devices, oe is for schools data and another log.

disk init
name = “schools_data1”,
physname = “/opt/sap/data/data1”,
size=’300M’
go

Device for log information.

disk init
name = “schools_log1”,
physname = “/opt/sap/data/log1”,
size=’100M’
go

How to get information above devices:

sp_helpdevice device_name

How to create physical devices in Sybase

To drop device:

sp_dropdevice schools_datan
go

Related Posts

CheapSexCams
Responses are currently closed, but you can trackback from your own site.

Comments are closed.

Powered by k2schools