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;
阅读更多
版权声明:个人手打,欢迎指正。 https://blog.csdn.net/xixiaoming_A/article/details/52355323
个人分类: 数据库
上一篇方法调用
下一篇Servlet概念
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭