473,418 Members | 1,965 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,418 software developers and data experts.

Redirected restore problem

I have searched this group for answers and tried the responses.

I am trying to Use an full online backup from our production server and
apply it to our test server. The Tablespaces in the productions server
are on the d drive and my test server has no d drive.

The restore command i am using is:

RESTORE DATABASE CENTRAL FROM "C:\DB2Backups" TAKEN AT 20050620000000
INTO CENT0620 REDIRECT;

SQL1277N Restore has detected that one or more table space containers
are
inaccessible, or has set their state to 'storage must be defined'.
DB20000I The RESTORE DATABASE command completed successfully.

message as expected. I then go to issue SET TABLESPACE commands and I
get:

db2 => SET TABLESPACE CONTAINER FOR 4 USING (PATH "CMPDEFAULT.DATA")
DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL1350N The application is not in the correct state to process this
request.
Reason code="3".

Any help would be greatly appreciated!!

thanks,

Chris

Nov 12 '05 #1
11 13456
I am sorry i forgot the basics:

Backup came from UDB worlgroup 8.1.7 on win32 (2003 server)

Restore is going on UDB worlgroup 8.1.7 on win32 (XP Pro)

I have also tried the restore on 8.1.9 on win32 (XP pro) with the same
results

thanks,

Chris

Nov 12 '05 #2

Try giving the full path in your in set tablespace command.

Nov 12 '05 #3
I did try that too. Same result.

Nov 12 '05 #4
Chris -
From the messages and codes doc, reason code 3:

------------------------------------------------------------------------------
03
A Restore request is in progress. A warning was received from the
initial utility call indicating that further requests are required
before Restore can complete.
-------------------------------------------------------------------------------

This would seem to indicate that you have missed at least 1 SET
TABLESPACE command because the util is still waiting. Good luck.

Pete H

Nov 12 '05 #5
I had looked the reason code 3 up. I posted in teh original post the
return from the restore statment the only warning it had was:
SQL1277N Restore has detected that one or more table space containers
are
inaccessible, or has set their state to 'storage must be defined'.
DB20000I The RESTORE DATABASE command completed successfully.

the following is the results from: LIST TABLESPACES SHOW DETAIL. Even
this returns with the same SQL1350N error reason code 3

Tablespaces for Current Database

Tablespace ID = 0
Name = SYSCATSPACE
Type = System managed space
Contents = Any data
State = 0x2000100
Detailed explanation:
Restore pending
Storage may be defined

Tablespace ID = 1
Name = TEMPSPACE1
Type = System managed space
Contents = System Temporary data
State = 0x2000100
Detailed explanation:
Restore pending
Storage may be defined

Tablespace ID = 2
Name = USERSPACE1
Type = System managed space
Contents = Any data
State = 0x2000100
Detailed explanation:
Restore pending
Storage may be defined

Tablespace ID = 3
Name = SYSTOOLSPACE
Type = System managed space
Contents = Any data
State = 0x2000100
Detailed explanation:
Restore pending
Storage may be defined

Tablespace ID = 4
Name = CMP_DEFAULT_DATA
Type = System managed space
Contents = Any data
State = 0x2001100
Detailed explanation:
Restore pending
Storage must be defined
Storage may be defined

Tablespace ID = 5
Name = CMP_DEFAULT_INDX
Type = System managed space
Contents = Any data
State = 0x2001100
Detailed explanation:
Restore pending
Storage must be defined
Storage may be defined

Tablespace ID = 6
Name = CMP_IVJ_DATA
Type = Database managed space
Contents = Any data
State = 0x2001100
Detailed explanation:
Restore pending
Storage must be defined
Storage may be defined

Tablespace ID = 7
Name = CMP_IVJ_INDX
Type = Database managed space
Contents = Any data
State = 0x2001100
Detailed explanation:
Restore pending
Storage must be defined
Storage may be defined

Tablespace ID = 8
Name = CMP_ORD_DATA
Type = Database managed space
Contents = Any data
State = 0x2001100
Detailed explanation:
Restore pending
Storage must be defined
Storage may be defined

Tablespace ID = 9
Name = CMP_ORD_INDX
Type = Database managed space
Contents = Any data
State = 0x2001100
Detailed explanation:
Restore pending
Storage must be defined
Storage may be defined

Tablespace ID = 10
Name = CMP_ORL_DATA
Type = Database managed space
Contents = Any data
State = 0x2001100
Detailed explanation:
Restore pending
Storage must be defined
Storage may be defined

Tablespace ID = 11
Name = CMP_ORL_INDX
Type = Database managed space
Contents = Any data
State = 0x2001100
Detailed explanation:
Restore pending
Storage must be defined
Storage may be defined

Tablespace ID = 12
Name = CMP_ORT_DATA
Type = Database managed space
Contents = Any data
State = 0x2001100
Detailed explanation:
Restore pending
Storage must be defined
Storage may be defined

Tablespace ID = 13
Name = CMP_ORT_INDX
Type = Database managed space
Contents = Any data
State = 0x2001100
Detailed explanation:
Restore pending
Storage must be defined
Storage may be defined

Tablespace ID = 14
Name = CMP_POI_DATA
Type = Database managed space
Contents = Any data
State = 0x2001100
Detailed explanation:
Restore pending
Storage must be defined
Storage may be defined

Tablespace ID = 15
Name = CMP_POI_INDX
Type = Database managed space
Contents = Any data
State = 0x2001100
Detailed explanation:
Restore pending
Storage must be defined
Storage may be defined

Tablespace ID = 16
Name = CMP_TRI_DATA
Type = Database managed space
Contents = Any data
State = 0x2001100
Detailed explanation:
Restore pending
Storage must be defined
Storage may be defined

Tablespace ID = 17
Name = CMP_TRI_INDX
Type = Database managed space
Contents = Any data
State = 0x2001100
Detailed explanation:
Restore pending
Storage must be defined
Storage may be defined

Tablespace ID = 18
Name = FLD_SLD_DATA
Type = Database managed space
Contents = Any data
State = 0x2001100
Detailed explanation:
Restore pending
Storage must be defined
Storage may be defined

Tablespace ID = 19
Name = FLD_SLD_INDX
Type = Database managed space
Contents = Any data
State = 0x2001100
Detailed explanation:
Restore pending
Storage must be defined
Storage may be defined

Tablespace ID = 20
Name = SYSTOOLSTMPSPACE
Type = System managed space
Contents = User Temporary data
State = 0x2001100
Detailed explanation:
Restore pending
Storage must be defined
Storage may be defined

SQL1350N The application is not in the correct state to process this
request.
Reason code="3".
Is there something else that needs to be done between the redirected
restore command and the SET TABLESPACE command??

Thanks,

Chris

Nov 12 '05 #6
Chris wrote:
I have searched this group for answers and tried the responses.

I am trying to Use an full online backup from our production server and
apply it to our test server. The Tablespaces in the productions server
are on the d drive and my test server has no d drive.

The restore command i am using is:

RESTORE DATABASE CENTRAL FROM "C:\DB2Backups" TAKEN AT 20050620000000
INTO CENT0620 REDIRECT;

SQL1277N Restore has detected that one or more table space containers
are
inaccessible, or has set their state to 'storage must be defined'.
DB20000I The RESTORE DATABASE command completed successfully.

message as expected. I then go to issue SET TABLESPACE commands and I
get:

db2 => SET TABLESPACE CONTAINER FOR 4 USING (PATH "CMPDEFAULT.DATA")
DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL1350N The application is not in the correct state to process this
request.
Reason code="3".

Any help would be greatly appreciated!!

thanks,

Chris


Chris,

I suspect that this is because you are doing autocommit after each
statement. So DB2 is treating each statement as a totally separate unit
of work.

Suggest you put all your commands you need to do into a file (let's call it
fullback.cmds) and run it from the db2cmd C: prompt as -

db2 -tvf fullback.cmds

I've had problems running redirected restores in any other way than this.
I've also had issues when a failure occurs and all the commands weren't
completed.

I've got a Perl script I use to build the redirected restore file based on
the source database. It produces UNIX type paths but you can always
globally change the output. If you are interested I can email you a copy.
Just send me an email at teamdbaATNOSPAMscotdb.com !!!

Phil Nelson
ScotDB Ltd.
Nov 12 '05 #7
My apologies for not reading the OP more carefully. I know your pain -
I struggled for quite awhile with the redirected restore/set tablespace
syntax. I'll offer a few other (possibly lame) observations:
* you have a mix of DMS amd SMS tablespaces...
* not knowing the platform, does CMPDEFAULT.DATA really describe your
path? Given your orginal backup dir, I would have expected something
like C:\TBSP4
* I used single quotes around path, not doubles

Sincerely hope this helps,

Pete H

Nov 12 '05 #8
Ian
Chris wrote:
I have searched this group for answers and tried the responses.

I am trying to Use an full online backup from our production server and
apply it to our test server. The Tablespaces in the productions server
are on the d drive and my test server has no d drive.

The restore command i am using is:

RESTORE DATABASE CENTRAL FROM "C:\DB2Backups" TAKEN AT 20050620000000
INTO CENT0620 REDIRECT;

SQL1277N Restore has detected that one or more table space containers
are
inaccessible, or has set their state to 'storage must be defined'.
DB20000I The RESTORE DATABASE command completed successfully.

message as expected. I then go to issue SET TABLESPACE commands and I
get:

db2 => SET TABLESPACE CONTAINER FOR 4 USING (PATH "CMPDEFAULT.DATA")


This is a syntax error (yes, I agree that the error code is misleading).

set tablespace containers for 4 using (path "cmpdefault.data")

Notice "containers" (plural), not "container" (singular).

Nov 12 '05 #9
Well thank you all for your responces.

I did try the script and turning off auto commit.

I also changed from plural to singular.

Script used as follows with return values:

RESTORE DATABASE CENTRAL USER USERID USING FROM
"C:\DB2Backups" TAKEN A
T 20050620000000 INTO CENT0620 REDIRECT
SQL1277N Restore has detected that one or more table space containers
are
inaccessible, or has set their state to 'storage must be defined'.
DB20000I The RESTORE DATABASE command completed successfully.

SET TABLESPACE CONTAINER FOR 0 USING (PATH "SQLT0000.0")
DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL1350N The application is not in the correct state to process this
request.
Reason code="3".

SET TABLESPACE CONTAINER FOR 1 USING (PATH "SQLT0001.0")
DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL1350N The application is not in the correct state to process this
request.
Reason code="3".

SET TABLESPACE CONTAINER FOR 2 USING (PATH "SQLT0002.0")
DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL1350N The application is not in the correct state to process this
request.
Reason code="3".

SET TABLESPACE CONTAINER FOR 3 USING (PATH "SYSTOOLSPACE")
DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL1350N The application is not in the correct state to process this
request.
Reason code="3".

SET TABLESPACE CONTAINER FOR 4 USING (PATH "CMPDEFAULT.DATA")
DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL1350N The application is not in the correct state to process this
request.
Reason code="3".

SET TABLESPACE CONTAINER FOR 5 USING (PATH "CMPDEFAULT.INDX")
DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL1350N The application is not in the correct state to process this
request.
Reason code="3".

SET TABLESPACE CONTAINER FOR 6 USING (FILE "CMPIVJ_01.DATA" 250000)
DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL1350N The application is not in the correct state to process this
request.
Reason code="3".

SET TABLESPACE CONTAINER FOR 7 USING (FILE "CMPIVJ_01.INDX" 250000)
DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL1350N The application is not in the correct state to process this
request.
Reason code="3".

SET TABLESPACE CONTAINER FOR 8 USING (FILE "CMPORD_01.DATA" 50000)
DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL1350N The application is not in the correct state to process this
request.
Reason code="3".

SET TABLESPACE CONTAINER FOR 8 USING (FILE "CMPORD_01.INDX" 50000)
DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL1350N The application is not in the correct state to process this
request.
Reason code="3".

SET TABLESPACE CONTAINER FOR 10 USING (FILE "CMPORL_01.DATA" 50000)
DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL1350N The application is not in the correct state to process this
request.
Reason code="3".

SET TABLESPACE CONTAINER FOR 11 USING (FILE "CMPORL_01.INDX" 50000)
DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL1350N The application is not in the correct state to process this
request.
Reason code="3".

SET TABLESPACE CONTAINER FOR 12 USING (FILE "CMPORT_01.DATA" 12500)
DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL1350N The application is not in the correct state to process this
request.
Reason code="3".

SET TABLESPACE CONTAINER FOR 13 USING (FILE "CMPORT_01.INDX" 12500)
DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL1350N The application is not in the correct state to process this
request.
Reason code="3".

SET TABLESPACE CONTAINER FOR 14 USING (FILE "CMPPOI_01.DATA" 3750)
DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL1350N The application is not in the correct state to process this
request.
Reason code="3".

SET TABLESPACE CONTAINER FOR 15 USING (FILE "CMPPOI_01.INDX" 3750)
DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL1350N The application is not in the correct state to process this
request.
Reason code="3".

SET TABLESPACE CONTAINER FOR 16 USING (FILE "CMPTRI_01.DATA" 12500)
DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL1350N The application is not in the correct state to process this
request.
Reason code="3".

SET TABLESPACE CONTAINER FOR 17 USING (FILE "CMPTRI_01.INDX" 12500)
DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL1350N The application is not in the correct state to process this
request.
Reason code="3".

SET TABLESPACE CONTAINER FOR 18 USING (FILE "FLDSLD_01.DATA" 250000)
DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL1350N The application is not in the correct state to process this
request.
Reason code="3".

SET TABLESPACE CONTAINER FOR 19 USING (FILE "FLDSLD_01.INDX" 250000)
DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL1350N The application is not in the correct state to process this
request.
Reason code="3".

SET TABLESPACE CONTAINER FOR 20 USING (PATH "SYSTOOLTMPSPACE")
DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL1350N The application is not in the correct state to process this
request.
Reason code="3".

RESTORE DATABASE CENTRAL CONTINUE
SQL1277N Restore has detected that one or more table space containers
are
inaccessible, or has set their state to 'storage must be defined'.
DB20000I The RESTORE DATABASE command completed successfully.
I am tring to put all containers into the defualt db directory. It is
interesting that the statment below even returns the same error:
db2 => SET
DB21034E The command was processed as an SQL statement because it was
not a
valid Command Line Processor command. During SQL processing it
returned:
SQL1350N The application is not in the correct state to process this
request.
Reason code="3".

I am fully out of ideas.

thanks,

Chris

Nov 12 '05 #10
Why are you not providing your absolute path name in the PATH?

It should be something like this:
SET TABLESPACE CONTAINERS FOR 19 USING (FILE
"D:\DB2\NODE0000\SQL0002\FLDSLD_01.INDX" 250000)
I am hoping you have taken a list tablespaces show detail for the
original database, and run SET TABLESPACE CONTAINERS for all the
containers starting from container 0.

Also, you do not have to SET TABLESPACE CONTAINERS in a script.

THE MOST important thing about REDIRECTED RESTORE is all the commands
starting from RESTORE command to the final RESTORE CONTINUE should all
be in the same command session!! VERY IMPORTANT.

Else, you'll have to start from the beginning.

Nov 12 '05 #11
Thank you all for your help.

I still do not know why the backup file would not restore.

Last night I did an offline backup and it restored without error with
the above commands.

Is there a problem restoring redirected from an online backup??

thansk,

Chris

Nov 12 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Philip Nelson | last post by:
Ran into a problem doing a redirected restore of a database with SQL stored procedures. On our production server database DPXXX001 has a number of SQL stored procedures defined. After...
3
by: Vikrant | last post by:
Friends, Due an application (old) install program problem, Under AIX I could only create DB2 instance, I could also catalog it. Its complex application and I am not expert in creating full...
1
by: Vikrant | last post by:
Hi Kelly This is from old response by you. What is 'callerac' parameter in REDIRECTED restore, how can I provide 'callerac' value ? Thanks, VKG =====
9
by: GL | last post by:
I am running DB2 8.1.1 on AIX 5.1 Having a problem with a redirected restore. Once into the restore continue phase, I immediately get the following “SQL2059W A device full warning was...
1
by: Jack | last post by:
Is it possible to find out what the tablespace definitions are of database you are about to build using a redirected restore? What I am wanting to do is build a script that can take only a backup...
7
by: CCC via DBMonster.com | last post by:
We use redirected restore to refresh test from prod on different AIX 5.2 servers. The databases have the same number, size and names of cooked containers. The only difference is the fully qualified...
1
by: Kent.Brooke | last post by:
When a backup is taken from server a and then redirected restore is done on server b, the tables and data is fine however db2advis says "explain & advise tables not created for user x properly"....
4
by: Laurence | last post by:
Hi there, Command Reference book stated for db2relocatedb command: Copy the files/devices belonging to the databases being copied onto the system where the new instance resides. The path names...
1
by: okonita | last post by:
Hi all, This is a very urgent issue for my team. We are trying a Redirected restore the most current online DB2 UDBv8.2 backup copy from prod disk to disk on another/test instance. Our...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
0
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...

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.