Solved

DB2 DR procedure

Posted on 2013-06-26
16
719 Views
Last Modified: 2013-07-08
Dear all,

right now we will do the DR drill for an application that use DB2, let give some comment about the following command and procedure:

When Failover:
  1) Restore database in DR server:


    “su – db2inst6”

db2 “restore db arsystem from /space/db2/backup taken at 20130531080101 logtarget /space/db2/backup/rest_log replace existing”

(check the timestamp of the latest backup file)

  2) Bring database online in DR server

db2 “rollforward db arsystem to end of logs and complete overflow log path (/space/db2/backup/rest_log)”

  3) Start Remedy application

/usr/ar/developmentremedy/bin/arsystem start

  4) Failover complete

when failback:


 1)Backup database on DR server

/space/home/db2inst6/sqllib/bin/db2 backup db arsystem online to /space/db2/backup/ include logs
 
 2) Copy database backup files to production server

/usr/bin/scp –P 63222/space/db2/backup/ARSYSTEM.0.db2inst6.NODE0000.CATN0000.20130619080101.001 db2inst6@207.226.160.20:/space/db2/backup

(check the exact file name on server)


  3) Restore database on production server

“su – db2inst6”

db2 “restore db arsystem from /space/db2/backup taken at 201306319080101 logtarget /space/db2/backup/rest_log replace existing”

(check the timestamp of the latest backup file)

  4) Bring database online

db2 “rollforward db arsystem to end of logs and complete overflow log path (/space/db2/backup/rest_log)”

  5) Start application

/usr/ar/developmentremedy/bin/arsystem start



------------------------------------------------------------------------

is it normal? anything missing ? how to improve it further ?
0
Comment
Question by:marrowyung
  • 8
  • 4
  • 2
  • +1
16 Comments
 
LVL 37

Expert Comment

by:momi_sabag
ID: 39278426
is the dr server always up and available?
what is the latency between the prod server and dr server?
you might be able to set up hadr which will make your life easier if latency is acceptable
0
 
LVL 45

Expert Comment

by:Kent Olsen
ID: 39278493
Most of it seems fine.  But if it's my environment, nobody's going to restore a backup from another site (even the DR test site) over my production database.  I would restore it over a test/development region instead.

Database size and availability requirements have something to do with backup and recovery practices, too.  

If a backup or restore runs in 10 minutes, you can do most anything.  If it takes 6 hours to restore/verify the database, your options are more limited.  In practical terms, if the database is HR and you need payroll out by the end of the month, you've probably got some flexibility in the restore schedule.  If the database is the product/pricing database for Walmart it needs to be up now.
0
 
LVL 1

Author Comment

by:marrowyung
ID: 39280556
"Most of it seems fine.  But if it's my environment, nobody's going to restore a backup from another site (even the DR test site) over my production database.  I would restore it over a test/development region instead."

if this is the case, how to get the real backup back to the productoin?

so all command is correct?
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 1

Author Comment

by:marrowyung
ID: 39280562
I am also wondering what command make sure that the applicatin point to the DR/production server, any of this ?
0
 
LVL 45

Expert Comment

by:Kent Olsen
ID: 39281256
Hi marrowyung,

My comment was meant for the DR drill.  I see no reason to take down the production database to overwrite it with a backup just to prove that you can. Overwriting the DR database and a test/development database prove that your processes work.  Of course, if you have an actual emergency you would need to restore your production database.

You'll probably want to do a redirected restore.  The DB2 restore process defaults to restoring a database back to its original location.  If it needs to be restored somewhere else, use the REDIRECT option on the RESTORE statement.

As far as the application is concerned, you have several options.

- A setup page in the application.
  If the application connects to a specific IP address you'll need a way to configure the application to connect to a different IP address.  You may want to include this capability in the application anyway.  If the specific IP address or URL of the database (or web page) changes, the application will need to be configured to the new address.

- DNS change.
  If the application will be connecting to the DR site for an extended period (more than 48 hours) you may want to change the IP address with the Domain Name Server.  Note that it can take up to 24 hours for the change to propagate up through the DNS chain and back down so that all DNS servers have the new address.  When you change back to your production environment, another 24 hours is required to restore the original IP address in the DNS chain.

- Static redirect.
  If your network is working, especially the domain's primary router, you can configure it to redirect traffic intended for one of your servers to another IP address.  Note that this has risks as security certificates will almost certainly become void so use of HTTPS protocols won't work.  

There are certainly other things that you can do to help ease the migration to another set of servers.  I suggest that you ask your DR provider for guidance here.


Kent
0
 
LVL 1

Author Comment

by:marrowyung
ID: 39283396
"- A setup page in the application.
  If the application connects to a specific IP address you'll need a way to configure the application to connect to a different IP address.  You may want to include this capability in the application anyway.  If the specific IP address or URL of the database (or web page) changes, the application will need to be configured to the new address.
"

yes, this is good, all DR should be doing this way.

"Note that it can take up to 24 hours for the change to propagate up through the DNS chain and back down so that all DNS servers have the new address.  When you change back to your production environment, another 24 hours is required to restore the original IP address in the DNS chain."

in our country, we tried changing DNS from US and that let replicate normally, it takes less than 1 sec. surprise.

The main purpose about why I ask this is I am not a AIX staff, I am not sure if the command is perfectly works. please suggest if they are vaild.
0
 
LVL 45

Accepted Solution

by:
Kent Olsen earned 400 total points
ID: 39284106
>> in our country, we tried changing DNS from US and that let replicate normally, it takes less than 1 sec. surprise.

You can change your DNS and the changes take effect immediately.  Any request to your DNS will get the new address.  However, there are thousands of Domain Name Servers in the world and it will take up to 24 hours for all of them to be updated.

If your application connects only from within your domain that may not be an issue.  But if the application can connect from anywhere on the internet, the 24-hour rule for worldwide DNS updates will impact external users.



Without knowing your exact environment it's tough to say that the commands that you have posted are valid.  They appear valid, though path names, host names, IP addresses, etc. need to be verified on your end.

Depending on the exact setup of your DR server the database restore may need the REDIRECT option.  It's worth testing to see.

But the rest does look quite reasonable.



Kent
0
 
LVL 1

Author Comment

by:marrowyung
ID: 39295735
"If your application connects only from within your domain that may not be an issue.  But if the application can connect from anywhere on the internet, the 24-hour rule for worldwide DNS updates will impact external users."

between US and HK, less than 1 sec is amazing !

"They appear valid, though path names, host names, IP addresses, etc. need to be verified on your end."

yeah, I want to say somehting before the procedure go ahead. So you are good to just say if the synts is ok.
0
 
LVL 1

Author Comment

by:marrowyung
ID: 39306236
I want to say something before the procedure go ahead. So you are good to just say if the synts is ok.
0
 
LVL 51

Assisted Solution

by:Mark Wills
Mark Wills earned 100 total points
ID: 39306419
There are a couple of tests you will need to do...

First is the backup and restore (with redirect as KDO has previously mentioned). That you do on a dev server first and verify the procedure and syntax and ensure the content is as up to date as per your DR requirements. You avoid using anything remotely to do with production whilst establishing procedure.

Second is your network, and a redirect for that IP address means your application is blissfully unaware (well, most of the time), but also means that you should have constructed your network with that possibility in mind.

There are several elements in building a DR plan... and needs to cover setup, configuration, administration, monitoring. It is not as simple as backup and restore. For example, you could also be exploring log-shipping.

For example, there is a facility in DB2 known as ACR (automatic client reroute) but little point unless you are prepared to set it up properly.

I think KDO has pretty much answered / addressed most of your concerns other than the syntax part (which does look OK to me, and easily tested via a dev server first), but also suggest you read some of the materials on the DB2 / IBM site such as :

http://www.redbooks.ibm.com/abstracts/sg247363.html

 and a very good account of one DR strategy at a db2 user group meeting (even though a few years old) at:

http://www.nedb2ug.org/slides/D10.pdf

and just to cover that "Oracle" comment in a previous question, you might also want to read : http://www.oracle.com/technetwork/database/features/availability/dataguardhadr-094462.html

without seeing your DR plans and the SLA's (service level agreements) for provisioning DR then it is all a bit academic in such a critically important process... and trust that most of the above has already been considered...
0
 
LVL 1

Author Comment

by:marrowyung
ID: 39306470
:"means your application is blissfully unaware"

What is that mean ?

"For example, you could also be exploring log-shipping.:"

you are not talking about MS SQL, right? even MS SQL seems coping most of the syntax from DB2......

yeah, I just have the syntax left as I fully trust KDO,

basically I do tshi kind of thing a lot but, DR drill, most of the time here, reall use production.. they most of them request that the procedure is working for the REAL production hardware.

here, we use a lot of SAN recoeveyr procedure with SQL procedure, the procedure will be totally different from this but must easy as the SAN failover procedure is quite simple.
0
 
LVL 51

Expert Comment

by:Mark Wills
ID: 39306506
Nope not talking SQL Server - DB2 also supports log-shipping :)

The application being "blissfully unaware" means that the hard work all happens on the server and your users don't have to do anything different.

Yes, I fully trust KDO too - he really is very good :)

Cheers,
Mark
0
 
LVL 1

Author Comment

by:marrowyung
ID: 39309228
I fully trust KDO too, that's why I give me mark..

"Nope not talking SQL Server - DB2 also supports log-shipping :)"

yeah, as i expect and alwasy tell other people, MS SQL mostly GOT the same feature of DB2, the syntax almost the same.

funny.

"The application being "blissfully unaware" means that the hard work all happens on the server and your users don't have to do anything different."

but applicatoin need to point to the new DB2 anyway, right?
0
 
LVL 45

Expert Comment

by:Kent Olsen
ID: 39309232
Offtopic, but...

It's really clear that a lot of the non-ANSI SQL syntax used by DB2 was ported almost directly into SQL Server.

Which begets the question, "Why in the world didn't they also port the Date/Time manipulation syntax?"  It's easily the friendliest of all the major vendors....

Kent
0
 
LVL 1

Author Comment

by:marrowyung
ID: 39309325
"It's really clear that a lot of the non-ANSI SQL syntax used by DB2 was ported almost directly into SQL Server."

hahhaa, for easy migrate the custome to MS world ma...

"Which begets the question, "Why in the world didn't they also port the Date/Time manipulation syntax?"  It's easily the friendliest of all the major vendors...."

Then they start go to different direction, just like SQL 2014, you know what they have done, right?

they all working in different direction.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question