Practical exercise - 07

2010-09-05  来源:本站原创  分类:Database  人气:167 

DELTA incremental backup and restore

Incremental backup only in medium and large, every day there are many updated database in order to realize its value.
Here only demonstrate its use.
DELTA incremental restore requires all the backup (or + INCREMENTAL backup) + All DELTA incremental backup + incremental backups after the LOG.

1. Incremental backups need to start archiving logs and set TRACKMOD
Set Reference practical exercise - 06

2. Backup
CMD: db2 backup database sample to / mnt / hgfs / F / backup /
Backup successful. The timestamp for this backup image is: 20100630154106

3. The establishment of test table
CMD: db2 connect to sample
CMD: db2 "create table TEST_DELTA (ID INT NOT NULL GENERATED ALWAYS A
S IDENTITY (START WITH 1, INCREMENT BY 1, NO CACHE), MSG CHAR (20)) "
DB20000I The SQL command completed successfully.

4. DELTA insert data and incremental backups
CMD: db2 "insert into TEST_DELTA (MSG) VALUES ('db2china.net'),(' db2china.net'),(' db2china.net')"
DB20000I The SQL command completed successfully.
CMD: db2 "select * from test_delta"
ID MSG
----------- --------------------
1 db2china.net
2 db2china.net
3 db2china.net
3 record (s) selected.
CMD: db2 backup database sample incremental delta to / mnt / hgfs / F / backup /
Backup successful. The timestamp for this backup image is: 20100630154408

CMD: db2 connect to sample
CMD: db2 "insert into TEST_DELTA (MSG) VALUES ('db2china.net'),(' db2china.net'),(' db2china.net')"
DB20000I The SQL command completed successfully.
CMD: db2 "select * from test_delta"
ID MSG
----------- --------------------
1 db2china.net
2 db2china.net
3 db2china.net
4 db2china.net
5 db2china.net
6 db2china.net
6 record (s) selected.
CMD: db2 backup database sample incremental delta to / mnt / hgfs / F / backup /
Backup successful. The timestamp for this backup image is: 20100630154505
CMD: db2 connect to sample
CMD: db2 "insert into TEST_DELTA (MSG) VALUES ('db2china.net'),(' db2china.net'),(' db2china.net')"
DB20000I The SQL command completed successfully.
CMD: db2 "insert into TEST_DELTA (MSG) VALUES ('db2china.net'),(' db2china.net'),(' db2china.net')"
DB20000I The SQL command completed successfully.
CMD: db2 "select * from test_delta"
ID MSG
----------- --------------------
1 db2china.net
2 db2china.net
3 db2china.net
4 db2china.net
5 db2china.net
6 db2china.net
7 db2china.net
8 db2china.net
9 db2china.net
10 db2china.net
11 db2china.net
12 db2china.net
12 record (s) selected.
CMD: db2 backup database sample incremental delta to / mnt / hgfs / F / backup /
Backup successful. The timestamp for this backup image is: 20100630154611
CMD: db2 connect to sample
Database Connection Information
Database server = DB2/LINUXX8664 9.7.1
SQL authorization ID = DB2INST1
Local database alias = SAMPLE
CMD: db2 "insert into TEST_DELTA (MSG) VALUES ('db2china.net'),(' db2china.net'),(' db2china.net')"
DB20000I The SQL command completed successfully.
CMD: db2 "select * from test_delta"

ID MSG
----------- --------------------
1 db2china.net
2 db2china.net
3 db2china.net
4 db2china.net
5 db2china.net
6 db2china.net
7 db2china.net
8 db2china.net
9 db2china.net
10 db2china.net
11 db2china.net
12 db2china.net
13 db2china.net
14 db2china.net
15 db2china.net
15 record (s) selected.
CMD: db2 connect reset
DB20000I The SQL command completed successfully.

5. Fault, table space from deletion
CMD: rm-fR db2inst1/NODE0000/SAMPLE / *
CMD: db2 connect to sample
SQL0293N Error accessing a table space container. SQLSTATE = 57048

6. SAMPLE.0.db2inst1.NODE0000.CATN0000.20100630154505.001 backup image to move to another directory, and restore the database, an error prompt recovery can not be
CMD: db2 "restore db sample INCREMENTAL AUTOMATIC from / mnt / hgfs / F / backup / taken at 20100630154611"
SQL2539W Warning! Restoring to an existing database that is the same as the
backup image database. The database files will be deleted.
Do you want to continue? (Y / n) y
SQL2542N No match for a database image file was found based on the source
database alias "SAMPLE" and timestamp "20100630154505" provided.

7. To give up recovery
CMD: db2 "restore db sample INCREMENTAL ABORT from / mnt / hgfs / F / backup
/ Taken at 20100630154611 "
SQL2001N The utility was interrupted. The output data may be incomplete.

8. To SAMPLE.0.db2inst1.NODE0000.CATN0000.20100630154505.001 backup image back to the directory after the backup, and restart recovery
CMD: db2 "restore db sample INCREMENTAL AUTOMATIC from / mnt / hgfs / F / backup / taken at 20100630154611"
SQL2539W Warning! Restoring to an existing database that is the same as the
backup image database. The database files will be deleted.
Do you want to continue? (Y / n) y
DB20000I The RESTORE DATABASE command completed successfully.

9. After the database is in roll-forward recovery to restore state (ROLL-FORWARD PENDING)
CMD: db2 connect to sample
SQL1117N A connection to or activation of database "SAMPLE" cannot be made
because of ROLL-FORWARD PENDING. SQLSTATE = 57019

10. To roll-forward recovery at the end LOG
CMD: db2 rollforward database sample to end of logs and complete
Rollforward Status
Input database alias = sample
Number of nodes have returned status = 1

Node number = 0
Rollforward status = not pending
Next log file to be read =
Log files processed = S0000012.LOG - S0000012.LOG
Last committed transaction = 2010-06-30-07.46.35.000000 UTC

DB20000I The ROLLFORWARD command completed successfully.

11. Inspection data, the results normal
CMD: db2 connect to sample

Database Connection Information

Database server = DB2/LINUXX8664 9.7.1
SQL authorization ID = DB2INST1
Local database alias = SAMPLE

CMD: db2 "select * from test_delta"

ID MSG
----------- --------------------
1 db2china.net
2 db2china.net
3 db2china.net
4 db2china.net
5 db2china.net
6 db2china.net
7 db2china.net
8 db2china.net
9 db2china.net
10 db2china.net
11 db2china.net
12 db2china.net
13 db2china.net
14 db2china.net
15 db2china.net

15 record (s) selected.

相关文章
  • Practical exercise - 07 2010-09-05

    DELTA incremental backup and restore Incremental backup only in medium and large, every day there are many updated database in order to realize its value. Here only demonstrate its use. DELTA incremental restore requires all the backup (or + INCREMEN

  • Practical exercise - 09 2010-09-05

    Recover database using RECOVER State Reference practical exercise - 08 1. Full Backup CMD: db2 backup database backupts online to / mnt / hgfs / F / backup / CMD: db2 connect to backupts Database Connection Information Database server = DB2/LINUXX866

  • Practical exercise - 08 2010-09-05

    Table space backup and recovery In large database, table space backup has a lot of flexibility. Generally speaking, form the basis for tables, indexes, LOB fields are required to establish a separate table space. 1. The establishment of non-automatic

  • Practical exercise - 10 2010-09-05

    Monitor 1. Backup monitoring, you can see the current backup situation CMD: db2 backup database backupts online to / mnt / hgfs / F / backup / Backup successful. The timestamp for this backup image is: 20100711010847 CMD: db2 list utilities show deta

  • Practical exercise - 02 2010-09-05

    Cycle under the log backup image database redirection redirection can create a new database 1. Redirected restore CMD: db2 "restore database sample from / mnt / hgfs / F / backup / INTO SAMPLE2 REDIRECT WITHOUT ROLLING FORWARD" RESULT: SQL1277W

  • Practical exercise - 03 2010-09-05

    Database archive log settings and database roll-forward recovery 1. Set the archive log can have a variety of settings approach, the specific reference InfoCenter CMD: login (user: db2inst1) db2 connect to sample db2 update db cfg using LOGARCHMETH1

  • Practical exercise - 04 2010-09-05

    Online backup and database recovery time 1. After the start of the archive log backup case can be online while the backup file contains the log CMD: db2 backup database sample online to / mnt / hgfs / F / backup / include logs Backup successful. The

  • Practical exercise - 05 2010-09-05

    Roll-forward recovery from deletion list 1. Archive log set reference real--3 2. On the table to delete the table space set to resume CMD: db2 alter tablespace userspace1 dropped table recovery on 3. Backup CMD: db2 backup database sample online to /

  • Practical exercise - 06 2010-09-05

    INCREMENTAL incremental backup and restore Incremental backup only in medium and large, every day there are many updated database in order to realize its value. Here only demonstrate its use. INCREMENTAL incremental restore requires all the backup +

  • Practical exercise - 11 2010-09-05

    Use the database table space reconstruction (REBUILD) 1. Please refer to actual combat environment training - 08, so the table space backup. CMD: db2 "backup database backupts tablespace (syscatspace) to / mnt / hgfs / F / backup /" Backup succe

  • Approached the COM Interop 2010-10-23

    Approached the COM Interop - RCW Getting Started Preface Added a charge due to the current system migration to the original. Net platform, the project team, spent some time on the COM ->. Net for some basic research. Posted this article, I hope to sh

  • version_tools VSS / CVS / SVN / ClearCase / Hudson / GIT 2009-11-08

    c vs docs Version control system can control the text file, binary can not control, such as voice, video version of the file changes Detailed in-depth version control and fire training / Beijing Saints CVS Detailed and in depth practical exercise vid

  • How to locate the root causes OutOfMemory 2011-07-19

    He recently did some of the factory MES software caused OOM, such as avon, andersen, ford, this is for my co-workers do OutOfMemory positioning sharing, garbage collection is reference to southern white blog post, all points are some more surface of

  • FICO learning program (transfer) 2011-08-22

    <div> <h3> FICO learning program </ h3> <div> <span> <span> 2011-06-22 10:47:00 </ span> </ span> </ div> </ Div> <div> </ div> <div> </ div> <div> <pre> FICO

  • oracle modify tablespace (rpm) 2011-03-18

    Briefly in the previous version of Oracle 10g, change the name of the table space is almost impossible, unless removed, re-creating, troublesome. Oracle 10g adds a new table space to change the name of the function, so you can instantly change the na

  • To learn the use of maven to see a very practical introductory tutorial (rookie level entry) 2010-03-29

    I. Preface knew maven project management in java distinguished reputation, so the thought of learning to master, so access to a large number of documents. The authors found that these documents are the biggest names in java, most of them are all on t

  • [Order] sql statement some practical tips for oracle 2010-03-30

    Finishing a book read long ago, and forgot what this was, now contributed. 1) In the select statement, use conditional logic 1select ename, sal, 2 case when sal <= 2000 then 'UNDERPAID' 3 when sal> = 4000 then 'OVERPAID' 4 else 'OK' 5 end as status

  • MAVEN2 Practical Guide, maven2 authoritative guide to Britain 2010-04-06

    maven2 authoritative guide to Britain: http://xizhenyin.javaeye.com/blog/609409 Transfer from: http://itren2006.blog.ccidnet.com/blog-htm-itemid-60879-do-showone-type-blog-uid-21308.html MAVEN2.0 Practical Guide Author: Li, Haipeng I. Introduction Kn

  • Learning to use maven to see a very practical introduction to tutorial (rookie level entry) 2010-08-20

    I. Introduction knew maven java project in the management of reputation and so he thought of learning to master, so a large amount of documentation. Discovery of these documents are the biggest names in java, most are standing mastered maven introduc

  • MySQL development specifications and practical technology exchange (transfer) 2011-07-12

    Original Address: http://www.nuxnu.com/2011/07/2/MySQL% E5% BC% 80% E5% 8F% 91% E8% A7% 84% E8% 8C% 83% E4% B8% 8E % E5% AE% 9E% E7% 94% A8% E6% 8A% 80% E6% 9C% AF% E4% BA% A4% E6% B5% 81.html Content 1. The development of practical techniques 2.MySQ