1 |
This chapter provides an overview of the Oracle database server. The topics include:
|
本章对Oracle数据库服务器进行概括性的介绍。本章的主题有: |
||||||||||||||||||||||||||||||||
2 |
Oracle Database Architecture |
1.1 Oracle数据库体系结构 |
||||||||||||||||||||||||||||||||
3 |
An Oracle database is a collection of data treated as a unit. The purpose of a database is to store and retrieve related information. A database server is the key to solving the problems of information management. In general, a server reliably manages a large amount of data in a multiuser environment so that many users can concurrently access the same data. All this is accomplished while delivering high performance. A database server also prevents unauthorized access and provides efficient solutions for failure recovery.
|
An Oracle database is a collection of data treated as a unit. The purpose of a database is to store and retrieve related information. 数据库服务器是解决信息管理问题的核心组件。大体上说,数据库服务器的作用是可靠地管理多用户环境下的大规模数据,使多用户可以并发地访问相同的数据,同时实现系统的高性能。数据库服务器还要阻止未授权的操作,并提供高效的故障恢复解决方案。 |
||||||||||||||||||||||||||||||||
4 |
Oracle Database is the first database
designed for enterprise grid computing, the most flexible and cost effective
way to manage information and applications.
|
Oracle数据库是第一个为企业网格计算而设计的数据库,她为管理信息和应用提供了灵活、低成本、高效益的方式。企业网格计算把存储及服务能力转化为符合业界标准、模块化的资源池 (resource pool)。在这种体系结构之下,新系统可以从组件化的资源池中组合资源而迅速构成。企业也无需建设尖锋负荷系统 (peak workloads),因为计算能力可以在需要时轻松地从资源池中获得或重新分配。 |
||||||||||||||||||||||||||||||||
5 |
The database has logical structures and physical structures. Because the physical and logical structures are separate, the physical storage of data can be managed without affecting the access to logical storage structures.
|
数据库具备逻辑结构和物理结构。因为物理和逻辑结构是分离的,所以数据物理存储的变动不会影响基于逻辑存储结构的应用程序。 |
||||||||||||||||||||||||||||||||
6 |
The section contains the following topics:
|
本节包含以下主题: |
||||||||||||||||||||||||||||||||
7 |
Overview of Oracle Grid Architecture |
1.1.1 Oracle网格体系结构概述 |
||||||||||||||||||||||||||||||||
8 |
Grid computing is a new IT architecture that produces more resilient and lower cost enterprise information systems. With grid computing, groups of independent, modular hardware and software components can be connected and rejoined on demand to meet the changing needs of businesses.
|
网格是新出现的IT体系结构,它可以提供更有弹性、成本更低的企业信息系统。在网格中,众多独立的、模块化的软硬件组件可以随时地被联接和重组,以满足业务 及业务变化的需要。 |
||||||||||||||||||||||||||||||||
9 |
The grid style of computing aims to solve some common problems with enterprise IT: the problem of application silos that lead to under utilized, dedicated hardware resources, the problem of monolithic, unwieldy systems that are expensive to maintain and difficult to change, and the problem of fragmented and disintegrated information that cannot be fully exploited by the enterprise as a whole.
|
网格形式的计算系统是为了解决企业IT中的常见问题:由不同的应用系统独占硬件资源而导致的资源利用率低下;系统过于庞大而导致的难以 改进、维护昂贵;信息过于分散而导致的企业信息难以作为整体充分利用。 |
||||||||||||||||||||||||||||||||
10 |
Benefits of Grid Computing Compared to other models of computing, IT systems designed and implemented in the grid style deliver higher quality of service, lower cost, and greater flexibility. Higher quality of service results from having no single point of failure, a robust security infrastructure, and centralized, policy-driven management. Lower costs derive from increasing the utilization of resources and dramatically reducing management and maintenance costs. Rather than dedicating a stack of software and hardware to a specific task, all resources are pooled and allocated on demand, thus eliminating under utilized capacity and redundant capabilities. Grid computing also enables the use of smaller individual hardware components, thus reducing the cost of each individual component and providing more flexibility to devote resources in accordance with changing needs.
|
网格的优势 和其他体系结构相比,基于网格设计、实施的IT系统能够提供更高质量的服务,更低的成本,更大的灵活性。更高质量的服务来源于网格不存在单点脆弱性(single point of failure),健壮的安全基础结构,和基于策略的集中化管理方式。更低成本来源于软硬件资源利用水平的提高和管理、维护成本的显著降低。在以往的体系结构中,一个 完成特定任务的系统要独占一系列软硬件资源,而网格体系中所有资源被统一储备随需分配,这就消除了资源利用不足和资源冗余的现象。网格可以使用更小型的硬件组件, 这降低了每个组件的成本并使用户可根据需求的变化更灵活地分配资源。 |
||||||||||||||||||||||||||||||||
11 |
Grid Computing Defined
|
1.1.1.1 网格的定义
|
||||||||||||||||||||||||||||||||
12 |
The grid style of computing treats collections of similar IT resources holistically as a single pool, while exploiting the distinct nature of individual resources within the pool. To address simultaneously the problems of monolithic systems and fragmented resources, grid computing achieves a balance between the benefits of holistic resource management and flexible independent resource control. IT resources managed in a grid include:
|
网格将相似的IT资源整体地看做一个池,同时充分发挥池中每一个个体的独特功能。网格实现了整体资源管理和独立资源控制的平衡,解决了庞大系统和分散资源的矛盾。在网格中管理的IT资源包括:
|
||||||||||||||||||||||||||||||||
13 |
Core Tenets of Grid Computing Two core tenets uniquely distinguish grid computing from other styles of computing, such as mainframe, client-server, or multi-tier: virtualization and provisioning.
· With virtualization, individual resources (e.g. computers, disks, application components and information sources) are pooled together by type then made available to consumers (e.g. people or software programs) through an abstraction. Virtualization means breaking hard-coded connections between providers and consumers of resources, and preparing a resource to serve a particular need without the consumer caring how that is accomplished. · With provisioning, when consumers request resources through a virtualization layer, behind the scenes a specific resource is identified to fulfill the request and then it is allocated to the consumer. Provisioning as part of grid computing means that the system determines how to meet the specific need of the consumer, while optimizing operation of the system as a whole.
|
网格的核心理念 与大型机、C/S结构、多层结构等以往的体系结构不同,网格有两个独特的核心理念:虚拟化和资源供给。
· 所谓虚拟化,就是将各类独立的资源(计算机,磁盘,应用组件,信息源等)视为一个池,经过抽象后提供给资源消费者(用户或软件程序)。虚拟化意味着打破了资源提供者和消费者之间的硬性联系(固化在程序代码 中的(hard-coded)),在满足消费者对资源需求的同时无需消费者关心资源供给是如何实现的。 · 所谓资源供给,就是当消费者通过虚拟层请求资源时,网格在幕后找出满足需求的资源并分配给消费者。在网格中供给意味着系统负责决定如何满足消费者的特定需求,同时还要从整体上对系统 运转进行优化。 |
||||||||||||||||||||||||||||||||
14 |
The specific ways in which information, application or infrastructure resources are virtualized and provisioned are specific to the type of resource, but the concepts apply universally. Similarly, the specific benefits derived from grid computing are particular to each type of resource, but all share the characteristics of better quality, lower costs and increased flexibility.
|
信息、应用、基础设施资源的虚拟化与资源供给的具体方法各不相同,但思路是相通的。类似的,通过网格供给各种资源给用户带来的的益处也各不相同,但都具备了高 质量、低造价及灵活的特点。 |
||||||||||||||||||||||||||||||||
15 |
Infrastructure Grid Infrastructure grid resources include hardware resources such as storage, processors, memory, and networks as well as software designed to manage this hardware, such as databases, storage management, system management, application servers, and operating systems.
|
基础设施网格 基础设施网格资源包括存储、处理器、内存、网络等硬件资源,及管理这些硬件的软件资源,如数据库、存储管理、应用服务器和操作系统。 |
||||||||||||||||||||||||||||||||
16 |
Virtualization and provisioning of infrastructure resources mean pooling resources together and allocating to the appropriate consumers based on policies. For example, one policy might be to dedicate enough processing power to a web server that it can always provide sub-second response time. That rule could be fulfilled in different ways by the provisioning software in order to balance the requests of all consumers.
|
基础设施网格的虚拟化与资源供给意味着将所有资源视为池,并根据预定策略分配给适当的消费者。例如,针对web服务器的策略要提供足够的处理能力来保证响应时间。资源供给管理软件根据实际情况选择适当的方式实现预定策略,以满足所有消费者对资源的请求。 |
||||||||||||||||||||||||||||||||
17 |
Treating infrastructure resources as a single pool and allocating those resources on demand saves money by eliminating under utilized capacity and redundant capabilities. Managing hardware and software resources holistically reduces the cost of labor and the opportunity for human error.
|
将基础设施资源视为一个池并随需分配,提高了资源的利用水平,减少了冗余资源,节约了软硬件购买资金。对软硬件资源整体的管理降低 了人力成本及人为错误发生的机会。 |
||||||||||||||||||||||||||||||||
18 |
Spreading computing capacity among many different computers and spreading storage capacity across multiple disks and disk groups removes single points of failure so that if any individual component fails, the system as a whole remains available. Furthermore, grid computing affords the option to use smaller individual hardware components, such as blade servers and low cost storage, which enables incremental scaling and reduces the cost of each individual component, thereby giving companies more flexibility and lower cost.
|
将计算能力分散于不同的计算机,将存储能力分散于多个磁盘和磁盘组,消除了系统的单点脆弱性,即保证系统中的个体组件发生故障时系统整体还能保持可用。此外,网格体系可以基于众多小型的硬件组件,例如刀片服务器和低成本存储器,这增加了系统的伸缩性、降低硬件组件的成本,使企业 获取更低的成本及更大的灵活性。 |
||||||||||||||||||||||||||||||||
19 |
Infrastructure is the dimension of grid computing that is most familiar and easy to understand, but the same concepts apply to applications and information.
|
基础设施是网格体系中最为人熟知也最易理解的范畴,其实类似的概念也适用于应用和信息。 |
||||||||||||||||||||||||||||||||
20 |
Applications Grid Application resources in the grid are the encodings of business logic and process flow within application software. These may be packaged applications or custom applications, written in any programming language, reflecting any level of complexity. For example, the software that takes an order from a customer and sends an acknowledgement, the process that prints payroll checks, and the logic that routes a particular customer call to a particular agent are all application resources.
|
应用网格 网格中的应用资源是蕴含于应用软件中反映业务逻辑(business logic)和处理流程(process flow)的程序代码。 这些应用软可以是套装的,也可以是定制的,可以以任何编程语言实现,表现任何层次的业务复杂度。举例来说,一个接受客户订单并发送反馈的程序,一个打印薪水册的工作流程,或一个 将特定客户的服务请求传递给特定员工的逻辑,都属于应用资源。 |
||||||||||||||||||||||||||||||||
21 |
Historically, application logic has been intertwined with user interface code, data management code, and process or page flow and has lacked well-defined interfaces, which has resulted in monolithic applications that are difficult to change and difficult to integrate.
|
历史上,应用逻辑往往和用户界面代码、数据管理代码、流程控制代码、页面流转代码交织在一起,并且缺乏完善的接口,这导致的庞大的孤岛系统,难于修改,难于集成。 |
||||||||||||||||||||||||||||||||
22 |
Service oriented architecture has emerged as a superior model for building applications, and service oriented architecture concepts align exactly with the core tenets of grid computing. Virtualization and provisioning of application resources involves publishing application components as services for use by multiple consumers, which may be people or processes, then orchestrating those services into more powerful business flows.
|
基于服务的体系结构(Service Oriented Architecture,SOA)是一种更高级的应用构建模型,同时SOA的概念与网格的核心理念不谋而合。应用资源的虚拟化和 资源供给意味着将应用组件发布为服务提供给众多消费者,这些消费者包括人或流程,进而用这些服务构件更为强大的业务流程。 |
||||||||||||||||||||||||||||||||
23 |
In the same way that grid computing enables better reuse and more flexibility of IT infrastructure resources, grid computing also treats bits of application logic as a resource, and enables greater reuse of application functionality and more flexibility in changing and building new composite applications.
|
就像网格可以使基础设施资源更加灵活可重用性更好一样,网格将应用逻辑也视为资源,因此使应用程序功能的可重用性更强,使应用变更更加灵活,使通过组合已有应用构建新的 复合应用更简单。 |
||||||||||||||||||||||||||||||||
24 |
Furthermore, applications that are orchestrated from published services are able to view activities in a business as a single whole, so that processes are standardized across geography and business units and processes are automated end-to-end. This generates more reliable business processes and lowers cost through increased automation and reduced variability.
|
由发布的服务构建而成的应用将整体地覆盖企业内的所有活动,由此业务处理在不同地理区域和不同业务部门间都是标准化的, 且从头到尾都是自动化的。由于自动化程度的提高和差异性的降低,将带来更可靠的业务流程和更低的管理成本。 |
||||||||||||||||||||||||||||||||
25 |
Information Grid The third dimension to grid computing, after infrastructure and applications, is information. Today, information tends to be fragmented across a company, making it difficult to see the business as a whole or answer basic questions about customers. Without information about who the customer is, and what they want to buy, information assets go underexploited.
|
信息网格 继基础设施和应用层之后,网格体系结构的第三个层次是信息网格。当前的常见的信息系统现状是,信息零散的分布于企业内,使得从整体了结业务情况或回答一些基本的客户问题都很困难。当业务人员无法了解用户是谁,他们想购买什么产品时,信息的价值就 被大大削弱了。 |
||||||||||||||||||||||||||||||||
26 |
In contrast, grid computing treats information
holistically as a resource, similar to infrastructure and applications
resources, and thus extracts more of its latent value. Information grid
resources include all data in the enterprise and all metadata required to
make that data meaningful. This data may be structured, semi-structured, or
unstructured, stored in any location, such as databases, local file systems,
or e-mail servers, and created by any application. |
与过去的情况相反,信息网格将信息视为一个完整统一的资源,以便获取其中的潜在价值。信息网格资源包括企业拥有的所有数据以及用于解释数据含义的所有元数据。这些数据可能是结构化的、半结构化的、或非结构化的,由各种应用生成,存储于如数据库、文件系统、email服务器等各种位置。 |
||||||||||||||||||||||||||||||||
27 |
The core tenets of grid computing apply similarly to information as they do to infrastructure and applications. The infrastructure grid exploits the power of the network to allow multiple servers or storage devices to be combined toward a single task, then easily reconfigured as needs change. A service oriented architecture, or an applications grid, enables independently developed services, or application resources, to be combined into larger business processes, then adapted as needs change without breaking other parts of the composite application. Similarly, the information grid provides a way for information resources to be joined with related information resources to greater exploit the value of the inherent relationships among information, then for new connections to be made as situations change.
|
与基础设施层和应用层一样,网格的核心理念也适用于信息层。基础设施网格可以通过网络集合多个服务器或存储设备来完成同一个任务,并可在需要时轻易的重新配置。基于服务的体系结构(或称为应用网格),可以将多个独立开发的服务(或称为应用资源)集合为更大的业务过程,当需求变动时每个服务可以独立调整,不至于影响应用的其他部分。同样地,信息网格提供 了将相关信息资源整合的方法,以便发掘具有潜在联系的信息的价值,同时当形势变化时也易于在信息间建立新的联系。 |
||||||||||||||||||||||||||||||||
28 |
The relational database, for example, was an early
information virtualization technology. Unlike its predecessors, the network
database and hierarchical database models, in which all relationships
between data had to be predetermined, relational database enabled flexible
access to a general-purpose information resource. Today, XML furthers
information virtualization by providing a standard way to represent
information along with metadata, which breaks the hard link between
information and a specific application used to create and view that
information. |
例如,关系型数据库就是一种信息虚拟化的技术。她的前辈网络数据模型和层次数据模型要求数据间的关系必须预先确定,而关系型数据库是一个可以灵活访问的通用信息源。现今,通过XML技术可以标准化的展现信息和元数据,进一步发展了信息虚拟化,打破了信息和用于创建、展现信息的应用之间的硬性联系。 |
||||||||||||||||||||||||||||||||
29 |
Information provisioning technologies include , data propagation, replication, extract-transform-load, as well as
mapping and cleansing tools to ensure data quality. Data hubs, in which a
central operational data store continually syncs with multiple live data
sources, are emerging as a preferred model for establishing a single source
of truth while maintaining the flexibility of distributed control. |
信息供给技术包括消息队列(message queuing)、数据播送(data propagation)、数据复制 (replication)、抽取转换加载(ETL),及用于保证数据质量的映射、清洗工具。数据中心--一个随时与众多活动数据源同步数据的中央操作数据库--的出现,为保证分析所需数据来源的唯一性,同时保证数据分布式使用的灵活性,提供了一个首选的模型。 |
||||||||||||||||||||||||||||||||
30 |
Grid Resources Work Well Independently and Best Together By managing any single IT resource – infrastructure, applications, or information - using grid computing, regardless of how the other resources are treated, enterprises can realize higher quality, more flexibility, and lower costs. For example, there is no need to rewrite applications to benefit from an infrastructure grid. It is also possible to deploy an applications grid, or a service oriented architecture, without changing the way information is managed or the way hardware is configured.
|
网格三层次资源的独立性与协调性 企业的基础设施、应用、信息这三个层次的IT资源中的任何一个改为通过网格管理,都能实现更好的服务质量,更大的灵活性,更低的成本。例如,建设了基础设施网格后无需改写程序就能感受到改变。同样,部署一个应用网格(或者说基于服务的体系结构)既无需改变信息层的管理方式,也无需改变基础设施层的硬件配置。 |
||||||||||||||||||||||||||||||||
31 |
It is possible, however, to derive even greater benefit
by using grid computing for all resources. For example, the applications
grid becomes even more valuable when you can set policies regarding resource
requirements at the level of individual services and have execution of
different services in the same composite application handled differently by
the infrastructure - something that can only be done by an application grid
in combination with an infrastructure grid. In addition, building an
information grid by integrating more information into a single source of
truth becomes tenable only when the infrastructure is configured as a grid,
so it can scale beyond the boundary of a single computer. |
但是如果将所有层次的资源均纳入网格体系将会获得更大的收益。例如,如果能为每个单独的服务(应用)设定相应的硬件资源(基础设施)分配策略,使组成同一个应用的不同服务 所需的硬件资源由基础设施网格根据情况单独分配,应用网格的优势就能更好地发挥,而这必须要求应用网格和基础设施网格协同工作。再比如,将众多信息源集成为唯一准确的数据源以建立信息网格时,必须依靠基础设施网格,才能超越单个计算机 硬件的界限。 |
||||||||||||||||||||||||||||||||
32 |
Grid Computing in Oracle Database 10g
|
Oracle 10g中的网格 |
||||||||||||||||||||||||||||||||
33 |
On the path toward this grand vision of grid computing, companies need real solutions to support their incremental moves toward a more flexible and more productive IT architecture. The Oracle Database 10g family of software products implements much of the core grid technology to get companies started. And Oracle delivers this grid computing functionality in the context of holistic enterprise architecture, providing a robust security infrastructure, centralized management, intuitive, powerful development tools, and universal access. Oracle Database 10g includes:
|
虽然网格具有美好前景,企业还是需要实实在在的解决方案才能确保实现这种更灵活更高效的IT体系结构。Oracle数据库10g家族的产品实现了大量网格核心技术。Oracle的网格解决方案包含于一个完整的企业信息平台之中,提供了健壮的安全机制、集中化的管理方式、强大的开发工具、全面的访问方式。Oracle数据库10g家族的产品包括:
|
||||||||||||||||||||||||||||||||
34 |
Although the grid features of Oracle 10g span all of the products listed above, this discussion will focus on the grid computing capabilities of Oracle Database 10g.
|
Oracle 10g包含的网格特性覆盖了上面列出的所有产品,但是下面主要讨论数据库服务器(Oracle Database 10g)的网格特性。 |
||||||||||||||||||||||||||||||||
35 |
Infrastructure Grid
|
基础设施网格
|
||||||||||||||||||||||||||||||||
36 |
The Grid Control feature of Oracle Enterprise Manager 10g provides a single console to manage multiple systems together as a logical group. Grid Control manages provisioning of nodes in the grid with the appropriate full stack of software and enables configurations and security settings to be maintained centrally for groups of systems.
|
Oracle 企业管理器 10g(Oracle Enterprise Manager,OEM)的网格控制功能通过一个控制台将多个系统作为一个逻辑组管理。 网格控制功能可以管理网格内各节点的资源供给,还能实现多组系统配置和安全设置的集中维护。 |
||||||||||||||||||||||||||||||||
37 |
Another aspect to grid management is managing user identities in a way that is both highly secure and easy to maintain. Oracle Identity Management 10g includes an LDAP-compliant directory with delegated administration and now, in Release 2, federated identity management so that single sign-on capabilities can be securely shared across security domains. Oracle Identity Management 10g closely adheres to grid principles by utilizing a central point for applications to authenticate users - the single sign-on server - while, behind the scenes, distributing control of identities via delegation and federation to optimize maintainability and overall operation of the system.
|
网格管理的另一特性是以高度安全、易于维护的方式管理用户身份。Oracle 身份管理 10g(OIM,Oracle Identity Management)提供了兼容于LDAP的目录服务,并结合代理管理(delegated administration)功能(在R2中结合了统一身份管理(federated identity management)),实现了在整个安全域的单点登录能力。OIM 10g依据网格的原则,为应用验证用户身份提供了单一控制点-单点登录服务器(sign-on server),在底层通过代理管理和统一身份管理将身份控制分布到不同组件,实现了系统维护的统一性和全面性。 |
||||||||||||||||||||||||||||||||
38 |
Applications Grid |
应用网格 |
||||||||||||||||||||||||||||||||
39 |
Standard Web Services Support. In addition to the robust web services support in Oracle Application Server 10g, Oracle database 10g can publish and consume web services. DML and DDL operations can be exposed as web services, and functions within the database can make a web service appear as a SQL row source, enabling use of powerful SQL tools to analyze web service data in conjunction with relational and non-relational data.
|
支持标准的Web Services。除了Oracle 应用服务器 10g(Oracle Application Server)中对Web Services的强大支持之外,Oracle 10g 数据库也可以发布或使用Web Service。DDL 和 DML操作可以以Web Service的形式供用户使用;数据库可以将Web Service的输出虚拟为一个SQL数据源,因此可以用强大的SQL工具将Web Service数据与关系型数据或非关系型数据关联使用。 |
||||||||||||||||||||||||||||||||
40 |
Oracle Enterprise Manager 10g enhances Oracle's support for service oriented architectures by monitoring and managing web services and any other administrator-defined services, tracking end-to-end performance and performing root cause analysis of problems encountered.
|
OEM 10g体现了Oracle管理功能对SOA的支持,她可以监视、管理Web Services和其他管理员定义的服务,可以进行端到端的性能监控,还可以对系统故障来源进行分析。 |
||||||||||||||||||||||||||||||||
41 |
Information Grid |
信息网格 |
||||||||||||||||||||||||||||||||
42 |
|
|
||||||||||||||||||||||||||||||||
43 |
|
|
||||||||||||||||||||||||||||||||
44 |
|
|
||||||||||||||||||||||||||||||||
45 |
|
|
||||||||||||||||||||||||||||||||
46 |
Overview of Application Architecture |
数据库应用的体系结构概述 |
||||||||||||||||||||||||||||||||
47 |
There are two common ways to architect a database: client/server or multitier. As internet computing becomes more prevalent in computing environments, many database management systems are moving to a multitier environment.
|
数据库应用的体系结构有两种主要形式:客户端/服务器结构和多层结构。随着互联网(internet)的兴起,越来越多的数据库管理系统转变为多层结构。 |
||||||||||||||||||||||||||||||||
48 |
Client/Server Architecture
|
1.1.2.1 客户端/服务器体系结构 |
||||||||||||||||||||||||||||||||
49 |
Multiprocessing uses more than one processor for a set of related jobs. Distributed processing reduces the load on a single processor by allowing different processors to concentrate on a subset of related tasks, thus improving the performance and capabilities of the system as a whole.
|
多处理技术(multiprocessing)指使用多个处理器完成同一个任务。将处理能力分布 到不同处理器,使每个处理器专注于任务的一个子集能够减轻单个处理器的负担,从而提高系统整体的性能。 |
||||||||||||||||||||||||||||||||
50 |
An Oracle database system can easily take advantage of distributed processing by using its client/server architecture. In this architecture, the database system is divided into two parts: a front-end or a client, and a back-end or a server.
|
Oracle数据库系统的客户端/服务器体系结构(client/server architecture)很容易发挥多处理技术的优势。在这种体系结构下,数据库系统被分为两部分:前端,也称为客户端(client);后端,也称为服务端(server)。 |
||||||||||||||||||||||||||||||||
51 |
The Client |
客户端 |
||||||||||||||||||||||||||||||||
52 |
The client is a database application that initiates a
request for an operation to be performed on the database server. It
requests, processes, and presents data managed by the server. The client
workstation can be optimized for its job. For example, it might not need
large disk capacity, or it might benefit from graphic capabilities. |
客户端是一个数据库应用程序,她提交在数据库上执行操作的请求。她负责请求、处理、展现由数据库服务器管理的数据。运行客户端的计算机可以针对她自身的工作进行优化。例如, 客户端计算机不需要大容量的磁盘,但应该适当提高显示性能。 |
||||||||||||||||||||||||||||||||
53 |
Often, the client runs on a different computer than the database server, generally on a PC. Many clients can simultaneously run against one server.
|
通常,客户端程序与数据库服务器运行在不同的计算机上,以PC机为主。多个客户端可以同时使用同一个服务器。 |
||||||||||||||||||||||||||||||||
54 |
The Server |
服务端 |
||||||||||||||||||||||||||||||||
55 |
The server runs Oracle software and handles the functions required for concurrent, shared data access. The server receives and processes the SQL and PL/SQL statements that originate from client applications. The computer that manages the server can be optimized for its duties. For example, it can have large disk capacity and fast processors.
|
服务器运行Oracle数据库管理软件,处理并发、共享的数据访问。数据库服务器接收、处理由客户端应用程序提交的SQL或PL/SQL语句。运行数据库的计算机也可以根据她的职责进行优化,她应具备大容量存储和较快的处理能力。 |
||||||||||||||||||||||||||||||||
56 |
Multitier Architecture: Application Servers
|
1.1.2.2 多层体系结构:应用服务器 |
||||||||||||||||||||||||||||||||
57 |
A multitier architecture has the following components:
|
多层体系结构具备以下组成部分:
|
||||||||||||||||||||||||||||||||
58 |
This architecture enables use of an application server to do the following:
|
在这种体系结构下,应用服务器起到以下作用:
|
||||||||||||||||||||||||||||||||
59 |
If proxy authentication is being used, then the identity
of the client is maintained throughout all tiers of the connection. |
如果使用身份认证代理(proxy authentication ),多层体系结构中各层间用户身份认证可以被统一维护。 |
||||||||||||||||||||||||||||||||
60 |
Overview of Physical Database Structures |
1.1.3 物理数据库结构概述 |
||||||||||||||||||||||||||||||||
61 |
The following sections explain the physical database
structures of an Oracle database, including datafiles, redo log files, and
control files. |
以下各节介绍Oracle数据库的各种物理结构,包括数据文件(datafile)、重做日志文件(redo log files)、和控制文件(control files)。 |
||||||||||||||||||||||||||||||||
62 |
Datafiles
|
1.1.3.1 数据文件 |
||||||||||||||||||||||||||||||||
63 |
Every Oracle database has one or more physical
datafiles. The datafiles contain all the database data. The data of
logical database structures, such as tables and indexes, is physically
stored in the datafiles allocated for a database. |
每个Oracle数据库使用一个或多个物理的数据文件(datafile)。数据文件中包含所了有的数据库数据。按表、索引等逻辑数据库结构组织的数据存储在数据库的数据文件中。 |
||||||||||||||||||||||||||||||||
64 |
The characteristics of datafiles are:
|
数据文件的特点有:
|
||||||||||||||||||||||||||||||||
65 |
Data in a datafile is read, as needed, during normal database operation and stored in the memory cache of Oracle. For example, assume that a user wants to access some data in a table of a database. If the requested information is not already in the memory cache for the database, then it is read from the appropriate datafiles and stored in memory.
|
当需要时,数据文件中的数据通过数据库操作被读出,并缓存于Oracle的内存结构中。例如,当用户需要访问数据库表中的数据时,如果用户请求的数据还没有放入缓存中, 数据库就会把数据从相应的数据文件中读出再放入内存。 |
||||||||||||||||||||||||||||||||
66 |
Modified or new data is not necessarily written to a
datafile immediately. To reduce the amount of disk access and to increase
performance, data is pooled in memory and written to the appropriate
datafiles all at once, as determined by the
database writer
process (DBWn) background process. |
新建或修改的数据不一定立即被写入数据文件。为了减少磁盘访问以提高性能,变化数据暂存在内存中,在适当时间集中地写入相应的数据文件,这个过程由后台进程数据库写进程 (DBWn)(database writer process,DBWn)完成。 |
||||||||||||||||||||||||||||||||
67 |
|
|
||||||||||||||||||||||||||||||||
68 |
Control Files
|
1.1.3.2 控制文件 |
||||||||||||||||||||||||||||||||
69 |
Every Oracle database has a control file. A control file contains entries that specify the physical structure of the database. For example, it contains the following information:
|
每个Oracle数据库都有控制文件(control file)。控制文件中含有说明数据库物理结构的内容。例如,其中包含以下信息:
|
||||||||||||||||||||||||||||||||
70 |
Oracle can multiplex the control file, that is, simultaneously maintain a number of identical control file copies, to protect against a failure involving the control file.
|
Oracle可以使用多重控制文件,即同时维护多个完全相同的控制文件,以防止控制文件损坏造成的数据库故障。 |
||||||||||||||||||||||||||||||||
71 |
Every time an instance of an Oracle database is started, its control file identifies the database and redo log files that must be opened for database operation to proceed. If the physical makeup of the database is altered (for example, if a new datafile or redo log file is created), then the control file is automatically modified by Oracle to reflect the change. A control file is also used in database recovery.
|
Oracle数据库的实例每次启动时,通过控制文件中的内容来确定哪些数据库文件和重做日志文件是执行数据库操作所必需的。当数据库的物理构成发生变化时(例如创建了新的数据文件或重做日志文件),Oracle自动地修改控制文件以反映这些变化。此外,数据库恢复(database recovery)时也要用到控制文件。 |
||||||||||||||||||||||||||||||||
72 |
|
|
||||||||||||||||||||||||||||||||
73 |
Redo Log Files
|
1.1.3.3 重做日志文件 |
||||||||||||||||||||||||||||||||
74 |
Every Oracle database has a set of two or more redo log files. The set of redo log files is collectively known as the redo log for the database. A redo log is made up of redo entries (also called redo records).
|
每个Oracle数据库都有两个或多个重做日志文件(redo log file)。这组文件作为一个整体被称为数据库的重做日志。重做日志由重做条目(redo record)构成(也被称为重做记录)。 |
||||||||||||||||||||||||||||||||
75 |
The primary function of the redo log is to record all
changes made to data. If a failure prevents modified data from being
permanently written to the datafiles, then the changes can be obtained from
the redo log, so work is never lost. |
重做日志的主要功能是记录对数据的操作。如果某种故障导致无法将修改过的数据永久的写入数据文件,那么这些修改内容可以从重做日志中获得,用户已完成的任务不会丢失。 |
||||||||||||||||||||||||||||||||
76 |
To protect against a failure involving the redo log itself, Oracle allows a multiplexed redo log so that two or more copies of the redo log can be maintained on different disks.
|
为了防止重做日志自身的问题导致故障,Oracle支持多重重做日志(multiplexed redo log)功能,即将内容相同的多份重做日志保存在不同的磁盘中。 |
||||||||||||||||||||||||||||||||
77 |
The information in a redo log file is used only to recover the database from a system or media failure that prevents database data from being written to the datafiles. For example, if an unexpected power outage terminates database operation, then data in memory cannot be written to the datafiles, and the data is lost. However, lost data can be recovered when the database is opened, after power is restored. By applying the information in the most recent redo log files to the database datafiles, Oracle restores the database to the time at which the power failure occurred.
|
重做日志中的信息只能用于恢复由于系统或介质故障导致的不能被写入数据文件的数据。例如,如果突然的断电导致数据库操作停止,则内存中的数据不能被写入数据文件,造成数据丢失。当电力恢复数据库再次打开时可以恢复丢失的数据。将最新的重做日志文件中的信息应用于数据文件,Oracle可以将数据库恢复到断电时的状态。 |
||||||||||||||||||||||||||||||||
78 |
The process of applying the redo log during a recovery operation is called rolling forward.
|
在恢复操作中恢复重做日志信息的过程叫做前滚(rolling forward )。 |
||||||||||||||||||||||||||||||||
79 |
|
|
||||||||||||||||||||||||||||||||
80 |
Archive Log Files
|
1.1.3.4 存档日志文件 |
||||||||||||||||||||||||||||||||
89 |
You can enable automatic archiving of the redo log. Oracle automatically archives log files when the database is in ARCHIVELOG mode.
|
重做日志文件可以被自动归档。当数据库运行在ARCHIVELOG模式下,Oracle将自动地归档重做日志文件。 |
||||||||||||||||||||||||||||||||
90 |
Parameter Files
|
1.1.3.5 参数文件 |
||||||||||||||||||||||||||||||||
91 |
Parameter files contain a list of configuration parameters for that instance and database.
|
参数文件包含了数据库与实例的配置参数列表。 |
||||||||||||||||||||||||||||||||
92 |
Oracle recommends that you create a server parameter file (SPFILE) as a dynamic means of maintaining initialization parameters. A server parameter file lets you store and manage your initialization parameters persistently in a server-side disk file.
|
Oracle建议数据库管理员创建服务器参数文件(server parameter file,SPFILE),以便动态地维护初始化参数。服务器参数文件使用户可以在服务器端磁盘的文件中保存初始化参数,并进行管理。 |
||||||||||||||||||||||||||||||||
93 |
|
|
||||||||||||||||||||||||||||||||
94 |
Alert and Trace Log Files
|
1.1.3.6 告警和跟踪调试日志文件 |
||||||||||||||||||||||||||||||||
95 |
Each server and background process can write to an
associated trace file. When an internal error is detected by a process, it
dumps information about the error to its trace file. Some of the information
written to a trace file is intended for the database administrator, while
other information is for Oracle Support Services. Trace file information is
also used to tune applications and instances. |
每一个服务进程、后台进程都有一个与之相关的跟踪调试文件(trace file)。当进程检查出一个内部错误时,就将错误信息导出到她的跟踪调试文件中。跟踪调试文件 中的一些信息供数据库管理员使用,还有些是供Oracle技术支持(Oracle Support Services)使用的。跟踪调试文件的内容还可以被用做应用与实例的调优。 |
||||||||||||||||||||||||||||||||
96 |
The alert file, or alert log, is a special trace file. The alert log of a database is a chronological log of messages and errors.
|
告警文件,或称作告警日志,是一种特殊的跟踪调试文件。数据库的告警日志按时间顺序记录了数据库运行时产生的消息与错误信息。 |
||||||||||||||||||||||||||||||||
97 |
|
|
||||||||||||||||||||||||||||||||
98 |
Backup Files
|
1.1.3.7 备份文件 |
||||||||||||||||||||||||||||||||
99 |
To restore a file is to replace it with a backup file. Typically, you restore a file when a media failure or user error has damaged or deleted the original file.
|
恢复文件就是用备份文件(backup file)来替换原有的文件。典型的情况是,当发生介质故障、用户操作失误导致原始文件损坏或被删除时,就需要进行恢复。 |
||||||||||||||||||||||||||||||||
100 |
User-managed backup and recovery requires you to actually restore backup files before you can perform a trial recovery of the backups.
|
|
||||||||||||||||||||||||||||||||
101 |
Server-managed backup and recovery manages the backup process, such as scheduling of backups, as well as the recovery process, such as applying the correct backup file when recovery is needed.
|
由服务器管理的备份恢复功能会根据需要进行备份工作,例如调度一个备份任务,或进行恢复工作,例如恢复一个备份文件的内容。 |
||||||||||||||||||||||||||||||||
102 |
|
|
||||||||||||||||||||||||||||||||
103 |
Overview of Logical Database Structures |
1.1.4 逻辑数据库结构概述 |
||||||||||||||||||||||||||||||||
104 |
The logical storage structures, including data blocks, extents, and segments, enable Oracle to have fine-grained control of disk space use.
|
逻辑存储结构包括数据块(data blocks),数据扩展(extents),数据段(segments),这些逻辑结构使Oracle可以精细地控制磁盘空间的使用。 |
||||||||||||||||||||||||||||||||
105 |
Tablespaces
|
1.1.4.1 表空间 |
||||||||||||||||||||||||||||||||
106 |
A database is divided into logical storage units called tablespaces, which group related logical structures together. For example, tablespaces commonly group together all application objects to simplify some administrative operations.
|
一个数据库被分割为数个被称作表空间(tablespaces)的逻辑存储单位,每个表空间内保存的是一组相关的逻辑对象。例如,一个表空可以用来存储一个应用所需的一组对象,以便简化管理操作。 |
||||||||||||||||||||||||||||||||
107 |
Each database is logically divided into one or more tablespaces. One or more datafiles are explicitly created for each tablespace to physically store the data of all logical structures in a tablespace. The combined size of the datafiles in a tablespace is the total storage capacity of the tablespace.
|
每个数据库都在逻辑上被划分为一个或多个表空间。用户需要为每个表空间创建一个或多个数据文件来物理地存储属于此表空间的逻辑对象。一个表空间所有数据文件的大小就是此表空间的可用数据存储量。 |
||||||||||||||||||||||||||||||||
108 |
Every Oracle database contains a SYSTEM tablespace and a
SYSAUX tablespace. Oracle creates them automatically when the database is
created. The system default is to create a smallfile tablespace, which is
the traditional type of Oracle tablespace. The SYSTEM and
SYSAUX tablespaces
are created as smallfile tablespaces. |
Oracle 10g数据库都包含 SYSTEM 和 SYSAUX 两个表空间。当创建数据库时她们被自动创建。数据库默认创建传统的Oracle表空间--小文件表空间(smallfile tablespace)。SYSTEM 和 SYSAUX 就是以小文件表空间的形式创建的。 |
||||||||||||||||||||||||||||||||
109 |
Oracle also lets you create bigfile tablespaces. This allows Oracle Database to contain tablespaces made up of single large files rather than numerous smaller ones. This lets Oracle Database utilize the ability of 64-bit systems to create and manage ultralarge files. The consequence of this is that Oracle Database can now scale up to 8 exabytes in size. With Oracle-managed files, bigfile tablespaces make datafiles completely transparent for users. In other words, you can perform operations on tablespaces, rather than the underlying datafiles.
|
使用Oracle还可以创建大文件表空间(bigfile tablespaces)。这样Oracle数据库的表空间可以由一个单一的大文件构成的,而不是多个小的数据文件。 这使Oracle可以发挥64位系统的能力,创建、管理超大的文件。在64位系统中,Oracle数据库的存储能力扩展到了8 EB(1EB = 1024PB,1PB = 1024TB,1TB=1024GB)。此外,当启用了Oracle自动管理数据文件的模式后,大文件表空间使数据文件对用户完全透明。换句话说,用户只针对表空间执行管理操作,无须关心处于底层的数据文件。 |
||||||||||||||||||||||||||||||||
110 |
|
|
||||||||||||||||||||||||||||||||
111 |
Online and Offline Tablespaces |
联机表空间和脱机表空间 |
||||||||||||||||||||||||||||||||
112 |
A tablespace can be online (accessible) or offline (not accessible). A tablespace is generally online, so that users can access the information in the tablespace. However, sometimes a tablespace is taken offline to make a portion of the database unavailable while allowing normal access to the remainder of the database. This makes many administrative tasks easier to perform.
|
表空间可以处于联机状态(可访问)或脱机状态(不可访问)。表空间通常处于联机状态,用户可以访问其中的信息。有时可以把某个表空间切换到脱机状态,使与脱机表空间对应的数据库部分失效,而数据库其余部分仍可以正常工作。这个功能使许多管理任务更容易执行。 |
||||||||||||||||||||||||||||||||
113 |
Oracle Data Blocks
|
1.1.4.2 Oracle数据块 |
||||||||||||||||||||||||||||||||
114 |
At the finest level of granularity, Oracle database data is stored in data blocks. One data block corresponds to a specific number of bytes of physical database space on disk. The standard block size is specified by the DB_BLOCK_SIZE initialization parameter. In addition, you can specify up to five other block sizes. A database uses and allocates free database space in Oracle data blocks.
|
在Oracle数据库中,最精细的数据存储粒度是数据块(data blocks)。一个数据块相当于磁盘上一段连续的物理存储空间。数据块分配的默认容量由初始化参数 DB_BLOCK_SIZE 决定。除了这个参数,管理员还可以额外设定5个数据块容量参数。Oracle数据库在数据块中分配、利用存储空间。 |
||||||||||||||||||||||||||||||||
115 |
Extents
|
1.1.4.3 数据扩展 |
||||||||||||||||||||||||||||||||
116 |
The next level of logical database space is an extent. An extent is a specific number of contiguous data blocks, obtained in a single allocation, used to store a specific type of information.
|
更高一层的逻辑数据库结构是数据扩展(extent)。数据扩展是由一次存储空间分配而获得的数个连续数据块,用于存储信息。 |
||||||||||||||||||||||||||||||||
117 |
Segments
|
1.1.4.4 段 |
||||||||||||||||||||||||||||||||
118 |
Above extents, the level of logical database storage is a segment. A segment is a set of extents allocated for a certain logical structure. The following table describes the different types of segments.
|
在数据扩展之上的数据库逻辑存储结构是段(segment)。段是为一个特定逻辑结构分配的一组数据扩展。下表描述了不同种类的段。 |
||||||||||||||||||||||||||||||||
119 |
|
|
||||||||||||||||||||||||||||||||
120 |
Oracle dynamically allocates space when the existing extents of a segment become full. In other words, when the extents of a segment are full, Oracle allocates another extent for that segment. Because extents are allocated as needed, the extents of a segment may or may not be contiguous on disk.
|
当一个段内已有的数据扩展的装满之后,Oracle动态地分配新空间。换句话说,段内已有的数据扩展装满之后,Oracle为这个段分配新的数据扩展。因为数据扩展是随需分配的,因此一个段内的数据扩展 物理上未必是连续的。 |
||||||||||||||||||||||||||||||||
121 |
|
|
||||||||||||||||||||||||||||||||
122 |
Overview of Schemas and Common Schema Objects |
1.1.5 方案及常用的方案对象概述 |
||||||||||||||||||||||||||||||||
123 |
A schema is a collection of database objects. A schema is owned by a database user and has the same name as that user. Schema objects are the logical structures that directly refer to the database's data. Schema objects include structures like tables, views, and indexes. (There is no relationship between a tablespace and a schema. Objects in the same schema can be in different tablespaces, and a tablespace can hold objects from different schemas.)
|
方案是一组数据库对象的集合。方案和数据库用户名相同,并属于该用户。方案对象是代表数据库数据的逻辑符号。方案对象包括表、视图、索引等逻辑数据结构。(表空间和方案之间没有联系。同一方案中的对象可以存储在不同表空间中,一个表空间中也可以存储不同方案的对象。) |
||||||||||||||||||||||||||||||||
124 |
Some of the most common schema objects are defined in the following section.
|
下面各节介绍了一些常用的数据库对象。 |
||||||||||||||||||||||||||||||||
125 |
Tables
|
1.1.5.1 表 |
||||||||||||||||||||||||||||||||
126 |
Tables are the basic unit of data storage in an Oracle database. Database tables hold all user-accessible data. Each table has columns and rows. A table that has an employee database, for example, can have a column called employee number, and each row in that column is an employee's number.
|
表(table)是Oracle数据库中基本的数据存储单位。数据库表包含所有用户可以访问的数据。每个表都有列和行。举例来说,一个存储员工信息的表通常有一列为员工编号,每行的此列都用来保存员工编号信息。 |
||||||||||||||||||||||||||||||||
127 |
Indexes
|
1.1.5.2 索引 |
||||||||||||||||||||||||||||||||
128 |
Indexes are optional structures associated with tables. Indexes can be created to increase the performance of data retrieval. Just as the index in this manual helps you quickly locate specific information, an Oracle index provides an access path to table data.
|
索引(index)和表相关,是一种可选的数据结构。创建索引是为了提高数据读取的性能。就像本文档的目录可以帮你快速定位所需信息一样,通过Oracle索引可以更快地访问表数据。 |
||||||||||||||||||||||||||||||||
129 |
When processing a request, Oracle can use some or all of the available indexes to locate the requested rows efficiently. Indexes are useful when applications frequently query a table for a range of rows (for example, all employees with a salary greater than 1000 dollars) or a specific row.
|
当Oracle处理一个用户请求时,可以利用适当的索引来更有效的定位查询所需的数据行。如果一个应用程序经常查询表中某一区间的数行(例如查询所有月薪大于1000美元的员工)或条件特定的几行时,使用索引就十分有效。 |
||||||||||||||||||||||||||||||||
130 |
Indexes are created on one or more columns of a table. After it is created, an index is automatically maintained and used by Oracle. Changes to table data (such as adding new rows, updating rows, or deleting rows) are automatically incorporated into all relevant indexes with complete transparency to the users.
|
索引是基于表的一列或数列创建的。索引创建后由Oracle负责维护。表数据的变化(添加新的数据行、更新数据行、或删除数据行)将会自动的反映到相关的索引中,而且此过程对用户是透明的。 |
||||||||||||||||||||||||||||||||
131 |
Views
|
1.1.5.3 视图 |
||||||||||||||||||||||||||||||||
132 |
Views are customized presentations of data in one or more tables or other views. A view can also be considered a stored query. Views do not actually contain data. Rather, they derive their data from the tables on which they are based, referred to as the base tables of the views.
|
视图(view)是一种基于数据表或其他视图而定义的逻辑对象,用于展现其中的数据。视图也可以被看成一个存储的查询 语句。视图并不实际包含数据,而是从她所依赖的表中获取数据。 |
||||||||||||||||||||||||||||||||
133 |
Like tables, views can be queried, updated, inserted into, and deleted from, with some restrictions. All operations performed on a view actually affect the base tables of the view.
|
像表一样,对视图可以进行查询、更新、插入、和删除操作,但有所限制。所有对视图的操作都将被反映到视图所依赖的基础表(base tables)中。 |
||||||||||||||||||||||||||||||||
134 |
Views provide an additional level of table security by restricting access to a predetermined set of rows and columns of a table. They also hide data complexity and store complex queries.
|
通过视图可以限制用户访问表中指定的行和列,实现了另一层次的表安全控制。她还可以用于保存复杂的查询、隐藏数据的复杂性。 |
||||||||||||||||||||||||||||||||
135 |
Clusters
|
1.1.5.4 簇 |
||||||||||||||||||||||||||||||||
136 |
Clusters are groups of one or more tables physically stored together because they share common columns and are often used together. Because related rows are physically stored together, disk access time improves.
|
簇(cluster)是一组物理上存储在一起的表,她适用于数个表有相同的列而且经常一起使用的情况。因为相关的数据物理的存储在一起,有利于降低磁盘存取时间。 |
||||||||||||||||||||||||||||||||
137 |
Like indexes, clusters do not affect application design. Whether a table is part of a cluster is transparent to users and to applications. Data stored in a clustered table is accessed by SQL in the same way as data stored in a nonclustered table.
|
同索引一样,簇的使用也不会影响应用程序设计。一个表是否属于一个簇对用户和应用程序都是透明的。储存于簇表中的数据与非簇表中的数据一样可以通过相同的SQL来访问。 |
||||||||||||||||||||||||||||||||
138 |
Synonyms
|
1.1.5.5 同义词 |
||||||||||||||||||||||||||||||||
139 |
A synonym is an alias for any table, view,
materialized view,
sequence, procedure,
function, package,
type, Java class schema
object, user-defined object type, or another synonym. Because a
synonym is simply an alias, it requires no storage other than its definition
in the data dictionary. |
同义词是表、视图、物化视图、序列、过程、函数、包、类型、Java类、用户自定义对象、或其他同义词的别名。因为同义词只是个别名,除了在数据字典中的定义之外他不需额外的存储空间。 |
||||||||||||||||||||||||||||||||
140 |
|
|
||||||||||||||||||||||||||||||||
141 |
Overview of the Oracle Data Dictionary |
1.1.6 Oracle数据字典概述 |
||||||||||||||||||||||||||||||||
142 |
Each Oracle database has a data dictionary. An Oracle data dictionary is a set of tables and views that are used as a read-only reference about the database. For example, a data dictionary stores information about both the logical and physical structure of the database. A data dictionary also stores the following information:
|
每个Oracle数据库都有数据字典(data dictionary)。Oracle数据字典是一系列只读的表和索引,用于描述数据库。例如,数据字典中存储了数据库逻辑、物理结构的信息。数据字典中还包括:
|
||||||||||||||||||||||||||||||||
143 |
A data dictionary is created when a database is created. To accurately reflect the status of the database at all times, the data dictionary is automatically updated by Oracle in response to specific actions, such as when the structure of the database is altered. The database relies on the data dictionary to record, verify, and conduct ongoing work. For example, during database operation, Oracle reads the data dictionary to verify that schema objects exist and that users have proper access to them.
|
当创建数据库时数据字典也被创建。为了实时、准确地反映数据库的状态,用户对Oracle数据库进行操作时(如改变数据库结构)数据字典将被自动更新。数据库依赖数据字典来记录、验证、管理正在进行的工作。例如当数据库操作进行时,Oracle读取数据字典来验证方案对象是否存在,及用户是否有相应的访问权限。 |
||||||||||||||||||||||||||||||||
144 |
|
|
||||||||||||||||||||||||||||||||
145 |
Overview of the Oracle Instance |
1.1.7 Oracle实例概述 |
||||||||||||||||||||||||||||||||
146 |
An Oracle database server consists of an Oracle database and an Oracle instance. Every time a database is started, a system global area (SGA) is allocated and Oracle background processes are started. The combination of the background processes and memory buffers is called an Oracle instance.
|
一个Oracle数据库服务器包括Oracle数据库[此处特指数据库物理文件]和Oracle实例。当数据库启动时,将在内存中分配系统全局区(system global area,SGA),并启动Oracle后台进程。上述内存区和后台进程一起被称为Oracle实例(instance)。 |
||||||||||||||||||||||||||||||||
147 |
Real Application Clusters:
Multiple Instance Systems
|
1.1.7.1 Real Application Clusters: 多实例系统 |
||||||||||||||||||||||||||||||||
148 |
Some hardware architectures (for example, shared disk systems) enable multiple computers to share access to data, software, or peripheral devices. Real Application Clusters (RAC) takes advantage of such architecture by running multiple instances that share a single physical database. In most applications, RAC enables access to a single database by users on multiple computers with increased performance.
|
有的硬件体系结构(例如共享磁盘系统)可以让多个计算机共享的使用数据、应用程序、或周边设备。Real Application Clusters (实时应用集群,RAC) 通过运行多个实例同时访问一个物理数据库来发挥这种体系结构的优势。在RAC体系结构下,可以提高应用程序中多个用户访问同一数据库的性能。 |
||||||||||||||||||||||||||||||||
149 |
An Oracle database server uses memory structures and processes to manage and access the database. All memory structures exist in the main memory of the computers that constitute the database system. Processes are jobs that work in the memory of these computers.
|
Oracle数据库服务器使用其自身的内存结构和后台进程来管理、访问数据库。所有内存结构都存在于数据库系统所在计算机的主内存中。后台进程是工作于计算机内存中的作业。 |
||||||||||||||||||||||||||||||||
150 |
|
|
||||||||||||||||||||||||||||||||
151 |
Instance Memory Structures
|
1.1.7.2 实例内存结构 |
||||||||||||||||||||||||||||||||
152 |
Oracle creates and uses memory structures to complete several jobs. For example, memory stores program code being run and data shared among users. Two basic memory structures are associated with Oracle: the system global area and the program global area. The following subsections explain each in detail.
|
Oracle创建并利用内存结构来完成各项工作。例如,在内存中存储需要运行的程序代码和用户使用的数据。和Oracle有关的两个基本内存结构是系统全局区(system global area,SGA)和程序全局区(program global area,PGA)。以下各小节将做进一步解释。 |
||||||||||||||||||||||||||||||||
153 |
System Global Area
|
1.1.7.3 系统全局区 |
||||||||||||||||||||||||||||||||
154 |
The System Global Area (SGA) is a shared memory region that contains data and control information for one Oracle instance. Oracle allocates the SGA when an instance starts and deallocates it when the instance shuts down. Each instance has its own SGA.
|
系统全局区(System Global Area,SGA)是包含了一个Oracle实例所拥有的数据及控制信息的共享内存区域。Oracle在实例启动时分配SGA空间,并在实例关闭时回收。每个实例都有自己的SGA。 |
||||||||||||||||||||||||||||||||
155 |
Users currently connected to an Oracle database share the data in the SGA. For optimal performance, the entire SGA should be as large as possible (while still fitting in real memory) to store as much data in memory as possible and to minimize disk I/O.
|
连接到Oracle数据库中的用户可以共享SGA中的数据。为了优化性能,应该使SGA尽可能的大(还要依据实际可用内存情况而定),以便在内存中尽可能多的存储数据,使磁盘I/O最小化。 |
||||||||||||||||||||||||||||||||
156 |
The information stored in the SGA is divided into several types of memory structures, including the database buffers, redo log buffer, and the shared pool.
|
|||||||||||||||||||||||||||||||||
157 |
Database Buffer Cache of the SGA |
SGA中的数据库缓存 |
||||||||||||||||||||||||||||||||
158 |
Database buffers store the most recently used blocks of data. The set of database buffers in an instance is the database buffer cache. The buffer cache contains modified as well as unmodified blocks. Because the most recently (and often, the most frequently) used data is kept in memory, less disk I/O is necessary, and performance is improved.
|
数据库缓冲区(database buffer)存储最近使用的数据块。一个实例中全部的数据库缓冲区被称为数据缓存。数据缓存同时包含修改过和未修改的数据块。 如果最近使用的(通常也是最常用的)数据被放在了内存中,对磁盘I/O的需求就减少了,因此性能得到了提高。 |
||||||||||||||||||||||||||||||||
159 |
Redo Log Buffer of the SGA |
SGA中的重做日志缓冲区 |
||||||||||||||||||||||||||||||||
160 |
The redo log buffer stores redo entries—a log of changes made to the database. The redo entries stored in the redo log buffers are written to an online redo log, which is used if database recovery is necessary. The size of the redo log is static.
|
重做日志缓冲区(redo log buffer)用于存储重做条目(redo entry)--用于记录数据库数据变化的日志。重做日志缓冲区中存储的重做条目将被写入联机的重做日志(online redo log)文件中,以备数据库恢复使用。重做日志文件的容量是固定的。 |
||||||||||||||||||||||||||||||||
161 |
Shared Pool of the SGA |
SGA中的共享池 |
||||||||||||||||||||||||||||||||
162 |
The shared pool contains shared memory constructs, such as shared SQL areas. A shared SQL area is required to process every unique SQL statement submitted to a database. A shared SQL area contains information such as the parse tree and execution plan for the corresponding statement. A single shared SQL area is used by multiple applications that issue the same statement, leaving more shared memory for other uses.
|
共享池(shared pool)中包含的是共享的内存结构,例如共享SQL区(shared SQL area)。处理所有提交到数据库的SQL语句都要用到共享SQL区。共享SQL区中包含了语句对应的解析树(parse tree)、执行计划(execution plan)等信息。一个共享SQL区可以被提交了相同SQL语句的多个应用程序使用,以便节约内存空间。 |
||||||||||||||||||||||||||||||||
163 |
|
|
||||||||||||||||||||||||||||||||
164 |
Statement Handles or Cursors |
语句句柄/游标 |
||||||||||||||||||||||||||||||||
165 |
A cursor is a handle or name for a private SQL area in which a parsed statement and other information for processing the statement are kept. (Oracle Call Interface, OCI, refers to these as statement handles.) Although most Oracle users rely on automatic cursor handling of Oracle utilities, the programmatic interfaces offer application designers more control over cursors.
|
游标(cursor)可以看作是私有SQL区的句柄或名称,在SQL语句执行过程中保存解析后的语句和其它信息。( 在Oracle Call Interface(OCI)中游标被称为语句句柄(statement handle)。)大部分Oracle用户只会使用Oracle工具提供的自动游标处理功能,此外Oracle编程接口为开发者提供了更多对游标的控制能力。 |
||||||||||||||||||||||||||||||||
166 |
For example, in precompiler application development, a cursor is a named resource available to a program and can be used specifically to parse SQL statements embedded within the application. Application developers can code an application so it controls the phases of SQL statement execution and thus improves application performance.
|
例如,在开发一个预编译的应用程序时,游标可以看作供程序使用的已命名的资源,它被嵌入程序中解析SQL语句。开发者可以编码来控制SQL语句执行的步骤,以提高程序的性能。 |
||||||||||||||||||||||||||||||||
167 |
Program Global Area
|
1.1.7.4 程序全局区 |
||||||||||||||||||||||||||||||||
168 |
The Program Global Area (PGA) is a memory buffer that contains data and control information for a server process. A PGA is created by Oracle when a server process is started. The information in a PGA depends on the Oracle configuration. |
程序全局区(Program Global Area,PGA)是服务器后台进程所需的数据与控制信息的内存缓冲区。PGA是当服务器后台进程启动时由Server创建的。PGA中存储的信息由Oracle的配置情况决定。 |
||||||||||||||||||||||||||||||||
169 |
|
|
||||||||||||||||||||||||||||||||
170 |
Oracle Background Processes
|
1.1.7.5 Oracle后台进程 |
||||||||||||||||||||||||||||||||
171 |
An Oracle database uses memory structures and processes to manage and access the database. All memory structures exist in the main memory of the computers that constitute the database system. Processes are jobs that work in the memory of these computers.
|
Oracle数据库服务器使用其自身的内存结构和后台进程来管理、访问数据库。所有内存结构都存在于数据库系统所在计算机的主内存中。后台进程是工作于计算机内存中的作业。 |
||||||||||||||||||||||||||||||||
172 |
The architectural features discussed in this section enable the Oracle database to support:
|
本节介绍的Oracle进程结构在数据库中的作用是:
|
||||||||||||||||||||||||||||||||
173 |
Oracle creates a set of background processes for each instance. The background processes consolidate functions that would otherwise be handled by multiple Oracle programs running for each user process. They asynchronously perform I/O and monitor other Oracle process to provide increased parallelism for better performance and reliability.
|
Oracle为每个实例创建了一组后台进程(Background Process)。后台进程中集成了众多为用户进程提供服务的功能。后台进程可以异步地执行I/O操作[此处指与用户对数据的操作异步]、也可以监控其它Oracle进程以提高并行性,从而获得高性能和高可靠性。 |
||||||||||||||||||||||||||||||||
174 |
There are numerous background processes, and each Oracle instance can use several background processes.
|
Oracle中有多种后台进程,每个Oracle实例包含了多个后台进程。 |
||||||||||||||||||||||||||||||||
175 |
|
|
||||||||||||||||||||||||||||||||
176 |
Process Architecture
|
1.1.7.6 进程体系结构 |
||||||||||||||||||||||||||||||||
177 |
A process is a "thread of control" or a mechanism in an operating system that can run a series of steps. Some operating systems use the terms job or task. A process generally has its own private memory area in which it runs.
|
进程(process)可以看作是“对任务执行的控制”,也可以看作操作系统中有步骤地运行一系列任务的一种机制。有些操作系统也使用作业(job)或任务(task)等术语来代指进程。一个进程通常运行在她自己的私有内存空间中。 |
||||||||||||||||||||||||||||||||
178 |
An Oracle database server has two general types of processes: user processes and Oracle processes.
|
Oracle数据库服务器有两类进程:用户进程(user process)和服务进程(Oracle process) |
||||||||||||||||||||||||||||||||
179 |
User (Client) Processes |
用户(客户)进程 |
||||||||||||||||||||||||||||||||
180 |
User processes are created and maintained to run the software code of an application program (such as an OCI or OCCI program) or an Oracle tool (such as Enterprise Manager). User processes also manage communication with the server process through the program interface, which is described in a later section.
|
用户进程用于运行应用程序(例如OCI或OCCI编制的程序)或Oracle工具(例如企业管理器)中的代码。用户进程还可以通过编程接口管理自身 与服务进程的通信,后面的章节将详细讲述。 |
||||||||||||||||||||||||||||||||
181 |
Oracle Processes |
Oracle服务进程 |
||||||||||||||||||||||||||||||||
182 |
Oracle processes are invoked by other processes to perform functions on behalf of the invoking process.
|
Oracle服务进程由其它进程[此处指用户进程]调用,执行调用者所需的功能。 |
||||||||||||||||||||||||||||||||
183 |
Oracle creates server processes to handle requests from connected user processes. A server process communicates with the user process and interacts with Oracle to carry out requests from the associated user process. For example, if a user queries some data not already in the database buffers of the SGA, then the associated server process reads the proper data blocks from the datafiles into the SGA.
|
Oracle创建服务进程来处理来自用户进程的请求。服务进程可以和用户进程通信,也可以和Oracle服务器交互,执行用户进程的请求。例如,如果用户查询所需的数据不在SGA的数据缓冲区中,则与此用户进程相关的服务进程就从数据文件中将所需的数据块读入SGA。 |
||||||||||||||||||||||||||||||||
184 |
Oracle can be configured to vary the number of user processes for each server process. In a dedicated server configuration, a server process handles requests for a single user process. A shared server configuration lets many user processes share a small number of server processes, minimizing the number of server processes and maximizing the use of available system resources.
|
Oracle可以为每个服务进程分配不同数量的用户进程。在专用服务模式(dedicated server configuration)下,每个只处理一个用户进程的请求。在共享服务模式(shared server configuration)下,大量用户可以共享几个服务进程,通过减少服务进程数量达到有效利用系统资源的目的。 |
||||||||||||||||||||||||||||||||
185 |
On some systems, the user and server processes are
separate, while on others they are combined into a single process. If a
system uses the shared server or if the user and server processes run on
different computers, then the user and server processes must be separate.
Client/server systems separate the user and server processes and run them on
different computers. |
在有些系统中,用户、服务进程是分开的,有时两者也可以合并成一个进程。如果系统运行在共享服务模式下,或者用户、服务进程运行在不同的计算机之上,那么用户、服务进程必须分开。在客户/服务(client/server)模式下用户、服务进程是运行在不同计算机上的。 |
||||||||||||||||||||||||||||||||
186 |
|
|
||||||||||||||||||||||||||||||||
187 |
Overview of Accessing the Database |
1.1.8 数据库访问概述 |
||||||||||||||||||||||||||||||||
188 |
This section describes Oracle Net Services, as well as how to start up the database.
|
本节讲述Oracle网络服务(Oracle Net Services),以及如何启动数据库。 |
||||||||||||||||||||||||||||||||
189 |
Network Connections
|
1.1.8.1 网络联接 |
||||||||||||||||||||||||||||||||
190 |
Oracle Net Services is Oracle's mechanism for interfacing with the communication protocols used by the networks that facilitate distributed processing and distributed databases.
|
Oracle网络服务是Oracle中负责和各种不同类型的网络(network)、不同类型的通信协议(communication protocol)交互的组件,通过Oracle网络服务可以实现分布式的处理和分布式数据库。 |
||||||||||||||||||||||||||||||||
191 |
Communication protocols define the way that data is transmitted and received on a network. Oracle Net Services supports communications on all major network protocols, including TCP/IP, HTTP, FTP, and WebDAV.
|
通信协议定义了一种网络中数据如何传输和接收。Oracle网络服务支持各种主流网络的通信协议,如TCP/IP,HTTP,FTP和WebDAV。 |
||||||||||||||||||||||||||||||||
192 |
Using Oracle Net Services, application developers do not need to be concerned with supporting network communications in a database application. If a new protocol is used, then the database administrator makes some minor changes, while the application requires no modifications and continues to function.
|
使用Oracle网络服务,数据库应用开发者就无需关心应用程序运行的网络环境。如果运行环境中引入了新协议,只需要数据库管理员简单设置,而无需对应用程序做修改。 |
||||||||||||||||||||||||||||||||
193 |
Oracle Net, a component of Oracle Net Services, enables a network session from a client application to an Oracle database server. Once a network session is established, Oracle Net acts as the data courier for both the client application and the database server. It establishes and maintains the connection between the client application and database server, as well as exchanges messages between them. Oracle Net can perform these jobs because it is located on each computer in the network.
|
Oracle网络(Oracle Net)是Oracle网络服务的一个组件,用于在客户应用程序和Oracle数据库之间建立会话(network session)。当会话建立后,Oracle负责在应用程序和数据库服务器传递数据。数据库运行环境内的节点都安装了Oracle网络组件,因此她能够建立和维护应用程序 与数据库之间的连接,同时协助她们交换信息。 |
||||||||||||||||||||||||||||||||
194 |
|
|
||||||||||||||||||||||||||||||||
195 |
Starting Up the Database
|
1.1.8.2 启动数据库 |
||||||||||||||||||||||||||||||||
196 |
The three steps to starting an Oracle database and making it available for systemwide use are:
|
启动Oracle数据库并使她开始为整个系统服务有三个步骤:
|
||||||||||||||||||||||||||||||||
197 |
A database administrator can perform these steps using the SQL*Plus STARTUP statement or Enterprise Manager. When Oracle starts an instance, it reads the server parameter file (SPFILE) or initialization parameter file to determine the values of initialization parameters. Then, it allocates an SGA and creates background processes.
|
数据库管理员在执行这些步骤时,可以使用SQL*Plus的 STARTUP 命令,或使用企业管理器(Enterprise Manager)。当Oracle实例启动时,她读取服务器参数文件(server parameter file,SPFILE)或初始化参数文件(initialization parameter file)来决定初始化参数的值。接着,分配SGA并创建后台进程。 |
||||||||||||||||||||||||||||||||
198 |
|
|
||||||||||||||||||||||||||||||||
199 |
How Oracle Works
|
1.1.8.3 Oracle是怎样工作的 |
||||||||||||||||||||||||||||||||
200 |
The following example describes the most basic level of operations that Oracle performs. This illustrates an Oracle configuration where the user and associated server process are on separate computers (connected through a network).
|
以下例子大体上描述了Oracle进行更新(update)时操作的主要步骤。在例子所描绘的Oracle配置中,用户和相关的服务进程处在不同的计算机中,通过网络连接。
|
||||||||||||||||||||||||||||||||
201 |
|
|
||||||||||||||||||||||||||||||||
202 |
Overview of Oracle Utilities |
1.1.9 Oracle工具概述 |
||||||||||||||||||||||||||||||||
203 |
Oracle provides several utilities for data transfer, data maintenance, and database administration, including Data Pump Export and Import, SQL*Loader, and LogMiner.
|
Oracle提供了众多的实用工具来完成数据迁移,数据维护,数据库管理等任务,这些工具有Data Pump Export and Import[数据泵导入导出工具],SQL*Loader[在数据库和文件之间交换数据],和LogMiner[重做日志分析工具]等。
|
||||||||||||||||||||||||||||||||
204 |
|
|
||||||||||||||||||||||||||||||||
205 |
Oracle Database Features |
1.2 Oracle数据库特性 |
||||||||||||||||||||||||||||||||
206 |
This section contains the following topics: |
本节包括以下主题: |
||||||||||||||||||||||||||||||||
207 |
Overview of Scalability and Performance Features |
1.2.1 性能和可伸缩性概述 |
||||||||||||||||||||||||||||||||
208 |
Oracle includes several software mechanisms to fulfill the following important requirements of an information management system:
|
Oracle包含了多种机制来实现一个信息管理系统必备的重要能力:
|
||||||||||||||||||||||||||||||||
209 |
This contains the following sections:
|
Oracle为实现上述重要功能而设计的机制将在以下各节介绍:
|
||||||||||||||||||||||||||||||||
210 |
Concurrency
|
1.2.1.1 并发 |
||||||||||||||||||||||||||||||||
211 |
A primary concern of a multiuser database management system is how to control concurrency, which is the simultaneous access of the same data by many users. Without adequate concurrency controls, data could be updated or changed improperly, compromising data integrity.
|
多用户数据库管理系统的一个主要任务是对并发(concurrency)进行控制,即对多个用户同时访问同一数据进行控制。当缺乏有效的并发控制时, 修改数据的操作就不能保证正常,从而危害数据完整性。 |
||||||||||||||||||||||||||||||||
212 |
One way to manage data concurrency is to make each user wait for a turn. The goal of a database management system is to reduce that wait so it is either nonexistent or negligible to each user. All data manipulation language statements should proceed with as little interference as possible, and destructive interactions between concurrent transactions must be prevented. Destructive interaction is any interaction that incorrectly updates data or incorrectly alters underlying data structures. Neither performance nor data integrity can be sacrificed.
|
管理数据并发的方法是让每个用户轮流操作数据。而数据库管理系统的目标就是减少每个用户的等待时间,即让用户无需等待或使等待难以察觉。所有的数据操作语句 (DML)在执行时要尽可能地减少冲突,还要防止并发事务之间破坏性的相互操作。破坏性的相互操作是指不正确地更新数据或不正确地修改数据结构等操作。在进行并发控制时,数据完整性和数据库性能要同时保证。 |
||||||||||||||||||||||||||||||||
213 |
Oracle resolves such issues by using various types of locks and a multiversion consistency model. These features are based on the concept of a transaction. It is the application designer's responsibility to ensure that transactions fully exploit these concurrency and consistency features.
|
为保证数据库性能,Oracle应用了不同类型的锁和多版本数据完整性模型(multiversion consistency model)。这些特性都包含在事务(transaction)的概念里。应用程序开发人员应该在设计事务时充分发挥其中的并发、完整性等特性。 |
||||||||||||||||||||||||||||||||
214 |
Read Consistency
|
1.2.1.2 读一致性 |
||||||||||||||||||||||||||||||||
215 |
Read consistency, as supported by Oracle, does the following:
|
Oracle提供的读完整性包含以下特性:
|
||||||||||||||||||||||||||||||||
216 |
The simplest way to think of Oracle's implementation of read consistency is to imagine each user operating a private copy of the database, hence the multiversion consistency model.
|
为了便于理解Oracle实现读完整性的方法,可以想象每个用户都在操作一个私有的数据库副本,也就是前面提到的多版本数据完整性模型。 |
||||||||||||||||||||||||||||||||
217 |
Read Consistency, Undo Records, and Transactions |
读完整性,撤销记录,事务 |
||||||||||||||||||||||||||||||||
218 |
To manage the multiversion consistency model, Oracle must create a read-consistent set of data when a table is queried (read) and simultaneously updated (written). When an update occurs, the original data values changed by the update are recorded in the database undo records. As long as this update remains part of an uncommitted transaction, any user that later queries the modified data views the original data values. Oracle uses current information in the system global area and information in the undo records to construct a read-consistent view of a table's data for a query.
|
为了维护多版本数据一致性模型,当一个表的数据被更新(写)的同时也在被查询(读)时,Oracle必须创建一个维持读完整性的数据集。当更新发生时,被更新数据的原始值被记录在数据库的undo records中。在事务中的更新操作没有被提交之前,用户查询正在被修改的记录时只能看到她们的原始值。Oracle结合SGA中以及撤销记录中的信息为查询表数据的用户构建了一个 维持读完整性的视图[此视图非彼视图]。 |
||||||||||||||||||||||||||||||||
219 |
Only when a transaction is committed are the changes of the transaction made permanent. Statements that start after the user's transaction is committed only see the changes made by the committed transaction.
|
当事务提交后,事务中对数据的修改才被永久记录。在用户事务提交后执行的语句九只能查询到提交后的数据了。 |
||||||||||||||||||||||||||||||||
220 |
The transaction is key to Oracle's strategy for providing read consistency. This unit of committed (or uncommitted) SQL statements:
|
事务是Oracle实现读完整性的关键。事务是一组SQL语句(这组语句或者被一起提交,或者都不被提交),事务的作用是:
|
||||||||||||||||||||||||||||||||
221 |
Read-Only Transactions |
只读事务 |
||||||||||||||||||||||||||||||||
222 |
By default, Oracle guarantees statement-level read consistency. The set of data returned by a single query is consistent with respect to a single point in time. However, in some situations, you might also require transaction-level read consistency. This is the ability to run multiple queries within a single transaction, all of which are read-consistent with respect to the same point in time, so that queries in this transaction do not see the effects of intervening committed transactions. If you want to run a number of queries against multiple tables and if you are not doing any updating, you prefer a read-only transaction.
|
默认情况下,Oracle只保证语句级的读完整性。由一个查询返回的数据对同一时间点来说是一致的。但是在有些情况下,用户可能需要事务级的读完整性。也就是要使一个事务中的多个查询对同一时间点来说都是一致的,这样事务中的每个查询都不会受到与之冲突的事务的干扰。如果用户需要对多个表做多个查询,建议使用只读事务。 |
||||||||||||||||||||||||||||||||
223 |
Locking Mechanisms
|
1.2.1.3 各种锁机制 |
||||||||||||||||||||||||||||||||
224 |
Oracle also uses locks to control concurrent access to data. When updating information, the data server holds that information with a lock until the update is submitted or committed. Until that happens, no one else can make changes to the locked information. This ensures the data integrity of the system.
|
Oracle也使用锁(lock)来控制对数据的并发访问。当更新数据时,数据库服务器锁定被修改的数据直到此更新被提交。在这期间,任何用户都不能修改被锁定的数据。这保证了系统的数据完整性。 |
||||||||||||||||||||||||||||||||
225 |
Oracle provides unique non-escalating row-level locking. Unlike other data servers that "escalate" locks to cover entire groups of rows or even the entire table, Oracle always locks only the row of information being updated. Because Oracle includes the locking information with the actual rows themselves, Oracle can lock an unlimited number of rows so users can work concurrently without unnecessary delays.
|
Oracle提供了独有的非扩散行级锁(non-escalating row-level locking)。在其它数据库中,锁有可能“扩散 (escalate)”为覆盖一组数据行,甚至覆盖整个表,而Oracle只会锁定正在被更新的唯一行。因为Oracle将锁信息存储在每个数据行内,因此Oracle对锁定的数据行数没有 限制,这就消除了用户并发工作时不必要的延迟。 |
||||||||||||||||||||||||||||||||
226 |
Automatic Locking |
自动锁 |
||||||||||||||||||||||||||||||||
227 |
Oracle locking is performed automatically and requires no user action. Implicit locking occurs for SQL statements as necessary, depending on the action requested. Oracle's lock manager automatically locks table data at the row level. By locking table data at the row level, contention for the same data is minimized.
|
Oracle锁定数据的操作无需用户干预,能够自动执行。当一个SQL执行时,Oracle根据实际情况的需要,隐式地对数据加锁。Oracle的锁管理器自动地在行级对表数据加锁,因此对相同的数据竞争可以最小化。 |
||||||||||||||||||||||||||||||||
228 |
Oracle's lock manager maintains several different types of row locks, depending on what type of operation established the lock. The two general types of locks are exclusive locks and share locks. Only one exclusive lock can be placed on a resource (such as a row or a table); however, many share locks can be placed on a single resource. Both exclusive and share locks always allow queries on the locked resource but prohibit other activity on the resource (such as updates and deletes).
|
Oracle的锁管理器依据操作的需要来创建锁,她可以管理多种类型的行级锁。排他锁(exclusive lock)和共享锁(share lock)是两种最常见的锁。在同一资源上(例如数据行或表)只能加一个排他锁,但是可以加多个共享锁。共享锁和排他锁都允许对被锁资源进行查询,但禁止其它所有活动(例如更新或删除)。 |
||||||||||||||||||||||||||||||||
229 |
Manual Locking |
手动锁 |
||||||||||||||||||||||||||||||||
230 |
Under some circumstances, a user might want to override default locking. Oracle allows manual override of automatic locking features at both the row level (by first querying for the rows that will be updated in a subsequent statement) and the table level.
|
在有些情况下,用户可能不想使用默认的锁。Oracle允许用户在行级(需要先将要修改的行查询出来)与表级手动加锁。 |
||||||||||||||||||||||||||||||||
231 |
Quiesce Database
|
1.2.1.4 静默数据库 |
||||||||||||||||||||||||||||||||
232 |
Database administrators occasionally need isolation from concurrent non-database administrator actions, that is, isolation from concurrent non-database administrator transactions, queries, or PL/SQL statements. One way to provide such isolation is to shut down the database and reopen it in restricted mode. You could also put the system into quiesced state without disrupting users. In quiesced state, the database administrator can safely perform certain actions whose executions require isolation from concurrent non-DBA users.
|
有时数据库管理员需要让数据库运行在没有非数据库管理性操作的环境中,也就暂时拒绝与数据库管理无关的并发操作,如事务、查询、PL/SQL语句等。提供这种隔离的方法之一是先关闭数据库,然后在限制模式下重新打开。管理员也可以将数据库置于静默状态 (quiesced state)以避免打扰普通用户操作。在静默状态下,数据库管理员可以安全的执行需要和非DBA用户的并发操作相隔离的操作。 |
||||||||||||||||||||||||||||||||
233 |
|
|
||||||||||||||||||||||||||||||||
234 |
Real Application Clusters
|
1.2.1.5 Real Application Clusters |
||||||||||||||||||||||||||||||||
235 |
Real Application Clusters (RAC) comprises several Oracle instances running on multiple clustered computers, which communicate with each other by means of a so-called interconnect. RAC uses cluster software to access a shared database that resides on shared disk. RAC combines the processing power of these multiple interconnected computers to provide system redundancy, near linear scalability, and high availability. RAC also offers significant advantages for both OLTP and data warehouse systems and all systems and applications can efficiently exploit clustered environments.
|
一个实时应用集群(Real Application Clusters,RAC)系统中包含了运行在集群内不同计算机上的多个Oracle实例,这些实例间通过互联的方式进行通信。RAC系统中的各个节点通过集群管理软件访问位于共享磁盘上的共享的数据库。RAC系统聚合了集群中互联的多个计算机的处理能力,提供了系统冗余能力、接近线形的可 扩展性、以及高可用性。RAC系统对OLTP [OnLine Transaction Process]或数据仓库(data warehouse)系统都有显著的好处,各种系统和应用都能有效的利用RAC环境。 |
||||||||||||||||||||||||||||||||
236 |
You can scale applications in RAC environments to meet increasing data processing demands without changing the application code. As you add resources such as nodes or storage, RAC extends the processing powers of these resources beyond the limits of the individual components.
|
在RAC环境中,当数据处理需求增长时,用户可以轻易地使应用的处理能力扩大而无需改变程序代码。当用户向RAC环境中加入计算节点、存储等资源后,RAC可以将新资源融入整体系统,从而超越每个单独组件的限制,形成更大的处理能力。 |
||||||||||||||||||||||||||||||||
237 |
|
|
||||||||||||||||||||||||||||||||
238 |
Portability
|
1.2.1.6 可移植性 |
||||||||||||||||||||||||||||||||
239 |
Oracle provides unique portability across all major platforms and ensures that your applications run without modification after changing platforms. This is because the Oracle code base is identical across platforms, so you have identical feature functionality across all platforms, for complete application transparency. Because of this portability, you can easily upgrade to a more powerful server as your requirements change.
|
Oracle具有在各种主流平台间移植的能力,而且保证更换平台后应用程序无需修改就能运行。这是由于Oracle的代码库在不同平台间是完全相同,所以Oracle在不同平台下的功能特性也是完全相同的,因此移植对应用程序完全透明。由于Oracle的可移植性,用户可以在需求变化时轻易地将系统升级到更强大的服务器上。 |
||||||||||||||||||||||||||||||||
240 |
Overview of Manageability Features |
1.2.2 可管理性概述 |
||||||||||||||||||||||||||||||||
241 |
People who administer the operation of an Oracle database system, known as database administrators (DBAs), are responsible for creating Oracle databases, ensuring their smooth operation, and monitoring their use. In addition to the many alerts and advisors Oracle provides, Oracle also offers the following features:
|
Oracle数据库运行的管理者被称为数据库管理员(database administrators,DBAs),她(他)们的主要职责是创建数据库,确保数据库平稳运行,并对数据库进行监控。在数据库系统管理方面,Oracle提供了各种生成告警、建议信息的软件,除此之外Oracle还具备以下特性: |
||||||||||||||||||||||||||||||||
242 |
Self-Managing Database
|
1.2.2.1 自我管理的数据库 |
||||||||||||||||||||||||||||||||
243 |
Oracle Database provides a high degree of self-management - automating routine DBA tasks and reducing complexity of space, memory, and resource administration. Oracle self-managing database features include the following: automatic undo management, dynamic memory management, Oracle-managed files, mean time to recover, free space management, multiple block sizes, and Recovery Manager (RMAN).
|
Oracle数据库实现了很高程度的自我管理能力,能够自动完成常规的DBA任务,减少对存储、内存及其他资源的管理的复杂性。Oracle的自我管理特性包含以下几点:自动撤销空间管理(automatic undo management)、动态内存管理(dynamic memory management)、自动数据文件管理(Oracle-managed files)、快速恢复(mean time to recover),可用存储空间管理(free space management),多种数据块容量(multiple block sizes)和恢复管理(Recovery Manager,RMAN)。
|
||||||||||||||||||||||||||||||||
244 |
Oracle Enterprise Manager
|
1.2.2.2 Oracle企业管理器 |
||||||||||||||||||||||||||||||||
245 |
Enterprise Manager is a system management tool that provides an integrated solution for centrally managing your heterogeneous environment. Combining a graphical console, Oracle Management Servers, Oracle Intelligent Agents, common services, and administrative tools, Enterprise Manager provides a comprehensive systems management platform for managing Oracle products.
|
企业管理器(Enterprise Manager)是一个数据库系统管理工具,作为一个集成化的解决方案,她能够集中地管理处与异构环境中的多个Oracle数据库。企业管理器的组件包括:图形化控制台(console),Oracle管理服务(Oracle Management Server,OMS),Oracle智能代理(Oracle Intelligent Agent),以及其他的公用服务和管理工具。企业管理器为各种Oracle产品提供了一个全面的系统管理平台。 |
||||||||||||||||||||||||||||||||
246 |
From the client interface, the Enterprise Manager Console, you can perform the following tasks:
|
在企业管理器控制台的界面下,管理员可以执行以下操作:
|
||||||||||||||||||||||||||||||||
247 |
SQL*Plus
|
1.2.2.3 SQL*Plus |
||||||||||||||||||||||||||||||||
248 |
SQL*Plus is a tool for entering and running ad-hoc database statements. It lets you run SQL statements and PL/SQL blocks, and perform many additional tasks as well.
|
SQL*Plus是根据用户需要键入、运行数据库脚本的工具。她可以执行SQL语句、PL/SQL程序,以及其他任务。 |
||||||||||||||||||||||||||||||||
249 |
|
|
||||||||||||||||||||||||||||||||
250 |
Automatic Storage Management
|
1.2.2.4 自动存储管理 |
||||||||||||||||||||||||||||||||
251 |
Automatic Storage Management automates and simplifies the layout of datafiles, control files, and log files. Database files are automatically distributed across all available disks, and database storage is rebalanced whenever the storage configuration changes. It provides redundancy through the mirroring of database files, and it improves performance by automatically distributing database files across all available disks. Rebalancing of the database's storage automatically occurs whenever the storage configuration changes.
|
自动存储管理(Automatic Storage Management)使数据文件、控制文件、日志文件的管理更简单、自动化程度更高。在自动存储管理模式下,数据文件被自动地分布在可用的磁盘上,当系统配置发生变化时可以自动调整。自动存储管理可以通过镜像数据文件来提供冗余。当数据文件自动地分布在可用的磁盘上时可以提升数据库性能。当系统配置发生变化时,对数据库存储的调整将自动发生。 |
||||||||||||||||||||||||||||||||
252 |
The Scheduler
|
1.2.2.5 调度器 |
||||||||||||||||||||||||||||||||
253 |
To help simplify management tasks, as well as providing a rich set of functionality for complex scheduling needs, Oracle provides a collection of functions and procedures in the DBMS_SCHEDULER package. Collectively, these functions are called the Scheduler, and they are callable from any PL/SQL program.
|
为了简化管理任务,同时支持复杂多样的调度需求,Oracle在 DBMS_SCHEDULER 包中提供了一套函数、过程。这套函数被统称为调度器,她们可以在PL/SQL程序中调用。 |
||||||||||||||||||||||||||||||||
254 |
The Scheduler lets database administrators and application developers control when and where various tasks take place in the database environment. For example, database administrators can schedule and monitor database maintenance jobs such as backups or nightly data warehousing loads and extracts.
|
调度器让数据库管理员和应用开发者控制数据库系统中各种任务在何时何地执行。例如,数据库管理员可以调度、监控备份之类的数据库维护作业,或需要在夜间执行的数据仓库抽取和加载任务。 |
||||||||||||||||||||||||||||||||
255 |
Database Resource Manager
|
1.2.2.6 数据库资源管理器 |
||||||||||||||||||||||||||||||||
256 |
Traditionally, the operating systems regulated resource management among the various applications running on a system, including Oracle databases. The Database Resource Manager controls the distribution of resources among various sessions by controlling the execution schedule inside the database. By controlling which sessions run and for how long, the Database Resource Manager can ensure that resource distribution matches the plan directive and hence, the business objectives.
|
按照惯例,对包括Oracle数据库在内的各种应用程序所需资源的管理是操作系统的任务。而数据库资源管理器(Database Resource Manager)则通过数据库系统内的调度来控制资源在不同会话(sessions)间的分配。通过控制会话运行及运行时长,数据库资源管理器可以确保资源的分配符合预定的资源计划[plan,见后面章节],进而满足业务处理能力的要求。 |
||||||||||||||||||||||||||||||||
257 |
|
|
||||||||||||||||||||||||||||||||
258 |
Overview of Database Backup and Recovery Features |
1.2.3 数据库备份与恢复特性概述 |
||||||||||||||||||||||||||||||||
259 |
In every database system, the possibility of a system or hardware failure always exists. If a failure occurs and affects the database, then the database must be recovered. The goals after a failure are to ensure that the effects of all committed transactions are reflected in the recovered database and to return to normal operation as quickly as possible while insulating users from problems caused by the failure.
|
对于每个数据库系统,总存在出现软硬件故障的可能性。如果故障发生并对数据库产生影响,就必须进行数据库恢复。故障恢复的目标是使故障前所有已提交的事务反映到恢复后的数据库中,并使数据库 尽可能快地恢复正常操作,使用户不受到故障的影响。 |
||||||||||||||||||||||||||||||||
260 |
Oracle provides various mechanisms for the following:
|
Oracle提供了多种机制来实现以下目标:
|
||||||||||||||||||||||||||||||||
261 |
Types of Failures
|
1.2.3.1 故障种类 |
||||||||||||||||||||||||||||||||
262 |
Several circumstances can halt the operation of an Oracle database. The most common types of failure are described in the following table.
|
很多情况都会导致Oracle数据库操作中断。下表中描述了最常见的故障类型。 |
||||||||||||||||||||||||||||||||
263 |
|
|
||||||||||||||||||||||||||||||||
264 |
Oracle provides for complete media recovery from all possible types of hardware failures, including disk failures. Options are provided so that a database can be completely recovered or partially recovered to a specific point in time.
|
Oracle能在各种硬件故障后进行完全的介质恢复。用户可以选择进行完全恢复,也可以选择恢复到指定时间点。 |
||||||||||||||||||||||||||||||||
265 |
If some datafiles are damaged in a disk failure but most of the database is intact and operational, the database can remain open while the required tablespaces are individually recovered. Therefore, undamaged portions of a database are available for normal use while damaged portions are being recovered.
|
如果磁盘故障后一部分数据文件受损,而其余部分的数据库未受影响,则数据库可以继续保持打开的状态,只单独恢复受影响的表空间。因此可以在正常使用数据库未损坏部分的同时,恢复损坏的部分。 |
||||||||||||||||||||||||||||||||
266 |
Structures Used for Recovery
|
1.2.3.2 用于数据库恢复的数据结构 |
||||||||||||||||||||||||||||||||
267 |
Oracle uses several structures to provide complete recovery from an instance or disk failure: the redo log, undo records, a control file, and database backups.
|
Oracle使用以下多种数据结构完成针对实例错误和磁盘故障的完全恢复:重做日志(redo log)、撤销记录(undo record)、控制文件(control file)和数据库备份(database backup)。 |
||||||||||||||||||||||||||||||||
268 |
The Redo Log |
重做日志 |
||||||||||||||||||||||||||||||||
269 |
The redo log is a set of files that protect altered database data in memory that has not been written to the datafiles. The redo log can consist of the online redo log and the archived redo log.
|
重做日志是一系列文件,用于防止已提交但位于内存中没有被写入数据文件的数据丢失。重做日志由联机重做日志和归档重做日志构成。 |
||||||||||||||||||||||||||||||||
270 |
|
|
||||||||||||||||||||||||||||||||
271 |
The online redo log is a set of two or more online redo log files that record all changes made to the database, including uncommitted and committed changes. Redo entries are temporarily stored in redo log buffers of the system global area, and the background process LGWR writes the redo entries sequentially to an online redo log file. LGWR writes redo entries continually, and it also writes a commit record every time a user process commits a transaction.
|
联机重做日志(online redo log)由两个或多个联机重做日志文件(online redo log files)构成,记录应用到数据库的所有变化,包括未提交和已提交的变化。重做条目(redo entry)临时存储于SGA的重做日志缓冲区(redo log buffer)内,后台进程 LGWR 负责将重做条目按顺序写入联机重做日志文件中。LGWR 持续地记录重做条目,并在用户提交事务时将对应的重做条目写入文件。 |
||||||||||||||||||||||||||||||||
272 |
Optionally, filled online redo files can be manually or automatically archived before being reused, creating archived redo logs. To enable or disable archiving, set the database in one of the following modes:
|
管理员可以选择是否建立归档重做日志,来决定空间用完的联机重做日志文件在重用前是手动还是自动归档。将数据库设定为以下两种运行模式可以决定是否启用自动归档:
|
||||||||||||||||||||||||||||||||
273 |
In ARCHIVELOG mode, the database can be completely recovered from both instance and disk failure. The database can also be backed up while it is open and available for use. However, additional administrative operations are required to maintain the archived redo log.
|
在 ARCHIVELOG 模式下,数据库可以从实例错误和磁盘故障中完全恢复。数据库也可以在打开(用户可用)的同时备份。但是管理员需要进行额外的操作来维护归档的重做日志。 |
||||||||||||||||||||||||||||||||
274 |
If the database redo log operates in NOARCHIVELOG mode, then the database can be completely recovered from instance failure, but not from disk failure. Also, the database can be backed up only while it is completely closed. Because no archived redo log is created, no extra work is required by the database administrator.
|
如果数据库运行在 NOARCHIVELOG 模式下,数据库只能完全恢复实例错误,而磁盘故障不行。数据库也只能在完全关闭的状态下才能备份。但是因为没有创建归档的重做日志,数据库管理员没有额外的维护工作。 |
||||||||||||||||||||||||||||||||
275 |
Undo Records |
撤销记录 |
||||||||||||||||||||||||||||||||
276 |
Undo records are stored in undo tablespaces. Oracle uses the undo data for a variety of purposes, including accessing before-images of blocks changed in uncommitted transactions. During database recovery, Oracle applies all changes recorded in the redo log and then uses undo information to roll back any uncommitted transactions.
|
撤销记录(undo record)保存在撤销表空间(undo tablespace)中。撤销数据(undo data)对Oracle来说有多种作用,例如前文提到的生成读完整性的数据视图[见1.2.1.2]。在数据库恢复中,Oracle先将重做日志中的记录的有变化的数据提交到数据库,再利用撤销记录中的信息回滚未提交的数据。 |
||||||||||||||||||||||||||||||||
277 |
Control Files |
控制文件 |
||||||||||||||||||||||||||||||||
278 |
The control files include information about the file structure of the database and the current log sequence number being written by LGWR. During normal recovery procedures, the information in a control file guides the automatic progression of the recovery operation.
|
控制文件中包括数据库的文件结构和当前由 LGWR 写入的日志序列号(log sequence number)。在恢复过程中,控制文件中的信息用于维护恢复操作的进程。 |
||||||||||||||||||||||||||||||||
279 |
Database Backups |
数据库备份 |
||||||||||||||||||||||||||||||||
280 |
Because one or more files can be physically damaged as the result of a disk failure, media recovery requires the restoration of the damaged files from the most recent operating system backup of a database. You can either back up the database files with Recovery Manager (RMAN), or use operating system utilities. RMAN is an Oracle utility that manages backup and recovery operations, creates backups of database files (datafiles, control files, and archived redo log files), and restores or recovers a database from backups.
|
由于磁盘故障可能导致多个文件物理损坏,介质恢复要求在操作系统级恢复被损坏的数据库文件。用户可以通过恢复管理器(Recovery Manager,RMAN)或操作系统工具完成备份数据库文件的工作。RMAN是一个Oracle备份恢复工具,她可以管理备份恢复操作,创建数据库文件的备份(包括数据文件、控制文件、归档日志文件),还能从备份中恢复数据库。 |
||||||||||||||||||||||||||||||||
281 |
|
|
||||||||||||||||||||||||||||||||
282 |
Overview of High Availability Features |
1.2.4 高可用性概述 |
||||||||||||||||||||||||||||||||
283 |
Computing environments configured to provide nearly full-time availability are known as high availability systems. Such systems typically have redundant hardware and software that makes the system available despite failures. Well-designed high availability systems avoid having single points-of-failure.
|
为提供近乎全时可用性(full-time availability)而配制的计算环境被称为高可用性系统(high availability system)。这样的系统通常具备冗余的硬件和软件,以保证系统在发生故障时仍然可用。设计良好的高可用性系统中不存在单点脆弱性(single points-of-failure)。 |
||||||||||||||||||||||||||||||||
284 |
When failures occur, the fail over process moves processing performed by the failed component to the backup component. This process remasters systemwide resources, recovers partial or failed transactions, and restores the system to normal, preferably within a matter of microseconds. The more transparent that fail over is to users, the higher the availability of the system.
|
当故障发生时,故障处理进程(fail over process)将故障组件正在执行的操作移交给备份的组件继续执行。这个进程重新分配系统资源,恢复失败的事务,使系统恢复正常, 而这一切都在毫秒级的时间内完成。故障处理的过程对用户越透明,系统的可用性就越高。 |
||||||||||||||||||||||||||||||||
285 |
Oracle has a number of products and features that provide high availability in cases of unplanned downtime or planned downtime. These include Fast-Start Fault Recovery, Real Application Clusters, Recovery Manager (RMAN), backup and recovery solutions, Oracle Flashback, partitioning, Oracle Data Guard, LogMiner, multiplexed redo log files, online reorganization. These can be used in various combinations to meet specific high availability needs.
|
Oracle有数个产品、特性来应对计划或非计划的停机,以保证高可用性,包括Fast-Start Fault Recovery,实时应用集群,恢复管理器,备份恢复解决方案,Oracle Flashback,分区,Oracle Data Guard,重做日志分析器,多重重做日志文件,online reorganization等。组合使用这些功能和特性就能满足特定的高可用性需求。 |
||||||||||||||||||||||||||||||||
286 |
|
|
||||||||||||||||||||||||||||||||
287 |
Overview of Business Intelligence Features |
1.2.5 业务智能特性概述 |
||||||||||||||||||||||||||||||||
288 |
This section describes several business intelligence features.
|
本节简述Oracle中关于业务智能的特性。 |
||||||||||||||||||||||||||||||||
289 |
Data Warehousing
|
1.2.5.1 数据仓库 |
||||||||||||||||||||||||||||||||
290 |
A data warehouse is a relational database designed for query and analysis rather than for transaction processing. It usually contains historical data derived from transaction data, but it can include data from other sources. It separates analysis workload from transaction workload and enables an organization to consolidate data from several sources.
|
Oracle对数据仓库的定义是,为查询、分析而非事务处理而设计的关系型数据库。数据仓库中主要存储来自业务系统的历史数据,也可以包括来自其他数据源的数据。数据仓库系统将数据分析工作和事务处理工作分离以确保各自的性能,同时还可以整合企业内不同的数据源。 |
||||||||||||||||||||||||||||||||
291 |
In addition to a relational database, a data warehouse environment includes an extraction, transportation, transformation, and loading (ETL) solution, an online analytical processing (OLAP) engine, client analysis tools, and other applications that manage the process of gathering data and delivering it to business users.
|
除了关系型数据库之外,数据仓库系统还应包括数据抽取、传输、转换、加载方案(ETL),联机分析(online analytical processing,OLAP)引擎,客户端分析软件,以及管理数据收集与信息发布的应用程序。 |
||||||||||||||||||||||||||||||||
292 |
Extraction, Transformation, and Loading (ETL)
|
1.2.5.2 抽取,转换,加载(ETL) |
||||||||||||||||||||||||||||||||
293 |
You must load your data warehouse regularly so that it can serve its purpose of facilitating business analysis. To do this, data from one or more operational systems must be extracted and copied into the warehouse. The process of extracting data from source systems and bringing it into the data warehouse is commonly called ETL, which stands for extraction, transformation, and loading.
|
用户必须定期向数据仓库加载数据,以保证数据仓库能够有效地支持业务分析。要完成加载数据,就要将数据从操作型系统中抽取并复制到数据仓库中。将数据从源系统抽取后放入数据仓库的过程通常被称为ETL,即抽取(extraction),转换(transformation),加载(loading)的缩写。 |
||||||||||||||||||||||||||||||||
294 |
Materialized Views
|
1.2.5.3 物化视图 |
||||||||||||||||||||||||||||||||
295 |
A materialized view provides access to table data by storing the results of a query in a separate schema object. Unlike an ordinary view, which does not take up any storage space or contain any data, a materialized view contains the rows resulting from a query against one or more base tables or views. A materialized view can be stored in the same database as its base tables or in a different database.
|
物化视图(materialized view)可以将数据查询结果保存在一种特殊的方案对象 (schema object)中。常规的视图并不包含数据,也不占用存储空间,物化视图与之不同,她储存了基于其它表或视图的查询结果。物化视图的存储位置可以与她的基表在同一数据库,也可以不同。 |
||||||||||||||||||||||||||||||||
295 |
Materialized views stored in the same database as their base tables can improve query performance through query rewrites. Query rewrite is a mechanism where Oracle or applications from the end user or database transparently improve query response time, by automatically rewriting the SQL query to use the materialized view instead of accessing the original tables. Query rewrites are particularly useful in a data warehouse environment.
|
当物化视图与她的基表位于同一数据库时,用户就可以使用查询重写(query rewrite)功能来提高查询性能。查询重写机制可以自动地在物化视图和原始表之间选择最优的方案重写用户提交的SQL语句,以便提高查询的响应时间,同时对用户透明。查询重写在数据仓库系统中格外有效。 |
||||||||||||||||||||||||||||||||
296 |
Bitmap Indexes in Data Warehousing
|
1.2.5.4 数据仓库中的位图索引 |
||||||||||||||||||||||||||||||||
297 |
Data warehousing environments typically have large amounts of data and ad hoc queries, but a low level of concurrent database manipulation language (DML) transactions. For such applications, bitmap indexing provides:
|
在典型的数据仓库中,数据量庞大,查询的随机性强,并发的数据操作性(DML)事务较少。针对这样的应用环境,位图索引提供了如下好处:
|
||||||||||||||||||||||||||||||||
298 |
Fully indexing a large table with a traditional B-tree index can be prohibitively expensive in terms of space because the indexes can be several times larger than the data in the table. Bitmap indexes are typically only a fraction of the size of the indexed data in the table.
|
如果为一个大表全面地建立传统的B-tree索引有可能代价异常高昂,因为索引所需的存储空间可能数倍于原数据表。而位图索引所需的存储空间通常不会超过原表。 |
||||||||||||||||||||||||||||||||
299 |
Table Compression
|
1.2.5.5 表压缩 |
||||||||||||||||||||||||||||||||
300 |
To reduce disk use and memory use (specifically, the buffer cache), you can store tables and partitioned tables in a compressed format inside the database. This often leads to a better scaleup for read-only operations. Table compression can also speed up query execution. There is, however, a slight cost in CPU overhead.
|
为了减少磁盘和内存(主要是数据缓冲区)使用,用户可以对数据库内的表、分区表以压缩的方式存储。这有利于提升只读型操作的性能。表压缩还能提升查询的执行速度,但会轻微增加CPU的负担。 |
||||||||||||||||||||||||||||||||
301 |
Parallel Execution
|
1.2.5.6 并行执行 |
||||||||||||||||||||||||||||||||
302 |
When Oracle runs SQL statements in parallel, multiple processes work together simultaneously to run a single SQL statement. By dividing the work necessary to run a statement among multiple processes, Oracle can run the statement more quickly than if only a single process ran it. This is called parallel execution or parallel processing.
|
当Oracle在并行模式下执行SQL语句时,多个进程同时执行一条SQL语句。如果Oracle将执行一个SQL语句的工作分配给多个进程,执行速度会超过单个进程执行的情况。这被称为并行执行(parallel execution)或并行处理(parallel processing)。 |
||||||||||||||||||||||||||||||||
303 |
Parallel execution dramatically reduces response time for data-intensive operations on large databases, because statement processing can be split up among many CPUs on a single Oracle system.
|
在进行大数据量的数据库操作时使用并行执行将显著的缩短响应时间,因为语句的处理工作可以被分配到系统中的数个CPU上。 |
||||||||||||||||||||||||||||||||
304 |
Analytic SQL
|
1.2.5.7 分析型SQL |
||||||||||||||||||||||||||||||||
305 |
Oracle has many SQL operations for performing analytic operations in the database. These include ranking, moving averages, cumulative sums, ratio-to-reports, and period-over-period comparisons.
|
Oracle数据库通过SQL可以实现多种分析性的查询。例如排名,移动平均,累计,比重,同期比较等。 |
||||||||||||||||||||||||||||||||
306 |
OLAP Capabilities
|
1.2.5.8 联机分析处理能力 |
||||||||||||||||||||||||||||||||
307 |
Application developers can use SQL online analytical processing (OLAP) functions for standard and ad-hoc reporting. For additional analytic functionality, Oracle OLAP provides multidimensional calculations, forecasting, modeling, and what-if scenarios. This enables developers to build sophisticated analytic and planning applications such as sales and marketing analysis, enterprise budgeting and financial analysis, and demand planning systems. Data can be stored in either relational tables or multidimensional objects.
|
应用程序开发者可以使用SQL中的联机分析处理(online analytical processing,OLAP)函数实现标准查询或随机查询[标准查询,即查询条件、结果集相对固定的查询;随机查询,即用户根据特定需要,临时定制的查询]。除此之外,Oracle中的 Oracle OLAP 组件还提供了多维计算、预测、建模及what-if分析等分析功能。开发者可以利用这些功能构建更为复杂的分析、计划应用程序,例如销售和市场分析系统,企业预算和财务系统,需求计划系统等。分析所需的数据既可以存储在关系数据表中,也可以存储在多维数据模型内。 |
||||||||||||||||||||||||||||||||
308 |
Oracle OLAP provides the query performance and calculation capability previously found only in multidimensional databases to Oracle's relational platform. In addition, it provides a Java OLAP API that is appropriate for the development of internet-ready analytical applications. Unlike other combinations of OLAP and RDBMS technology, Oracle OLAP is not a multidimensional database using bridges to move data from the relational data store to a multidimensional data store. Instead, it is truly an OLAP-enabled relational database. As a result, Oracle provides the benefits of a multidimensional database along with the scalability, accessibility, security, manageability, and high availability of the Oracle database. The Java OLAP API, which is specifically designed for internet-based analytical applications, offers productive data access.
|
Oracle OLAP组件在Oracle的关系型平台上实现了高效的分析型查询,并提供了强大的计算能力,而以前这些特性只存在于多维数据库中。Oracle OLAP组件还提供了Java OLAP API作为开发接口,通过此接口可以轻松地开发基于internet的分析程序。与其他将OLAP 与RDBMS结合的技术不同,Oracle OLAP不是一个多维数据库,因此也不需进行将储存在关系数据库中的数据库迁移到多维数据库的工作。相反的,Oracle OLAP是一个支持OLAP的关系型数据库。因此,Oracle在实现了多维数据库功能的同时,还具备的Oracle数据库的可扩展性、易访问性、可管理性及高可用性。用于开发基于internet的分析程序的Java OLAP API保证了数据访问的高效。 |
||||||||||||||||||||||||||||||||
309 |
Data Mining
|
1.2.5.9 数据挖掘 |
||||||||||||||||||||||||||||||||
310 |
With Oracle Data Mining, data never leaves the database — the data, data preparation, model building, and model scoring results all remain in the database. This enables Oracle to provide an infrastructure for application developers to integrate data mining seamlessly with database applications. Some typical examples of the applications that data mining are used in are call centers, ATMs, ERM, and business planning applications. Data mining functions such as model building, testing, and scoring are provided through a Java API.
|
通过Oracle Data Mining组件,数据挖掘所需的所有信息都可以保存在数据库中,例如原始数据、展现结果、分析模型、模型评估结果等等。这样Oracle可以作为应用开发者的一个基础平台,数据挖掘功能可以与其他数据库应用无缝地集成在一起。呼叫中心、ATM、ERM、BPA等应用系统都会使用到数据挖掘。Oracle通过Java API提供建模、模型测试、模型评价等数据挖掘功能。 |
||||||||||||||||||||||||||||||||
311 |
|
|
||||||||||||||||||||||||||||||||
312 |
Partitioning
|
1.2.5.10 分区 |
||||||||||||||||||||||||||||||||
313 |
Partitioning addresses key issues in supporting very large tables and indexes by letting you decompose them into smaller and more manageable pieces called partitions. SQL queries and DML statements do not need to be modified in order to access partitioned tables. However, after partitions are defined, DDL statements can access and manipulate individuals partitions rather than entire tables or indexes. This is how partitioning can simplify the manageability of large database objects. Also, partitioning is entirely transparent to applications.
|
分区技术可以将大表、大索引分解为更小、更易管理的块,这些块被称为分区,通过分区技术可以有效地解决大表、大索引带来的问题。用户对分区表执行的SQL查询或DML语句与对普通数据表一样。但是定义了分区后,DDL语句可以访问、操作单独的分区,而不是整个表或索引,这样通过分区技术就能简化对大数据库对象的管理工作。分区对应用程序是透明的。 |
||||||||||||||||||||||||||||||||
314 |
Partitioning is useful for many different types of applications, particularly applications that manage large volumes of data. OLTP systems often benefit from improvements in manageability and availability, while data warehousing systems benefit from performance and manageability.
|
分区技术对不同种类的应用程序,尤其是需要访问大量数据的应用程序十分有效。分区可以增加OLTP系统的易管理性和可用性,还可以增加数据仓库系统的易管理性和系统性能。 |
||||||||||||||||||||||||||||||||
315 |
|
|
||||||||||||||||||||||||||||||||
316 |
Overview of Content Management Features |
1.2.6 内容管理特性概述 |
||||||||||||||||||||||||||||||||
317 |
Oracle includes datatypes to handle all the types of rich Internet content such as relational data, object-relational data, XML, text, audio, video, image, and spatial. These datatypes appear as native types in the database. They can all be queried using SQL. A single SQL statement can include data belonging to any or all of these datatypes.
|
Oracle数据库支持的存储类型可以容纳当今Internet环境中的各种数据,例如关系型数据、对象--关系型数据、XML、文本、音频、视频、图片及空间数据。这些数据在数据库中以其原始形态存储。她们都可以通过SQL进行查询。在一个SQL语句中就可以同时查询以上各种数据类型。 |
||||||||||||||||||||||||||||||||
318 |
XML in Oracle
|
1.2.6.1 Oracle中的XML |
||||||||||||||||||||||||||||||||
319 |
XML, eXtensible Markup Language, is the standard way to identify and describe data on the Web. Oracle XML DB treats XML as a native datatype in the database. Oracle XML DB offers a number of easy ways to create XML documents from relational tables. The result of any SQL query can be automatically converted into an XML document. Oracle also includes a set of utilities, available in Java and C++, to simplify the task of creating XML documents.
|
XML是eXtensible Markup Language[可扩展的标记语言]的缩写,她是Web环境中定义与描述数据的标准方式。Oracle XML DB组件将XML作为数据库内置的数据类型。Oracle XML DB组件提供了多种从关系型数据表创建XML文档的方法。来自SQL查询的结果集可以被自动地转换为XML文档。Oracle还提供了Java和C++的接口来完成创建XML文档的工作。 |
||||||||||||||||||||||||||||||||
320 |
Oracle includes five XML developer's kits, or XDKs. Each consists of a standards-based set of components, tools, and utilities. The XDKs are available for Java, C, C++, PL/SQL, and Java Beans.
|
Oracle包含了5个XML开发包(XML developer's kits),或称为XDK。她们分别支持Java,C,C++,PL/SQL和Java Beans。这些开发包均由标准的组件、工具构成。 |
||||||||||||||||||||||||||||||||
321 |
LOBs
|
1.2.6.2 LOB |
||||||||||||||||||||||||||||||||
322 |
The LOB datatypes BLOB, CLOB, NCLOB, and BFILE enable you to store and manipulate large blocks of unstructured data (such as text, graphic images, video clips, and sound waveforms) in binary or character format. They provide efficient, random, piece-wise access to the data.
|
用户可以使用 BLOB,CLOB,NCLOB 和 BFILE这四种LOB数据类型以二进制或文本格式存储和操作大数据量的非结构化数据(例如文本、图形、视频、音频等)。通过LOB可以实现高效地、非线性地、或部分地访问非结构化数据。 |
||||||||||||||||||||||||||||||||
323 |
Oracle Text
|
1.2.6.3 Oracle文档管理(Oracle Text) |
||||||||||||||||||||||||||||||||
324 |
Oracle Text indexes any document or textual content to add fast, accurate retrieval of information. Oracle Text allows text searches to be combined with regular database searches in a single SQL statement. The ability to find documents based on their textual content, metadata, or attributes, makes the Oracle Database the single point of integration for all data management.
|
Oracle Text组件可以为文档(文本内容)创建索引,使用户能够快速、准确地获取所需的文档信息。Oracle Text组件可以将对文档的搜索与常规的数据库搜索融合到同一SQL语句中。Oracle数据库具备按照文档的文本内容、元数据、或文档属性来查询文档的功能,这使Oracle能够集成各种 类型数据的管理工作。 |
||||||||||||||||||||||||||||||||
325 |
The Oracle Text SQL API makes it simple and intuitive for application developers and DBAs to create and maintain Text indexes and run Text searches.
|
应用程序开发人员和DBA可以利用Oracle Text SQL API组件简单明了地创建和管理文档索引,并进行文档搜索。 |
||||||||||||||||||||||||||||||||
326 |
Oracle Ultra Search
|
1.2.6.4 Oracle Ultra Search |
||||||||||||||||||||||||||||||||
327 |
Oracle Ultra Search lets you index and search Web sites, database tables, files, mailing lists, Oracle Application Server Portals, and user-defined data sources. As such, you can use Oracle Ultra Search to build different kinds of search applications.
|
用户可以使用Oracle Ultra Search组件搜索Web站点、数据库表、文件、邮件列表、Oracle应用服务器门户及用户自定义的数据源。开发者可以利用Oracle Ultra Search组件创建各种搜索应用。 |
||||||||||||||||||||||||||||||||
328 |
Oracle interMedia
|
1.2.6.5 Oracle interMedia |
||||||||||||||||||||||||||||||||
329 |
Oracle interMedia provides an array of services to develop and deploy traditional, Web, and wireless applications that include image, audio, and video in an integrated fashion. Multimedia content can be stored and managed directly in Oracle, or Oracle can store and index metadata together with external references that enable efficient access to media content stored outside the database.
|
Oracle interMedia组件用于开发与部署运行在普通、Web或无线环境下的多媒体应用,她能够统一地管理图像、音频、视频等信息。Oracle数据库既可以直接存储、管理完整的多媒体内容,也可以只保存多媒体内容的元数据和外部引用信息,实现对储存于数据库外部的多媒体信息进行高效的访问。 |
||||||||||||||||||||||||||||||||
330 |
Oracle Spatial
|
1.2.6.6 Oracle Spatial |
||||||||||||||||||||||||||||||||
331 |
Oracle includes built-in spatial features that let you store, index, and manage location content (assets, buildings, roads, land parcels, sales regions, and so on.) and query location relationships using the power of the database. The Oracle Spatial Option adds advanced spatial features such as linear reference support and coordinate systems.
|
Oracle内置地理空间信息管理功能,使用户能够利用数据库存储、索引、管理位置信息(如地产、建筑、道路、地块、销售区域等信息),还可以查询地理空间的位置空间关系。Oracle Spatial组件还提供了高级地理空间信息管理功能,能够构建基准线系统(linear reference support)或坐标系统 (coordinate system)等复杂的地理空间应用。 |
||||||||||||||||||||||||||||||||
332 |
|
|
||||||||||||||||||||||||||||||||
333 |
Overview of Security Features |
1.2.7 安全特性概述 |
||||||||||||||||||||||||||||||||
334 |
Oracle includes security features that control how a database is accessed and used. For example, security mechanisms:
|
Oracle的安全特性用于控制对数据库的使用与访问。常见的安全机制有:
|
||||||||||||||||||||||||||||||||
335 |
Associated with each database user is a schema by the same name. By default, each database user creates and has access to all objects in the corresponding schema.
|
每个数据库用户都有一个同名的方案(schema)。默认情况下,每个数据库用户在其拥有的方案下创建、访问数据库对象。 |
||||||||||||||||||||||||||||||||
336 |
Database security can be classified into two categories: system security and data security.
|
数据库安全可以分为两类:系统安全(system security)和数据安全(data security)。 |
||||||||||||||||||||||||||||||||
337 |
System security includes the mechanisms that control the access and use of the database at the system level. For example, system security includes:
|
系统安全是指在系统级控制对数据库访问和使用的机制。举例来说,系统安全包括:
|
||||||||||||||||||||||||||||||||
338 |
System security mechanisms check whether a user is authorized to connect to the database, whether database auditing is active, and which system operations a user can perform.
|
系统安全机制可以检查:用户是否被授权连接数据库,对用户操作的监控是否被激活,用户可以执行那些系统操作等。 |
||||||||||||||||||||||||||||||||
339 |
Data security includes the mechanisms that control the access and use of the database at the schema object level. For example, data security includes:
|
数据安全是指在方案对象级控制对数据库访问和使用的机制。举例来说,数据安全包括:
|
||||||||||||||||||||||||||||||||
340 |
Security Mechanisms
|
1.2.7.1 安全机制 |
||||||||||||||||||||||||||||||||
341 |
The Oracle database provides discretionary access control, which is a means of restricting access to information based on privileges. The appropriate privilege must be assigned to a user in order for that user to access a schema object. Appropriately privileged users can grant other users privileges at their discretion.
|
Oracle采取授权式的访问控制,即基于权限来控制用户对数据的访问。用户需要访问方案对象时必具备相应的权限。一个用户在其权限范围内还可以给其他用户授权。 |
||||||||||||||||||||||||||||||||
342 |
Oracle manages database security using several different facilities:
|
Oracle使用以下方式管理数据库安全:
|
||||||||||||||||||||||||||||||||
343 |
|
|
||||||||||||||||||||||||||||||||
344 |
Overview of Data Integrity and Triggers |
1.2.8 数据完整性和触发器概述 |
||||||||||||||||||||||||||||||||
345 |
Data must adhere to certain business rules, as determined by the database administrator or application developer. For example, assume that a business rule says that no row in the inventory table can contain a numeric value greater than nine in the sale_discount column. If an INSERT or UPDATE statement attempts to violate this integrity rule, then Oracle must undo the invalid statement and return an error to the application. Oracle provides integrity constraints and database triggers to manage data integrity rules.
|
数据库中存储的数据必须遵守一定的业务规则,这个规则由DBA或应用程序开发者决定。例如,假设有一条业务规则要求 inventory 表的 sale_discount 字段数值不能超过9。如果一条 INSERT 或 UPDATE 语句的内容违背了这条完整性规则,Oracle必须撤销无效语句并给应用程序返回一个错误。Oracle使用完整性约束和数据库触发器来管理数据完整性规则。 |
||||||||||||||||||||||||||||||||
346 |
|
|
||||||||||||||||||||||||||||||||
347 |
Integrity Constraints
|
1.2.8.1 完整性约束 |
||||||||||||||||||||||||||||||||
348 |
An integrity constraint is a declarative way to define a business rule for a column of a table. An integrity constraint is a statement about table data that is always true and that follows these rules:
|
完整性约束是以声明的形式来定义完表内的各列数据的业务规则。完整性约束对表内的全部数据都有效,其规则如下:
|
||||||||||||||||||||||||||||||||
349 |
Integrity constraints are defined with a table and are stored as part of the table's definition in the data dictionary, so that all database applications adhere to the same set of rules. When a rule changes, it only needs be changed once at the database level and not many times for each application.
|
完整性约束的定义基于表,这个定义与表定义一起保存在数据字典中,因此所有基于数据库的应用程序都使用这套相同的规则。如果因为业务变化而导致规则改变,只需要在数据库层改变一次,而无需改动每个应用程序。 |
||||||||||||||||||||||||||||||||
350 |
The following integrity constraints are supported by Oracle:
|
Oracle支持以下完整性约束:
|
||||||||||||||||||||||||||||||||
351 |
Keys
|
1.2.8.2 键 |
||||||||||||||||||||||||||||||||
352 |
Key is used in the definitions of several types of
integrity constraints. A key is the column or set of columns included in the
definition of certain types of integrity constraints. Keys describe the
relationships between the different tables and columns of a relational
database. Individual values in a key are called key values. |
在多种完整性约束的定义中都使用了键(key)这个概念。键是一个完整性定义中的列或列的集合。键描述了关系型数据库里不同数据表 中的多个数据列或同一表中的多个数据列之间的关系。键中的每个值被称为键值(key values)。 |
||||||||||||||||||||||||||||||||
353 |
The different types of keys include:
|
Oracle中有以下几种类型的键:
|
||||||||||||||||||||||||||||||||
354 |
|
|
||||||||||||||||||||||||||||||||
355 |
Triggers
|
1.2.8.3 触发器 |
||||||||||||||||||||||||||||||||
356 |
Triggers are procedures written in PL/SQL, Java, or C that run (fire) implicitly whenever a table or view is modified or when some user actions or database system actions occur.
|
触发器是由 PL/SQL,java 或 C 编写的过程,当表或视图被修改,或数据库中发生了用户操作、系统操作时,触发器将被隐式地调用。 |
||||||||||||||||||||||||||||||||
357 |
Triggers supplement the standard capabilities of Oracle to provide a highly customized database management system. For example, a trigger can restrict DML operations against a table to those issued during regular business hours.
|
作为Oracle自身功能的补充,用户可以使用触发器在数据库管理系统中实现自定义的功能。例如,可以定义一个触发器限制在工作时间执行某些DML操作。 |
||||||||||||||||||||||||||||||||
358 |
|
|
||||||||||||||||||||||||||||||||
359 |
Overview of Information Integration Features |
1.2.9 信息集成特性概述 |
||||||||||||||||||||||||||||||||
360 |
A distributed environment is a network of disparate systems that seamlessly communicate with each other. Each system in the distributed environment is called a node. The system to which a user is directly connected is called the local system. Any additional systems accessed by this user are called remote systems. A distributed environment allows applications to access and exchange data from the local and remote systems. All the data can be simultaneously accessed and modified.
|
分布式环境(distributed environment)指在网络中物理分散,但能实现无缝通信的系统的集合。分布式环境中的每一个系统被称为一个节点(node)。用户直接连接的系统被称为本地系统(local system),用户通过本地系统访问的其他系统被称为远程系统(remote system)。在分布式环境中,应用程序可以与本地或远程系统交换数据。这些数据可以被同时访问或修改。 |
||||||||||||||||||||||||||||||||
361 |
Distributed SQL
|
1.2.9.1 分布式SQL |
||||||||||||||||||||||||||||||||
362 |
A homogeneous distributed database system is a network of two or more Oracle databases that reside on one or more computers. Distributed SQL enables applications and users to simultaneously access or modify the data in several databases as easily as they access or modify a single database.
|
同构分布式数据库系统(homogeneous distributed database system)是由两个或多个Oracle数据库构成的网络,这个系统可以位于一台或多台计算机上。用户和应用程序可以使用分布式 SQL 同时地访问或修改多个数据库中的数据,就如同修改单一数据库一样便捷。 |
||||||||||||||||||||||||||||||||
363 |
An Oracle distributed database system can be transparent to users, making it appear as though it is a single Oracle database. Companies can use this distributed SQL feature to make all its Oracle databases look like one and thus reduce some of the complexity of the distributed system.
|
Oracle分布式数据库系统对用户是透明的,用户就像在操作单个Oracle数据库。企业可以利用分布式 SQL 特性将其所拥有的多个Oracle数据库整合为一个整体,以减少分布式系统的用户复杂性。 |
||||||||||||||||||||||||||||||||
364 |
Oracle uses database links to enable users on one database to access objects in a remote database. A local user can access a link to a remote database without having to be a user on the remote database.
|
Oracle使用数据库链接(database link)来使一个数据库的用户可以访问远程数据库中的对象。本地用户可以通过数据库链接访问远程数据库,而不需要成为远程数据库的用户。 |
||||||||||||||||||||||||||||||||
365 |
Location Transparency |
位置透明性 |
||||||||||||||||||||||||||||||||
366 |
Location transparency occurs when the physical location of data is transparent to the applications and users. For example, a view that joins table data from several databases provides location transparency because the user of the view does not need to know from where the data originates.
|
数据的物理位置对应用程序或用户透明被称为位置透明性(location transparency)。例如,创建一个视图来展现来自多个数据库中的数据表的关联查询,这个视图就为用户提供了位置透明性,因为这个视图的用户并不知道数据的原始位置在哪里。 |
||||||||||||||||||||||||||||||||
367 |
SQL and Transaction Transparency |
SQL和事务透明性 |
||||||||||||||||||||||||||||||||
368 |
Oracle's provides query, update, and transaction transparency. For example, standard SQL statements like SELECT, INSERT, UPDATE, and DELETE work just as they do in a non-distributed database environment. Additionally, applications control transactions using the standard SQL statements COMMIT, SAVEPOINT, and ROLLBACK. Oracle ensures the integrity of data in a distributed transaction using the two-phase commit mechanism.
|
Oracle支持查询(query),更新(update)和事务(transaction)透明性。例如,在分布式环境中 SELECT,INSERT,UPDATE 和 DELETE 之类的操作与非分布式环境相同。对事务的控制也使用 COMMIT,SAVEPOINT 和 ROLLBACK 等标准的 SQL。Oracle使用两步提交机制(two-phase commit mechanism)来保证分布式事务中的数据完整性。 |
||||||||||||||||||||||||||||||||
369 |
Distributed Query Optimization |
分布式查询优化 |
||||||||||||||||||||||||||||||||
370 |
Distributed query optimization reduces the amount of data transfer required between sites when a transaction retrieves data from remote tables referenced in a distributed SQL statement.
|
如果一个事务中的分布式 SQL 语句需要从远程数据表获取数据,可以使用分布式查询优化(distributed query optimization)来减少节点间的数据传输量。 |
||||||||||||||||||||||||||||||||
371 |
Oracle Streams
|
1.2.9.2 Oracle数据流 |
||||||||||||||||||||||||||||||||
372 |
Oracle Streams enables the propagation and management of
data, transactions, and events in a data stream either within a database, or
from one database to another. The stream routes published information to
subscribed destinations. As users' needs change, they can simply implement a
new capability of Oracle Streams, without sacrificing existing capabilities. |
Oracle 数据流(Oracle Streams)可以在一个数据库内或多个数据库间以数据流的形式传播(propagation )数据、事务和事件,并对这些过程进行管理。数据流可以将发布者提供的信息传送到订阅者手中。当用户需求改变时,可以订制新的数据流,对已存在的数据流没有影响。 |
||||||||||||||||||||||||||||||||
373 |
Oracle Streams provides a set of elements that lets users control what information is put into a stream, how the stream flows or is routed from node to node, what happens to events in the stream as they flow into each node, and how the stream terminates. By specifying the configuration of the elements acting on the stream, a user can address specific requirements, such as message queuing or data replication.
|
Oracle 数据流包含一套组件,用户可以控制数据流动的全过程,例如数据流中传递什么信息,信息在节点间如何流动,数据流中的事件到达每个节点该如何处理,数据流如何结束。通过配置控制数据流的组件,用户可以 实现特定的应用需求,例如消息队列或数据复制。 |
||||||||||||||||||||||||||||||||
374 |
Capture |
捕获 |
||||||||||||||||||||||||||||||||
375 |
Oracle Streams implicitly and explicitly captures events and places them in the staging area. Database events, such as DML and DDL, are implicitly captured by mining the redo log files. Sophisticated subscription rules can determine what events should be captured.
|
Oracle 数据流能够隐式或显式地捕获数据库中的事件并放入中转区(staging area)。DML、DDL之类的数据库事件可以通过分析重做日志文件(redo log file)被隐式地捕获。用户可以定义精细的订阅规则(subscription rule)来决定捕获何种事件。 |
||||||||||||||||||||||||||||||||
376 |
Staging |
中转 |
||||||||||||||||||||||||||||||||
377 |
The staging area is a queue that provides a service to
store and manage captured events. Changes to database tables are formatted
as logical change records (LCR), and stored in a staging area until
subscribers consume them. LCR staging provides a holding area with security,
as well as auditing and tracking of LCR data. |
中转区是一个存储、管理被捕获事件的队列。对数据库表数据的修改被格式化为逻辑变化记录(logical change records,LCR)存储在中转区,直到订阅者使用这些记录。数据库利用 LCR 中转区对其中的 LCR 数据进行安全性检查(security),使用情况监控(auditing),以及数据流动的跟踪(tracking)。 |
||||||||||||||||||||||||||||||||
378 |
Consumption |
使用 |
||||||||||||||||||||||||||||||||
379 |
Messages in a staging area are consumed by the apply
engine, where changes are applied to a database or consumed by an
application. A flexible apply engine allows use of a standard or custom
apply function. Support for explicit dequeue lets application developers use
Oracle Streams to reliably exchange messages. They can also notify
applications of changes to data, by still leveraging the change capture and
propagation features of Oracle Streams. |
中转区中的消息由应用引擎(apply engine)使用,引擎可以将数据变化应用到目标数据库或提交给应用程序。这个灵活的应用引擎可以执行标准或自定义的应用操作(apply function)。Oracle 数据流支持显式出队(explicit dequeue)功能,开发者可以利用这个功能开发可靠的消息交换应用。开发者也可以利用Oracle 数据流能够捕获、传播数据变化的特性,将数据变化通知其他应用程序。 |
||||||||||||||||||||||||||||||||
380 |
Message Queuing |
消息队列 |
||||||||||||||||||||||||||||||||
381 |
Oracle Streams Advanced Queuing is built on top of the
flexible Oracle Streams infrastructure. It provides a unified framework for
processing events. Events generated in applications, in workflow, or
implicitly captured from redo logs or database triggers can be captured in a
queue. These events can be consumed in a variety of ways. They can be
automatically applied with a user-defined function or database table
operation, can be explicitly dequeued, or a notification can be sent to the
consuming application. These events can be transformed at any stage. If the
consuming application is on a different database, then the events are
automatically propagated to the appropriate database. Operations on these
events can be automatically audited, and the history can be retained for the
user-specified duration. |
Oracle 数据流高级队列(Oracle Streams Advanced Queuing)构建于Oracle 数据流(Oracle Streams)之上。她为事件处理提供了一个统一的框架。由应用程序、工作流产生的事件,或者隐式地从重做日志、数据库触发器中捕获的事件,都可以保存在队列中。这些事件可以以不同方式使用。她们可以用于自动调用数据库标准的表操作或用户定义的过程,也可以显式地出队,或者向应用程序发送通知。These events can be transformed at any stage.如果订阅事件的应用运行在与事件产生位置不同的数据库上,事件能被自动地传播到相应的数据库中。对这些事件的操作可以被自动监控,监控历史信息的保存时间可以由用户指定。
|
||||||||||||||||||||||||||||||||
382 |
Data Replication |
数据复制 |
||||||||||||||||||||||||||||||||
383 |
Replication is the maintenance of database objects in two
or more databases. Oracle Streams provides powerful replication features
that can be used to keep multiple copies of distributed objects
synchronized. |
复制是指在两个或多个数据库间维护数据库对象的一致性。Oracle 数据流提供了强大的数据复制功能,可以用于分布式环境中数据库对象与其副本之间的同步。 |
||||||||||||||||||||||||||||||||
384 |
Oracle Streams automatically determines what information
is relevant and shares that information with those who need it. This active
sharing of information includes capturing and managing events in the
database including data changes with DML and propagating those events to
other databases and applications. Data changes can be applied directly to
the replica database, or can call a user-defined procedure to perform
alternative work at the destination database, for example, populate a
staging table used to load a data warehouse. |
Oracle 数据流能够自动判断哪些数据需要同步,并将需要同步的数据共享给所有副本。这个共享的工作分为以下步骤,首先需要捕获、管理数据库中发生的事件(如DML操作导致的数据变化),再将这些事件传播到其他数据库或应用程序。数据变化可以被直接应用到副本数据库中,也可以在目标数据库上调用自定义的过程执行其他任务,例如,将数据加载到一个中转表中用于构建数据仓库。 |
||||||||||||||||||||||||||||||||
385 |
Oracle Streams is an open information sharing solution,
supporting heterogeneous replication between Oracle and non-Oracle systems.
Using a transparent gateway, DML changes initiated at Oracle databases can
be applied to non-Oracle platforms. |
Oracle 数据流是一个开放的信息共享解决方案,支持在Oracle和非Oracle数据库之间的异构数据复制。使用透明网关(transparent gateway),在Oracle数据库中进行的DML操作可以被应用到非Oracle数据平台上。 |
||||||||||||||||||||||||||||||||
386 |
Oracle Streams is fully inter-operational with
materialized views, or snapshots, which can maintain updatable or read-only,
point-in-time copies of data. They can contain a full copy of a table or a
defined subset of the rows in the master table that satisfy a value-based
selection criterion. There can be multitier materialized views as well,
where one materialized view is a subset of another materialized view.
Materialized views are periodically updated, or refreshed, from their
associated master tables through transactionally consistent batch updates. |
Oracle 数据流和物化视图(或称为snapshot)之间可以相互操作,用户可以利用这一特性管理一个只读或可更新的实时的数据副本。这个数据复制过程既可以复制整个表,也可以依据查询条件复制主表(master table)中的部分数据行。用户还可以使用多层物化视图,即基于物化视图的物化视图。物化视图可以以事物完整性(transactionally consistent batch updates)的方式,从她的主表中周期性的获得更新数据。 |
||||||||||||||||||||||||||||||||
387 |
Oracle Transparent Gateways and Generic Connectivity
|
1.2.9.3 Oracle 透明网关和通用连接 |
||||||||||||||||||||||||||||||||
388 |
Oracle Transparent Gateways and Generic Connectivity extend Oracle distributed features to non-Oracle systems. Oracle can work with non-Oracle data sources, non-Oracle message queuing systems, and non-SQL applications, ensuring interoperability with other vendor's products and technologies.
|
Oracle 透明网关(Oracle Transparent Gateway)和通用连接(eneric Connectivity)将Oracle数据库的分布式特性扩展到了非Oracle系统中。Oracle数据库可以和非Oracle数据源,非Oracle消息队列系统及非Oracle应用程序协同工作,保证了Oracle产品与其他厂商产品与技术的互操作性。 |
||||||||||||||||||||||||||||||||
389 |
They translate third party SQL dialects, data dictionaries, and datatypes into Oracle formats, thus making the non-Oracle data store appear as a remote Oracle database. These technologies enable companies to seamlessly integrate the different systems and provide a consolidated view of the company as a whole.
|
Oracle 透明网关和通用连接能将第三方产品的特殊SQL语法,数据字典及数据类型转换成Oracle格式,使非Oracle数据源变为一个远程Oracle数据库。企业可以利于这个技术将不同数据平台的系统无缝集成,形成一个覆盖全企业的统一的视角。 |
||||||||||||||||||||||||||||||||
390 |
Oracle Transparent Gateways and Generic Connectivity can be used for synchronous access, using distributed SQL, and for asynchronous access, using Oracle Streams. Introducing a Transparent Gateway into an Oracle Streams environment enables replication of data from an Oracle database to a non-Oracle database.
|
分布式SQL可以利用Oracle 透明网关和通用连接实现同步的数据访问,而Oracle 数据流可以利用她实现异步的数据访问。在Oracle 数据流使用透明网关,就可以将Oracle数据库中的数据复制到非Oracle系统中。 |
||||||||||||||||||||||||||||||||
391 |
Generic Connectivity is a generic solution, while Oracle Transparent Gateways are tailored solutions, specifically coded for the non-Oracle system.
|
Oracle 透明网关针对不同非Oracle系统开发了专用的程序,而通用连接则使用公共方法连接不同的数据源。 |
||||||||||||||||||||||||||||||||
392 |
|
|
||||||||||||||||||||||||||||||||
393 |
Oracle Database Application Development |
1.3 Oracle数据库应用开发 |
||||||||||||||||||||||||||||||||
394 |
SQL and PL/SQL form the core of Oracle's application development stack. Not only do most enterprise back-ends run SQL, but Web applications accessing databases do so using SQL (wrappered by Java classes as JDBC), Enterprise Application Integration applications generate XML from SQL queries, and content-repositories are built on top of SQL tables. It is a simple, widely understood, unified data model. It is used standalone in many applications, but it is also invoked directly from Java (JDBC), Oracle Call Interface (OCI), Oracle C++ Call Interface (OCCI), or XSU (XML SQL Utility). Stored packages, procedures, and triggers can all be written in PL/SQL or in Java.
|
SQL和PL/SQL是Oracle应用开发的核心组件。在企业中,除了后台程序会运行SQL语句之外,Web应用程序通过SQL访问数据库(SQL通常由JDBC封装为Java类),企业应用集成(Enterprise Application Integration,EAI)程序通过SQL查询生成XML,非结构化内容资料库也构建于SQL数据表之上。SQL是一个简单、统一、并被广泛认可的数据模型。SQL既可以在应用程序中直接使用,也能由Java (JDBC), Oracle Call Interface (OCI), Oracle C++ Call Interface (OCCI), or XSU (XML SQL Utility)等编程接口调用。存储过程、包、触发器可以用PL/SQL或Java实现。 |
||||||||||||||||||||||||||||||||
395 |
This section contains the following topics:
|
本节包括以下主题:
|
||||||||||||||||||||||||||||||||
396 |
Overview of Oracle SQL |
1.3.1 Oracle SQL 概述 |
||||||||||||||||||||||||||||||||
397 |
SQL (pronounced SEQUEL) is the programming language that defines and manipulates the database. SQL databases are relational databases, which means that data is stored in a set of simple relations.
|
SQL(发音为SEQUEL)是一种定义和操作数据库的编程语言。SQL数据库是一种关系数据库,数据以关系的形式存储于其中。 |
||||||||||||||||||||||||||||||||
398 |
SQL Statements
|
1.3.1.1 SQL 语句 |
||||||||||||||||||||||||||||||||
399 |
All operations on the information in an Oracle database are performed using SQL statements. A SQL statement is a string of SQL text. A statement must be the equivalent of a complete SQL sentence, as in:
|
对Oracle数据库的所有操作是通过SQL语句实现的。SQL语句是一个满足SQL规则的文本字符串。一个SQL语句必需表达一段完整的SQL语法,例如: |
||||||||||||||||||||||||||||||||
400 |
|
|
||||||||||||||||||||||||||||||||
401 |
Only a complete SQL statement can run successfully. A sentence fragment, such as the following, generates an error indicating that more text is required:
|
只有一个完整的SQL语句才能被成功执行。执行以下例子中的SQL语句片断,将会产生错误,要求用户提供更多语句内容。 |
||||||||||||||||||||||||||||||||
402 |
|
|
||||||||||||||||||||||||||||||||
403 |
A SQL statement can be thought of as a very simple, but powerful, computer program or instruction. SQL statements are divided into the following categories:
|
SQL 语句可以被看作一种简单但是非常强大的计算机语言(或指令)。SQL 语句被分为以下几类:
|
||||||||||||||||||||||||||||||||
404 |
Data Definition Language (DDL) Statements |
数据定义语句 |
||||||||||||||||||||||||||||||||
405 |
These statements create, alter, maintain, and drop schema objects. DDL statements also include statements that permit a user to grant other users the privileges to access the database and specific objects within the database.
|
数据定义语句(Data Definition Language,DDL)用于创建、修改、维护、删除方案对象。DDL中还包括赋予用户访问数据库对象权限的语句。 |
||||||||||||||||||||||||||||||||
406 |
Data Manipulation Language (DML) Statements |
数据操作语句 |
||||||||||||||||||||||||||||||||
407 |
These statements manipulate data. For example, querying, inserting, updating, and deleting rows of a table are all DML operations. The most common SQL statement is the SELECT statement, which retrieves data from the database. Locking a table or view and examining the execution plan of a SQL statement are also DML operations.
|
数据操作语句(Data Manipulation Language,DML)用于操作数据。例如对表进行查询、插入、修改、删除均为DML操作。用户最常用的SQL语句为 SELECT 语句,其作用是从数据库中获取数据。对表或视图加锁、检查SQL语句的执行计划都属于DML操作。 |
||||||||||||||||||||||||||||||||
408 |
Transaction Control Statements |
事务控制语句 |
||||||||||||||||||||||||||||||||
409 |
These statements manage the changes made by DML statements. They enable a user to group changes into logical transactions. Examples include COMMIT, ROLLBACK, and SAVEPOINT.
|
事务控制语句(Transaction Control Statements)用于管理DML语句引起的数据变化。用户可以将数据变化分组成为逻辑事务(logical transactions)。常用的事务控制语句包括COMMIT,ROLLBACK,和 SAVEPOINT. |
||||||||||||||||||||||||||||||||
410 |
Session Control Statements |
会话控制语句 |
||||||||||||||||||||||||||||||||
411 |
These statements let a user control the properties of the current session, including enabling and disabling roles and changing language settings. The two session control statements are ALTER SESSION and SET ROLE.
|
会话控制语句(Session Control Statements)用于控制当前会话的属性,例如使一个角色(role)有效或失效,或改变会话的语言设置。只有两个会话控制语句,分别是 ALTER SESSION 和 SET ROLE。 |
||||||||||||||||||||||||||||||||
412 |
System Control Statements |
系统控制语句 |
||||||||||||||||||||||||||||||||
413 |
These statements change the properties of the Oracle database instance. The only system control statement is ALTER SYSTEM. It lets users change settings, such as the minimum number of shared servers, kill a session, and perform other tasks.
|
系统控制语句(System Control Statements)用于改变Oracle数据库实例的属性。系统控制语句只有一个,就是 ALTER SYSTEM 。用户使用她可以改变实例的设置(如最小共享服务器数),结束会话,以及其他系统任务。 |
||||||||||||||||||||||||||||||||
414 |
Embedded SQL Statements |
嵌入式 SQL 语句 |
||||||||||||||||||||||||||||||||
415 |
These statements incorporate DDL, DML, and transaction control statements in a procedural language program, such as those used with the Oracle precompilers. Examples include OPEN, CLOSE, FETCH, and EXECUTE.
|
嵌入式 SQL 语句(Embedded SQL Statements)将DDL、DML语句嵌入存储过程中,并被Oracle编译后存储。嵌入式 SQL 语句包括 OPEN,CLOSE,FETCH,和 EXECUTE。 |
||||||||||||||||||||||||||||||||
416 |
|
|
||||||||||||||||||||||||||||||||
417 |
Overview of PL/SQL |
1.3.2 PL/SQL 概述 |
||||||||||||||||||||||||||||||||
418 |
PL/SQL is Oracle's procedural language extension to SQL. PL/SQL combines the ease and flexibility of SQL with the procedural functionality of a structured programming language, such as IF ... THEN, WHILE, and LOOP.
|
PL/SQL是Oracle在SQL基础上扩展的一种过程语言。PL/SQL既具备SQL语言的灵活性易用性,又具备结构化编程语言的过程控制能力(如IF ... THEN,WHILE 和 LOOP)。 |
||||||||||||||||||||||||||||||||
419 |
When designing a database application, consider the following advantages of using stored PL/SQL:
|
在设计应用程序时,可以考虑利用PL/SQL的以下优势:
|
||||||||||||||||||||||||||||||||
420 |
The following sections describe the PL/SQL program units that can be defined and stored centrally in a database.
|
以下各节讲解在数据库中定义并集中存储的各种PL/SQL程序结构。 |
||||||||||||||||||||||||||||||||
421 |
PL/SQL Program Units
|
1.3.2.1 PL/SQL 程序结构 |
||||||||||||||||||||||||||||||||
422 |
Program units are stored procedures, functions, packages, triggers, and autonomous transactions.
|
PL/SQL 程序结构包括存储过程(stored procedure),函数(function),包(package),触发器(trigger),自治事务(autonomous transaction)。 |
||||||||||||||||||||||||||||||||
423 |
Procedures and functions are sets of SQL and PL/SQL statements grouped together as a unit to solve a specific problem or to perform a set of related tasks. They are created and stored in compiled form in the database and can be run by a user or a database application.
|
过程(procedure)和函数(function)是一组SQL和PL/SQL语句的集合,用于解决特定问题或执行一系列相关的操作。她们被创建之后以编译 结果的形式存储在数据库中,可以由用户或数据库应用调用。 |
||||||||||||||||||||||||||||||||
424 |
Procedures and functions are identical, except that functions always return a single value to the user. Procedures do not return values.
|
过程和函数基本相同,除了函数可以给调用者一个返回值,而过程没有返回值。 |
||||||||||||||||||||||||||||||||
425 |
Packages encapsulate and store related procedures, functions, variables, and other constructs together as a unit in the database. They offer increased functionality (for example, global package variables can be declared and used by any procedure in the package). They also improve performance (for example, all objects of the package are parsed, compiled, and loaded into memory once).
|
包(package)可以将相关的过程,函数,变量,及其他数据结构包装为一个整体存储在数据库中。包加强了PL/SQL的功能(例如,在包中声明了全局变量后,可以被包内的任何过程使用)。包也能提高性能(例如,包内的所有对象可以被一起解析、编译,在使用时一次全部加载到内存中)。 |
||||||||||||||||||||||||||||||||
426 |
|
|
||||||||||||||||||||||||||||||||
427 |
Overview of Java |
1.3.3 Java 概述 |
||||||||||||||||||||||||||||||||
428 |
Java is an object-oriented programming language efficient for application-level programs. Oracle provides all types of JDBC drivers and enhances database access from Java applications. Java Stored Procedures are portable and secure in terms of access control, and allow non-Java and legacy applications to transparently invoke Java.
|
Java是一种面向对象的编程语言,能够高效地开发应用级程序(application-level program)。Oracle提供了各类JDBC驱动程序并加强了Java应用程序对数据库的访问能力。Oracle中的Java存储过程(Java Stored Procedure)具备可移植性,在访问控制方面的安全性,并允许非Java应用和其他大型机系统(legacy applications)透明地调用Java。 |
||||||||||||||||||||||||||||||||
429 |
|
|
||||||||||||||||||||||||||||||||
430 |
Overview of Application Programming Languages (APIs) |
1.3.4 API 概述 |
||||||||||||||||||||||||||||||||
431 |
Oracle Database developers have a choice of languages for developing applications—C, C++, Java, COBOL, PL/SQL, and Visual Basic. The entire functionality of the database is available in all the languages. All language-specific standards are supported. Developers can choose the languages in which they are most proficient or one that is most suitable for a specific task. For example an application might use Java on the server side to create dynamic Web pages, PL/SQL to implement stored procedures in the database, and C++ to implement computationally intensive logic in the middle tier.
|
Oracle数据库的开发者可以使用C,C++,Java,COBOL,PL/SQL 及 Visual Basic 等多种编程语言进行开发。数据库所提供的全部功能都可以通过这些语言调用。Oracle对每种语言标准都提供支持。开发者可以选择最熟悉或最适合特定任务的语言进行开发。例如一个应用系统中,在服务端可以使用Java生成动态的Web页面,在数据库中利用PL/SQL实现存储过程,在中间层用C++实现计算强度大的业务逻辑。 |
||||||||||||||||||||||||||||||||
432 |
The Oracle Call Interface (OCI) is a C data access API for Oracle Database. It supports the entire Oracle Database feature set. Many data access APIs, such as OCCI, ODBC, Oracle JDBC Type2 drivers, and so on, are built on top of OCI. OCI provides powerful functionality to build high performance, secure, scalable, and fault-tolerant applications. OCI is also used within the server for the data access needs of database kernel components, along with distributed database access. OCI lets an application developer use C function calls to access the Oracle data server and control all phases of business logic execution. OCI is exposed as a library of standard database access and retrieval functions in the form of a dynamic runtime library that can be linked in by the application.
|
Oracle调用接口(Oracle Call Interface,OCI)是用C语言实现的Oracle数据库数据访问API。她全面地支持Oracle数据库的特性。诸如OCCI,ODBC,Oracle JDBC Type2驱动之类的其他很多数据访问API都是基于OCI开发的。OCI具备强大的功能来建立高效、安全、可扩展、可容错的应用程序。在Oracle服务器上,OCI也被用于实现数据库核心组件的数据访问 功能,及分布式的数据库访问能力。应用程序开发者利用OCI,可以以C语言函数调用的形式访问数据库,并控制业务逻辑执行的每个步骤。OCI是一个标准的数据库控制与数据访问函数库,她以动态运行时库 (dynamic runtime library)的形式提供,开发者可以将她链接(link)到应用程序中。 |
||||||||||||||||||||||||||||||||
433 |
The Oracle C++ Call Interface (OCCI) is a C++ API that lets you use the object-oriented features, native classes, and methods of the C++ programing language to access the Oracle database. The OCCI interface is modeled on the JDBC interface. OCCI is built on top of OCI and provides the power and performance of OCI using an object-oriented paradigm.
|
Oracle C++ 调用接口(Oracle C++ Call Interface,OCCI)是一个以C++实现的API,开发者可以利用面向对象编程方法,使用以C++语言实现的内置类和方法访问Oracle数据库。OCCI的模型基于JDBC,而OCCI的代码基于OCI,OCCI在提供了面向对象开发能力的同时还继承了OCI的功能与效率。 |
||||||||||||||||||||||||||||||||
434 |
Open database connectivity (ODBC), is a database access API that lets you connect to a database and then prepare and run SQL statements against the database. In conjunction with an ODBC driver, an application can access any data source including data stored in spreadsheets, like Excel.
|
开放数据库连接(ODBC)是一种数据库访问API,用户可以使用她连接数据库,在数据库上准备并运行SQL语句。应用程序结合了ODBC驱动后,可以访问任何数据源,包括存储在如Excle的电子表格之内的数据。 |
||||||||||||||||||||||||||||||||
435 |
Oracle offers a variety of data access methods from COM-based programming languages, such as Visual Basic and Active Server Pages. These include Oracle Objects for OLE (OO40) and the Oracle Provider for OLE DB. Oracle also provides .NET data access support through the Oracle Data Provider for .NET. Oracle also support OLE DB .NET and ODBC .NET.
|
Oracle提供了数种源于Visual Basic 或 Active Server Pages等COM编程语言的数据访问方式。主要有Oracle Objects for OLE (OO4O)和Oracle Provider for OLE DB。Oracle还通过Oracle Data Provider for .NET提供了.NET数据访问支持。Oracle 还支持 OLE DB .NET 和 ODBC .NET。 |
||||||||||||||||||||||||||||||||
436 |
Oracle also provides the Pro* series of precompilers, which allow you to embed SQL and PL/SQL in your C, C++, or COBOL applications.
|
Oracle还提供了Pro*系列预编译器,使开发者可以将SQL和PL/SQL嵌入C,C++ 或 COBOL 应用程序中。 |
||||||||||||||||||||||||||||||||
437 |
|
|
||||||||||||||||||||||||||||||||
438 |
Overview of Transactions |
1.3.5 事务概述 |
||||||||||||||||||||||||||||||||
439 |
A transaction is a logical unit of work that comprises one or more SQL statements run by a single user. According to the ANSI/ISO SQL standard, with which Oracle is compatible, a transaction begins with the user's first executable SQL statement. A transaction ends when it is explicitly committed or rolled back by that user.
|
事务是一段逻辑完整的数据处理工作,她由一个用户提交的一个或多个SQL语句构成。根据Oracle兼容的 ANSI/ISO SQL 标准的规定,一个事务从用户提交的第一个可执行的SQL开始,当用户显式地提交(commit)或回滚(roll back)时结束。 |
||||||||||||||||||||||||||||||||
440 |
|
|
||||||||||||||||||||||||||||||||
441 |
Transactions let users guarantee consistent changes to data, as long as the SQL statements within a transaction are grouped logically. A transaction should consist of all of the necessary parts for one logical unit of work—no more and no less. Data in all referenced tables are in a consistent state before the transaction begins and after it ends. Transactions should consist of only the SQL statements that make one consistent change to the data.
|
因为事务内的SQL语句表达了一个完整的逻辑含义,用户可以通过事务来保证操作数据时的数据完整性。一个事务应该由组成一个完整的逻辑操作所需的所有步骤构成--不能多也不能少。所有相关表中的数据在事务开始前与结束后都处于满足完整性的状态。事务中只应该包括满足数据完整性的一组SQL语句。 |
||||||||||||||||||||||||||||||||
442 |
Consider a banking database. When a bank customer transfers money from a savings account to a checking account, the transaction can consist of three separate operations: decrease the savings account, increase the checking account, and record the transaction in the transaction journal.
|
以一个银行数据库为例。当一个客户将一笔银行存款从储蓄账户转移到支票账户时,处理此业务的事务应该包含三个独立的操作:从储蓄账户中扣除资金,将资金增加到支票帐户中,在交易记录中保存此次交易。 |
||||||||||||||||||||||||||||||||
443 |
The transfer of funds (the transaction) includes increasing one account (one SQL statement), decreasing another account (one SQL statement), and recording the transaction in the journal (one SQL statement). All actions should either fail or succeed together; the credit should not be committed without the debit. Other nonrelated actions, such as a new deposit to one account, should not be included in the transfer of funds transaction. Such statements should be in other transactions.
|
转移资金的业务(事务)包括增加一个账户的资金(一个SQL语句),减少另一个账户的资金(一个SQL语句),及在日志中记录此业务(一个SQL语句)。这三个操作应该同时成功或同时撤销。如果没有记录取款就不能记录存款。其他不相关的操作(如在一个账户中存入新的资金)不应被包括在转移资金的事务中。 处理不相关操作的语句应该放在其他事务中。 |
||||||||||||||||||||||||||||||||
444 |
Oracle must guarantee that all three SQL statements are performed to maintain the accounts in proper balance. When something prevents one of the statements in the transaction from running (such as a hardware failure), then the other statements of the transaction must be undone. This is called rolling back. If an error occurs in making any of the updates, then no updates are made.
|
Oracle必须保证上述三个SQL语句一起成功的执行,以保证帐户的平衡。如果某种原因导致事务中的一个语句不能被执行的话(例如出现硬件故障),那么事务中的其他语句的操作必须撤销。这被称为回滚,即事务中任何对数据的更新失败,那么其中所有的数据更新都要撤销。 |
||||||||||||||||||||||||||||||||
445 |
|
|
||||||||||||||||||||||||||||||||
446 |
Commit and Undo Transactions
|
1.3.5.1 提交、撤销事务 |
||||||||||||||||||||||||||||||||
447 |
The changes made by the SQL statements that constitute a transaction can be either committed or rolled back. After a transaction is committed or rolled back, the next transaction begins with the next SQL statement.
|
组成事务的SQL语句对数据的操作既可以被提交,也可以被回滚。当一个事务被提交或回滚后,下一个执行的SQL语句就开始了一个新的事务。 |
||||||||||||||||||||||||||||||||
448 |
To commit a transaction makes permanent the changes resulting from all DML statements in the transaction. The changes made by the SQL statements of a transaction become visible to any other user's statements whose execution starts after the transaction is committed.
|
提交一个事务意味着此事务中的DML操作对数据的更改将被永久保存。其他用户在事务提交后执行的查询将能看到此事务中的SQL语句对数据的更改。 |
||||||||||||||||||||||||||||||||
449 |
To undo a transaction retracts any of the changes resulting from the SQL statements in the transaction. After a transaction is rolled back, the affected data is left unchanged, as if the SQL statements in the transaction were never run.
|
撤销事务将恢复事务中SQL语句对数据的改变。当事务回滚后,在事务中修改的数据并不保存,就如同事务中的SQL语句并没有被执行一样。 |
||||||||||||||||||||||||||||||||
450 |
Savepoints
|
1.3.5.2 保存点 |
||||||||||||||||||||||||||||||||
451 |
Savepoints divide a long transaction with many SQL statements into smaller parts. With savepoints, you can arbitrarily mark your work at any point within a long transaction. This gives you the option of later rolling back all work performed from the current point in the transaction to a declared savepoint within the transaction.
|
保存点(savepoint)将一个由多句SQL构成的大事务拆分为小段。用户可以使用保存点在一个大事务的操作中任意地做标记。使用保存点做标记后,用户可以从事务中的当前步骤回滚到事务中的任意一个保存点。 |
||||||||||||||||||||||||||||||||
452 |
|
|
||||||||||||||||||||||||||||||||
453 |
Overview of Datatypes |
1.3.6 数据类型概述 |
||||||||||||||||||||||||||||||||
454 |
Each column value and constant in a SQL statement has a datatype, which is associated with a specific storage format, constraints, and a valid range of values. When you create a table, you must specify a datatype for each of its columns.
|
SQL语句中的每个字段值和常量都有一个数据类型,表明了数据的存储格式,内容规范和有效值范围。用户创建表时,必须制定每列的数据类型。 |
||||||||||||||||||||||||||||||||
455 |
Oracle provides the following built-in datatypes:
|
Oracle提供了以下内置的数据类型:
|
||||||||||||||||||||||||||||||||
456 |
New object types can be created from any built-in database types or any previously created object types, object references, and collection types. Metadata for user-defined types is stored in a schema available to SQL, PL/SQL, Java, and other published interfaces.
|
创建新的对象类型可以基于Oracle的内置数据类型,或已有的对象类型(object type)、对象引用(object reference)或集合类型 (collection type)。用户定义的数据类型存储在用户方案中,并可以通过SQL,PL/SQL,Java及其他接口访问。 |
||||||||||||||||||||||||||||||||
457 |
An object type differs from native SQL datatypes in that it is user-defined, and it specifies both the underlying persistent data (attributes) and the related behaviors (methods). Object types are abstractions of the real-world entities, for example, purchase orders.
|
对象类型与数据库内置类型的区别在于对象类型是由用户自定义的,此外对象类型还设定了对象中要保存的数据(属性(attribute))及对对象的行为(方法 (method))。对象类型是对现实世界实体的抽象(例如一个订单可以抽象为一个对象类型)。 |
||||||||||||||||||||||||||||||||
458 |
Object types and related object-oriented features, such as variable-length arrays and nested tables, provide higher-level ways to organize and access data in the database. Underneath the object layer, data is still stored in columns and tables, but you can work with the data in terms of the real-world entities--customers and purchase orders, for example--that make the data meaningful. Instead of thinking in terms of columns and tables when you query the database, you can simply select a customer.
|
对象类型以及数据库中其他的面向对象特性(如变长数组(variable-length array)与嵌套表(nested table))为组织访问数据库数据提供了更高层的方式。在对象层 之下,数据依旧存储于关系数据表中,但是用户可以把数据作为更有意义的真实世界的实体来操作(例如用户可以定义顾客对象、订单对象)。用户在查询数据时不用考虑数据表和列,只需查询对象即可。 |
||||||||||||||||||||||||||||||||
459 |
|
|
||||||||||||||||||||||||||||||||
460 |
Overview of Globalization |
1.3.7 国际化支持概述 |
||||||||||||||||||||||||||||||||
461 |
Oracle databases can be deployed anywhere in the world, and a single instance of an Oracle database can be accessed by users across the globe. Information is presented to each user in the language and format specific to his or her location.
|
Oracle数据库可能被部署到世界的任何角落,Oracle数据库的一个实例可能被全球各地的用户访问。为此,数据库信息可以按照用户所在地的语言和格式习惯展现。 |
||||||||||||||||||||||||||||||||
462 |
The Globalization Development Kit (GDK) simplifies the development process and reduces the cost of developing internet applications for a multilingual market. GDK lets a single program work with text in any language from anywhere in the world.
|
国际化支持开发包(Globalization Development Kit,GDK)简化了系统的开发过程,并减少了面向多语言市场的internet应用程序的开发成本。使用GDK开发可以使一个应用程序支持世界各地的语言及习惯。 |
||||||||||||||||||||||||||||||||
463 |
|
|
翻译不确定的词(字体-红色):
Features [1.3] monolithic [9.1][12.2][21.1] intuitive [33.3] standard machines [35.2] |
翻译不确定的技术性专有词(字体-红色):
grid computing [4.1][4.2][6.2][7.1][8.1] single point of failure [10.2][18.1][283.3] virtualization [13.1] provisioning [13.1] processes [22.2][24.1] business processes [24.2] Data hubs [29.1][44.5] live data sources [26.1] delegated administration [37.2] federated identity management [37.2][37.3] security domains [37.2][37.3] administrator-defined [40.1] fuzzy matching [44.3] shared disk systems [148.1] disk I/O [155.2] ATMs, ERM, and business planning applications [310] linear reference support [331] legacy applications [428] |
翻译不确定的Oracle专有词(字体-红色):
Oracle Real Application Clusters [35.2] Transportable Tablespaces [42.5] Spatial [43] redo entrie [74.3] rolling forward [78.1] server parameter file [92.1] extent [115.1] segment [117.1] nonclustered table [119.1] automatic undo management mode [119] undo space [119] read-consistent [119] materialized view [139] sequence [139] procedure [139] function [139] package [139] type [139] Java class schema object [139] user-defined object type [139] system global area [146] program global area [152] database buffer [156] buffer cache [158] parse tree [162.3] execution plan [162.3] private SQL area [165.1] Oracle process [178] server process [183] Mount [196.2] dedicated server process [200] Quiesce Database [209.5] multiversion consistency model [213.1] Undo Records [217.1] read-only transaction [221.1] Real Application Clusters [235.1] 实时应用群集 interconnect [235.1] cluster software [235.2] automatic undo management [243] dynamic memory management [243] Oracle-managed files [243] mean time to recover [243] free space management [243] multiple block sizes [243] and Recovery Manager (RMAN) [243] log sequence number [278] Fast-Start Fault Recovery [285] Oracle Text [323] Oracle文档管理 referential integrity actions [350] Referenced key [353] transactionally consistent batch updates [386] program units [420] autonomous transactions [422] Native Datatypes [459] object references [456] collection types [456] |
翻译不确定的句子(字体-红色):
[3.1] An Oracle database is a collection of data treated as a unit. The purpose of a database is to store and retrieve related information. [20.2] reflecting any level of complexity [24.1] Furthermore, applications that are orchestrated from published services are able to view activities in a business as a single whole [30.1] Grid Resources Work Well Independently and Best Together [36.2] Grid Control manages provisioning of nodes in the grid with the appropriate full stack of software [44.4] With Oracle 10g Release 2, its metadata management capabilities are extended from scheduled data pulls to handle a transaction-time data push from an Oracle database implementing the Oracle Streams feature. [100.1] User-managed backup and recovery requires you to actually restore backup files before you can perform a trial recovery of the backups. [230.2] by first querying for the rows that will be updated in a subsequent statement [232] 整段的含义都不清楚 [251] Rebalancing of the database's storage automatically occurs whenever the storage configuration changes.和前面重复。 [263] If one instance in a RAC environment fails, then another instance recovers the redo for the failed instance. [295.2] Query rewrite is a mechanism where Oracle or applications from the end user or database transparently improve query response time, by automatically rewriting the SQL query to use the materialized view instead of accessing the original tables. [322.-1] They provide efficient, random, piece-wise access to the data. [329] Oracle interMedia provides an array of services to develop and deploy traditional, Web, and wireless applications that include image, audio, and video in an integrated fashion. [350] FOREIGN KEY integrity constraints also define referential integrity actions that dictate what Oracle should do with dependent data if the data it references is altered. [372] As users' needs change, they can simply implement a new capability of Oracle Streams, without sacrificing existing capabilities. [381] These events can be transformed at any stage. [386] Materialized views are periodically updated, or refreshed, from their associated master tables through transactionally consistent batch updates. [397] SQL databases are relational databases, which means that data is stored in a set of simple relations. [431] All language-specific standards are supported. [454] Each column value and constant in a SQL statement has a datatype, which is associated with a specific storage format, constraints, and a valid range of values. |
注释性的文字(字体-绿色;标识-中括号):
[146] [173.2] [182.1] [203.1] [209.2] [218.-1] [235.-1] [256.-1] [276] [307] [319] |
未完成的链接
[66] database writer process (DBWn) [67] Overview of the Oracle Instance [71] instance [72] Tablespaces, Datafiles, and Control Files [93]
Initialization Parameter Files and Server Parameter Files [97] Oracle Database Administrator's Guide
[102] Backup and Recovery [110] Overview of Tablespaces [119] SQL [119] rolling back [119] transactions
[121] Data Blocks, Extents, and Segments [123] table [123] view [123] index [126] column [126] row [144] The Data Dictionary [150] Oracle Database Oracle Clusterware and Oracle Real Application Clusters Administration and Deployment Guide
[156] database buffer [158] buffer cache [160] online redo log [163] SQL Statements [169] Memory Architecture [175] Background Processes [180] Enterprise Manager [183] database buffer [183] data block [186] Process Architecture [194] Oracle Database Net Services Administrator's Guide [198] Database and Instance Startup and Shutdown
[200] instance [201] Process Architecture [204] Oracle Utilities [208] concurrency [233] Data Concurrency and Consistency [235] cluster [237] Oracle Database Oracle Clusterware and Oracle Real Application Clusters Administration and Deployment Guide [249] SQL*Plus User's Guide and Reference [257] Manageability [281] Backup and Recovery [281] Control Files [281] Oracle Database Administrator's Guide [281] Introduction to Automatic Undo Management [285] Recovery Manager (RMAN) [286] High Availability [311] Business Intelligence [315] Partitioned Tables and Indexes [332] Content Management [343] Database Security [354] Data Integrity [358] Triggers [392] Information Integration [416] SQL, PL/SQL, and Java [426] SQL, PL/SQL, and Java [429] SQL, PL/SQL, and Java [437] Overview of Application Development Languages [445] Oracle Database SQL Reference [452] Transaction Management [459] Native Datatypes [459] Object Datatypes and Object Views [463] Oracle Database Globalization Support Guide |
Oracle学习问题(背景-黄色):
1、不是10g也能使用ASM么? [35.7] In Oracle 10g Release 2, ASM supports multiple databases, which could be at different software version levels, accessing the same storage pool.
2、关于OIM的设计思想 统一界面single sign-on server 再把登录信息发布到不同的组件,通过delegation and federation? [37.3]Oracle Identity Management 10g closely adheres to grid principles by utilizing a central point for applications to authenticate users - the single sign-on server - while, behind the scenes, distributing control of identities via delegation and federation to optimize maintainability and overall operation of the system.
3、都有什么样的时间戳? [69] Time stamp of database creation
4、SYSTEM rollback segment在数据库中的属性,比如owner等等。 [119] Oracle does use a SYSTEM rollback segment for performing system transactions.
5、这里的undo records和redo entries一样么?该怎么翻译?是不是只对DML有效,对DDL无效。 [218] When an update occurs, the original data values changed by the update are recorded in the database undo records. [243] automatic undo management undo是撤销;形式是数据;用于读一致、恢复;在恢复时,恢复未提交的数据(是roll back操作); redo是重做;形式是与用户操作对应的逆操作。用于恢复;在恢复时,恢复已提交的数据(是rolling forward操作); 另见:[271]在redo log buffers中的redo entries是未提交的,在redo log file中的是已提交的 [276]
6、data integrity 和 consistency 的区别 [224] This ensures the data integrity of the system. 应该是data integrity包含了consistency,还包括?
7、静默数据库,不明白 [231] Quiesce Database
8、不知道这里的Redo指什么? [263] If one instance in a RAC environment fails, then another instance recovers the redo for the failed instance.
9、什么是两步提交机制? [368] |
translator: zw1840@hotmail.com