標籤:span int pre style oracle drop 恢複 books dba
--添加、修改與刪除約束--1.添加約束alter table tableadd[constraint constraint]constraint_type(column1[,column2,…])[constraint_parameters];alter table books modify title not null;--添加非空約束--2.修改約束ALTER TABLE tableMODIFY[CONSTRAINT constraint][PRIMARY KEY]|[UNIQUE(column1[,column2,…])][constraint_parameters];--3.重新命名約束alter table table rename constraint old_name to new_name;--4.刪除約束ALTER TABLE table DROP[CONSTRAINT constraint] [PRIMARY KEY]|[UNIQUE(column1[,column2,…])] [CASCADE][KEEP|DROP INDEX]set constraints all deferred;--對所有可以延遲的約束進行延遲檢查set constraints all immediate;--恢複所有延遲檢查的約束為立即檢查--查詢約束資訊all_constraints--包含目前使用者可以訪問的所有約束定義資訊user_constraints--包含目前使用者擁有的所有約束的定義資訊dba_constraints--包含當前資料庫中所有約束的定義資訊all_cons_columns--包含目前使用者可以訪問的約束列資訊user_cons_columns--包含目前使用者擁有的約束列的資訊dba_cons_columns--包含當前資料庫所有約束列的資訊
oracle資料庫維護操作4