sqlplusÏÂÁîµÄÓ÷¨
ÕªÒª£ºsqlplus ÊÇÒ»ÖÖ oracle Êý¾Ý¿â½»»¥Ê½¹¤¾ß£¬ÓÃÓÚÅþÁ¬Êý¾Ý¿â²¢Ö´ÐÐ sql Óï¾ä¡£¿Éͨ¹ýÏÂÁîÐÐÆô¶¯£¬ÏÂÁî½á¹¹°üÀ¨ sql Óï¾ä¡¢·ÖºÅºÍ»»Ðзû¡£»ù±¾ÏÂÁconnect£ºÅþÁ¬Êý¾Ý¿â¡£disconnect£º¶Ï¿ªÅþÁ¬¡£select£ºÅÌÎÊÊý¾Ý¡£update£º¸üÐÂÊý¾Ý¡£insert£º²åÈëÊý¾Ý¡£delete£ºÉ¾³ýÊý¾Ý¡£
SQLPlus ÏÂÁîÓ÷¨
SQLPlus ÊÇ Oracle Êý¾Ý¿âÖÎÀíϵͳÌṩµÄ½»»¥Ê½¹¤¾ß£¬ÓÃÓÚÅþÁ¬µ½Êý¾Ý¿â²¢Ö´ÐÐ SQL Óï¾ä¡£
Æô¶¯ SQLPlus
·¿ªÏÂÁîÐлòÖն˲¢¼üÈëÒÔÏÂÏÂÁ
sqlplus username/password[@database]
µÇ¼ºó¸´ÖÆ
username£ºÊý¾Ý¿âÓû§Ãû
password£ºÊý¾Ý¿âÃÜÂë
@database£º¿ÉÑ¡²ÎÊý£¬Ö¸¶¨ÒªÅþÁ¬µÄÊý¾Ý¿âʵÀý
SQLPlus ÏÂÁî½á¹¹
SQLPlus ÏÂÁîÒ»Ñùƽ³£ÓÉÒÔϲ¿·Ö×é³É£º
SQL Óï¾ä£ºÓÃÓÚÖ´ÐÐÅÌÎÊ¡¢¸üС¢²åÈëºÍɾ³ý²Ù×÷¡£
·ÖºÅ (;)£ºÖÕÖ¹ SQL Óï¾ä¡£
»»Ðзû£ºÖ´ÐÐ SQL Óï¾ä¡£
»ù±¾ÏÂÁî
CONNECT£ºÅþÁ¬µ½Êý¾Ý¿â¡£
DISCONNECT£º¶Ï¿ªÓëÊý¾Ý¿âµÄÅþÁ¬¡£
SELECT£ºÅÌÎÊÊý¾Ý¡£
UPDATE£º¸üÐÂÊý¾Ý¡£
INSERT£º²åÈëÊý¾Ý¡£
DELETE£ºÉ¾³ýÊý¾Ý¡£
ÆäËû³£¼ûÏÂÁî
SHOW USER£ºÏÔʾĿ½ñÓû§¡£
DESC table_name£ºÐÎò±í½á¹¹¡£
SET LINESIZE value£ºÉèÖÃÊä³öÐеÄ×î´ó¿í¶È¡£
SET PAGESIZE value£ºÉèÖÃÊä³öÒ³ÃæµÄ×î´óÐÐÊý¡£
SPOOL file.txt£º½«Êä³öÖض¨Ïòµ½Îļþ¡£
EXIT£ÎÂ˳ö SQLPlus¡£
ʾÀý
ÒÔÏÂʾÀýչʾÁËÔõÑùʹÓà SQLPlus Ö´Ðлù±¾²Ù×÷£º
ÅþÁ¬µ½Êý¾Ý¿â
SQL> CONNECT user1/password@orcl
µÇ¼ºó¸´ÖÆ
ÅÌÎÊÊý¾Ý
SQL> SELECT * FROM employees;
µÇ¼ºó¸´ÖÆ
¸üÐÂÊý¾Ý
SQL> UPDATE employees SET salary = salary * 1.10 WHERE department_id = 10;
µÇ¼ºó¸´ÖÆ
¶Ï¿ªÓëÊý¾Ý¿âµÄÅþÁ¬
SQL> DISCONNECT
µÇ¼ºó¸´ÖÆ
×¢ÖØ£º
SQLPlus ÏÂÁî²»Çø·Ö¾Þϸд¡£
SQL Óï¾ä±ØÐèÒԷֺŠ(;) ×îºó²Å»ªÖ´ÐС£
SQLPlus ÌṩÁËÒ»¸öÏÂÁîÐнçÃ棬ÆäÖÐ SQL> ÊÇÌáÐÑ·û¡£
ÒÔÉϾÍÊÇsqlplusÏÂÁîµÄÓ÷¨µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡