Oracle数据仓库解决方案 .pptx
Oracle Data Warehouse SolutionOracle(China)Presales ConsultantXu Xin数据仓库几大功能数据仓库几大功能lQuery/ReportlDrill up/Drill DownlComparelExceptionlForcast,WhatiflData Mining数据仓库三大流程数据仓库三大流程l数据建模数据建模 Data Model Designl数据抽取数据抽取 Data Extract,Transform,Transportl数据表现数据表现 Rolap,Molap Data Delivery,Drill up/Drill down,Data Rotation,Data MiningROLAP/MOLAP-ROLAP/MOLAP-争论的焦点在哪里争论的焦点在哪里争论的焦点在哪里争论的焦点在哪里定义定义:lROLAP=基于关系的基于关系的 OLAPlMOLAP=基于多维的基于多维的 OLAPlROLAP 供应商说供应商说:你能用关系技术做所有的事情你能用关系技术做所有的事情?lMOLAP ROLAP 供应商说供应商说:你用多维数据库能做得更好你用多维数据库能做得更好lROLAP 供应商仅仅能做供应商仅仅能做ROLAP.lMOLAP 供应商仅仅能做供应商仅仅能做MOLAP.lORACLE 能提供能提供 ROLAP和和MOLAPROLAP/MOLAP-争论的焦点在哪里ROLAPROLAPROLAPROLAP和和和和MOLAP-OracleMOLAP-OracleMOLAP-OracleMOLAP-Oracle的解决方案的解决方案的解决方案的解决方案lOracle ROLAPData Mart Suite-建模,数据抽取的工具建模,数据抽取的工具Discoverer-基于关系数据库的分析工具基于关系数据库的分析工具多维数据的视图多维数据的视图,挖掘和旋转挖掘和旋转lOracle MOLAPExpress 系列产品提供系列产品提供 MOLAP的方案的方案多维数据的视图多维数据的视图,挖掘和旋转挖掘和旋转,计算和存取、预测计算和存取、预测计算和存取、预测计算和存取、预测lOracle 能提供能提供 ROLAP 和和 MOLAPExpress 系列产品能做系列产品能做 MOLAP 和和 ROLAPOFA,OSAApplicationsExpressPower Analysis DiscovererQuery,Reporting,AnalysisDecisionsComponentsofaDataWarehouse/MartOLTPOLTPExternal DataOperationsDataStorageData Mart SuiteData Mart SuiteAdd Value To The Oracle WarehouseData Mart Suite 2.0-ComponentsData Mart Suite 2.0-ComponentslGreat8-Oracle8,release 8.0.4lDashing-Data Mart Designer 2.1lBetter-Data Mart Builder 2.0lDebonair-Discoverer 3.1lAwesome-Web Application Server 3.0.1lRavishing-Reports Server 3.0lCompelling-CookbookDesign and ManagementAny DataAny DataAny AccessAny AccessAny SourceAny SourceMetadataConstruction Methodology Construction Methodology Drag&drop visual metaphorDrag&drop visual metaphorData ModelingIdentify data sourcesIdentify source subsetModel Star SchemaProcess ModelingBuild PlansDimension tablesTime DimensionFact tablePopulate databaseBusiness ModelingDefine end-user layerOracle8Oracle8i i for Data Warehousingfor Data Warehousing Continuous InnovationContinuous InnovationOracle 7.3Oracle 7.3llHash JoinHash JoinllBitmap IndexesBitmap IndexesllParallel-Aware OptimizerParallel-Aware OptimizerllPartition ViewsPartition ViewsllInstance Affinity:Function Instance Affinity:Function ShippingShippingllParallel Union AllParallel Union AllllAsynchronous Read-AheadAsynchronous Read-AheadllHistogramsHistogramsllAnti-JoinAnti-JoinllPartitioned Tables and IndexesPartitioned Tables and IndexesllPartition PruningPartition PruningllParallel Index ScansParallel Index ScansllParallel Insert,Update,DeleteParallel Insert,Update,DeletellParallel Bitmap Star QueryParallel Bitmap Star QueryllParallel ANALYZEParallel ANALYZEllParallel Constraint EnablingParallel Constraint EnablingllServer Managed Backup/RecoveryServer Managed Backup/RecoveryllPoint-in-Time RecoveryPoint-in-Time RecoveryOracle 8.0Oracle 8.0llSummary ManagementSummary ManagementllNew Partitioning SchemesNew Partitioning SchemesllResource ManagerResource ManagerllProgress MonitorProgress MonitorllAdaptive Parallel QueryAdaptive Parallel QueryllServer-based Analytic FunctionsServer-based Analytic FunctionsllTransportable TablespacesTransportable TablespacesllDirect Loader APIDirect Loader APIllFunctional IndexesFunctional IndexesllPartition-wise JoinsPartition-wise JoinsllSecurity EnhancementsSecurity Enhancementsand more.and more.Oracle8Oracle8i iData ModelingData ModelingOracle Data Mart DesignerOracle Data Mart DesignerTable orders(constraint c_o_date check(O_entry_d between to_date(?1-jan-1997?慸慸d-mon-yyyy?and to_date(?1-dec-1997?慸慸d-mon-yyyy?)disable,o_idnumber,o_d_idnumber,o_w_idnumber,o_c_idnumber,o_entry_ddate,o_carrier_idnumber,o_ol_cntnumber,o_all_localnumber)tablespace ord initrans 3 pctfree 5 storage(initial 20K next 110M pctincrease 0 freelist groups 19 freelists 9);Source:OLTPProductdescriptionsizeflavorpackagePromotiondescriptiondealdiscountmediaMarketdescriptiondistrictregiondemographicsTimedescriptionweekdayholidayfiscalFact TableTarget:Data MartProcess Modeling Process Modeling Oracle Data Mart BuilderOracle Data Mart BuilderOrders-ExtractSQL QueryProductProduct_LineProduct_GroupShipShipperContactCus_ LocOrdersContact_LocProductLookupMarketLookupPromotionLookupTimeLookupDirect PathLoaderOracle Data Mart BuilderMetadata IntegrationMetadata IntegrationProductdescriptionsizeflavorpackagePromotiondescriptiondealdiscountmediaMarketdescriptiondistrictregiondemographicsTimedescriptionweekdayholidayfiscalFact TableOrders-ExtractSQL QueryProductLookupMarketLookupPromotionLookupTimeLookupDirect PathLoaderOracle Data Mart BuilderOracleDiscovererOracle Data Mart DesignerMetadataMetadata决策支持系统的范围决策支持系统的范围决策支持系统的范围决策支持系统的范围IT 人员人员为用户开发为用户开发业务用户业务用户独立分析独立分析专业分析人员专业分析人员标准报表标准报表即席查询分析即席查询分析复杂分析复杂分析Oracle Oracle 决策支持工具集决策支持工具集决策支持工具集决策支持工具集标准报表标准报表即席查询分析即席查询分析复杂分析复杂分析上季度各地区销售上季度各地区销售 情况如何?情况如何?什么原因造成东南亚什么原因造成东南亚 地区的业务下降地区的业务下降?如果同样的因素影响到如果同样的因素影响到 其其它地区,将会对全球的它地区,将会对全球的 业业务造成什么影响务造成什么影响?OracleExpressOracle DiscovererOracleReportsOracle Oracle 决策支持工具集决策支持工具集决策支持工具集决策支持工具集l标准报表标准报表-Oracle Reports集中式报表生成存储集中式报表生成存储输出发布高质量的报表输出发布高质量的报表 l即席查询分析即席查询分析-Discoverer即席查询即席查询,数据钻入,旋转数据钻入,旋转业界领先的易用性和性能业界领先的易用性和性能l复杂分析复杂分析-Express On-line Analytical Processing(OLAP)高级计算高级计算 财务财务,时间序列时间序列,建模建模,预测预测,回归分析,假设分析回归分析,假设分析Oracle ReportsOracle ReportslWhat is it?Formats and distributes database informationlKey advantagesUnlimited data formattingDistributes high fidelity reports via the WebApplication server based reporting engineOracleExpressOracle DiscovererOracleReportsProductionReportingAd Hoc Query,AnalysisAdvanced AnalysisOracle DiscoverOracle DiscoverAdd Value To The Oracle WarehouseOracle DiscovererOracle DiscovererlWhat is it:Ad hoc query and analysis of relational datalKey advantages:Award-winning ease of useIndustry-leading query performance OracleExpressOracle DiscovererOracleReportsProductionReportingAd Hoc Query,AnalysisAdvanced AnalysisDiscoverer is:10 times faster than Cognos9 times faster than Business ObjectsMarket-Leading PerformanceMarket-Leading PerformanceTime to query 100,000 rows:CognosBusiness ObjectsDiscovererOracle Discoverer 3.1Oracle Discoverer 3.1User EditionUser EditionBusiness Abstraction Layer End User Layer(TM)Data Warehouse/Data Mart(or OLTP)User EditionAdministrationEditionOracle Discoverer 3.1Oracle Discoverer 3.1User EditionUser EditionSuperior Ease of UseEase of UsePerformanceWarehouse ExplorationExceptional PerformanceNavigational PowerNavigational PowerOpennessOpenness Most Tested UI on the Most Tested UI on the MarketMarketResizeableWizard InterfaceIndustry Specific Quick TourDramatic Reduction of the Learning Curveand more.Ease of UseEnd User LayerEnd User LayerEase of UseHides the Complexity of the Underlying DatabaseDatabasecl_addr1|,|cl_addr2|,|cl_addr3|,|cl_twn|,|cl_zipcodesum(nvl(qty*unit_price,0)JonesSmithNameCustomerClientAddressRevenueEasternRegionUserBatch ReportingBatch ReportingOpenness To Do.Schedule long running queries for laterEase of Use 9:00 Open workbooks 12:00 Refresh workbooks 3:00 Schedule Monthly reports 5:00 Schedule Quarterly reports 5:30 Generate new report for management meeting tomorrow Solution to Long Running Queries Solution to Long Running QueriesReactive Query GovernorStops queries after a pre-set timeUses the resources without showing results!PerformancePredictive Query GovernorPredicts the time a query takes before executionDoes not waste valuable resources!Managing Large Data Managing Large Data VolumesVolumesSelect Location,Period,Product,sum(videos_lent)From video_detailsGroup by Location,Period,ProductDetail RowsPerformanceSlow Table ScansMachine Intensive AggregationsSummary RedirectionSummary RedirectionSelect Location,Period,Product,sum(videos_lent)From video_detailsGroup by Location,Period,ProductDetail RowsSummary TablePerformanceSelect Location,Period,Product,SalesFrom video_summaryAutomatic!Summary RedirectionDetail RowsSummary TablePerformanceServerClientNetworkResultsBase:CubicClientCachePerformanceEfficient Storage AlgorithmMultidimensional accessRapid rotation,drillRegionRegionNorthNorthParisParisProductProductYearYearDetail RowsExternalExternalDataDataDrill EverywhereDrill EverywherelDrill DownlDrill AcrosslDrill to DetaillDrill OutNavigational PowerWeb PublishingWeb PublishingNavigational PowerIntegrationIntegrationReportsReportsExpressExpressOpenness MAPIMAPIOracle Discoverer 3.1Oracle Discoverer 3.1Administration EditionAdministration EditionSuperior Ease of UseEase of UseSummary ManagementServer BasedAdministrationServer Based AdministrationAdvanced Summary ManagementServer Based Abstraction Server Based Abstraction LayerLayerServer BasedAdministrationEase of UsePRODUCTIONPRODUCTIONEULEUL(RDBMS)(RDBMS)Sales.Marketing 匜匜inance匛匛ducation匔匔onsultancyUsersAdministratorRead/WriteRead OnlyEasy to Create,Maintain and SetupScaleableLeverage SecurityOpen-ODBCOpen-ODBCDB2DB2SybaseSybaseInformixInformixSQLSQLServerServerOracleOracle?.ODBCODBCEnhancements OpennessOracleOracleEnd User LayerEUL GatewayDes/2000Des/2000ETT ToolsETT ToolsApplicationsApplicationsQuery ToolsQuery ToolsBuild Summaries from QueriesBuild Summaries from QuerieslQuery performance statistics lSummary management recommendationsSummary Management38DefinitionsDefinitionsData WarehouselA multi-subject information storelDesigned specifically for decision supportData MartlA subject or application-specific data warehouselTypes:Dependent,IndependentDW vs.Data MartDW vs.Data MartWarehouseData MartScopeScopeCorporateCorporateLine-of-BusinessLine-of-BusinessSubjectsSubjectsmulti-subjectmulti-subjectsubject-specificsubject-specificData SourcesData SourcesmanymanyfewfewSizeSize100GB-1TB+100GB-1TB+100GB=或!=其它(not)inis(not)betweenandandor单值函数nvl-空值替换函数abs-绝对值函数mod-求模函数power-求幂函数sqrt-平方根函数exp,ln,log-对数函数sin,cos等-三角函数唯一性查询唯一性查询l关键字:distinctselectdistinct列名from表名where条件;l模糊查询select列名1,列名2,列名3from表名where列名1like_%mmorderby列名1,列名2;l关键字:(not)likel通配符:%_联接查询联接查询select表名1.列名1,表名2.列名2,列名3from表名1,表名2where条件orderby表名1.列名1,表名2.列名2;子查询子查询 单值子查询单值子查询 多值子查询多值子查询select列名1,列名2,列名3from表名1where列名1=(select列名1from表名2where条件)orderby列名1,列名2;select列名1,列名2,列名3from表名1where列名1in(select列名1from表名2where条件)orderby列名1,列名2;组值函数avg-平均值函数count-非空值数目max-最大值函数min-最小值函数sum-求和函数distinct-唯一性函数分组查询分组查询select列名1,列名2,sum(列名3)from表名where条件groupby列名1,列名2;l关键字:groupby改变数据操作改变数据操作lInsert插入操作insertinto表名1(列名1,列名2)values(值1,值2);注意:值表中的数据用逗号间隔;字符型和日期型要用单引号括起来;缺省的日期格式为dd-man-yy。insertinto表名1usingselect列名1,列名2from表名2where条件;Update Update 修改操作修改操作可修改单个字段、修改多行、修改单个列。update表名set列名=值或表达式where条件;DeleteDelete删除删除ldeletefrom表名where条件;注意不能只删除行的一部分where子句决定哪一行将被删除。如里省略了where子句,则所有的行都将被删除。其它常用其它常用sqlsql命令命令Createtable-创建表;例子Droptable-删除表,sql同时自动删除该表上的索引、特权,但并不删除相关的视图或同义词;Grant-授权Connect-连上Oracle,做最基本操作resource-具有程序开发最基本的权限dba-数据库管理员所有权限l-运行指定的命令文件,作用等价于start命令;l/-运行sql缓冲区的命令,与run命令等价;lConnect-退出当前账号,向指定的用户帐号登录;lDesc-显示指定表的结构;lExit-中止sql*plus,返回操作系统;lSpool-将屏幕显示内容输出到一个文件上;lSpooloff-输出文件结束;其它常用其它常用sql*plussql*plus命令命令四、四、SQL*NETSQL*NET的配置和使用的配置和使用 l1配置网络协议TCP/IPl2测试网络是否连通l3在Windows95上选择“开始”按钮,选定“程序”中的“OracleforWindows95”下的“SQL*NetEasyConfiguration”,在“SQL*NetEasyConfiguration”窗口中选择“AddDatabaseAlias”,在“ChooseDatabaseAlias”对话框中“DatabaseAlias”项中键入数据库别名,按“OK”按钮确认。在“ChooseTCP/IPHostNameandDatabase”对话框中的TCP/IPHostname项中键入SERVER的IP地址,在“DatabaseInstance”项中键入Oracle的实例名。l在“ConfirmAddingDatabaseAlias”对话框中可以看到你新增加的数据库别名。按“YES”按钮,按“OK”,退出“SQL*NetEasyConfiguration”。五、数据库备份五、数据库备份(exp/imp)(exp/imp)EXPORT将数据库中数据备份成一个二进制系统文件称为“导出转储文件”(EXPORTDUMPFILE),并将重新生成数据库写入文件中。它有三种模式:a.用户模式:导出用户所有对象以及对象中的数据;b.表模式:导出用户所有表或者指定的表;c.整个数据库:导出数据库中所有对象。IMPORT导入:导入的过程是导出的逆过程,这个命令先读取导出来的导出转储二进制文件,并运行文件,恢复对象用户和数据。数据库导出过程数据库导出过程exp80用户名/密码Enterarrayfetchbuffersize:4096exportfile:expdat.dmp(1)Entiredatabase(2)Users(3)Table:(2)UsersExportgrants:yesExporttabledata:yesConpressextents:yesUsertobeexportExportingtable、synonyms、view、grant等Exportterminatedsuccessfullywithoutwarning.导出选项导出选项l关键字内容lUSERID运行导出命令的帐号的用户名/口令。lBUFFEER用来取数据行的缓冲区的大小。lFILE导出转储文件的名字lCOMPRESS导出是否应该压缩有碎片的段成一个范围lGRANTS导出时否要导出数据库对象上的授权lINDEXES是否要导出表上的索引lROWS是否应导出行。如它为N,那么在导出文件中仅生成数据库对象的DDLlCONSSTRAINTS是否导出表旧的约定条件lFULL如设为Y,那么将执行一个整个数据库导出操作lOWNER要导出的一系列数据库帐号,然后执行这些帐号的USER导出操作lTABLES要导出的一系列表;执行这些表的TABLE导出操作导出选项导出选项l关键字内容lRECORDLENGTH转储导出文件日志的长度(以字节为单位),通常都使用缺省,除非要在两个不同操作系统中传递导出文件lINCTYPE正在执行的导出操作的类型(有效值有”COMPLETE“(缺省值),CUMULATIVE”和“IVCREMENTAL”)lRECORD在增量导出类型中的一个标记,标明是否将日志存储到数据字典中日志导出的表中lPARFILE要传递给导出的参数文件的名字。这个文件将包含所有参数的入口项lANALYZE标明是否将移对象的统计信息写入导出转储文件中lCONSISTENT标明是否保留所有导出对象的读取一致复制。lLOG导出日志将要写入的文件的名字lMLS标明是否要导出MLS标号lMLS_LABEL_规定了MLS标号的格式数据库恢复数据库恢复Imp80用户名/密码Importfile:expdat.dmp导入选择项导入选择项l关键字内容lUSERID运行导入命令的帐号的用户名/口令。lBUFFEER用来取数据行的缓冲区的大小。lFILE导入转储文件的名字lSHOW规定文件内容是否被显示,而不是被执行。lEGORE标明在执行CREATE命令时,是否忽略遇到的错误。如果正l在导入的对象已经存在时,应使用这个参数。lFULL如设为Y,那么将执行一个整个数据库导入操作lFROMUSER在FULL=N的情况下,才有参数。它是一系列的数据库帐号,其l对象应从导出转储文件中读取。lTOUSER一系列数据库帐号,导出转储文件扣的对象将要导入这些帐号。lGRANTS导入时否要导入数据库对象上的授权lINDEXES是否要导入表上的索引lROWS是否应导入行。如它为N,那么在导入文件中执行数据库对l象的DDL导入选择项导入选择项l关键字内容lFULL如设为Y,那么将执行一个整个数据库导出操作lTABLES要导入的一系列表lRECORDLENGTH转储导入文件日志的长度(以字节为单位),通常都使用缺省,除非要在两个不同操作系统中传递导入文件lINCTYPE正在执行的导入操作的类型(有效值有”COMPLETE“(缺省值),lCUMULATIVE”和“IVCREMENTAL”)lPARFILE要传递给导入的参数文件的名字。这个文件将包含所有参数的入l口项lANALYZE标明是否将移对象的统计信息写入导入转储文件中lLOG导入日志将要写入的文件的名字lMLS标明是否要导入MLS标号六、其它常见问题六、其它常见问题l1.字符集的问题l在Windows95上选择“开始”按钮,启动“运行”图标,键入REGEDIT,进行注册表编辑,选取“我的电脑”中的“HKEY_LOCALMACHINE”下的“Software”Oracle选取Oracle下的NLS_LANG,其缺省值为:AMERICAN_AMERICA.us7ascii,双击进行编辑改为:AMERICAN_AMERICAl2.PB常用的描述器应用、数据库管理、表、l3.利用PB进行数据的导入l4.