资源描述:
《GREENPLUM介数据库绍之数据库管理(四)-创建数据库和用户管理》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、GREENPLUM介数据库绍之数据库管理(四)-创建数据库和用户管理GREENPLUMintroducesdatabasemanagement(four)-creatingdatabasesandusermanagementPrevious/next2011-04-0815:09:01/personalcategory:GREENPLUMView(82)/comment(1)/score(5/0)GREENPLUM,likeORACLE,hasausermanagementsystemthatiscompletelyindependentoftheoperati
2、ngsystem,andarightsmanagementsystem.Firstofall,let'sintroducethedatabaseinGP.AftertheGPinitializesthesystem,GPautomaticallycreatesthreedatabasespostgre,templateO,template1.,wherepostgreisusedforstoringdatainsidethesystem,andwedonotdeleteitormodifyit.Templatelisthedefaultdataforthesys
3、tem,andwhenwecreateadatabase,wecancreateanewdatabaseusingtemplatelasatemplate・So,ifyoudon,twantotherdatabasestoinheritobjects,don,tcreatetheminthedatabasetemplate1.ThesyntaxforcreatingadatabaseinGPisverysimple,syntaxfollowsCREATE,DATABASE,newname,USING,TEMPLATE,tmplatedbname;Veryfast
4、,andintheprocess,thesystemgeneratesthecorrespondingdictionaryinformation.Iftheusingtemplateclauseisnotspecified,thesystemcreatesthenewdatabaseusingthetemplateldatabaseasatemplate・Wecanalsocreateanewdatabaseforothertemplatesforotherdatabases・ThetemplateOdatabaseisatemplateforcreatingt
5、emplatel,andgenerallywedon,tuseittocreateapplicationobjects・GPallowsyoutocreatemultipleDATABASEinaGPSERVER・ButaDATABASEcanonlybelongtoaSERVER・Aconnectioncanonlyaccessonedatabaseatthesametimepoint・SCHEMAalsohastheconceptofGP.SCHEMAisessentiallyacollectionofrelationalobjectsinadatabase
6、,orcanbeunderstoodasnamespacesofobjects・GPallowsyoutocreatemultipleSCHEMAinonedatabase,butaSCHEMAcanonlybelongtoonedatabase・Whenyoucreateadatabase,thesystemautomaticallycreatesaSCHEMAcalledPUBLIC・IfyouneedtocreateaSCHEMA,thesyntaxisasfollowsCREATESCHEMAschema_name;Anobjectofthesamena
7、meisnotallowedinaSCHEMA.However,differentSCHEMAallowobjectstohavethesamename・SomanySQLaccessobjectscanbeprefixedwithSCHEMAbeforetheobject,indicatingthesourceoftheobject・IfyoudonotprefixwithSCHEMAtoaccesstheobject,thesessionsearchesfortheobjectinthespecifiedSCHEMAorder・Thedefaultsearc
8、hpathisonlyp