oracle管理之 view synonym sequence(server.102 b14231)
--view sequence synonyms
view也是可以update的,只要你有update的許可權,不過有很多約束
例如:view不能含有 set distinct group by,not null列沒有default值,decode等等都不能update delete
create table AAATTT
(
ID CHAR(5) not null,
NAME CHAR(10),
NOTE CHAR(30),
XINGMING VARCHAR2(10),
XINGM VARCHAR2(10),
NUM NUMBER(5,3),
NUM2 NUMBER(4),
NUM3 NUMBER(*,3),
DAT DATE,
TIMLZ TIMESTAMP(6) WITH LOCAL TIME ZONE,
TIMZ TIMESTAMP(6) WITH TIME ZONE
);
create view aaat as select * from aaattt;
--view定義存放在資料字典中如下:
select "ID","NAME","NOTE","XINGMING","XINGM","NUM","NUM2","NUM3","DAT","TIMLZ","TIMZ" from aaattt
insert into aaat(id,name) values ('999','hexiaoling');
commit;
--create or replace view比 drop view再create view更好,不丟失授權和依賴關係
--join view有多個base table,聯合檢視可更新的條件
1、只能更新主鍵保留表,如果一個表的primary key也是檢視的primary key,那麼這個表可以透過檢視來更新
2、可以透過instead of trigger來更新base table
--sequence
CREATE SEQUENCE emp_sequence
INCREMENT BY 1
START WITH 1
NOMAXVALUE
NOCYCLE
CACHE 10;
--cache 10,如果遇到instance失敗,cache內的資料丟失,sequence則跳過cache內的數值
--可以遞增也可以遞減,可以迴圈
NEXTVAL
CURRVAL
DROP SEQUENCE order_seq;
--Synonyms Managing
CREATE PUBLIC SYNONYM public_emp FOR jward.emp
DROP PUBLIC SYNONYM public_emp;
--相關檢視
DBA_VIEWS
ALL_VIEWS
USER_VIEWS
DBA_SYNONYMS
ALL_SYNONYMS
USER_SYNONYMS
DBA_SEQUENCES
ALL_SEQUENCES
USER_SEQUENCES
DBA_UPDATABLE_COLUMNS
ALL_UPDATABLE_COLUMNS
USER_UPDATABLE_COLUMNS[@more@]
view也是可以update的,只要你有update的許可權,不過有很多約束
例如:view不能含有 set distinct group by,not null列沒有default值,decode等等都不能update delete
create table AAATTT
(
ID CHAR(5) not null,
NAME CHAR(10),
NOTE CHAR(30),
XINGMING VARCHAR2(10),
XINGM VARCHAR2(10),
NUM NUMBER(5,3),
NUM2 NUMBER(4),
NUM3 NUMBER(*,3),
DAT DATE,
TIMLZ TIMESTAMP(6) WITH LOCAL TIME ZONE,
TIMZ TIMESTAMP(6) WITH TIME ZONE
);
create view aaat as select * from aaattt;
--view定義存放在資料字典中如下:
select "ID","NAME","NOTE","XINGMING","XINGM","NUM","NUM2","NUM3","DAT","TIMLZ","TIMZ" from aaattt
insert into aaat(id,name) values ('999','hexiaoling');
commit;
--create or replace view比 drop view再create view更好,不丟失授權和依賴關係
--join view有多個base table,聯合檢視可更新的條件
1、只能更新主鍵保留表,如果一個表的primary key也是檢視的primary key,那麼這個表可以透過檢視來更新
2、可以透過instead of trigger來更新base table
--sequence
CREATE SEQUENCE emp_sequence
INCREMENT BY 1
START WITH 1
NOMAXVALUE
NOCYCLE
CACHE 10;
--cache 10,如果遇到instance失敗,cache內的資料丟失,sequence則跳過cache內的數值
--可以遞增也可以遞減,可以迴圈
NEXTVAL
CURRVAL
DROP SEQUENCE order_seq;
--Synonyms Managing
CREATE PUBLIC SYNONYM public_emp FOR jward.emp
DROP PUBLIC SYNONYM public_emp;
--相關檢視
DBA_VIEWS
ALL_VIEWS
USER_VIEWS
DBA_SYNONYMS
ALL_SYNONYMS
USER_SYNONYMS
DBA_SEQUENCES
ALL_SEQUENCES
USER_SEQUENCES
DBA_UPDATABLE_COLUMNS
ALL_UPDATABLE_COLUMNS
USER_UPDATABLE_COLUMNS[@more@]
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/70612/viewspace-1025165/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle管理之 cluster(server.102 b14231)OracleServer
- oracle管理之 index(server.102 b14231)OracleIndexServer
- oracle管理之 table(server.102 b14231)OracleServer
- oracle管理之 tablespace(server.102 b14231)OracleServer
- oracle管理之 partitioned table(server.102 b14231)OracleServer
- oracle管理之 undo tablespace(server.102 b14231)OracleServer
- oracle檔案管理之 archive log(server.102 b14231)OracleHiveServer
- oracle儲存管理之 segment和space管理(server.102 b14231)OracleServer
- oracle儲存管理之 oracle managed files(OMF)(server.102 b14231)OracleServer
- oracle儲存管理之 ASM(automatic storage management)(server.102 b14231)OracleASMServer
- Synonym_View_Materialized和Public物件ViewZed物件
- Oracle之Sequence(序列)Oracle
- Oracle synonym 相關Oracle
- oracle rename table 相關index view constraint synonym等的變化OracleIndexViewAI
- Oracle之處理synonym同義詞無效物件Oracle物件
- ORACLE SEQUENCEOracle
- VIEW和SYNONYM引起的執行計劃的異常View
- Oracle中的同義詞SYNONYMOracle
- ORACLE SEQUENCE用法Oracle
- Oracle - Sequence序列Oracle
- Oracle Sequence NocacheOracle
- Oracle序列sequenceOracle
- Oracle 基本操作之 建立自增欄位方法-ORACLE SEQUENCEOracle
- 關於oracle synonym 的總結整理Oracle
- Oracle Sequence Audses$研究Oracle
- oracle sequence語法Oracle
- oracle sequence 試用Oracle
- Oracle 12c新特性之Sequence的Session特性OracleSession
- 【轉】MySQL中增加sequence管理功能(模擬建立sequence)MySql
- oracle的scn及sequenceOracle
- Oracle中Sequence的使用Oracle
- 建立Materialized view log時是否使用sequence clause的差別ZedView
- oracle中sequence使用的限制Oracle
- 1229Create schema synonym in Oracle 12cOracle
- sequence to sequence模型模型
- Oracle -- 批次更新sequence的儲存Oracle
- Oracle -- 批量更新sequence的儲存Oracle
- ORACLE SEQUENCE的簡單介紹Oracle