I have db MYDB that I try to restore but I can't find out what is the problem with redirection of one TEMPORARY (8k) DMS tablespace.
I try to make restore to a new db (NEWONEDB) from offline backup of MYDB.
$ db2 connect to mydb
Database Connection Information
Database server = DB2/AIX64 8.2.0
SQL authorization ID = DB2INST1
Local database alias = MYDB
$ db2 list tablespaces
Tablespaces for Current Database
Tablespace ID = 0
Name = SYSCATSPACE
Type = System managed space
Contents = Any data
State = 0x0000
Detailed explanation:
Normal
Tablespace ID = 1
Name = TEMPSPACE1
Type = System managed space
Contents = System Temporary data
State = 0x0000
Detailed explanation:
Normal
Tablespace ID = 2
Name = USERSPACE1
Type = System managed space
Contents = Any data
State = 0x0000
Detailed explanation:
Normal
Tablespace ID = 3
Name = SYSTOOLSPACE
Type = System managed space
Contents = Any data
State = 0x0000
Detailed explanation:
Normal
Tablespace ID = 4
Name = TMPLOCAL
Type = Database managed space
Contents = User Temporary data
State = 0x0000
Detailed explanation:
Normal
I have created place for new db NEWONEDB with all necesary directories.
$ pwd
/new_place
$ ls -al
total 80
drwxr-xr-x 8 db2inst1 db2iadm1 4096 3 Pro 16:22 .
drwxrwxrwx 11 db2inst1 db2iadm1 4096 2 Pro 18:24 ..
drwxr-xr-x 2 db2inst1 db2iadm1 256 3 Pro 11:43 sys
drwxr-xr-x 2 db2inst1 db2iadm1 256 3 Pro 11:43 sys1
drwxr-xr-x 2 db2inst1 db2iadm1 256 3 Pro 11:44 tmp
drwxr-xr-x 2 db2inst1 db2iadm1 256 3 Pro 16:22 tmp1
drwxr-xr-x 2 db2inst1 db2iadm1 256 3 Pro 11:44 usr
$ du -k
0 ./sys
0 ./sirv
0 ./tmp
0 ./usr
0 ./sys1
0 ./tmp1
36 .
And here is the restore command that doesn't work. I have plenty of space in /new_place
$ db2 -tvf restore.sql -z restore.out
restore db mydb from /mydb/backup taken at 20041202173127 to /new_place into NEWONEDB 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 containers for 0 using (path '/new_place/sys')
DB20000I The SET TABLESPACE CONTAINERS command completed successfully.
set tablespace containers for 1 using (path '/new_place/tmp')
DB20000I The SET TABLESPACE CONTAINERS command completed successfully.
set tablespace containers for 2 using (path '/new_place/usr')
DB20000I The SET TABLESPACE CONTAINERS command completed successfully.
set tablespace containers for 3 using (path '/new_place/sys1')
DB20000I The SET TABLESPACE CONTAINERS command completed successfully.
set tablespace containers for 4 using (path '/new_place/tmp1')
===>SQL0298N Bad container path. SQLSTATE=428B2
restore db MYDB 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 also tried to create NEWONEDB, with tempspace that has 8k page size (and necessary BP) but the message was the same.
Do you maybe have idea what can be problem with ?
Thank you in advance!
NNIcole