Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

oracleÖеÄdual±íÏê½â

1.DUAL±íµÄÓÃ;
Dual ÊÇ OracleÖеÄÒ»¸öʵ¼Ê´æÔÚµÄ±í£¬ÈκÎÓû§¾ù¿É¶ÁÈ¡£¬³£ÓÃÔÚûÓÐÄ¿±ê±íµÄSelectÓï¾ä¿éÖÐ
--²é¿´µ±Ç°Á¬½ÓÓû§
SQL> select user from dual;
USER
------------------------------
SYSTEM
--²é¿´µ±Ç°ÈÕÆÚ¡¢Ê±¼ä
SQL> select sysdate from dual;
SYSDATE
-----------
2007-1-24 1
SQL> select to_char(sysdate,''yyyy-mm-dd hh24:mi:ss'') from dual;
TO_CHAR(SYSDATE,''YYYY-MM-DDHH2
------------------------------
2007-01-24 15:02:47
--µ±×÷¼ÆËãÆ÷ÓÃ
SQL> select 1+2 from dual;
1+2
----------
3
--²é¿´ÐòÁÐÖµ
SQL> create sequence aaa increment by 1 start with 1;
SQL> select aaa.nextval from dual;
NEXTVAL
----------
1
SQL> select aaa.currval from dual;
CURRVAL
----------
1
2¡¢¹ØÓÚDUAL±íµÄ²âÊÔÓë·ÖÎö
DUAL¾ÍÊǸöÒ»ÐÐÒ»ÁÐµÄ±í£¬Èç¹ûÄãÍùÀïÖ´ÐÐinsert¡¢delete¡¢truncate²Ù×÷£¬¾Í»áµ¼Öºܶà³ÌÐò³öÎÊÌâ¡£½á¹ûÒ²Òòsql*plus¡¢pl/sql devµÈ¹¤¾ß¶øÒì¡£
--²é¿´DUALÊÇʲôOBJECT
--DUALÊÇÊôÓÚSYS schemaµÄÒ»¸ö±í,È»ºóÒÔPUBLIC SYNONYMµÄ·½Ê½¹©ÆäËûÊý¾Ý¿âUSERʹÓÃ.
SQL> select owner, object_name , object_type from dba_objects where object_name like ''%DUAL%'';
OWNER OBJECT_NAME OBJECT_TYPE
---------- ----------------- ------------------
SYS DUAL TABLE
PUBLIC DUAL SYNONYM
--²é¿´±í½á¹¹£¬Ö»ÓÐÒ»¸ö×Ö¶ÎDUMMY£¬ÎªVARCHAR2(1)ÐÍ
SQL> desc dual
Name Type Nullable Default Comments
----- ----------- -------- ------- --------
DUMMY VARCHAR2(1) Y
--DUAL±íµÄ½á¹¹£º
create table SYS.DUAL
(
DUMMY VARCHAR2(1)
)
tablespace SYSTEM
pctfree 10
pctused 40
initrans 1
maxtrans 255
storage
(
initial 16K
next 16K
minextents 1
maxextents 505
pctincrease 50
);
/*
ºÜÊÇÀ§»ó£¬ORACLEΪʲôҪÓÃVARCHAR(1)ÐÍ£¬ÓÃCHAR(1)ÄѵÀ²»ºÃô£¿´ÓÕâÑùµÄ±í½á¹¹À´¿´£¬DUAL±íÉè¼ÆµÄÄ¿µÄ¾ÍÊÇÒª¾¡¿ÉÄܵļòµ¥£¬ÒÔ¼õÉÙ¼ìË÷µÄ¿ªÏú¡£
»¹ÓУ¬DUAL±íÊǽ¨Á¢ÔÚSYSTEM±í¿Õ¼äµÄ£¬µÚÒ»ÊÇÒòΪDUAL±íÊÇSYSÕâ¸öÓû§½¨µÄ£¬±¾À´Ä¬Èϵıí¿Õ¼ä¾ÍÊÇSYSTEM£»µÚ¶þ£¬°ÑÕâ¸ö¿ÉÄܾ­³£±»²éѯµÄ±íºÍÓû§±í·Ö¿ªÀ´´æ·Å£¬¶ÔÓÚϵͳÐÔÄܵÄÊÇÓкô¦µÄ¡£
ÓÐÁË´´½¨ÁË±í¡¢´´½¨ÁËͬÒå´Ê


Ïà¹ØÎĵµ£º

OracleÅäÖñ¾µØNet·þÎñÃû

Ò».ÅäÖñ¾µØNet·þÎñÃûÊǸÉʲôÓõģ¿
Èç¹ûҪͨ¹ýÍøÂç·ÃÎÊOracleÊý¾Ý¿â»òÆäËû·þÎñ£¬¾Í»áÓõ½Net·þÎñÃû¡£Oracle Net
Configuration AssistantÔÊÐíʹÓÃÓɱ¾µØÃüÃû½âÎöµÄÍøÂç·þÎñÃû¡£
¶þ.ÔõÑùÅäÖñ¾µØNet·þÎñÃû£¿
1.´ò¿ª->³ÌÐò/Oracle - OraClient10g_home1/ÅäÖúÍÒÆÖ²¹¤¾ß/Net
Configuration Assistant´ò¿ªNet Co ......

ÈçºÎÐÞ¸ÄOracleĬÈÏÓû§ÃÜÂëÓÐЧÆÚʱ¼ä


ÈçºÎÐÞ¸ÄOracleĬÈÏÓû§ÃÜÂëÓÐЧÆÚʱ¼ä
1¡¢²é¿´Óû§µÄproifleÊÇÄĸö£¬Ò»°ãÊÇdefault£º
sql>SELECT username,PROFILE from dba_users;
2¡¢²é¿´Ö¸¶¨¸ÅÒªÎļþ£¨Èçdefault£©µÄÃÜÂëÓÐЧÆÚÉèÖãº
sql>SELECT * from dba_profiles s WHERE s.profile='DEFAULT' AND resource_name='PASSWORD_LIFE_TIME';
3¡¢½«ÃÜÂëÓÐÐ ......

ORACLEµ¼Èëµ¼³öÃüÁî½âÎö

±¾ÎĶÔOracleÊý¾ÝµÄµ¼Èëµ¼³ö imp ,exp Á½¸öÃüÁî½øÐÐÁ˽éÉÜ, ²¢¶ÔÆäÏàÓ¦µÄ²ÎÊý½øÐÐÁË˵Ã÷,È»ºóͨ¹ýһЩʾÀý½øÐÐÑÝÁ·,¼ÓÉîÀí½â.
ÎÄÕÂ×îºó¶ÔÔËÓÃÕâÁ½¸öÃüÁî¿ÉÄܳöÏÖµÄÎÊÌâ(ÈçȨÏÞ²»¹»,²»Í¬oracle°æ±¾)½øÐÐÁË̽ÌÖ,²¢Ìá³öÁËÏàÓ¦µÄ½â¾ö·½°¸;
±¾ÎIJ¿·ÖÄÚÈÝժ¼×ÔÍøÂç,¸ÐлÍøÓѵľ­Ñé×ܽá;
Ò».˵Ã÷
   oracle µÄexp/i ......

oracle³éÈ¡º¯Êý extract()

auhtor£ºskate
time£º2010/03/03
oracle³éÈ¡º¯Êý
½ñÌìÅóÓÑÎʸöÎÊÌ⣬ÈçºÎ³éȡʱ¼äµÄ“Сʱ”
oracleµÄ³éÈ¡º¯ÊýÊÇ extrac()Óï·¨:
SELECT EXTRACT(YEAR from SYSDATE) from DUAL; return Current Year
SELECT EXTRACT(MONTH from SYSDATE) from DUAL; return Current Month
SELECT EXTRACT(DAY from SYSDA ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ