oracleѧϰ±Ê¼Ç1 ¼òµ¥³£Ê¶
Ä¿Ç°Ö÷Á÷Êý¾Ý¿â£º
΢Èí£ºsql serverºÍaccess
ÈðµäMySql£ºAB¹«Ë¾mysql
IBM¹«Ë¾£ºDB2¡¢
ÃÀ¹úSybase¹«Ë¾£ºSybase
IBM¹«Ë¾£ºinformix
ÃÀ¹úoracle¹«Ë¾£ºoracle
¶ÔÓÚoracleµÄ¹¤×÷¸ÚλÐèÇóÄÇÊÇÏ൱µÄ´ó°¡¡£
OracleÓÐÈý¸öÈÏÖ¤£ºoca¡¢ocp¡¢ocm
Oracle°²×°¹ý³ÌÖÐ×¢ÒâsysÓû§ºÍsystemÓû§µÄĬÈÏÃÜÂ룬µ±È»£¬ÕâÒ²ÊÇ¿ÉÒÔ¸ü¸ÄµÄ¡£
ÒªÏëʹÓÃoracle£¬¼ÇµÃ¿ª·þÎñ:o´òÍ·µÄ……ListenerºÍ……Service……Á½¸ö·þÎñ¡£
Oracle¹ÜÀí¹¤¾ßÖ÷ÒªÓУº
Sqlplus¡¢sqlplusw¡¢plsqldeveloper……
oracle 9i»áÔÚ°²×°¹ý³ÌÖÐĬÈÏÌṩ¸øÄãsysºÍsystemµÄÃÜÂë
oracle 10gÊÇÈÃÓû§×Ô¼ºÀ´ÌîдµÄ¡£»¹ÓоÍÊÇÎÒÃǺܳ£ÓõÄScottÓû§ÊDZ»ËøµÄ£¬¸Õ¿ªÊ¼ÎÒÃǵǼ²»ÉÏÈ¥£¬ÕâʱÎÒÃÇÓ¦¸ÃÏÈÓÃdbaÓû§µÇ¼£¬È»ºóÖ´ÐÐÕâ¸öÃüÁîÀ´½âËø£ºalter user scott account unlock;
»ù±¾²Ù×÷ÃüÁ
1¡¢Á¬½ÓÃüÁconn[ect]
Ó÷¨£ºconn Óû§Ãû/ÃÜÂë@ÍøÂç·þÎñÃû [as sysdba/sysoper]£¬µ±ÓÃÌØȨÓû§µÇ¼ʱ£¬±ØÐë´øÉÏas sysdba/sysoper¡£ÍøÂç·þÎñÃû¾ÍÊÇÖ¸µÄÊÇÊý¾Ý¿âʵÀý¡£Èç¹û»úÆ÷ÉϾÍ×°ÁËÒ»¸ö£¬ÄÇĬÈÏÊÇ¿ÉÒÔÕÒµ½µÄ£¬ËùÒÔ²»ÓÃд¡£Èç¹ûʹÓÃÈçÏÂÃüÁconn system/ÃÜÂë as sysdba;show userÖ®ºó»á·¢ÏÖÓû§ÃûÊÇsys£¬ËµÃ÷ϵͳ½«ÒÔsysdbaÉí·ÝµÇ¼µÄsystemÓû§Ä¬ÈÏת³ÉÁËȨÏÞ¸ü¸ßµÄsys¡£
2¡¢disc[onnect]¸ÃÃüÁîÓÃÀ´¶Ï¿ªÓ뵱ǰÊý¾Ý¿âµÄÁ¬½Ó¡£
3¡¢passw[ord]¸ÃÃüÁîÓÃÀ´ÐÞ¸ÄÓû§µÄÃÜÂ룬Èç¹ûÒªÏëÐÞ¸ÄÆäËûÓû§µÄÃÜÂ룬ÐèÒªÓÃsys»òÊÇsystemÓû§µÇ¼¡£
4¡¢show userÏÔʾµ±Ç°Óû§Ãû
5¡¢exit¶Ï¿ªÓëÊý¾Ý¿âµÄÁ¬½Ó£¬Í¬Ê±»áÍ˳ö¡£
Îļþ²Ù×÷ÃüÁ
1¡¢ startºÍ@ÔËÐÐsql½Å±¾¡£
Eg£ºsql>start d:\a.sql»òsql>@ d:\a.sql
2¡¢ edit¸ÃÃüÁî¿ÉÒÔ±à¼Ö¸¶¨µÄsql½Å±¾
eg£ºedit d:\a.sql
3¡¢ spool¿ÉÒÔ½«sql*plusÆÁÄ»ÉϵÄÄÚÈÝÊä³öµ½Ö¸¶¨ÎļþÖÐÈ¥¡£
Eg£ºspool d:\b.sqlÓÃspool off;ÃüÁî½áÊø
ÏÔʾºÍÉèÖû·¾³±äÁ¿£º
¿ÉÒÔÓÃÀ´¿ØÖÆÊä³öµÄ¸÷ÖÖ¸ñʽ£¬Èç¹ûÏ£ÍûÓÀ¾ÃµÄ±£´æÏà¹ØµÄÉèÖ㬿
Ïà¹ØÎĵµ£º
±¸·ÝµÄ·½·¨
ORACLEÊý¾Ý¿âÓÐÈýÖÖ±ê×¼µÄ±¸·Ý¡£µ¼³ö/µ¼Èë(EXPORT/IMPORT) ¡¢À䱸·Ý¡¢Èȱ¸·Ý¡£
µ¼³ö±¸·ÝÊÇÒ»ÖÖÂß¼±¸·Ý£¬ÕâÖÖ·½·¨°üÀ¨¶ÁȡһϵÁеÄÊý¾Ý¿âÈÕÖ¾£¬²¢Ð´ÈëÎļþÖУ¬ÕâЩÈÕÖ¾µÄ¶ÁÈ¡ÓëÆäËù´¦Î»ÖÃÎ޹ء£
À䱸·ÝºÍÈȱ¸·ÝÊÇÎïÀí±¸·Ý(Ò²³ÆµÍ¼¶±¸·Ý)£¬ËüÉæ¼°µ½ ......
Oracle
ÖеÄÈÕÆÚÀàÐͼ°ÆäÏà¹ØµÄº¯Êý
Oracle
ÌṩÁ˺ܶàµÄÄÚÖõÄÈÕÆÚÀàÐÍ£¬°üÀ¨Èçϼ¸ÖÖ£º
Date
Timestamp
Timestamp With Time Zone
Timestamp With Local Time Zone
Interval Year To Month
Interval Day To Second
DateÀàÐÍÓÃÓÚ´æ´¢ÈÕÆÚ£¬¾«È·µ½Ã룬¿ÉÄÜͨ¹ýÉèÖÃNLS_DATE_FORMAT»òÕßTO_CHAR·½·¨À´¸ñʽ»¯ÈÕÆÚµÄÊ ......
dc-test2<oracle>sqlplus /nolog
SQL*Plus: Release 10.2.0.4.0 - Production on Thu Feb 25 19:23:35 2010
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
SQL> desc v$datafile;
SP2-0640: Not connected
SP2-0641: "DESCRIBE" requires connection to server
SQL> conn / a ......
oracleÊý¾Ý¿âµÄµ¼ÈëÓëµ¼³öÊÇ×öΪһÃûʵʩ¹¤³Ìʦ»òά»¤¹¤³Ìʦÿ¾³£Òª×öµÄ¹¤×÷¡£µ±Êý¾Ý¿â½á¹¹ÐèÒª×ö±ä»¯µÄʱºò£¬ÎÒÃÇÒ»°ãÏȽ«Êý¾Ý×ö±¸·Ý£¬´ËʱÎÒÃÇÐèҪʹÓõ½OracleµÄµ¼³ö¹¦ÄÜ¡£µ±ÎÒÃÇÔÚ×öµ¼ÈëµÄʱºò³ö´í»òÕßÎÒÃǵÄÊý¾ÝÔâµ½´íÎóɾ³ýµÄʱºò£¬ÎÒÃÇÐèÒª»Ö¸´Êý¾Ý¿â£¬ÄÇÎÒÃÇÐèҪʹÓõ½µ¼ÈëµÄ¹¦ÄÜ¡£ÏÖÔÚÒ²Óкܶ๦ÄÜÄܹ»°ïÎÒÃÇ×öµ½ ......
recordʾÀý£º
create or replace procedure pro_test_record(vid in varchar2) is
type userRow is record(
id t_user.id%type,
name t_user.name%type
);
realRow userRow;
begin
select id,name into realRow from t_user where id=vid;
dbms_output.put_line(realRow.id||','||realRow.name);
end pro_test_re ......