Minimal Invalidation of Dependent Objects
In the previous release, Oracle automatically invalidated all dependent views and PL/SQL packages during an online redefinition, even if those objects weren’t logically affected. For example, if you dropped a table column during redefinition, all procedures and views that referenced the table were automatically invalidated. Unlike in the previous releases, Oracle Database 11g invalidates only the logically affected objects such as views and synonyms during an online redefinition. It doesn’t automatically invalidate all dependent views and PL/SQL packages as before. In the case of a dropped column, Oracle will invalidate a procedure or view only if the object used the dropped column. This new concept of minimal validation of dependent objects is called fine-grained dependency management, under which the database tracks object dependencies at the level of the element within a unit.
Triggers continue to be automatically invalidated as before during an online redefinition.
Objects such as views, synonyms, and other similar table-dependent objects aren’t logically affected by a table redefinition and thus aren’t invalidated. Thus, for example, if an object referenced during an online redefinition isn’t modified during the redefinition, the object remains valid. All triggers that are defined on a redefined table will be invalidated, but the database automatically revalidates them when the next DML statement execution takes place.The use of fine-grained dependencies leads to more precise dependency metadata.
In Oracle Database 10g, the object dependency metadata was looked at from the object level. For example, let’s say a view depends on a specific table. Even though the addition of a new column to the table has no bearing on the view, the database still invalidates the view because it treats the entire object as the unit of reference. In Oracle Database 11g, the fact that a new column has been added to a table doesn’t invalidate a view that uses a table if the view doesn’t use the newly added column. Similar fine-grained dependency management applies to PL/SQL objects such as procedures and functions. If you add a new procedure or function to a package, that will invalidate other procedures and functions in that package only if those objects have a dependency on the altered or new procedure or function.
The fine-grained dependency management is easy to use, as it doesn’t need any configuration on your part. Your application availability will be higher as a result, especially during an application upgrade.
Sample
In previous releases, object dependencies were managed at the object level, so altering an object automatically invalidated all dependent objects. Oracle 11g has more granular dependency management, so only changes that directly affect an object will cause an invalidation. To show this create a table with a dependent package, which is in turn used by a view.
CREATE TABLE dep_tab (
id NUMBER,
description VARCHAR2(50),
CONSTRAINT dep_tab_pk PRIMARY KEY (id)
);
CREATE OR REPLACE PACKAGE dep_api AS
FUNCTION get_desc (p_id IN dep_tab.id%TYPE)
RETURN dep_tab.description%TYPE;
END dep_api;
/
CREATE OR REPLACE PACKAGE BODY dep_api AS
FUNCTION get_desc (p_id IN dep_tab.id%TYPE)
RETURN dep_tab.description%TYPE
AS
l_description dep_tab.description%TYPE;
BEGIN
SELECT description
INTO l_description
FROM dep_tab
WHERE id = p_id;
RETURN l_description;
END get_desc;
END dep_api;
/
CREATE OR REPLACE VIEW dept_tab_v AS
SELECT id, dep_api.get_desc(id) AS description
FROM dep_tab;
The objects in the schema are valid.
COLUMN object_name FORMAT A30
SELECT object_name, object_type, status FROM user_objects;
OBJECT_NAME OBJECT_TYPE STATUS
------------------------------ ------------------- -------
DEP_TAB TABLE VALID
DEP_TAB_PK INDEX VALID
DEP_API PACKAGE VALID
DEP_API PACKAGE BODY VALID
DEPT_TAB_V VIEW VALID
5 rows selected.
Add a column to the table and check the status of the schema objects. Prior to 11g we would expect both the package and the view to be invalidated by this operation.
ALTER TABLE dep_tab ADD (
record_type NUMBER(1)
);
SELECT object_name, object_type, status FROM user_objects;
OBJECT_NAME OBJECT_TYPE STATUS
------------------------------ ------------------- -------
DEP_TAB TABLE VALID
DEP_TAB_PK INDEX VALID
DEP_API PACKAGE VALID
DEP_API PACKAGE BODY INVALID
DEPT_TAB_V VIEW VALID
5 rows selected.
Notice the package specification and the view are not invalidated, because the table columns they reference are not changed by the addition of the new column. The package body is invalidated, but this is of little consequence since dependent objects reference the package specification, not the package body.
Next, recreate the package specification, adding the prototype for a new procedure, then check the status of the schema objects. We would expect this operation to invalidate the dependent view in releases prior to 11g.
CREATE OR REPLACE PACKAGE dep_api AS
FUNCTION get_desc (p_id IN dep_tab.id%TYPE)
RETURN dep_tab.description%TYPE;
PROCEDURE stub;
END dep_api;
/
SELECT object_name, object_type, status FROM user_objects;
OBJECT_NAME OBJECT_TYPE STATUS
------------------------------ ------------------- -------
DEP_TAB TABLE VALID
DEP_TAB_PK INDEX VALID
DEP_API PACKAGE VALID
DEP_API PACKAGE BODY INVALID
DEPT_TAB_V VIEW VALID
5 rows selected.
The dependent view is unaffected by the modification to the package specification.
参考至: 《McGraw.Hill.OCP.Oracle.Database.11g.New.Features.for.Administrators.Exam.Guide.Apr.2008》 http://www.oracle-base.com/articles/11g/enhanced-finer-grained-dependency-management-11gr1.php
本文原创,转载请注明出处、作者
如有错误,欢迎指正
邮箱:czmcj@163.com
相关推荐
代码资源(Fine-Grained Crowdsourcing for Fine-Grained Recognition_DengKrauseFei-Fei_CVPR2013_Code)提供了实现这一方法的具体程序,可能包括了任务分配、数据收集、质量评估和反馈系统等模块,可供研究者和...
Distributed systems have become more fine-grained in the past 10 years, shifting from code-heavy monolithic applications to smaller, self-contained microservices. But developing these systems brings ...
ECCV 2018 paper, Fine-grained image recognition,propose a novel self-supervision mechanism to effectively localize informative regions without the need of bounding-box/part annotations
Fine-grained Patient Similarity Measuring using Deep Metric Learning Fine-grained Patient Similarity Measuring using Deep Metric Learning
Automated Fine-Grained CPU Cap Control, M. Reza HoseinyFarahabady, Member, IEEE,
Recent research has shown great progress on fine-grained entity typing. Most existing methods require pre-defining a set of types and training a multi-class classifier from a large labeled data set ...
A Platform for Fine-Grained Resource Sharing in the Data Center 数据中心中细粒度资源共享的平台 1 Introduction 2 Target Environment 3 Architecture 4 Mesos Behavior 5 Implementation 6 Evaluation 7 ...
where informationisorganizedw.r.ttableschemasconsistingofcolumns.In turneachcolumn,maycontaininstance values thatpointtoother Wikipediaarticlesorprimitive values (e.g.numbers,stringsetc.).
标题《Fine-Grained Change Detection of Misaligned Scenes with Varied Illuminations》和描述表明本文献是关于一种细粒度变化检测技术的研究,这项技术旨在对在不同光照条件下错位的场景进行变化检测。...
Abstract Estimating the head pose of a person is a crucial prob- lem that has a large amount of applications such as aiding in gaze estimation, modeling attention, fitting 3D models ...
《构建微服务:设计细粒度系统》是Sam Newman在2015年所著的一本关于微服务架构的图书。该书详细介绍了微服务架构的概念、设计、实施以及如何管理微服务架构的过程,并涵盖了从单体应用向微服务架构迁移过程中可能会...
在当今信息化飞速发展的时代,计算机视觉作为人工智能的一个重要分支,正日益受到广泛的关注。特别是随着深度学习技术的发展,视频理解技术已经取得了巨大的进步。然而,在视频理解中,识别和理解其中的精细动作依然...
《实体粒度更细:超空间中的精细实体分类》 实体分类是自然语言处理领域中的一个关键任务,它旨在将文本中的实体分配到相应的语义类别中。从最初的公司名称识别,到粗略的类别(如人、地点、组织等),再到包含上百...
### 细粒度情感分析方法在中文微博中的应用 #### 概述 本文探讨了一种应用于中文微博的细粒度情感分析方法。该方法旨在通过深入解析文本中的情感信息,提高对用户情绪感知的准确性和细致程度。...
RBS-Fine-Grained Network Time Synchronization using Reference Broadcasts.PDF,经典同步算法
本篇文章是关于使用智能手机进行精细睡眠监测的研究,标题为“3 Fine-grained Sleep Monitoring Hearing Your Brea”,发表于2015年IEEE计算机通讯会议(INFOCOM)。论文介绍了通过智能手机的耳塞来捕捉人体呼吸声音...
Fine-Grained Recognition via Attribute-Guided Attentive Feature Aggregation
我们的 CVPR 2019 论文 Distilling Object Detectors with Fine-grained Feature Imitation 的实现 我们提出了一种基于锚点的对象检测模型的通用蒸馏方法,以利用大型教师模型的知识获得增强的小型学生模型,该模型...
### Hierarchical Deep Click Feature Prediction for Fine-grained Image Recognition #### 概述 本文提出了一种新的方法——层次化深度点击特征预测(Hierarchical Deep Click Feature Prediction),用于细粒度...