Sybase's Equipment (Device)

Source: Internet
Author: User

Sybase stores all the data in the database on the device.

1. The concept of a device

A device is a contiguous piece of disk space that Sybase preconfigured to store a database, and it is mapped to an operating system file or a raw partition. It has two corresponding names: the logical name and the physical name. NT only supports device mapping to files.

The relationship between the device and the database: Many-to-many relationships. A database can be created or extended to multiple devices, and a device can be used to hold multiple databases. Different device operating systems can read and write to them in parallel, so we can artificially place a database on multiple database devices.

Classification of equipment: Database Device and dump Device. Database devices store databases and transaction logs, and dump devices to hold backups of databases or logs.

2. The creation of a device

Command syntax:

DISK INIT

Name= ' Device_name ',

Physname= ' Physical_name ',

Vdevno=virtual_device_number

Size=number_of_pages

[.......]

An example is provided:

DISK INIT

Name= ' My_device ',

Physname= ' D:\database\My_device.dat ',

Vdevno=3

size=5000

Comments: Logical name, physical name, device virtual number, device size

To create a dump device:

sp_addumpdevice{' disk ' | ' Tape '}

Logical_name,

Physical_name,

Tapesize

3. Default Device

In the absence of a specified device, any data object created by the user is automatically placed on the default device.

After the initial installation, Master Master of the system is preset as the default device, so create your own default device as soon as possible. Make sure that the following devices are not the default: The System master, and the device that specifies that only the log is used.

Sp_diskdefault device name [, defaulton| Defaultoff]

4. Disk mirroring

Disk mirroring is considered for database security, and disk mirroring provides uninterrupted recovery when media fails. Disk mirroring is an absolute copy of the data on the disk. If a hard drive accident occurs, the corrupted copy automatically becomes offline, so all reads and writes are directed to the undamaged copy.

Sybase disk mirroring is performed at the device level, so disk mirroring is essentially a device image. When mirroring a device, Sybase automatically creates an additional device that copies all the data on the original device to the mirrored device by the mirror handler.

If you want to make a database mirror, each device assigned to the database must be mirrored. The master device has a special status in the server, and if it is corrupted, SQL Server crashes. Therefore, if it is possible to always mirror the master device (on another disk).

Mirroring command Syntax:

Disk Mirror

Name= ' device_name ',//mirrored device

Mirror= ' Physical_name '

[, Writes=serial|noserial]

5. Remove device

Sp_dropdevice Logical_name[,delfile]

The device containing the database is not allowed to be deleted.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.