By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,592 Members | 2,158 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,592 IT Pros & Developers. It's quick & easy.

Restoring DB's without Backup?

P: n/a
Hi all,

I am in a situation to restore a DB just from the Files (No Backup
Image) I have got all the files of NODE0000 directory.

Platform WIN 2000 pro And db2 8.1 fp 2

Is it possible to restore the DB.

How do i do it?

Thanks
Nov 12 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
I'm not sure but you may try the following On your target drive:
a) Create a directory with the name of the instance to which the db will
belong if it does not exist already.
b) Copy the NODE0000 directory and ALL its files and
subdirectories(SQLDBDIR, SQL00001, and so on...
c) On a command line issue:
set db2instance=<instancename>
db2start
db2 catalog db <dbname> on <targetdrive>
db2 connect to <dbname> Cross your fingers...

I've never tried it but it may work. If it does not and you get a
message like:" The db is in use by another instance..." then you may
want to investigate the relocate database function as explained in your
on line docs. Good luck.
HTH, Pierre.

db2inst2 wrote:
Hi all,

I am in a situation to restore a DB just from the Files (No Backup
Image) I have got all the files of NODE0000 directory.

Platform WIN 2000 pro And db2 8.1 fp 2

Is it possible to restore the DB.

How do i do it?

Thanks


--
Pierre Saint-Jacques - Reply to: sescons at attglobal dot net
IBM DB2 Cerified Solutions Expert - Administration
SES Consultants Inc.
Nov 12 '05 #2

P: n/a
Ian
db2inst2 wrote:
Hi all,

I am in a situation to restore a DB just from the Files (No Backup
Image) I have got all the files of NODE0000 directory.


This is not supported by IBM, but it can theoretically work (backup via
split mirror technology is similar to this). First of all, it would
depend on whether your entire database was stored in the NODE0000
directory. If some of the tablespaces (or the log files) were stored
in other directories, you'll be out of luck.

Also, unless your instance was stopped when the backup occurred, chances
are the files aren't internally consistent.

If you can actually bring the database up, you should probably try to
EXPORT all of your DDL/data, drop your database and recreate.
Good luck,

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
Nov 12 '05 #3

P: n/a
I'd say the odds are against you. Issues you will have to address
include, but are not limited to:
1. On the source system; were there multiple databases? If so, which one
do you want to restore?
2. Was the Database open when the file backups were taken? If so; a
recovery from files is almost guraanteed to fail.
3. did your database use SMS, DMS, or a mix for storage?
4. Is any documentation available for the original database?

If you have all of the files; perhaps you have an entire system backup.
If so; you could restore the entire system, boot it, start UDB then
generate a regular backup which can be restored to a different system.
I've successfully (once) used files to recover a single SMS table but
never tried to do an entire database. This should be attempted only as a
last resort when you've exhausted all other possibilities, have no
option other than to recover the database, and have management willing
to "spend" an inordinate amount of time, effort, and money on a task
that has a very very limited chance of success.

Good Luck!
Phil Sherman


db2inst2 wrote:
Hi all,

I am in a situation to restore a DB just from the Files (No Backup
Image) I have got all the files of NODE0000 directory.

Platform WIN 2000 pro And db2 8.1 fp 2

Is it possible to restore the DB.

How do i do it?

Thanks


Nov 12 '05 #4

P: n/a
Thanks for all your responses!!

I followed Pierre Steps

Copied all the files and sub directory of NODE0000 and tried
cataloging and got an error

SQL6028N Catalog database failed because database "DBNAME" was not
found in
the local database directory.

Another issue here is the original DB was in D:\ So internally DB2 has
everything denoted like this D:\DB2\NODE0000

So i used the "subst d: c:\" in dos and issued the above commands in
d: But i still got the same error.

Which file has the local DBNAME entry?

To Answer Ian

Yes all the files (Containers , Log files) are in the "NODE0000"
directory. Except for db2diag.log

D:\ is not functional now and the files that i have is backup of the
the system. So I can't bring the Database Up

To Answer Philip

Yes we had 4 Databases and i want two of them. which are SQL0002 &
SQL0003

The files was recovered after the disk died :( . Database used only
SMS tablespaces.

Thanks for all your help
Nov 12 '05 #5

P: n/a
The only file that could identify the db's are the local database direcrory.
In your case D:\DB2\NODE0000\SQLDBDIR\sqldbdir

You should also checkto see if the following file is present:
D:\SQLLIB\DB2\SQLDBDIR\sqldbdir
That is the system database directory for instance DB2

None of these should and can be edited by the way.

If they are not there then I think you are out of luck, unless IBM
support can help you.
Regards, Pierre.

db2inst2 wrote:
Thanks for all your responses!!

I followed Pierre Steps

Copied all the files and sub directory of NODE0000 and tried
cataloging and got an error

SQL6028N Catalog database failed because database "DBNAME" was not
found in
the local database directory.

Another issue here is the original DB was in D:\ So internally DB2 has
everything denoted like this D:\DB2\NODE0000

So i used the "subst d: c:\" in dos and issued the above commands in
d: But i still got the same error.

Which file has the local DBNAME entry?

To Answer Ian

Yes all the files (Containers , Log files) are in the "NODE0000"
directory. Except for db2diag.log

D:\ is not functional now and the files that i have is backup of the
the system. So I can't bring the Database Up

To Answer Philip

Yes we had 4 Databases and i want two of them. which are SQL0002 &
SQL0003

The files was recovered after the disk died :( . Database used only
SMS tablespaces.

Thanks for all your help


--
Pierre Saint-Jacques - Reply to: sescons at attglobal dot net
IBM DB2 Cerified Solutions Expert - Administration
SES Consultants Inc.
Nov 12 '05 #6

P: n/a
db2inst2 wrote:
Copied all the files and sub directory of NODE0000 and tried
cataloging and got an error


How big are the files (total only). How desperate you want this back? Can you
send me the files so I can look at them?

Jan M. Nelken

jasinek at attglobal dot net
Nov 12 '05 #7

P: n/a
Yes D:\DB2\NODE0000\SQLDBDIR\sqldbdir is present.

Now we got the original machine up but without the d:. So i tried
cataloging the DB's after copying all the contents of DB2\NODE0000.

catalog was succesful but when i try to connect i am getting.

SQL1039C An I/O error occurred while accessing the database directory
SQLSTATE=58031

I noticed the DB's were cataloged as (obtained from db2 list db
directory)

Catalog database partition number = -1

I thought sqlddir is corrupted and renamed it and cataloged again, but
still getting the same error. I am not able to create new DB's too

Heres the db2diag.log output with DIAGLEVEL 4 (obtained when trying to
catalog)

I don't know why its trying to migrate when i am running in the same
environment. (same machine where it was created)

2004-10-14-20.00.57.463000 Instance:DB2 Node:000
PID:1948(db2bp.exe) TID:1532 Appid:none
base sys utilities sqlehdir Probe:160

Node: 0. Start local database directory migration

2004-10-14-20.00.57.483000 Instance:DB2 Node:000
PID:1948(db2bp.exe) TID:1532 Appid:none
base sys utilities sqlehdir Probe:161

Node: 0. Instance path: C:\PROGRA~1\IBM\SQLLIB\DB2

2004-10-14-20.00.57.493000 Instance:DB2 Node:000
PID:1948(db2bp.exe) TID:1532 Appid:none
base sys utilities sqlehdir Probe:163

Node: 0. Install path: C:\PROGRA~1\IBM\SQLLIB

2004-10-14-20.00.57.713000 Instance:DB2 Node:000
PID:1948(db2bp.exe) TID:1532 Appid:none
base sys utilities sqlehdir Probe:180

sqlemgdr rc =
0x0012EA28 : 0x00000001 ....

2004-10-14-20.00.57.743000 Instance:DB2 Node:000
PID:1948(db2bp.exe) TID:1532 Appid:none
base sys utilities sqlehdir Probe:184
WARNING
It is possible your database
directories have not been
successfully migrated.

Thank you so much
Nov 12 '05 #8

P: n/a
Try, on the new system with no databases defined, using the D: drive:
1.create databases to construct the directory structures for SQL0002 &
SQL0003. The database names should match the original ones.
2. Restore the individual files starting at the SQL00002 & 3 directories.

I believe that the SUBST commnd won't work to define the D: drive.
You'll need a physical drive or partition. One option is to get a USB
disk drive and get that attached to the system as the D: drive.

Phil Sherman
db2inst2 wrote:
Thanks for all your responses!!

I followed Pierre Steps

Copied all the files and sub directory of NODE0000 and tried
cataloging and got an error

SQL6028N Catalog database failed because database "DBNAME" was not
found in
the local database directory.

Another issue here is the original DB was in D:\ So internally DB2 has
everything denoted like this D:\DB2\NODE0000

So i used the "subst d: c:\" in dos and issued the above commands in
d: But i still got the same error.

Which file has the local DBNAME entry?

To Answer Ian

Yes all the files (Containers , Log files) are in the "NODE0000"
directory. Except for db2diag.log

D:\ is not functional now and the files that i have is backup of the
the system. So I can't bring the Database Up

To Answer Philip

Yes we had 4 Databases and i want two of them. which are SQL0002 &
SQL0003

The files was recovered after the disk died :( . Database used only
SMS tablespaces.

Thanks for all your help


Nov 12 '05 #9

P: n/a
It worked!!

Thanks Philip

This time i used a new machine which has a d: physically. (You are
right Philip subst doesn't really work..)

Then created new DB's with the same name maintaining same directory
entry (SQL00003)and copied the directories.

It worked like a champ.

I need to document the steps. :)

Thanks a lot everybody.
Philip Sherman <ps******@ameritech.net> wrote in message news:<e7*******************@newssvr33.news.prodigy .com>...
Try, on the new system with no databases defined, using the D: drive:
1.create databases to construct the directory structures for SQL0002 &
SQL0003. The database names should match the original ones.
2. Restore the individual files starting at the SQL00002 & 3 directories.

I believe that the SUBST commnd won't work to define the D: drive.
You'll need a physical drive or partition. One option is to get a USB
disk drive and get that attached to the system as the D: drive.

Phil Sherman
db2inst2 wrote:
Thanks for all your responses!!

I followed Pierre Steps

Copied all the files and sub directory of NODE0000 and tried
cataloging and got an error

SQL6028N Catalog database failed because database "DBNAME" was not
found in
the local database directory.

Another issue here is the original DB was in D:\ So internally DB2 has
everything denoted like this D:\DB2\NODE0000

So i used the "subst d: c:\" in dos and issued the above commands in
d: But i still got the same error.

Which file has the local DBNAME entry?

To Answer Ian

Yes all the files (Containers , Log files) are in the "NODE0000"
directory. Except for db2diag.log

D:\ is not functional now and the files that i have is backup of the
the system. So I can't bring the Database Up

To Answer Philip

Yes we had 4 Databases and i want two of them. which are SQL0002 &
SQL0003

The files was recovered after the disk died :( . Database used only
SMS tablespaces.

Thanks for all your help

Nov 12 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.