Oracle table to create an ID from the growth

2011-01-12  来源:本站原创  分类:Database  人气:86 

************************************************** ***********************

1 Create table space

************************************************** ***********************

create tablespace nsw datafile 'E: \ nsw.dbf' size 20M autoextend on next 5M maxsize unlimited;

************************************************** ***********************

2 Create a user

************************************************** ***********************

create user nsw identified by nsw default tablespace nsw;

************************************************** ***********************

3 user license

************************************************** ***********************

grant resource to nsw;
grant create session to nsw;

************************************************** ***********************
4 Create table icm_cert

************************************************** ***********************

CREATE TABLE icm_cert (
ID number (11) NOT NULL,
CERT_USERCODE varchar2 (255) NOT NULL,
CERT_SERIALNUMBER varchar2 (255) NOT NULL unique,
CERT_SUBJECT varchar2 (255) default NULL,
CERT_BUF clob,
CERT_BEGIN varchar2 (255) default NULL,
CERT_END varchar2 (255) default NULL,
CERT_TYPE varchar2 (255) default NULL,
CERT_STATUS varchar2 (255) default NULL,
PRIMARY KEY (ID)
)

************************************************** ***********************
Create sequence sequence 5

************************************************** ***********************

create sequence icm_cert_seq minvalue 1 maxvalue 999999999999999999 start with 1 increment by 1 cache 20;

************************************************** ***********************
6 Creating a trigger

************************************************** ***********************

CREATE OR REPLACE TRIGGER "icm_cert_trig"
BEFORE INSERT ON icm_cert
REFERENCING OLD AS OLD NEW AS NEW FOR EACH ROW
DECLARE
BEGIN
SELECT icm_cert_seq.NEXTVAL INTO: NEW.ID FROM DUAL;
END icm_cert_trig;

************************************************** ***********************
7 insert query delete

************************************************** ***********************
insert into icm_cert (CERT_USERCODE, CERT_SERIALNUMBER, CERT_SUBJECT, CERT_BUF, CERT_BEGIN, CERT_END, CERT_TYPE, CERT_STATUS) values ​​('nsw', '123 ', '1', '2 ', '3', '4 ', '5', '6 ');

select * from icm_cert;

delete from icm_cert

相关文章
  • Oracle table to create an ID from the growth 2011-01-12

    ************************************************** *********************** 1 Create table space ************************************************** *********************** create tablespace nsw datafile 'E: \ nsw.dbf' size 20M autoextend on next 5M ma

  • oracle table dynamically create keyword filter 2011-03-30

    Description: Create a table function name may be used as field names, but can not use keywords as field names. oracle Keyword: ACCESS ADD ALL ALTER AND ANY AS ASC AUDIT BETWEEN BY CHAR CHECK CLUSTER COLUMN COMMENT COMPRESS CONNECT CREATE CURRENT DATE

  • oracle table scripts create jbpm4.4 2011-04-25

    create table JBPM4_DEPLOYMENT ( DBID_ number (19,0) not null, NAME_ clob, TIMESTAMP_ number (19,0), STATE_ varchar2 (255 char), primary key (DBID_) ); create table JBPM4_DEPLOYPROP ( DBID_ number (19,0) not null, DEPLOYMENT_ number (19,0), OBJNAME_ v

  • Oracle table's primary key to achieve automatic growth 2011-07-11

    These days do Oracle, want the table's primary key automatically grow, check the network to achieve the following: create table simon_example ( id number(4) not null primary key, name varchar2(25) ) - The establishment of the sequence: -- Create sequ

  • Oracle create table space. Create a user and authorization. View permissions 2010-03-26

    Oracle create table space, create a user and the authorization to view the permissions to create temporary table space Create temporary table space CREATE TEMPORARY TABLESPACE test_temp TEMPFILE 'C: \ oracle \ product \ 10.1.0 \ oradata \ orcl \ test

  • Oracle create table space. Create a user and authorization 2010-04-07

    Quote from http://www.cnblogs.com/GoalRyan/archive/0001/01/01/1525055.html Create temporary table space CREATE TEMPORARY TABLESPACE test_temp TEMPFILE 'F:\oracle\product\10.2.0\oradata\orcl\test_temp01.dbf' SIZE 32M AUTOEXTEND ON NEXT 32M MAXSIZE 204

  • Command to create oracle table space / user 2010-04-13

    Previously always felt very troublesome oracle command line operation, no use, But recently, in many cases the application needs to use the command operation: The first was unable to open the database console command can not need to create, There com

  • (Transfer) Oracle table spaces to create changes 2010-04-16

    create tablespace sehr datafile 'E: \ ORACLEDB \ SEHR.DBF' Modified to automatically expand alter database datafile 'E: \ ORACLEDB \ SEHR.DBF' autoextend on next 100M maxsize 20000M Add file alter tablespace sehr add datafile 'E: \ ORACLEDB \ SEHR2.D

  • oracle table space to create and description 2010-04-29

    / / Create a temporary table space create temporary tablespace test_temp tempfile 'E: \ oracle \ product \ 10.2.0 \ oradata \ testserver \ test_temp01.dbf' size 32m autoextend on next 32m maxsize 2048m extent management local; / / Create a data table

  • oracle table space operation & CREATE TABLESPACE command 2010-05-07

    select * from dba_tables where OWNER = 'peter' - Create table space (oracle in the tablespace (table space) is equivalent to sqlserver in the database) CREATE TABLESPACE data01 DATAFILE 'D: \ oracle \ ora92 \ oradata \ db \ DATA01.dbf' SIZE 200M UNIF

  • oracle create table space, create a user (change) 2010-05-22

    Keywords: oracle tablespace users / / Create a temporary table space create temporary tablespace test_temp tempfile 'E: \ oracle \ product \ 10.2.0 \ oradata \ testserver \ test_temp01.dbf' size 32m autoextend on next 32m maxsize 2048m extent managem

  • oracle create table space, create a user 2010-05-26

    / / Create a temporary table space create temporary tablespace test_temp tempfile 'E:\oracle\product\10.2.0\oradata\testserver\test_temp01.dbf' size 32m autoextend on next 32m maxsize 2048m extent management local; / / Create a data table space creat

  • oracle table space to create. delete. view. tablespace does not exist. and modify the default table space Xiangjie (change) 2010-05-26

    1. Create table space ORACLE, the table space is the basic method of data management, all users of the object to be stored in the table space, that is, users have the right to use space to create a user object. Otherwise it is and not allow to create

  • oracle table space creation, table creation, users create detailed 2010-07-08

    In SQL * Plus in: (1) how to add delete the database? (2) database is the table? ? (3) How to create a table space? (4) How to create a user? (5) is not a table space can only create a user? (6) How to access the database server from the client confi

  • [Reprinted] Oracle create table space. Create a user and authorization. View permissions 2010-07-14

    Create temporary table space CREATE TEMPORARY TABLESPACE test_temp TEMPFILE 'C:\oracle\product\10.1.0\oradata\orcl\test_temp01.dbf' SIZE 32M AUTOEXTEND ON NEXT 32M MAXSIZE 2048M EXTENT MANAGEMENT LOCAL; Create a user table space CREATE TABLESPACE tes

  • Create oracle table space, the user, etc. 2010-08-27

    Create table space: CREATE TABLESPACE test_data LOGGING DATAFILE 'C: \ oracle.DBF' SIZE 32M AUTOEXTEND ON NEXT 32M MAXSIZE 2048M EXTENT MANAGEMENT LOCAL; Create User CREATE USER username IDENTIFIED BY password DEFAULT TABLESPACE TEST_DATA; Grant perm

  • oracle create table space. create the user. to change the user default tablespace. delete the temporary table space 2010-08-28

    Create temporary table space create temporary tablespace stbss_tmp tempfile 'E:\oracle\product\10.2.0\oradata\orcl\stbss_temp01.dbf' size 32m autoextend on next 32m maxsize 2048m extent management local; Create a data table space create tablespace st

  • Oracle table using the command line to create space. Users and assign permissions 2010-09-16

    SQL> create tablespace test datafile 'E: \ ORACLE \ ORADATA \ DB228 \ test.ora' 2 size 5M; Table space has been created. SQL> create user test identified by test default tablespace test; Users have created SQL> grant connect, resource, dba to tes

  • Oracle table space to create, modify, delete 2010-09-28

    Today, I use the imp command oracle, there has been no corresponding table space error. Frustration from the new table space can only be re-established. Create table space: create tablespace BHINFOSPACE datafile 'c: \ oracle \ cdc01.ora' size 100M RE

  • Oracle to create an external table, then create an external table entity table 2010-10-09

    External table: These tables are not stored in the database itself, but on the outside of the database, that is, on the normal operating system files. In Oracle9i And above, using the external table can query the database in a file, as if this file i