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 基本知识 问题

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