Implementation of Online DB2 backup

Source: Internet
Author: User
Tags db2 connect db2 connect to db2 insert

DB2 online backup is one of our most commonly used database backup methods. The following describes the steps of DB2 online backup methods in detail, hoping to help you.

DB2 online database backup test:

-- Change database configuration parameters
Db2 update db cfg using LOGRETAIN on

-- Completely back up the database offline to remove the database from the "backup temporarily suspended" status
Db2 backup db TestDB to D: \ DB2_Train

-- Insert a new record in the test table and verify the record
Db2 insert into T1 (C1, C2) values (2, 'Online backup test ')
Db2 select * from T1

-- Online backup database
Db2 backup db TestDB online To D: \ DB2_Train

-- Obtain the path of the database activity log and back up the log

-- Simulate a disaster and delete a database
Db2 drop db TestDB

-- Restore database
Db2 restore db TestDB from D: \ DB2_Train taken at 20100426075221

-- Database connection will fail)
C: \> db2 connect to TestDB
SQL1117N cannot connect to or activate the database because it is in the ROLL-forward pending state.
"TESTDB ". SQLSTATE = 57019

-- Roll back the database to make it available
Db2 rollforward database testdb to end of logs and complete overflow log path ("D: \ DB2_Train \ SQLOGDIR ")

-- Connect to the database and Test
Db2 connect to TESTDB

Db2 select * from T1

How to Create a DB2 instance in Windows

DB2 Time Functions

Four ways to delete DB2 data

DB2 tablespace size limit

Lotus Notes calls the DB2 Stored Procedure

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.