Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

making physical device

Status
Not open for further replies.

babeo

Technical User
Mar 30, 2000
398
0
0
CA
Hi,
Maybe I am asking in the wrong session, but because my question is related to database so I think I am posting my question in here.

I want to create a physical device for my database before i am able to initiate the logical then. How can I create a physical device on UNIX (solaris).
Thanks
 
Your physical device can be a raw partition or any UFS file system. However, for simplicity we go for a file system.
1) identify where you want the device file to be, obviously somewhere with enough space. Let us say you have identified directory /data1 on UNIX as a place you want to create the device.
2) create a subditectory in the name of your dataserver <SERVER_NAME> there Sybase UNIX login requires full read and write to this sub-directory. The file must not exist!
3)do

/********************************************/
/*------------ device01 -------------*/
/********************************************/
use master
go
select &quot; Started creating device01 device at &quot; +convert(char(30),getdate(),9)
go
disk init
name = &quot;device01&quot;,
physname = &quot;/data1/<SERVER_NAME>/device01.dat&quot;,
vdevno = 10,
size = 1024000 -- 2GB device (512*2000MB)
go
select &quot; Finished creating device01 at &quot; +convert(char(30),getdate(),9)
go
exit

So I have create a sybase device &quot;device01&quot; on UFS file system &quot;/data1/<SERVER_NAME>/decice01.dat&quot; with a size of 2GB.
If you want a raw partition then you need to set up a raw partion device. Conceptually similar but different from file system. You can use &quot;fdisk&quot; utility on Linux to create a raw partition and use it as a raw device.

I hope this helps
 
Just noticed something...

I'm assuming specifying the vdevno was an oversight?

1> Newer versions (12.0) don't need a vdevno, they are calculated internally.
2> Out of the box default configurations of 10 devices means that you can only access/use 0-9 (0 = master never use this). Therefore logical device numbers are 1-9 for default installations.

See:
sp_configure &quot;number of devices&quot; to see how many devices you have configured.

In addiiton you issue this command to see which ones are already in use. You can't re-use device (vdevno) numbers.


SELECT DISTINCT low/16777216
FROM sysdevices
ORDER BY low

P.S. is where you can find all the Sybase documentation. I would look into the Admin guides (sag1 and sag2) to start getting a goof feeel for how to take care of your databases.

Thanks.


-=-=-=-=-=-=-=-=-
For ease of reading, any posted CODE should be wrapped by [ignore][COLOR]
and
Code:
[/ignore] tags.

Ex:
Code:
SELECT 1 from sysobjects
 
Just a quick point, which I do not think I have seen in above thread...

If this is dev, I have no problem with just putting on FS. But if prod system, and you decide to use the FS route, you may want to use 'dsync=true' when creating your devices to assure the data is written to disk and not still in OS buffers.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top