`
edwards0307
  • 浏览: 27396 次
  • 性别: Icon_minigender_2
  • 来自: 北京
社区版块
存档分类
最新评论

Data Integirty

 
阅读更多

1.Constraints

 

type: Not null ,PK,FK,Check,Unique

 

SQL> create table mm(
  2  id number constraint con_pk primary key,
  3  name char(10) not null,
  4  uniqueid number unique,
  5  sal number check(sal>100));

 

  alter table mm  modify  name not null;

  alter table mm  add primary key(id);

  alter table mm  add unique(name);

  alter table mm  add check(sal>1000);

  alter table mm  add foreign key(id) references tt(id);

  alter table mm  add constraint  pk_cons primary key(id);

 

  alter table mm  drop primary key cascade;

  alter table mm  drop unique(name) cascade

  alter table mm  drop constraint pk_cons;

 

Constraint States:

 

■ ENABLE VALIDATE is the same as ENABLE. The constraint is checked and is
guaranteed to hold for all rows.
■ ENABLE NOVALIDATE means that the constraint is checked, but it does not have to
be true for all rows. This allows existing rows to violate the constraint, while
ensuring that all new or modified rows are valid.
In an ALTER TABLE statement, ENABLE NOVALIDATE resumes constraint checking
on disabled constraints without first validating all data in the table.
■ DISABLE NOVALIDATE is the same as DISABLE. The constraint is not checked and
is not necessarily true.
■ DISABLE VALIDATE disables the constraint, drops the index on the constraint,
and disallows any modification of the constrained columns. When any constraint is moved from the NOVALIDATE state to the VALIDATE state, all data must be checked. (This can be very slow.) However, moving from VALIDATE to NOVALIDATE simply forgets that the data was ever checked.Moving a single constraint from the ENABLE NOVALIDATE state to the ENABLE VALIDATE state does not block reads, writes, or other DDL statements. It can be done in parallel.

 

alter table mm enable validate constraint pk_con;

alter table mm disable novalidate primary key;

 

 

Constraint Check:

 

deferred: after commit,check;

nodeferred: immdeite checck;

 

set  constraints pk_emp deferred/immediate

alter session set constraints=deferred/immediate

 

 

分享到:
评论

相关推荐

    earthdata-download

    Earthdata Download was designed to be a bulk download application for Earthdata Search, but can be reused by other applications with a bulk download need. In order to use your application with Earth...

    openGauss Tools (Data Studio_3.0.0)Data Studio 用户手册.pdf

    openGauss Tools (Data Studio 3.0.0) Data Studio 用户手册.pdf openGauss 是一个开源的关系数据库管理系统,Data Studio 是 openGauss 的一款图形化管理工具。下面是根据提供的文件信息生成的相关知识点: ...

    Data Analytics with Hadoop: An Introduction for Data Scientists

    "Data Analytics with Hadoop: An Introduction for Data Scientists" ISBN: 1491913703 | 2016 | PDF | 288 pages | 7 MB Ready to use statistical and machine-learning techniques across large data sets? ...

    Sharing.Big.Data.Safely.Managing.Data.Security.1491952121.epub

    Many big data-driven companies today are moving to protect certain types of data against intrusion, leaks, or unauthorized eyes. But how do you lock down data while granting access to people who need ...

    Beginning Data Science in R

    Beginning Data Science in R: Data Analysis, Visualization, and Modelling for the Data Scientist by Thomas Mailund English | 5 Apr. 2017 | ISBN: 1484226704 | 352 Pages | PDF | 6.46 MB Discover best ...

    Data Vault数据库建模指南.pdf

    Data Vault数据库建模方法是一种专为应对企业数据仓库(EDW)项目中复杂的数据集成、数据历史记录和灵活性问题而设计的建模技术。Data Vault方法强调数据的整合、非易失性、时间变体和业务键驱动的特点。Data Vault...

    Elements.data gshop.data 编辑器

    "Elements.data"和"gshop.data"是两种特定类型的数据文件,它们可能被用于各种应用程序或游戏,存储用户数据、配置信息或者游戏进度等。在这个场景中,"Kuqoi Elements x"是一款专为编辑这些文件而设计的工具,由...

    finalData 注册码

    1. **下载并安装finalData**:首先需要从官方网站或其他可信渠道下载finalData安装包,并按照提示完成安装过程。 2. **获取注册码**:通常情况下,用户购买finalData软件后会收到一封包含注册码的邮件。如果是在其他...

    利用getdata获取图形数据

    "利用getdata获取图形数据"这一主题涉及到一个名为getdata的软件工具,它专门用于从各种图形文件中提取数据点,使用户能够对这些数据进行进一步处理或分析。下面将详细介绍getdata软件及其使用方法。 getdata是一款...

    spring-data-commons-1.7.2.RELEASEspring-data-jpa-1.5.2.RELEASE-java datajpa

    Spring Data Commons 和 Spring Data JPA 是 Spring 框架中的两个关键模块,它们在 Java 应用开发中扮演着重要角色,特别是在数据访问层。这两个模块是基于 Java 的数据访问接口(JPA)来简化数据库操作,使得开发者...

    DataService-操作手册.docx

    SAP DataServices 技术文档 SAP DataServices 是一款强大的数据integration 平台,旨在帮助企业集成、转换和提供高质量的数据。以下是基于 DataServices 操作手册的知识点总结: 一、DataServices 简介 Data...

    GetData安装软件及使用教程

    【GetData安装软件及使用教程】 GetData是一款强大的图形数据提取工具,尤其在科研和工程领域中广泛应用。当你遇到只有二维曲线图而缺乏具体点数据的情况时,GetData可以帮助你从图像中恢复或提取这些丢失的数据点...

    Data.Science.and.Big.Data.Analytics

    Data Science and Big Data Analytics is about harnessing the power of data for new insights. The book covers the breadth of activities and methods and tools that Data Scientists use. The content ...

    二维码datamatrix编码工具SDK包

    二维码datamatrix编码工具SDK包是一款专为开发者设计的软件开发工具包,它主要功能是生成QR Code码和Data Matrix码。在当前信息化社会中,二维码作为一种高效的信息载体,广泛应用于各种场景,如产品追溯、电子票务...

    SAP Data Services如何链接MYSQL

    SAP Data Services如何链接MYSQL SAP Data Services 是一种功能强大的数据集成工具,它允许用户从各种数据源中提取、转换和加载数据。为了连接 MYSQL 数据库,需要按照以下步骤进行操作。 首先,需要打开 SAP ...

    Clean.Data.1785284010

    Title: Clean Data Author: Megan Squire Length: 267 pages Edition: 1 Language: English Publisher: Packt Publishing Publication Date: 2015-05-29 ISBN-10: 1785284010 ISBN-13: 9781785284014 Save time by ...

    STM32文档资料 STM32F103VC_DATASHEET_CN

    STM32文档资料 STM32F103VC_DATASHEET_CNSTM32文档资料 STM32F103VC_DATASHEET_CNSTM32文档资料 STM32F103VC_DATASHEET_CNSTM32文档资料 STM32F103VC_DATASHEET_CNSTM32文档资料 STM32F103VC_DATASHEET_CNSTM32文档...

    AppData文件夹转移工具

    AppData文件夹是Windows操作系统中的一个重要组成部分,它存储着用户特定的应用程序数据、配置信息以及临时文件。这个文件夹的内容通常对用户不透明,但随着时间的推移,它可能会占用大量的磁盘空间,尤其是当你频繁...

Global site tag (gtag.js) - Google Analytics