If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Restore problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-17-04, 18:04
dingi dingi is offline
Registered User
 
Join Date: Feb 2004
Posts: 34
Restore problem

I had bad container error so i'm applying this script to restore the database but still its prompting me to continue/terminate/abort .....

here is the syntax

something is missing here.

restore database siebpdb from e:\Backup taken at 20040216230006 to d: into tstsieb redirect WITHOUT PROMPTING;
set tablespace containers for 3 using (file 'd:\sqllib\sqltestdata\siebel_4k' 128000, file 'd:\sqllib\sqltestdata\siebel_4k1' 128000, file 'd:\sqllib\sqltestdata\siebel_4k2' 128000,file 'd:\sqllib\sqltestdata\siebel_4k3' 128000,file 'd:\sqllib\sqltestdata\siebel_4k4' 128000,file 'd:\sqllib\sqltestdata\siebel_4k5' 128000);
set tablespace containers for 4 using (file 'd:\sqllib\sqltestdata\siebel_16k' 128000, file 'd:\sqllib\sqltestdata\siebel_16k1' 128000, file 'd:\sqllib\sqltestdata\siebel_16k2' 128000);
set tablespace containers for 5 using (file 'd:\sqllib\sqltestdata\siebel_4kl' 32000);
set tablespace containers for 6 using (file 'd:\sqllib\sqltestdata\siebel_idx' 128000, file 'd:\sqllib\sqltestdata\sybel_idx1' 128000, file 'd:\sqllib\sqltestdata\siebel_idx2' 128000, file 'd:\sqllib\sqltestdata\siebel_idx3' 128000);
set tablespace containers for 7 using (path 'd:\sqllib\sqltestdata\temp16k');
set tablespace containers for 8 using (path 'd:\sqllib\sqltestdata\temp32k');
set tablespace containers for 9 using (path 'd:\sqllib\sqltestdata\temp4k');
restore database siebpdb continue;


Would u pl. tell me what is missing ?
Reply With Quote
  #2 (permalink)  
Old 02-17-04, 18:52
dingi dingi is offline
Registered User
 
Join Date: Feb 2004
Posts: 34
any one there to help me out please ?
Reply With Quote
  #3 (permalink)  
Old 02-17-04, 19:24
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Not sure why it would prompt ..

Can't you try the restore after dropping the existing database (You may need to save the db cfg in this case)

Cheers
Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #4 (permalink)  
Old 02-17-04, 21:15
dingi dingi is offline
Registered User
 
Join Date: Feb 2004
Posts: 34
As I mentioned before, it was constantly prompting me, it went to infinite loop so forcefullly i had to close the command center.

I tried to restore it again with the following syntax and got the output.

SYNTAX
--------


restore database siebpdb from e:\Backup taken at 20040216230006 to d:
into tstsieb redirect WITHOUT PROMPTING;

set tablespace containers for 0 using (path "d:\DB2\NODE00");

set tablespace containers for 1 using (path "d:\DB2\NODE00");

set tablespace containers for 2 using (path "d:\DB2\NODE00");

set tablespace containers for 3 using (file
'd:\sqllib\sqltestdata\siebel_4k' 128000, file 'd:\sqllib\sqltestdata\siebel_4k1' 128000, file
'd:\sqllib\sqltestdata\siebel_4k2' 128000,file
'd:\sqllib\sqltestdata\siebel_4k3' 128000,file 'd:\sqllib\sqltestdata\siebel_4k4' 128000,file
'd:\sqllib\sqltestdata\siebel_4k5' 128000);

set tablespace containers for 4 using (file
'd:\sqllib\sqltestdata\siebel_16k' 128000, file 'd:\sqllib\sqltestdata\siebel_16k1' 128000, file
'd:\sqllib\sqltestdata\siebel_16k2' 128000);

set tablespace containers for 5 using (file
'd:\sqllib\sqltestdata\siebel_4kl' 32000);

set tablespace containers for 6 using (file
'd:\sqllib\sqltestdata\siebel_idx' 128000, file 'd:\sqllib\sqltestdata\sybel_idx1' 128000, file
'd:\sqllib\sqltestdata\siebel_idx2' 128000, file
'd:\sqllib\sqltestdata\siebel_idx3' 128000);

set tablespace containers for 7 using (path
'd:\sqllib\sqltestdata\temp16k');

set tablespace containers for 8 using (path
'd:\sqllib\sqltestdata\temp32k');

set tablespace containers for 9 using (path
'd:\sqllib\sqltestdata\temp4k');

RESTORE DATABASE SIEBPDB CONTINUE;

db2 rollforward database tstsieb to end of logs and stop;



ERROR which i get
---------------------

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.

DB20000I The SET TABLESPACE CONTAINERS command completed successfully.

SQL0294N The container is already in use. SQLSTATE=42730

SQL0294N The container is already in use. SQLSTATE=42730

DB20000I The SET TABLESPACE CONTAINERS command completed successfully.

DB20000I The SET TABLESPACE CONTAINERS command completed successfully.

DB20000I The SET TABLESPACE CONTAINERS command completed successfully.

DB20000I The SET TABLESPACE CONTAINERS command completed successfully.

DB20000I The SET TABLESPACE CONTAINERS command completed successfully.

DB20000I The SET TABLESPACE CONTAINERS command completed successfully.

DB20000I The SET TABLESPACE CONTAINERS command completed successfully.

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.

SQL0104N An unexpected token "db2" was found following
"BEGIN-OF-STATEMENT".
Expected tokens may include: "SELECT". SQLSTATE=42601



What should I do next ?
Reply With Quote
  #5 (permalink)  
Old 02-17-04, 22:01
dollar489 dollar489 is offline
Registered User
 
Join Date: Sep 2002
Posts: 456
The path for containers 0,1 and 2 is same; so make sure you specify a different path (directory) there e.g.

set tablespace containers for 0 using (path "d:\DB2\NODE00.0");

set tablespace containers for 1 using (path "d:\DB2\NODE00.1");

set tablespace containers for 2 using (path "d:\DB2\NODE00.2");

and then make sure that you specify a set tablespace container for each and every tablespace, you might be missing a statement for tablespace...check that out.

dollar


Quote:
Originally posted by dingi
As I mentioned before, it was constantly prompting me, it went to infinite loop so forcefullly i had to close the command center.

I tried to restore it again with the following syntax and got the output.

SYNTAX
--------


restore database siebpdb from e:\Backup taken at 20040216230006 to d:
into tstsieb redirect WITHOUT PROMPTING;

set tablespace containers for 0 using (path "d:\DB2\NODE00");

set tablespace containers for 1 using (path "d:\DB2\NODE00");

set tablespace containers for 2 using (path "d:\DB2\NODE00");

set tablespace containers for 3 using (file
'd:\sqllib\sqltestdata\siebel_4k' 128000, file 'd:\sqllib\sqltestdata\siebel_4k1' 128000, file
'd:\sqllib\sqltestdata\siebel_4k2' 128000,file
'd:\sqllib\sqltestdata\siebel_4k3' 128000,file 'd:\sqllib\sqltestdata\siebel_4k4' 128000,file
'd:\sqllib\sqltestdata\siebel_4k5' 128000);

set tablespace containers for 4 using (file
'd:\sqllib\sqltestdata\siebel_16k' 128000, file 'd:\sqllib\sqltestdata\siebel_16k1' 128000, file
'd:\sqllib\sqltestdata\siebel_16k2' 128000);

set tablespace containers for 5 using (file
'd:\sqllib\sqltestdata\siebel_4kl' 32000);

set tablespace containers for 6 using (file
'd:\sqllib\sqltestdata\siebel_idx' 128000, file 'd:\sqllib\sqltestdata\sybel_idx1' 128000, file
'd:\sqllib\sqltestdata\siebel_idx2' 128000, file
'd:\sqllib\sqltestdata\siebel_idx3' 128000);

set tablespace containers for 7 using (path
'd:\sqllib\sqltestdata\temp16k');

set tablespace containers for 8 using (path
'd:\sqllib\sqltestdata\temp32k');

set tablespace containers for 9 using (path
'd:\sqllib\sqltestdata\temp4k');

RESTORE DATABASE SIEBPDB CONTINUE;

db2 rollforward database tstsieb to end of logs and stop;



ERROR which i get
---------------------

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.

DB20000I The SET TABLESPACE CONTAINERS command completed successfully.

SQL0294N The container is already in use. SQLSTATE=42730

SQL0294N The container is already in use. SQLSTATE=42730

DB20000I The SET TABLESPACE CONTAINERS command completed successfully.

DB20000I The SET TABLESPACE CONTAINERS command completed successfully.

DB20000I The SET TABLESPACE CONTAINERS command completed successfully.

DB20000I The SET TABLESPACE CONTAINERS command completed successfully.

DB20000I The SET TABLESPACE CONTAINERS command completed successfully.

DB20000I The SET TABLESPACE CONTAINERS command completed successfully.

DB20000I The SET TABLESPACE CONTAINERS command completed successfully.

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.

SQL0104N An unexpected token "db2" was found following
"BEGIN-OF-STATEMENT".
Expected tokens may include: "SELECT". SQLSTATE=42601



What should I do next ?
Reply With Quote
  #6 (permalink)  
Old 02-18-04, 13:53
dingi dingi is offline
Registered User
 
Join Date: Feb 2004
Posts: 34
Thanks a bunch !!!

Problem got solved.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On