DB2 database back up and restore commands and using db2cc tool unix and windows

DB2 database back up and restore commands & using db2cc tool UNIX and windows

This post briefs the steps to take back up of a database in DB2.
There are mutiple ways to take database back up in DB2. I felt the easiest way of taking back up for a database is using the DB2CC tool (DB2 control center tool). There the process or steps to take back up or restore a particular DB is pretty straight and easy.

Yet another simple process to take back up is commands in the command line.

To take back up : 
  db2inst1@nc145016:/opt> db2 BACKUP DATABASE CDSDB TO "/opt/BKP"

                           Backup successful. The timestamp for this backup image is : 20100709051851
However you can see the command generated during the back up taking process using db2cc tool. 
It looks some thing like below ...
-- The following commands may not run as expected in a multi database partition environment if executed from a single script.

-- Quiesce Database
-- Run on any database partition.
CONNECT TO CDSDB;
QUIESCE DATABASE IMMEDIATE FORCE CONNECTIONS;
CONNECT RESET;

-- Backup Database Partition Grouping 1
-- Run on database partition(s): 0
BACKUP DATABASE CDSDB TO "/opt/BKP" WITH 2 BUFFERS BUFFER 1024 PARALLELISM 1 WITHOUT PROMPTING;

-- Unquiesce Database
-- Run on any database partition.
CONNECT TO CDSDB;
UNQUIESCE DATABASE;
CONNECT RESET;

To restore a database : 
A simple command looks like below to restore a particular database.
 db2inst1@nc145016:/opt/BKP> db2 RESTORE DATABASE CDSDB FROM "/opt/BKP" TAKEN AT 20100708081818
                               DB20000I  The RESTORE DATABASE command completed successfully.

And where as the db2cc generated SQL query may look like some thing below 

RESTORE DATABASE CDSDB FROM "/opt/BKP" TAKEN AT 20100708081818 WITH 2 BUFFERS BUFFER 1024 PARALLELISM 1 WITHOUT PROMPTING;

Hope this helps .. any related information to db2 database back up / restore process can be posted to this in comments.

Reference : [1] [2] [3]


1 comments to "DB2 database back up and restore commands and using db2cc tool unix and windows"

Post a Comment

Who ever writes Inappropriate/Vulgar comments to context, generally want to be anonymous …So I hope U r not the one like that?
For lazy logs u can at least use Name/URL option which don’t even require any sign-in, good thing is that it can accept your lovely nick name also and URL is not mandatory too.
Thanks for your patience
~Krishna(I love "Transparency")
వీలయితే నాల్గు పోస్టులు ...కుదురితే ఒక కామెంటూ ...

Translate

Enter your email address:

Buffs ...

Visitors


hits counter
View My StatsCheck Google Page Rank

Add to Google Reader or Homepage

Bookmark and Share

Tags


Powered by WidgetsForFree