473,404 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Restoring DB's without Backup?

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
9 8375
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
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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Yair Sageev | last post by:
Greetings. I was running PHP Nuke on a Win2k box using Apache2Triad. Fortunately I backed up the drive using windows backup prior to the hard drive failure. Now I have installed Apache2Triad...
2
by: Kev | last post by:
Hi all, I have a very old MSSQL data backup file. I do not even remember that it was created in SQL7 or 2000. Anyway, I'm trying to recreate DB from this backup. Is it possible to create DB...
0
by: Martin Hart | last post by:
Hi, postgresql 7.4beta4 on linux and postgresql 7.3.4 on linux We have a database that we routinely backup using "pg_dump -a" We have to do this (dump the data only) because of various...
1
by: Luc Le Blanc | last post by:
I'm trying to restore a backup from a DMS DB2/2 database. The original DB has 3x 1Gb containers in the user tablespace. So the backup has 3 files, bearing the time of the backup as file name, with...
5
by: wanchan | last post by:
Dear all, Is it possible to restore some (not all) tablespaces to a new database? We have a full offline backup, and as the manual says, we can restore the whole set of tablespaces to a new...
1
by: Robbert van Geldrop | last post by:
Hello, I have a problem restoring Exchange 2000 files. Our software has an interface to ESEBCLI2.dll for online backup and restore features. Everything works fine with Exchange 2003 and also...
1
by: aj | last post by:
DB2 LUW 8.2 FP14 Red Hat AS 2.1 I went to restore a backup of my production DB on my test/developmental server. The backup on the prod system was taken /before/ alt_obj() was used there to do...
5
by: Troels Arvin | last post by:
Hello, Every so often, I'm asked to help people recover data from tables that were either dropped or where to much data was DELETEed. The complications related to restoring data are a problem....
1
by: GM | last post by:
We have received a backup file that is 6G in size. The log file is about 74G while the MDF is about 5 G when we restored. Is there a way to run a SQL script to restore the .BAK file without...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.