Oh , now I see ... you are doing this from a client ?
Based on this assumption, here is the information from the db2 command reference :
To restore to a new remote database, it is necessary to first attach to the
instance where the new database will reside. Then, create the new database,
specifying the code page and the territory of the server.
If you are not sure the type of instance, then issue the command
db2 get dbm cfg
from a command line on the client and the second non-blank line in the output will tell you the node type .. (This command should be run on the box under the same instance id you are trying to run the perl script)
Please bear with me if my assumption is wrong
Originally posted by neelakant
thanks a lot. Your suggestion to remove the db2clp.bat from the statement solved my earlier problems. But now I am getting the error
"SQL1096N The command is not valid for this node type."
Can you suggest some solution to this problem. I am really new to DB2.
Thanks in advance.
Visit the new-look IDUG Website , register to gain access to the excellent content.
Now we have a different approach to the issue of backup and restore. we now have a file named "com.db" , the content of which is as follows
connect to testdb user db2admin using password;
backup database testdb user db2admin using password online to c:\\;
connect to testdb2 user db2admin using password;
RESTORE DATABASE testdb user db2admin using password FROM C: taken at 20030923162140 to D: INTO testdb2 WITH 2 BUFFERS BUFFER 1024 replace existing WITHOUT PROMPTING;
The com.db file is executed from a perl script with the commands
$cmd ="db2cmd.exe DB2.exe -tvf d:\\db2\\com.db";
Now I get the output as follows
connect to testdb user db2admin using
Database Connection Information
Database server = DB2/NT 7.1.0
SQL authorization ID = DB2ADMIN
Local database alias = TESTDB
backup database testdb user db2admin using online to c:\\
Backup successful. The timestamp for this backup image is : 20030925123751
connect to testdb2 user db2admin using
SQL1117N A connection to or activation of database "TESTDB2" cannot be made
because of ROLL-FORWARD PENDING. SQLSTATE=57019
RESTORE DATABASE testdb user db2admin using FROM C: taken at 2003092316
2140 to D: INTO testdb2 WITH 2 BUFFERS BUFFER 1024 replace existing WITHOUT PROM
SQL2540W Restore is successful, however a warning "2528" was encountered
during Database Restore while processing in No Interrupt mode.
Is there a way to avoid all the errors we see in the output?