Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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·¢²¼SunµÄ¸÷Ïî²úÆ·µÄδÀ´µÄFAQÁбí


Ô­·¢±íÓÚhttp://saharabear.javaeye.com
ͬʱ·¢±íÔÚÕâÀï.
²»ÐèÒªÏàÐÅÉÌÒµÉϵÄÈκγÐŵ,²»¹ýÈκεĹٷ½FAQ¶¼»áÓвο¼¼ÛÖµ,ÕâÀï
ÊÇOracle·¢²¼µÄÕë¶ÔSunµÄ¸÷Ïî²úÆ·µÄһЩ˵Ã÷µÄFAQ,»ù±¾ÉÏÃèÊöÁ˶ÔGlassfish¼ÌÐøÖ§³Ö,¶ÔNetbeans¼ÌÐø¿ª·¢µÄ̬¶È,²»¹ý,kenai.com,ΰ´óµÄ"ÎÒÃDz»½ö½öÊÇ´úÂëÍйÜ"µÄÉç½»ÐÔ¿ª·¢Õ¾µã,»ù± ......

Oracleά»¤³£ÓÃSQLÓï¾ä»ã×Ü


¡¡ÈçºÎÔ¶³ÌÅжÏOracleÊý¾Ý¿âµÄ°²×°Æ½Ì¨
¡¡¡¡select * from v$version;
¡¡¡¡²é¿´±í¿Õ¼äµÄʹÓÃÇé¿ö
¡¡¡¡select sum(bytes)/(1024*1024) as free_space,tablespace_name
¡¡¡¡from dba_free_space
¡¡¡¡group by tablespace_name;
¡¡¡¡SELECT A.TABLESPACE_NAME,A.BYTES TOTAL,B.BYTES USED, C.BYTES FREE,
¡¡¡¡(B.BYTE ......

Oracle Óαê Cursor ʹÓÃ

create or replace procedure getok
as
cursor mycur is select ids,name from aaa where name not in (select names from ok);
vempno aaa.ids%type;
vename aaa.name%type;
begin
open mycur;
loop
fetch mycur into vempno,vename;
exit when mycur%notfound;
if mycur%found then
    insert ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ