Oracle Database Backup Method

Source: Internet
Author: User
Tags sybase database


Oracle Database Backup mode the Oracle Kernel provides a database backup and recovery mechanism. SQL * DBA backs up and recovers data by tablespace. Oracle provides two methods: Backup Recovery and forward rolling to ensure Database Consistency and integrity during accidental fault recovery. ____ 1. Backup Recovery Method ____ creates a copy of a database in a consistent state and stores it on the media offline for storage. This serves as the basis for database recovery. The Oracle utility Export/Import is used to introduce the Backup recovery method. ____ Export/Import is two complementary programs provided by Oracle, namely, unload and load. They not only reproduce the files of databases and operating systems, but also effectively recycle database fragments and provide Oracle data transfer methods for different versions to transfer data between different users. ____ Export data uninstallation, data is written from Oracle to the specified operating system file for backup. There are three modes for uninstalling objects, content and quantity: table mode, user mode, and full databasem ode ). You can use both the interactive mode and the command line mode to unmount the required information in the command line with "keyword = value. Export requires the user to have the CONNECT or DBA privilege. Www.2cto.com ____ Import and Export are opposite each other, and the operating system file is reloaded to the Oracle database, such as Expo rt. Users require the CONNECT and RESOURCE privileges and can choose to load in part or in whole. ____ Export/Import is very convenient and has low system overhead. The limit is that the output operating system files are stored in a dedicated compression mode and only provided for Import. ____ You can also use SQL * PLUS and SQL * LOADER utilities for backup. The SPOOL command of SQL * PLUS is output offline and formatted with PLUS to form an ASCII file in the specified format. You can use SQL * LOADER to load the file as needed. Its convenience is that ASCII files can be edited and can be easily loaded to other databases (such as FoxPro and Sybase ). ____ 2. forward rolling mode ____ Oracle provides forward rolling mode, so that transactions that are successfully backed up will not be lost. The restoration is based on a database's consistent state (that is, Backup Recovery completed in method 1). The recovery is based on the archived record files. Start the record file as follows: ____ (1) Start Oracle; ____ (2) CONNECT Oracle: connect system/PASSWORD; ____ (3) Start archive log. ____ When a media fault occurs, you can use the SQL * DBA RECOVER command to restore one or more tablespaces using the archived record file. The RECOVER command restores the DATABASE or TABLASPACE. The former requires SQL * DBA START UP to be loaded without being opened; the latter requires that the database be loaded and opened when the tablespace in the inactive rollback segment is offline. ____ Because the forward rolling method is based on the record file record of the archive, the system overhead is high, but the recovered transaction is successful after the backup is established, so the recovery degree is higher and more complete. Www.2cto.com Sybase Database Backup ____ Sybase Database provides two recovery methods: Automatic Recovery and non-automatic recovery. Automatic Recovery is a recovery mechanism provided under soft faults. Non-automatic recovery is a manual recovery mechanism that is loaded through the dumped media in the case of a hard fault. ____ 1. software fault recovery mechanism ____ SQL Server starts the automatic recovery process upon restart, writes the transactions that have been committed before the fault to the database device, and rolls back the unfinished transactions. The automatic recovery process first restores the system database, and then restores the user database. The basis for automatic recovery of each data is the transaction log, that is, the SYSLOGS table, which records every change to the database. ____ Restoration process: Scan logs, cancel uncompleted transactions, and overwrite committed transactions. ____ Undo mechanism: Scan logs in reverse order to perform a reverse operation on the update operation of each undo transaction. ____ Rewrite mechanism: the system performs a forward log scan to physically write the committed transactions but still in the database buffer to the database device. ____ 2. Hard fault recovery mechanism ____ hard fault generally refers to a media fault. The basic data source for backup comes from the dump media of the database. Therefore, the recovery depends on the usage of the dump command. ____ The dumping and loading process is described using a MB tape as an example. ____ (1) configure the backup server and start SQL SERVER and BACKUP SERVER. For example: www.2cto.com ____ startserver-f run-sybase ____ startserver-f run-syb-backup ____ (2) create a tape dump device ____ sp-addumpdevice "tape", mytape, "/____ dev/nrct0", 6, skip ____ 250 ____ go ____ where: "/dev/nrct0" indicates the name of a non-Rewind tape device. "6" indicates the device control number, tape in 3 ~ Between 8, skip notifies the server to ignore the existing ANSI tape number, 250 is the size of the tape, in MB. ____ After successful creation, you can query the description of the records in the maser. dbo. sysdevices table with name = "mytape. ____ (3) dump database ____: Back up a complete database, including its system table, and create various data objects and transaction logs. Unlike operating system files, the tar command is not readable and can only be identified and restored by the SQL Server load tool. Dump command: ____ dump database TRYDB to mytape with init ____ go www.2cto.com ____ where: TRYDB is the database name; with init is the option, reinitialize the tape volume. ____ (4) load database ____ if the database is damaged and must be deleted, reinitialize the database device, rebuild the database in tb, and load the latest database backup and all transaction logs. ____ Load database: ____ load database TRYDB from mytape ____ go ____ and above only load user database, not applicable to master database. In addition, you can back up the database to an operating system file and run the Operating System Backup command to copy the file to the tape. When restoring, first tar the files on the tape and then load them. In this way, no dumping device is required. Author tbwshc

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.