易截截图软件、单文件、免安装、纯绿色、仅160KB

在Oracle数据库创建脚本中如何初始化某些表

Sample
表空间:IMPTEMP
表:Roles 、Users
通过PL/SQL导出的数据库脚本
-----------------------------------------------------
-- Export file for user IMPTEMP                    --
-- Created by Administrator on 2010-1-29, 14:14:25 --
-----------------------------------------------------
spool sample.log
prompt
prompt Creating table ROLES
prompt ====================
prompt
create table IMPTEMP.ROLES
(
  ROLENAME NVARCHAR2(50) not null,
  ROLEXML  NCLOB
)
tablespace IMPTEMP
  pctfree 10
  initrans 1
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
alter table IMPTEMP.ROLES
  add constraint ROLES_PRIMARY_KEY primary key (ROLENAME)
  using index
  tablespace IMPTEMP
  pctfree 10
  initrans 2
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
prompt
prompt Creating table USERS
prompt ====================
prompt
create table IMPTEMP.USERS
(
  USERID   NVARCHAR2(50) not null,
  USERNAME NVARCHAR2(50),
  ROLENAME NVARCHAR2(50),
  PASSWORD NVARCHAR2(50),
  USERXML  NCLOB,
  USERDN   NVARCHAR2(100),
  ISLOCAL  NUMBER(1)
)
tablespace IMPTEMP
  pctfree 10
  initrans 1
  maxtrans 255
  storage
  (
    initial 64K
    minextents 1
    maxextents unlimited
  );
comment on column IMPTEMP.USERS.ISLOCAL
  is '0-ISNOTLOCAL  :  1-ISLOCAL';
alter table IMPTEMP.USERS
  add constraint USERS_PRIMARY_KEY primary key (USERID)
  using index
  tablespace IMPTEMP
  pctfree 10
  initrans 2
 


相关文档:

oracle 表空间操作

oracle表空间操作详解
  1
  2
  3作者:   来源:    更新日期:2006-01-04 
  5
  6 
  7建立表空间
  8
  9CREATE TABLESPACE data01
 10DATAFILE '/ora ......

ORACLE 物化视图—Oracle的物化视图

http://blog.csdn.net/XIAOHUI_LIAO/archive/2007/08/27/1759990.aspx
 create materialized view [view_name]
refresh [fast|complete|force]
[
on [commit|demand] |
start with (start_time) next (next_time)
]
as
{创建物化视图用的查询语句}
以上是 ......

Oracle中删除包含物化视图的表空间的方法


今天删除的表空间包含物化视图报错,ORA-23515: 实体化视图和/或它们的索引存在于表空间中
看来是需要删除物化视图,执行删除操作,因为数据太大了,半天也没弄完,取消了,上网查另外一种方法,删除用户,指定cascade 参数,这样就可以了
我试了一下感觉用
drop user user_name cascade;
删除的还是挺快的,比删除物 ......

Oracle排序以及序号的输出

   在一般Select语句中我们通过Order by ...Asc/Desc来进行排序。但是这种排序方式在输出时,不包含排序后的序号信息。
   现在介绍一下Oracle中可以用于排序输出的方法。
   1. RANK ( ) OVER ( [query_partition_clause] order_by_clause )
   RANK ( ) OVER ( [query_p ......

Oracle 日期时间函数的用法

   TO_DATE格式 
Day: 
dd number 12 
dy abbreviated fri 
day spelled out friday 
ddspth spelled out, ordinal twelfth 
Month: 
mm number 03 
mon abbreviated mar 
month spelled out march 
Year: 
yy two digits 98  ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号