DB2 Restoration: SQL0928N

Source: Internet
Author: User
Tags db2 connect db2 connect to

The environment is AIX 6.1, and DB2 9.7.0.7 first checks whether the db2 master process exists.Ps-ef | grep db2sysIf notDb2startOpen the database backup media as a cold backup data source and cd it to the directory where the media is located:Cd/home/db2inst1/backupUse the redirect parameter to change the Directory: 1.>Db2 restore db xxx from. replace existing redirect without rolling forwardSQL1277W A redirected restore operation is being completed MED. Table space configuration can now be viewed and table spaces that do not use automatic IC storage can have their containers reconfigured. DB20000I The restore database command completed successfully.
List xxx database container details: 2.>Db2pd-db xxx-tablespacesDatabase Partition 0 -- Database xxx -- Active -- Up 0 days 00:00:16 -- Date 2014-05-07-13.06.01.022471
Tablespace Configuration: address Id Type Content PageSz ExtentSz Auto Prefetch BufID BufIDDisk FSC NumCntrs MaxStripe lastconsecpp limit 0 SMS Regular 4096 32 Yes 32 1 1 On 1 0 31 running 1 SMS limit MP 4096 32 Yes 32 1 On 1 1 0 31 TEMPSPACE10x0700000103DF3C00 2 SMS Regular 4096 32 Yes 32 1 1 On 1 0 31 USERSPACE10x0700000103DF7360 3 SMS Regular 4096 32 Yes 32 1 1 On 1 0 31 then 4 SMS UsrTmp 4096 32 Yes 32 1 1 on 1 0 31 running 5 DMS Large 4096 32 No 32 1 Off 1 0 31 CDTS0x0700000105280080 6 DMS Large 4096 32 No 64 1 Off 1 1 0 31 TSASNCA0x0700000105281560 7 DMS Large 4096 32 No 64 1 1 Off 1 0 31 TSASNUOW0x0700000105282A40 8 SMS Regular 8192 32 No 32 2 2 Off 1 0 31 CLOBTBS1
Tablespace Statistics: address Id TotalPgs UsablePgs UsedPgs PndFreePgs FreePgs HWM Max HWM State MinRecTime NQuiescers PathsDropped limit 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0x02001100 0 0 No 0x0700000103DF3C00 2 0 0 0 0 0 0 0 0x02001100 1398850212 0 No 0x0700000103DF7360 3 0 0 0 0 0 0 0 0x02001100 1373021563 0 No 0x0700000103DFAAC0 4 0 0 0 0 0 0 0 0 0 0 0x02001100 1301089227 0 No 0x0700000103DFE220 5 50000 49952 0 0 0 0 0 0x02001100 1374892759 0 No 0x0700000105280080 6 38400 38368 0 0 0 0 0x02001100 0 no 0x0700000105281560 7 12800 12768 0 0 0 0 0x02001100 1374890249 0 No 0x0700000105282A40 8 0 0 0 0 0 0 0 0 0x02001100 1398850032 0 No
Tablespace Autoresize Statistics: address Id as ar InitSize IncSize IIP MaxSize LastResize limit 0 No 0 No 0 None No limit 1 No 0 0 No 0 None No 0x0700000103DF3C00 2 No 0 No 0 None No 0x0700000103DF7360 3 No 0 0 No 0 None No 0x0700000103DFAAC0 4 No 0 0 No 0 None No 0x0700000103DFE220 5 No 0 0 No 0 None No 0x0700000105280080 6 No 0 0 No 0 None no 0x0700000105281560 7 No 0 0 No 0 None No 0x0700000105282A40 8 No 0 0 No 0 None No
Containers: address TspId ContainNum Type TotalPgs UseablePgs PathID StripeSet Container defaults 0 0 Path 0 0-0/db2sys/db2inst1/XXX/NODE0000/SQL00003/defaults 1 0 Path 0 0-0/db2sys/db2inst1 /XXX/NODE0000/SQL00003/defaults 2 0 Path 0 0-0/db2sys/db2inst1/XXX/NODE0000/SQL00003/SQLT0002.00x0700000103DF8840 3 0 Path 0 0-0/db2sys/db2inst1/XXX /NODE0000/SQL00003/SYSTOOLSPACE0x0700000103DFBFA0 4 0 Path 0 0-0/db2sys/db2inst1/XXX/NODE0000/SQL00003/00005 0 File 50000 49952-0/db2sys/db2inst1/XXX/NODE0000 /SQL00003/CDTABLESPACE. DAT0x0700000103DFF940 6 0 File 38400 38368-0/db2sys/db2inst1/XXX/NODE0000/SQL00003/00007 0 File 12800 12768-0/db2sys/db2inst1/XXX/NODE0000/SQL00003/00008 0 Path 0 0-0/db2sys/db2inst1/XXX/NODE0000/SQL00003/XXXCLOB
In the/db2sys directory, create the xxx database container storage path: cd/db2sys/db2inst1mkdir xxx3. change the storage path of the container and file:Db2 "set tablespace containers for 0 using (Path '/db2sys/db2inst1/xxx/NODE0000/SQL00001/SQLT0000.0 ')"Db2 "set tablespace containers for 1 using (Path '/db2sys/db2inst1/xxx/NODE0000/SQL00001/SQLT0001.0 ')"Db2 "set tablespace containers for 2 using (Path '/db2sys/db2inst1/xxx/NODE0000/SQL00001/SQLT0002.0 ')"Db2 "set tablespace containers for 3 using (Path '/db2sys/db2inst1/xxx/NODE0000/SQL00001/SYSTOOLSPACE ')"Db2 "set tablespace containers for 4 using (Path '/db2sys/db2inst1/xxx/NODE0000/SQL00001/SYSTOOLSTMPSPACE ')"Db2 "set tablespace containers for 5 using (File '/db2sys/db2inst1/xxx/NODE0000/SQL00001/CDTABLESPACE. DAT' 50000 )"Db2 "set tablespace containers for 6 using (File '/db2sys/db2inst1/xxx/NODE0000/SQL00001/TSASNCA' 38400 )"Db2 "set tablespace containers for 7 using (File '/db2sys/db2inst1/xxx/NODE0000/SQL00001/TSASNUOW' 12800 )"Db2 "set tablespace containers for 8 using (Path '/db2sys/db2inst1/xxx/NODE0000/SQL00001/xxxclob ')"
Ps: the following error occurs: SQL0298N Bad container path. SQLSTATE = 428B2: The container type and container name are both correct. Finally, I couldn't find a solution. Finally, I used a clumsy solution. Solution: Delete the xxx database:
> Db2 drop db xxx re-use db2 restore to restore and add the to parameter:> db2 restore db xxx from. on/db2sys/db2inst1/xxx replace existing redirect without rolling forward the command to change the container and data file path on the duplicate is OK. After the path is changed, restore continue:>Db2 restore db xxx continueDB20000I The restore database command completed successfully.
Change archive path> db2 update db cfg for xxx using LOGARCHMETH1 disk:/db2sys/db2log/xxx
Restart the database to make the parameters take effect:>Db2 stop>Db2 start
Ps: SQL0332N>Db2 connect to xxxSQL0332N Character conversion from the source code page "1386" to the target code page "819" is not supported. SQLSTATE = 57017 solution:>Db2setDB2COMM = tcpip
>Db2set DB2CODEPAGE = 1386
>Db2setDB2COMM = tcpipDB2CODEPAGE = 1386>Db2 terminate
>Db2 connect to cnap
Database Connection Information
Database server = DB2/AIX64 9.7.7 SQL authorization ID = DB2INST1 Local database alias = XXX
OK, DB2 is restored.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.