Oracle 11gR2 概念 第2章 表和表簇

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

@hotmail.comPreviousNextViewPDF2TablesandTableClustersPreviousNextViewPDF第2章表和表簇Thischapterprovidesanintroductiontoschemaobjectsanddiscussestables,whicharethemostcommontypesofschemaobjects.本章介绍了模式对象,并讨论了最常见的模式对象类型——表。Thischaptercontainsthefollowingsections:本章包含以下各节:IntroductiontoSchemaObjectsoSchemaObjectTypesoSchemaObjectStorageoSchemaObjectDependenciesoSYSandSYSTEMSchemasoSampleSchemasOverviewofTablesoColumnsandRowsoExample:CREATETABLEandALTERTABLEStatementsoOracleDataTypesoIntegrityConstraintsoObjectTablesoTemporaryTablesoExternalTablesoTableStorageOverviewofTableClustersoOverviewofIndexedClustersoOverviewofHashClusters模式对象简介o模式对象类型o模式对象存储o模式对象依赖oSYS和SYSTEM模式o示例模式表概述o列和行o示例:CREATETABLE和ALTERTABLE语句oOracle数据类型o完整性约束o对象表o临时表o外部表o表存储表簇概述o索引化表簇概述o哈希簇概述IntroductiontoSchemaObjects模式对象简介Adatabaseschemaisalogicalcontainerfordatastructures,calledschemaobjects.Examplesofschemaobjectsaretablesandindexes.SchemaobjectsarecreatedandmanipulatedwithSQL.数据库模式,是被称为模式对象的数据结构的逻辑容器。举例来说,表和索引即是模式对象。模式对象通过SQL来创建和操作。Adatabaseuserhasapasswordandvariousdatabaseprivileges.Each数据库用户具有口令并拥有各种数据库的权限。每个用户拥有一个单一的@hotmail.comuserownsasingleschema,whichhasthesamenameastheuser.Theschemacontainsthedatafortheuserowningtheschema.Forexample,thehruserownsthehrschema,whichcontainsschemaobjectssuchastheemployeestable.Inaproductiondatabase,theschemaownerusuallyrepresentsadatabaseapplicationratherthanaperson.模式,此模式与用户具有相同的名称。模式包含相应用户的全部数据。例如,hr用户拥有hr模式,此模式包含如雇员表之类的模式对象。在生产数据库中,一个数据库模式的拥有者通常表示一个数据库应用程序,而不是一个人。Withinaschema,eachschemaobjectofaparticulartypehasauniquename.Forexample,hr.employeesreferstothetableemployeesinthehrschema.Figure2-1depictsaschemaownernamedhrandschemaobjectswithinthehrschema.在一个模式里,某一特定类型的每个模式对象都有一个唯一的名称。例如hr.employees是指hr模式中的employees表。图2-1描述了一个名为hr的模式拥有者,及其在hr模式内的模式对象。Figure2-1HRSchema图2-1HR模式DescriptionofFigure2-1HRSchemaDescriptionofFigure2-1HRSchemaSeeAlso:另见:OverviewofDatabaseSecuritytolearnmoreaboutusersandprivileges数据库安全概述了解用户和权限的更多信息SchemaObjectTypes模式对象类型Themostimportantschemaobjectsinarelationaldatabasearetables.Atablestoresdatainrows.在关系数据库中,最重要的模式对象是表。表以行的形式存储数据。OracleSQLenablesyoutocreateandmanipulatemanyothertypesofschemaobjects,includingthefollowing:OracleSQL使您能够创建和操作许多其他类型的模式对象,包括以下这些:@hotmail.comIndexes索引Indexesareschemaobjectsthatcontainsanentryforeachindexedrowofthetableortableclusterandprovidedirect,fastaccesstorows.OracleDatabasesupportsseveraltypesofindex.Anindex-organizedtableisatableinwhichthedataisstoredinanindexstructure.SeeChapter3,IndexesandIndex-OrganizedTables.索引是一种模式对象,对于每一个被索引的表行或表簇行,索引都包含一个条目,以提供直接、快速的存取。Oracle数据库支持几种类型的索引。一个索引组织表是一个表,其数据以一个索引结构来存储。请参见第3章,索引和索引组织表。Partitions分区Partitionsarepiecesoflargetablesandindexes.Eachpartitionhasitsownnameandmayoptionallyhaveitsownstoragecharacteristics.SeeOverviewofPartitions.分区是大型表和索引的分片。每个分区有其自己的名称,并可能有其自己(可选)的存储特征。请参阅分区概述。Views视图Viewsarecustomizedpresentationsofdatainoneormoretablesorotherviews.Youcanthinkofthemasstoredqueries.Viewsdonotactuallycontaindata.SeeOverviewofViews.视图是对一个或多个表、或其他视图中的数据的自定义表示。你可以把它们看作存储的查询。视图实际上并不存储数据。请参见视图概述。Sequences序列Asequenceisauser-createdobjectthatcanbesharedbymultipleuserstogenerateintegers.Typically,sequencesareusedtogenerateprimarykeyvalues.SeeOverviewofSequences.序列是一个由用户创建的对象,可以被多个用户共享,用于生成整数。通常,序列用于生成主键值。请参阅序列概述。Dimensions维度Adimensiondefinesaparent-childrelationshipbetweenpairsofcolumnsets,whereallthecolumnsofacolumnsetmustcomefromthesametable.Dimensionsarecommonlyusedtocategorizedatasuchascustomers,products,andtime.SeeOverviewofDimensions.维度定义多个列集之间的父-子关系,列集中的所有列必须都来自同一个表。维度通常用于对数据进行分类(如客户、产品、和时间之)。请参阅维度概述。Synonyms同义词Asynonymisanaliasforanotherschemaobject.Becauseasynonymissimplyanalias,itrequiresnostorageotherthanits同义词是另一个模式对象的别名。因为同义词只是一个别名,它在数据字典中除了其定义之外,没有存储。请参阅同义词概述。@hotmail.comdefinitioninthedatadictionary.SeeOverviewofSynonyms.PL/SQLsubprogramsandpackagesPL/SQL子程序和包PL/SQListheOracleproceduralextensionofSQL.APL/SQLsubprogramisanamedPL/SQLblockthatcanbeinvokedwithasetofparameters.APL/SQLpackagegroupslogicallyrelatedPL/SQLtypes,variables,andsubprograms.SeePL/SQLSubprogramsandPL/SQLPackages.PL/SQL是Oracle对SQL的过程化扩展。PL/SQL子程序是命名的PL/SQL块,可以带参数调用。PL/SQL包用于将逻辑上相关的PL/SQL类型、变量、和子程序进行分组。请参阅PL/SQL子程序和PL/SQL包。OthertypesofobjectsarealsostoredinthedatabaseandcanbecreatedandmanipulatedwithSQLstatementsbutarenotcontainedinaschema.Theseobjectsincludedatabaseusers,roles,contexts,anddirectoryobjects.还有一些其他类型的对象也存储在数据库中,并以SQL语句来创建和操作,但不包含在模式中。这些对象包括数据库用户、角色、上下文、和目录对象。SeeAlso:另见:OracleDatabase2DayDBAandOracleDatabaseAdministrator'sGuidetolearnhowtomanageschemaobjectsOracleDatabaseSQLLanguageReferenceformoreaboutschemaobjectsanddatabaseobjects《Oracle数据库2日DBA》和《Oracle数据库管理员指南》了解如何管理模式对象《

1 / 42
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功