重定向恢复DB2操作指引_第1页
重定向恢复DB2操作指引_第2页
重定向恢复DB2操作指引_第3页
重定向恢复DB2操作指引_第4页
重定向恢复DB2操作指引_第5页
已阅读5页,还剩1页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

如果DB2镜像的数据库存储路径与目标恢复的路径不一致,需要用重定向的方式恢复数据库,否则会出现报错。如下是直接恢复时的报错:SQL20321NStoragepathscannotbeprovidedbecausethedatabaseisnotenabledforautomaticstorage.SQLSTATE=55062解决方法:表示需要恢复的OS环境中的路径不满足原镜像主机恢复时所需的路径,需要将数据库恢复的命令中on修改为to,并且需要增加重定向指令:执行后出现如下提示:SQL1277W Aredirectedrestoreoperationisbeingperformed. Tablespaceconfigurationcannowbeviewedandtablespacesthatdonotuseautomatic storagecanhavetheircontainersreconfigured.DB20000I TheRESTOREDATABASEcommandcompletedsuccessfully.分析表空间:C:\ProgramFiles\IBM\SQLLIB\BIN>db2listtablespacesTablespacesforCurrentDatabaseTablespaceID =0Name =SYSCATSPACEType =SystemmanagedspaceContents =Allpermanentdata.Regulartablespace.State =0x2001100Detailedexplanation:RestorependingStoragemustbedefinedStoragemaybedefinedTablespaceID =1Name =TEMPSPACE1Type =SystemmanagedspaceContents =SystemTemporarydataState =0x2001100Detailedexplanation:RestorependingStoragemustbedefinedStoragemaybedefinedTablespaceID =2Name =USERSPACE1Type =SystemmanagedspaceContents =Allpermanentdata.Regulartablespace.State =0x2001100Detailedexplanation:RestorependingStoragemustbedefinedStoragemaybedefinedTablespaceID

=3NameTypeContentsState

=AMWAY4=Systemmanagedspace=SystemTemporarydata=0x2001100Detailedexplanation:RestorependingStoragemustbedefinedStoragemaybedefinedTablespaceID

=4NameTypeContentsState

=TEMP_SPACE=Systemmanagedspace=UserTemporarydata=0x2001100Detailedexplanation:RestorependingStoragemustbedefinedStoragemaybedefinedTablespaceID

=5NameTypeContentsState

=AMWAY4_LARGE=Systemmanagedspace=Allpermanentdata.Regulartablespace.=0x2001100Detailedexplanation:RestorependingStoragemustbedefinedStoragemaybedefinedTablespaceID

=6NameTypeContentsState

=SYSTOOLSPACE=Systemmanagedspace=Allpermanentdata.Regulartablespace.=0x2001100Detailedexplanation:RestorependingStoragemustbedefinedStoragemaybedefined查看每个表空间的容器情况: 标识出的未恢复的新的路径,

需要手动配置。标识出的路径是源镜像的数据路径,但目标服务器无法提供此路径,所以会出错。C:\ProgramFiles\IBM\SQLLIB\BIN>db2listtablespacecontainersfor0TablespaceContainersforTablespace0ContainerID=0Name=C:\DB2\NODE0000\SQL00001\SQLT0000.0Type=PathTablespaceContainersforTablespace1ContainerID =0Name =C:\DB2\NODE0000\SQL00001\SQLT0001.0Type =PathTablespaceContainersforTablespace2ContainerID =0Name =C:\DB2\NODE0000\SQL00001\SQLT0002.0Type =PathC:\ProgramFiles\IBM\SQLLIB\BIN>db2listtablespacecontainersfor3showdetailTablespaceContainersforTablespace3ContainerID =0Name =E:\Tablespaces\PRODHRType =PathTotalpages =0Useablepages =0Accessible =NoC:\ProgramFiles\IBM\SQLLIB\BIN>db2listtablespacecontainersfor4showdetailContainerID =0Name =E:\Tablespaces\PRODHR_TEMP_SPACEType =PathTotalpages =0Useablepages =0Accessible =NoC:\ProgramFiles\IBM\SQLLIB\BIN>db2listtablespacecontainersfor5showdetailTablespaceContainersforTablespace5ContainerID =0Name =E:\Tablespaces\PRODHR_LARGEType =PathTotalpages =0Useablepages =0Accessible =NoC:\ProgramFiles\IBM\SQLLIB\BIN>db2listtablespacecontainersfor6showdetailTablespaceContainersforTablespace6ContainerID =0Name =C:\DB2\NODE0000\SQL00001\SYSTOOLSPACEType =PathTotalpages =0Useablepages =0Accessible =No用如下命令修改新合适的路径:db2"settablespacecontainersfor3using(path'C:\DB2\Tablespaces\PRODHR')"db2"settablespacecontainersfor4using(path'C:\DB2\Tablespaces\PRODHR_TEMP_SPACE')"db2"settablespacecontainersfor5using(path'C:\DB2\Tablespaces\PRODHR_LARGE')"成功会返回如下结果:DB20000I TheSETTABLESPACECONTAINERScommandcompletedsuccessfully.错误的例子:如果类型是 file时,需要指定 file文件的page数量,例如:db2"settablespacecontainersfor3using(file'/fangys_db/fangys_tbs.dbf'10000)"通过”db2listtablespacecontainersfor3showdetail可”以查看 page数量。C:\ProgramFiles\IBM\SQLLIB\BIN>db2"settablespacecontainersfor3using(file'C:\DB2\PRODHR'100)"SQL0298NBadcontainerpath. SQLSTATE=428B2C:\ProgramFiles\IBM\SQLLIB\BIN>db2"settablespacecontainersfor3using(path'C:\DB2\Tablespaces\PRODHR'100)"SQL0104NAnunexpectedtoken"100"wasfoundfollowing"<character-string>".Expectedtokensmayinclude:")". SQLSTATE=42601完成后继续 restoredb2"restoredatabasePRODHRcontinue"C:\ProgramFiles\IBM\SQLLIB\BIN>db2"restoredatabasePRODHRcontinue"DB20000I TheRESTOREDATABASEcommandcompletedsuccessfully.db2getdbcfgforprodhrC:\ProgramFiles\IBM\SQLLIB\BIN>db2getdbcfgforprodhr⋯Backuppending

=NOAllcommittedtransactionshavebeenwrittentodisk

=NORollforwardpendingRestorepending

=DATABASE=NO⋯前滚日志:(如果生成镜像无日志输出,则无需此步骤,需通过查看

dbcfg的状态判断)db2rollforwarddatabasePRODHRtoendoflogsandcompleteoverflowlogpath(C:\DB2\data)C:\ProgramFiles\IBM\SQLLIB\BIN>db2rollforwarddatabasePRODHRtoendoflogsandcompleteoverflowlogpath(C:\DB2\data)InputdatabasealiasNumberofnodeshavereturnedstatus

RollforwardStatus=PRODHR=1NodenumberRollforwardstatus

=0=notpendingNextlogfiletoberead

=Logfilesprocessed

=S0790330.LOG-S0790330.LOGLastcommittedtransaction DB20000I TheROLLFORWARDcommandcompletedsuccessfully.再次查看配置 :db2getdbcfgforprodhrBackuppending =NOAllcommittedtransactionshavebeenwrittentodisk =YESRollforwardpending =NORestorepending =NO连接数据库C:\ProgramFiles\IBM\SQLLIB\BIN>db2connecttoprodhrDatabaseConnectionInformationDatabaseserver SQLauthorizationID =ADMINIST...Localdatabasealias =PRODHR查看数据库位置:C:\ProgramFiles\IBM\SQLLIB\BIN>db2listtablespacecontainersfor3showdetailTablespaceContainersforTablespace3ContainerID =0Name =C:\DB2\Tablespaces\PRODHRType =PathTotalpages =1Useablepages =1Accessible =YesC:\ProgramFiles\IBM\SQLLIB\BIN>db2listtablespacecontainersfor4showdetailTablespaceContainersforTablespace4ContainerID =0Name =C:\DB2\Tablespaces\PRODHR_TEMP_SPACEType =PathTotalpages =1Useablepages =1Accessible =YesC:\ProgramFiles\IBM\SQLLIB\BIN>db2listtablespacecontainersfor5showdetailTablespaceContainersforTablespace5ContainerID =0Name =C:\DB2\Tablespaces\PRODHR_LARGEType =PathTotalpages =3130Useablepages =3130Accessible =Yes出师表两汉:诸葛亮先帝创业未半而中道崩殂,今天下三分,益州疲弊,此诚危急存亡之秋也。然侍卫之臣不懈于内,忠志之士忘身于外者

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论