前端之家收集整理的这篇文章主要介绍了
Oracle对象的创建,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
表空间
create tablespace myspace datafile 'C:\myspace.ora' size 100m;
create user xixiaoming identified by xixiaoming default tablespace myspace quota 50m on users;
grant all privileges to xixiaoming;
表
CREATE TABLE emp1( emp_id NUMBER(6),name VARCHAR2(20),age NUMBER(3),CONSTRAINT pk_emp_id PRIMARY KEY(emp_id),CONSTRAINT uq_name UNIQUE (name),CONSTRAINT ck_age CHECK (age>0 AND age<150) );
包
create or replace package SYNC_IMPLEMENT IS
...
end;
包体
create or replace package body SYNC_IMPLEMENT is
...
end;
过程
CREATE OR REPLACE PROCEDURE show_param_detail( isShowDetail IN NUMBER:=1 ) is begin ... end;
视图
create or replace view show_emp as select * from emp;
触发器
create or replace trigger tri_xtwh_ysdw
after insert or update or delete on xtwh_gly.bm_ysdw
for each row
declare
...
begin
...
end;
类型
create or replace type JArrayType is table of varchar(255);
序列
CREATE SEQUENCE seq_emp1 INCREMENT BY 1 START WITH 1 NOCACHE NOCYCLE;
索引
CREATE INDEX idx_emp_name ON emp1(age);
同义词
CREATE SYNONYM st_ysdw FOR jczl.enterprise@dlink_orcl44;