SYBASE database backup and Restoration

Source: Internet
Author: User
Tags sybase database

This article describes how to use Sybase's backup server to perform dump backup and restore the database.


First, use Sybase's backup server for dump backup

First, we will introduce the concept that dump database is a physical backup for the entire database (including data, table structure, triggers, cursors, stored procedures, transaction logs, etc. When a database is dumped, the system automatically performs a checkpoint to copy logs and data from the buffer zone to the hard disk (only copy dirty pages) and distribute the allocated pages (logs and data) dump to the device.

Backup command format:
Dump database name to path
For example, dump database test to "D:/test. dmp"

Advantages and disadvantages of this backup and restoration method:

This data backup method completely copies the operating environment of the entire database, including the dirty pages and fragments of the database. When you use the load command to restore the database, only databases of the same size can be recovered (the data and log size can only be exactly the same as the original size ). The advantage is that the database is complete, but the disadvantage is that you cannot directly view the backup content.

The theoretical part ends here. Let's take a look at the Detailed backup process (as shown in the figure below ).

Let's take a look at my database first, for example, back up the test database as an example to show you the Detailed backup process.

Open SQL advantage (similar to the query analyzer in SQL Server)

Next, click Connect under the server menu.

Select the server where the database is located, enter the user name SA, and the password is blank by default (of course, if you have modified the SA password, enter the modified password), and click Connect.

After the connection is successful, select the master database and enter the following command in session1: Dump database test to "D:/test. DMP "(back up database test to D:/test. in the DMP file ). Click the execute button.

The error is as follows:

The reason is that the Sybase backup service has been enabled. Start it!

The following prompt is displayed, indicating that the backup is successful.

The test. dmp file under drive D is our backup file. The backup is complete.

Then, the database is restored.

The general steps for restoring Sybase databases are as follows:
1. Create the same database devices as the original database (the file size and devices number must be the same, and the file location should be the same). It is the three database devices files in the original database.

Double-click the test file in, open the properties page of the test file, and view the file size and device Number of the test file.


2. Create a database with the same name as the original database and containing the same database devices.
3. Execute the database restoration statement.
Load database a from '\ U \ databak \ A. dmp'
Online Database

The procedure is as follows:
1. Open Sybase Central Java edition.

Click Tools-Connect

Enter the user name and password (my password is blank)

After logging on, click Database devices to create the same database devices as the original database. The creation process is simple and will not be detailed here. During creation, pay attention to the file size, devices number, and file location settings (consistent with the original database ).

2. Create a database. Click databases and double-click adddatabase.

When adding a device during the creation process, be sure to mark the location, consistent with the original database.

Is the usage of the original database device.

Next, go to the next step and click "OK.


3. As with the backup process, open SQL advantage, connect to the server, and execute the following commands in sequence.
Load database test from "D:/test. dmp"
Online Database Test
Note: If you do not run online database test, question marks will appear in the test database, and the database cannot be used normally.

So far, the backup and restoration of the database are all over.

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.