Applications that back up Oracle Data Online

Source: Internet
Author: User

In actual Oracle Applications, online backup mainly requires the ARCHIVELOG-related mode, which is mainly used to execute the actual application and operations of Oracle data. For example, in an online store, the Oracle database must be open 24x7.

Therefore, it is impossible for users to perform offline backup without accessing the database. In this scenario, the database should be run in ARCHIVELOG mode. In this mode, the transaction will continue to run, and the backup processing will continue.

Unlike offline backup, online backup only requires backing up data files and control files. The offline database backup unit is the entire database, while the online backup unit is some or all tablespaces.

In Oracle, the idea of online backup is that when a user executes a transaction, all the changes made to the Oracle database are committed or not committed) stored in the redo log buffer, then the LGWr process writes them to the online redo log file. Redo logs are written cyclically. Therefore, before rewriting them, you must start the ARCH process to manually or automatically archive the redo logs.

The LOG_ARCHIVE_DUPLEX_DEST parameter is used when all transactions are recorded and archived Through multiplexing in the future. If media recovery is required, you can use these archived redo logs for restoration.

Note that using online backup cannot guarantee that you do not lose data. Such steps as putting control files in different locations through multiplexing to make Oracle databases immune, using online redo logs, and archiving redo logs are all necessary to avoid spof.

In Oracle, to switch from the default offline backup to an online backup with automatic archiving, perform the following operations:

In init. ora, enter the LOG_ARCHIVE_START, LOG_ARCHIVE_DEST, LOG_ARCHIVE_FORMAT, and LOG_ARCHIVE_DUPLEX_DEST and LOG_ARCHIVE_DEST_N parameters with appropriate values.

Close and start Mount ).

Operate databases in archivelog mode.

Open the database.

Verify the archived log list.

Archive all logs.

Back up all newly created logs.

Run the "Alter Tablespace ts_name Begin Backup" command to enable online Backup by placing any or all online tablespaces in online Backup mode. When this command is issued, all data files in online backup mode will be issued with the checkpoint SCN. In other words, all the dirty bits in the Oracle data buffer are refreshed to the data file. After the initial checkpoint SCN, no new checkpoint SCN will be issued.

For data files that are not in online backup mode, the subsequent check points will add SCN to their file headers. When "Alter Tablespace ts_name End Backup" is issued, the checkpoint SCN is recorded again in the file header of the online Backup data file. The Begin Backup and End backup commands let Oracle know what operations to redo and where the rollback will terminate.

Oracle recommends that the Begin backup and End backup commands consume the least time. In addition, we recommend that you perform as few user activities as possible during this period, because Oracle will record the entire block image when changing the block for the first time. For online backup data files, this will generate a large number of redo logs.

In fact, after performing Begin backup, you should immediately execute system replication and End backup to quickly End the operation. Backup is performed in strict order, which means that after the data files in table space 1 are backed up, the Oracle data files in table space 2 will be backed up.

For online backup, pay special attention to the SYSTEM tablespace and rollback segment tablespace. At the same time, make sure that the control file is backed up as long as the database mode is changed. The backup script should reflect the latest mode.

DB2UDB online backup

The Restoration Mechanism of the execution time of DB2UDB is similar to that of Oracle. To learn about the online backup and recovery of DB2 UDB, you need to understand the archived log records. There are three log definitions that we need to be familiar:

Activity Log-this log contains transactions that have not been committed or rolled back, or transactions that have been committed but have not been refreshed to the disk.

Online archiving log-this log contains the transaction information submitted and recorded to the hard disk, which is in the same directory as the activity log.

Offline archiving logs-if you move online archiving logs from the active log directory to another directory or tape, it becomes an offline archiving log.

There are many log-related configuration parameters:

LOGFILSIZ-the size of each log file. The default value is 250. The unit is 4 kb.

LOGPRIMARY -- the default number of master log files is 3 ).

LOGSECOND -- number of second-level log files that can be allocated when the primary log file is full. When this parameter is set to-1, version 8), an unlimited number of activity logs can be used.

NEWLOGPATH -- used to change the storage location of log files. To make this parameter take effect, you need to reactivate the Oracle database.

MIRRORLOGPATH -- the image path of the log file to avoid spof.

OVERFLOWLOGPATH -- specify the directories in which logs can be searched during the rollback to allow the rollback operation to access logs in multiple directories.

USEREXIT -- enable the user exit function to automatically archive logs.

BLK_LOG_DSK_FUL -- When DB2 cannot create a new log file in the active Log Path, it will prevent the error that the generated disk is full.

To use online backup, you must open the archive log. By setting LOGRETAIN to ON, you can open archived log records.
 

Article by: http://database.csdn.net/page/b4f53bc8-37f1-46aa-855c-6e7d5fdda91d

Related Article

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.