DB2V8.2数据恢复到v9.5 ONAIX

db2 => connect to bpfdb

   Database Connection Information

 Database server        = DB2/AIX64 9.5.7
 SQL authorization ID   = DB2INST1
 Local database alias   = BPFDB

db2 => select   *   from   sysibm.sysversions 

VERSIONNUMBER VERSION_TIMESTAMP          AUTHID                                                                                                                          
------------- -------------------------- -------------------
      9050700 2011-02-24-08.51.05.354359 DB2INST1                                                                                                                        

  1 record(s) selected.
bash-3.2$ db2set -all
[i] DB2_HASH_JOIN=Y
[i] DB2COMM=tcpip
[g] DB2FCMCOMM=TCPIP4
[g] DB2SYSTEM=test2
[g] DB2INSTDEF=db2inst1
[g] DB2ADMINSERVER=dasusr1
bash-3.2$     db2   list   database   directory 

 System Database Directory

 Number of entries in the directory = 2

Database 1 entry:

 Database alias                       = BPFDB
 Database name                        = BPFDB
 Local database directory             = /db2/bpfdb
 Database release level               = c.00
 Comment                              =
 Directory entry type                 = Indirect
 Catalog database partition number    = 0
 Alternate server hostname            =
 Alternate server port number         =

Database 2 entry:

 Database alias                       = SAMPLE
 Database name                        = SAMPLE
 Local database directory             = /home/db2inst1
 Database release level               = c.00
 Comment                              =
 Directory entry type                 = Indirect
 Catalog database partition number    = 0
 Alternate server hostname            =
 Alternate server port number         =
bash-3.2$ db2 force applications all
DB20000I  The FORCE APPLICATION command completed successfully.
DB21024I  This command is asynchronous and may not be effective immediately.

bash-3.2$ db2 list tablespaces
SQL1024N  A database connection does not exist.  SQLSTATE=08003
bash-3.2$ db2 connect to bpfdb
db2 list tablespaces
SQL1119N  A connection to or activation of database "BPFDB" cannot be made 
because a previous restore is incomplete or still in progress.  SQLSTATE=57019
bash-3.2$ db2 restore database BPFDB from /db2/back/ taken at 20110221030637 to /db2/bpfdb with 3 buffers buffer 1024 replace existing redirect WITHOUT ROLLING FORWARD
SQL2523W  Warning!  Restoring to an existing database that is different from 
the database on the backup image, but have matching names. The target database 
will be overwritten by the backup version.  The Roll-forward recovery logs 
associated with the target database will be deleted.
SQL1277W  A redirected restore operation is being performed.  Table space 
configuration can now be viewed and table spaces that do not use automatic 
storage can have their containers reconfigured.
DB20000I  The RESTORE DATABASE command completed successfully.
bash-3.2$ db2 list tablespaces

           Tablespaces for Current Database

 Tablespace ID                        = 0
 Name                                 = SYSCATSPACE
 Type                                 = System managed space
 Contents                             = All permanent data. Regular table space.
 State                                = 0x2001100
   Detailed explanation:
     Restore pending
     Storage must be defined
     Storage may be defined

 Tablespace ID                        = 1
 Name                                 = TEMPSPACE1
 Type                                 = System managed space
 Contents                             = System Temporary data
 State                                = 0x2001100
   Detailed explanation:
     Restore pending
     Storage must be defined
     Storage may be defined

 Tablespace ID                        = 2
 Name                                 = USERSPACE1
 Type                                 = System managed space
 Contents                             = All permanent data. Regular table space.
 State                                = 0x2001100
   Detailed explanation:
     Restore pending
     Storage must be defined
     Storage may be defined

 Tablespace ID                        = 3
 Name                                 = UTMTP32
 Type                                 = System managed space
 Contents                             = User Temporary data
 State                                = 0x2001100
   Detailed explanation:
     Restore pending
     Storage must be defined
     Storage may be defined

 Tablespace ID                        = 4
 Name                                 = SYSTOOLSPACE
 Type                                 = System managed space
 Contents                             = All permanent data. Regular table space.
 State                                = 0x2001100
   Detailed explanation:
     Restore pending
     Storage must be defined
     Storage may be defined

 Tablespace ID                        = 5
 Name                                 = QCTEMPTS bash-3.2$ pwd
/db2/bpfdb
bash-3.2$ mkdir 0
bash-3.2$ db2 "set tablespace containers for 0 using (path '/db2/bpfdb/0')"
DB20000I  The SET TABLESPACE CONTAINERS command completed successfully.
bash-3.2$ db2 "set tablespace containers for 1 using (path '/db2/bpfdb/1')"
SQL0299N  Container is already assigned to the table space.  SQLSTATE=42731
bash-3.2$ db2 "set tablespace containers for 2 using (path '/db2/bpfdb/2')"
db2 "set tablespace containers for 3 using (path '/db2/bpfdb/3')"
db2 "set tablespace containers for 4 using (path '/db2/bpfdb/4')"
db2 "set tablespace containers for 5 using (path '/db2/bpfdb/5')"
SQL0299N  Container is already assigned to the table space.  SQLSTATE=42731
bash-3.2$ db2 "set tablespace containers for 3 using (path '/db2/bpfdb/3')"
SQL0299N  Container is already assigned to the table space.  SQLSTATE=42731
bash-3.2$ db2 "set tablespace containers for 4 using (path '/db2/bpfdb/4')"
SQL0299N  Container is already assigned to the table space.  SQLSTATE=42731
bash-3.2$ db2 "set tablespace containers for 5 using (path '/db2/bpfdb/5')"
SQL0299N  Container is already assigned to the table space.  SQLSTATE=42731
bash-3.2$ 

 Type                                 = System managed space
 Contents                             = User Temporary data
 State                                = 0x2001100
   Detailed explanation:
     Restore pending
     Storage must be defined
     Storage may be defined

bash-3.2$ db2 restore database  bpfdb continue
SQL2519N  The database was restored but the restored database was not migrated 
to the current release.  Error "-1006" with tokens " 3  j                      
" is returned.
bash-3.2$ db2 migrate db  bpfdb
SQL1006N  The code page "648535941224547762I" of the application does not 
match the code page "648535941224547765I" of the database.



bash-3.2$ db2set db2codepage=1386
bash-3.2$ db2 terminate 
DB20000I  The TERMINATE command completed successfully.
bash-3.2$ db2 migrate db  bpfdb
DB20000I  The MIGRATE DATABASE command completed successfully.
bash-3.2$ db2 connect to bpfdb 

   Database Connection Information

 Database server        = DB2/AIX64 9.5.7
 SQL authorization ID   = DB2INST1
 Local database alias   = BPFDB

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/11134849/viewspace-688005/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/11134849/viewspace-688005/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值