Topic
  • 2 replies
  • Latest Post - ‏2009-06-22T15:14:48Z by s_m_gopinath
big
big
82 Posts

Pinned topic Redirected restore

‏2009-06-22T12:32:49Z |
Hi,
I'm trying to follow the exemple of restoring from backup(of SAMPLE) to a new database (SAMPLE2)given here :
https://www6.software.ibm.com/developerworks/education/db2-cert7316/db2-cert7316-pdf.pdf
This is a my script and error received :

RESTORE DATABASE SAMPLE FROM C:\backups\SAMPLE INTO SAMPLE2 REDIRECT WITHOUT ROLLING FORWARD   SET TABLESPACE CONTAINERS FOR 0 USING (FILE 
"E:\BASES\SAMPLE2\cat0.dat" 5000)   SQL20319N  The SET TABLESPACE CONTAINERS command is not allowed on an automatic storage table space.  SQLSTATE=55061 SET TABLESPACE CONTAINERS FOR 1 USING (FILE 
"E:\BASES\SAMPLE2\temp.dat" 5000) SQL20319N  The SET TABLESPACE CONTAINERS command is not allowed on an automatic storage table space.  SQLSTATE=55061 SET TABLESPACE CONTAINERS FOR 2 USING (FILE 
"E:\BASES\SAMPLE2\users.dat" 5000) SET TABLESPACE CONTAINERS FOR 3 USING (FILE 
"E:\BASES\SAMPLE2\ibm.dat" 5000)

Any help.
Thank you.
Updated on 2009-06-22T15:14:48Z at 2009-06-22T15:14:48Z by s_m_gopinath
  • SystemAdmin
    SystemAdmin
    17917 Posts

    Re: Redirected restore

    ‏2009-06-22T14:01:43Z  
    Hi big,

    The error message pretty much says it all:

    
    SQL20319N  The SET TABLESPACE CONTAINERS command is not allowed on an automatic storage table space.  SQLSTATE=55061
    


    Tablespaces are of the 'automatic storage' variety by default these days, which can not be redirected in the manner traditionally used to redirect SMS or DMS containers. The online help for that sqlcode has some additional details, and the docs have lots more. You'll need to redefine the automatic storage paths for the entire DB, and that is done through other options on the RESTORE command:

    http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.admin.dbobj.doc/doc/r0024234.html

    Hope that helps.
    Kelly Rodger
  • s_m_gopinath
    s_m_gopinath
    33 Posts

    Re: Redirected restore

    ‏2009-06-22T15:14:48Z  
    Hi

    Try the following command:

    RESTORE DATABASE SAMPLE FROM C:\backups\SAMPLE on 'c:\sample\' dbpath on '
    E:\BASES\SAMPLE2\ ' INTO SAMPLE2 REDIRECT WITHOUT ROLLING FORWARD

    db2 'RESTORE DATABASE SAMPLE FROM '/home/db2inst2/backup' TAKEN AT 20090623082331 ON '/home/db2inst2' DBPATH ON '/home/db2inst2/backup' INTO SAMPLES REDIRECT WITHOUT ROLLING FORWARD'

    where,

    on - specifies the storage path for the database
    dbpath on - specifies the db directory

    NOTE:

    For auto storage enabled database the containers cant be set using 'SET CONTAINER ' statement the 'ON ' parameter of restore specifies the storage path.

    Regards,
    Gopinath.