473,569 Members | 2,691 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 8398
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=<in stancename>
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\sqldb dir

You should also checkto see if the following file is present:
D:\SQLLIB\DB2\S QLDBDIR\sqldbdi r
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\sqldb dir 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******@ameri tech.net> wrote in message news:<e7******* ************@ne wssvr33.news.pr odigy.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
2356
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 on another machine and wish to reimport the mySQL database that PHP Nuke relies upon. If anyone can tell me how to do this I would be very...
2
3287
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 from backup file? I tried restore from that file and SQL server complaining. "The file on device '***' is not valid Microsoft tape format backup...
0
4833
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 characteristics of the database (e.g. the dump file tries to create fks to tables that it hasn't created yet if we export schema + data).
1
5184
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 extensions ..001, .002 and .003. The files are placed into a d:\dbname.0\db2.0\yyyymmdd directory tree, as does DB2/2 when performing the backup. I...
5
2848
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 database. But, is there any way to restore only some of the tablespaces? thank you in advanced.
1
2352
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 when backing up Exchange 2000, yet restoring Exchange 2000 gives some problems: A Store is restored: * the restore is started.
1
1546
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 some schema evolution. The restore on the test box barfed on the roll forward because alt_obj() uses COPY YES on its LOAD, and the test box did not...
5
6547
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. The SAS users are laughing because they can (to a certain extend) easily go back to an earlier SAS table by simply starting dsm. Of course, a flat...
1
5548
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 restoring the log file as we do not have enough space on the server. PS. We are running Sql2K5. Thanks!
0
7695
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7612
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7922
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7964
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6281
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5218
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1209
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
936
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.