WEB开发网
开发学院数据库Oracle Oracle基本知识及问题解决 阅读

Oracle基本知识及问题解决

 2007-05-10 12:17:36 来源:WEB开发网   
核心提示: create table test_name1(a NUMBER(10) not null,b NUMBER(10) null ,c NUMBER(3) defalut 0,d number(3) not null ,constraint PK_ test_user primary key
  create table test_name1
  (
  a NUMBER(10) not null,
  b NUMBER(10) null ,
  c NUMBER(3) defalut 0,
  d number(3) not null ,
  constraint PK_ test_user primary key (a)
  using index
  tablespace test_name1
  storage
  (
  initial 1m
  next 1m
  pctincrease 0
  )
  )
  pctfree 10
  tablespace test_name1
  storage
  (
  initial 1m
  next 1m
  pctincrease 0
  )
  partition by range(d)
  (partition part000 values less than (1) tablespace test_name1,
  partition part001 values less than (2) tablespace test_name1,
  )

6、创建索引

  create index id_tablename1 on test_name1 (f2)
  tablespace ts_name
  storage
  (
  initial 500k
  next 500k
  pctincrease 0
  )

三、查询表空间

  select substr(a.TABLESPACE_NAME,1,10) TablespaceName,
  sum(a.bytes/1024/1024) totle_size,
  sum(nvl(b.free_space1/1024/1024,0)) free_space,
  sum(a.bytes/1024/1024)-sum(nvl(b.free_space1/1024/1024,0)) used_space,
  round((sum(a.bytes/1024/1024)-sum(nvl(b.free_space1/1024/1024,0)))*100/sum(a.bytes/1024/1024),2) used_percent
  from dba_data_files a,
  (select sum(nvl(bytes,0)) free_space1,file_id
  from dba_free_space
  group by file_id) b
  where a.file_id = b.file_id(+)
  group by a.TABLESPACE_NAME

上一页  1 2 3 

Tags:Oracle 基本知识 问题

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接