DB2实验报告2.doc
《DB2实验报告2.doc》由会员分享,可在线阅读,更多相关《DB2实验报告2.doc(60页珍藏版)》请在冰豆网上搜索。
吉林大学
DB2实验报告
班级:
姓名:
学号:
姓名
学号
实验项目
2.Creatingdatabasesanddataplacement
实验性质
□演示性实验□验证性实验
þ操作性实验□综合性实验
实验地点
机器编号
指导教师
实验时间
年月日时分
一、实验综述
1.实验目的及要求
Duringthislab,youwillcreateyourdatabaseandyourtablespaces.Alsointhislab,youwillselectinformationontablespacesfromthesystemcatalog(SYSCAT)views.
Attheendofthelab,studentsshouldbeableto:
•Createadatabase
•Createatablespace
•Executeascriptfiletocreatemultipletablespaces
•AccesstheSYSCATviewscontainingtablespaceinformation
•Listtablespaceinformation
•Listcontainerinformation
2.实验设备、软件
PC, windows XPProfessional, DB2 9 Express-c
二、实验过程(实验步骤、记录、数据、分析)
Section1-CreatingtheDatabase
1.CreatingadatabasecanbedonewiththeDB2commandcreatedatabase.UsetheonlinehelpfacilitytodisplaytheDB2commandsyntaxforcreatedatabase.
Showyourworkbelowbyprintingscreen.
2.Whatinformationcanyouspecifyonthecreatedatabasecommand?
Thenameofthedatabase,thelocationofthedatabase,analiasname,thecodesetandterritoryforstoringthedata,acollatingsequence,adefaultextentsize,automaticstorage,andtablespaceinformationcanbespecifiedonthecreatedatabasecommand.
3.Basedonwhatyoulearnedinlecture,whattablespacesarecreatedwhenadatabaseiscreated?
SYSCATSPACE,USERSPACE1,andTEMPSPACE1
Dependingonwhatyouspecifywhenyoucreatethedatabase,theremaybeafourthtablespacecreatedwithanameofSYSTOOLSPACE.ThisiscreatedifyouspecifyWithAutomaticMaintenanceinsteadofStandardwhenyoucreatethedatabase.
4.Whattypeoftablespace,SMSorDMS,willyourdatabaseusebydefaultforthesedefaulttablespaces?
DMStablespacesforSYSCATSPACEandUSERSPACE1,andSMSforTEMPSPACE1.NotethatinDB2UDBV8.2andearlierthedefaulttablespacesareSMS.
5.BeforewecreateourMUSICDBdatabase,rememberwhatyoulearnedinlectureaboutwhatsomeofthedefaultswillbe.
•Whatisthedefaultpaththatthedatabasewillbecreatedon?
•Whatwillbethedefaulttablespacetype(SMSorDMS)forthetablespacesthatwillbecreatedtohouseUserTables,CatalogTables,andTemporaryTables?
•WhatarethedefaultExtentandPrefetchsizes?
•WhatarethedefaultTerritory,CodeSetandCollatingSequencevalues?
•ThedatabasewillbecreatedontheC:
\DB2pathbydefault.
•ThedefaulttablespacetypeforUserTablesandCatalogTablesisDMS,andforTemporaryTablesisSMS.
•ThedefaultExtentandPrefetchsizesare324KBpageseach.
•Thedefault
6.CreateyourdatabasewithaDatabasenameofMUSICDBusingthedefaultsettings.Itwilltakeafewminutestocreatethedatabase.
Showyourworkbelowbyprintingscreenforthelaststep.
7.YoushouldnowhaveyourMUSICDBdatabasecreated.TheSystemDatabaseDirectorycontainsanentryforalldatabasesknownbythisinstance.ChecktheSystemDatabaseDirectoryforanentryfortheMUSICDBdatabasebyissuingthelistdbdirectorycommand.
Showyourworkbelowbyprintingscreen.
8.Asthereisalotofinformationreturnedfromtheselectstatementandthedatabasemanagerconfiguration,itmightbehelpfultostoretheinformationinafilecalledmyouttobeabletoexamineitstepbystep.Executethescriptagainandsavetheoutputinafilenamedmyout.
Showyourworkbelowbyprintingscreen.
8.WhatistheDatabasealiasnameandwherediditcomefrom?
TheDatabasealiasnameisYL1016.Itdefaultedtothedatabasenamesincenoaliaswasspecifiedwhenthedatabasewascreated.
9.WhatdoesaDirectoryentrytypeofIndirectmean?
ADirectoryentrytypeofIndirectmeansthedatabaseislocatedonthissystem,andthatthelocaldatabasedirectorycanbefoundhere.Youwillseethisifyouissuethelistdatabasedirectorycommandfromyourtelnetwindow.
10.WhatdoesaDirectoryentrytypeofRemotemean?
ADirectoryentrytypeofRemotemeansthedatabaseislocatedonanothersystem.YouwillseethisifyouissuethelistdatabasedirectorycommandfromtheWindowsclient.
11.It'stimetoconnecttoyourMUSICDBdatabase.Checkyourcurrentconnectionstatewiththegetconnectionstatecommand.
12.Whatistheconnectionstate?
Showyourworkbelowbyprintingscreen.
TheconnectionstateisConnectableandUnconnected.
13.ConnecttoyourMUSICDBdatabase.
14.DidyougetconnectedtoyourMUSICDBdatabase?
Showyourworkbelowbyprintingscreen.
15.Checkyourconnectionstateagain.Whatdoesitshow?
Showyourworkbelowbyprintingscreen.
16.EverydatabasehasitsownDatabaseConfigurationfilethatcontainsinformationaboutthedatabaseandtuningparameters.LookattheDatabaseConfigurationfileforyourMUSICDBdatabase.
Showyourworkbelowbyprintingscr