I am attempting to clone my production database to a backup/test server.
I have an on-line backup (logs included) of my production v9.1 Fixpack 2 LUW ESE database running on a Window 2003 Server. The data for the production db is stored in the following directory structure e:\db2data\db2\node0000\proddb\t000000n\filename.
The server that will house the cloned db does not have an E: drive and has a database named testdb with no user defined tablespaces created.
From reading several articles and books, I believe the following statements will need to be run on the cloned machine --
connect to testdb user user_id using password;
restore db proddb from d:\db2backups to testdb redirect; (there will only be one backup file in this directory)
set tablespace containers for 0 using (path 'd:\db2\node0000\testdb\T0000000');
set tablespace containers for 1 using (path 'd:\db2\node0000\testdb\T0000001');
set tablespace containers for 2 using (path 'd:\db2\node0000\testdb\T0000002');
set tablsepace containter for n using (path 'd:\db2\node0000\testdb\t000000n');
restore db proddb continue;
Are the above commands correct? Am I missing anything?
The commands are basically correct, except do not connect to the database just before you try to restore to it. The restore will fail. The first restore command (not the continue after the set tabslespace container line) may need more options depending on your setup.