OracleÊý¾Ý¿âSQL*plus³£ÓõÄÃüÁîºÍº¯Êý
OracleÖг£ÓõÄÃüÁîºÍº¯Êý£¬×ö¸öÕûÀí£¬ÒÔ±¸ÒÔºóÓõ½£¬·½±ã²éÔÄ¡£
³£ÓÃÃüÁ
Á¬½Ósqlplus
ÃüÁîÐÐÏÂÔËÐÐcmd½øÈ룬ÈçÒÔsysģʽµÇ½£¬ÃüÁîÈçÏ£º
(1).sqlplus "sys/zhb126 as sysdba"
(2).sqlplus/nolog connect sys/zhb126 as sysdba
(3).sqlplus scott/tiger
Æô¶¯Êý¾Ý¿âʵÀý
startup --Æô¶¯Êý¾Ý¿âµÄͬʱÆô¶¯¿ØÖÆÎļþ¡¢Êý¾ÝÎļþ
startup mount --Æô¶¯Êý¾Ý¿âµÄͬʱÆô¶¯¿ØÖÆÎļþ¡¢²»Æô¶¯Êý¾ÝÎļþ
startup nomount --½öÆô¶¯Êý¾Ý¿âʵÀý£¬ÓÃÓÚ¿ØÖÆÎļþ¶ªÊ§Çé¿ö£¬´Ëʱ¿ØÖÆÎļþÎÞ·¨Æô¶¯
¹Ø±ÕÊý¾Ý¿âʵÀý
shutdown --Õý³£¹Ø±Õ£¨µÈ´ýËùÓÐÓû§¶Ï¿ªÁ¬½Óºó²ÅÄܹرգ©
shutdown immediate--½¨ÒéʹÓã¨ÆÈʹÓû§Ö´Ðе±Ç°SQLºóÁ¢¼´¶Ï¿ªÁ¬½Ó£©
shutdown transactional--£¨ÆÈʹÔÚµ±Ç°Óû§Ö´ÐÐÍêºóÁ¢¼´¶Ï¿ªÁ¬½Ó£©
shutdown abort--Ç¿Öƹرգ¨Ààdb2µÄdb2 stop force£©
²é¿´ÈÕÖ¾¹éµµ·½Ê½--ÓÃstartup mountÆô¶¯Êý¾Ý¿â
archive log list
ALTER DATABASE archivelog
ALTER DATABASE OPEN
²é¿´sqlplusÖ§³ÖµÄÃüÁî
help INDEX
½â³ýÓû§Ëø
ÒÔ°²×°oracleʱµÚÒ»²½ÉèÖõÄÓû§¿ÚÁîµÇ½£¨È磺sqlplus "sys/zhb126 as sysdba"£©ºóÖ´ÐÐ
alter user scott account unlock;
È»ºóÖ´ÐÐsqlplus scott/tiger£¬´Ëʱ»áÒªÇóÄãÐÞ¸ÄscottµÄпÚÁî¡£
ÉèÖÃÃüÁîÐÐÖ§³Ö¿Õ¸ñ
set sqlblanklines on
±äÁ¿Ìæ´ú--±äÁ¿Ìæ»»£¬Õâ¸ö¹ý³ÌÖ»°²ÅÅÒ»¸öÖ´Ðмƻ®£¬¿ÉÌá¸ßÖ´ÐÐЧÂÊ
SQL> select * from dept where deptno = &t;
ÊäÈë t µÄÖµ: 10
ÔÖµ 1: select * from dept where deptno = &t
ÐÂÖµ 1: select * from dept where deptno = 10
²é¿´»º³åÆ÷Ö´ÐйýµÄÃüÁî (list/l)
SQL> l
1* select * from dept where deptno = &t
SQL> l1
1* select * from dept where deptno = &t
»º³åÇøÎļþµÄ±£³Ö¡¢Ö´ÐÐ
SQL> save d:\test.sql --±£´æ»º³åÇøÎļþµ½Ö¸¶¨ÎļþÖÐ
ÒÑ´´½¨ file d:\test.sql
SQL> @d:\test.sql --Ö´Ðб£´æÎļþµÄSQL
²é¿´±í½
Ïà¹ØÎĵµ£º
ϵͳ»·¾³£ºWindows 7
Èí¼þ»·¾³£ºVisual C++ 2008 SP1 +SQL Server 2005
±¾´ÎÄ¿µÄ£º±àдһ¸öº½¿Õ¹ÜÀíϵͳ
ÕâÊÇÊý¾Ý¿â¿Î³ÌÉè¼ÆµÄ³É¹û£¬ËäÈ»³É¼¨²»¼Ñ£¬µ«ÊÇ×÷ΪÎÒÓÃVC++ ÒÔÀ´±àдµÄ×î´ó³ÌÐò»¹ÊÇ´«µ½ÍøÉÏ£¬ÒÔ¹©²Î¿¼¡£ÓÃVC++ ×öÊý¾Ý¿âÉè¼Æ²¢²»ÈÝÒ×£¬µ«Ò²²»ÊDz»¿ÉÄÜ¡£ÒÔÏÂÊÇÎҵijÌÐò½çÃ棬ºóÃæ ......
ѧϰOracle DBAÒ²°ë¸ö¶àѧÆÚÁË£¬½ñÌìÃÍÈ»²Å·¢ÏÖ£¬ÔÀ´ÎÒµÄÊ黹ÊǺÜеģ¬ÉϿβÙ×÷ʱºòÒ²Ö»ÊÇÖªµÀ´ó¸ÅÔõô×ö£¬µ«ÊÇÒªÕæµÄÈ«²¿×Ô¼º×ö£¬¶ø²»È¥·Ê黹ÊÇÓÐÒ»¶¨µÄÄѶȵģ¬ËùÒÔÄØ£¬½ñÌ쿪ʼ½«DBA´ÓÍ·¸´Ï°Ò»±é£¬Í¬Ê±ÔÙ²Ù×÷Ò»±é¡£
µÚÒ»Õ£¬Ñ§µÄÊÇOracleµÄÌåϵ½á¹¹£ ......
1.ÔÚ±íÖ®¼ä´«ÊäÊý¾Ý
1£©ÀûÓÃINSERT´«ÊäÊý¾Ý
insert into test1 (select name2,age2 from test2);
´ÓÉÏÃæµÄ²Ù×÷¿ÉÒÔ¿´³ö£¬¿Éͨ¹ýSELECTÏòÒ»¸ö±íÖгÉÅúµØÌí¼ÓÊý¾Ý£¬µ«Ó¦×¢Ò⣺Êý¾ÝÀàÐÍÒªÒ»Ö£¬ËùÑ¡ÔñµÄÁÐÊýÓ¦Ò»Ö¡£´ËÓï¾äµÄÓï·¨¸ñʽÈçÏ£º
INSERT INTO table_name (
SELECT statement
) ;
2£©»ùÓÚÒÑÓÐµÄ±í½¨Á¢Ð ......
ÎÊ£ºÔõÑùÔÚÒ»¸öUPDATEÓï¾äÖÐʹÓñíBµÄÈý¸öÁиüбíAÖеÄÈý¸öÁУ¿
¡¡¡¡´ð£º¶ÔÕâ¸öÎÊÌ⣬Äú¿ÉÒÔʹÓÃÇ¿´óµÄ¹Øϵ´úÊý¡£±¾Ò³ÖеĴúÂë˵Ã÷ÁËÈçºÎ×éºÏʹÓÃfrom×Ó¾äºÍJOIN²Ù×÷£¬ÒÔ´ïµ½ÓÃÆäËû±íÖÐÊý¾Ý¸üÐÂÖ¸¶¨ÁеÄÄ¿µÄ¡£ÔÚÉè¼Æ¹Øϵ±í´ïʽʱ£¬ÄúÐèÒª¾ö¶¨ÊÇ·ñÐèÒªµ¥Ò»ÐÐÆ¥Åä¶à¸öÐУ¨Ò»¶Ô¶à¹Øϵ£©£¬»òÕßÐèÒª¶à¸öÐÐÆ¥Åä±»Áª½Ó±íÖеĵ¥Ò» ......
ÎÊ£ºÔõÑùÔÚÒ»¸öUPDATEÓï¾äÖÐʹÓñíBµÄÈý¸öÁиüбíAÖеÄÈý¸öÁУ¿
¡¡¡¡´ð£º¶ÔÕâ¸öÎÊÌ⣬Äú¿ÉÒÔʹÓÃÇ¿´óµÄ¹Øϵ´úÊý¡£±¾Ò³ÖеĴúÂë˵Ã÷ÁËÈçºÎ×éºÏʹÓÃfrom×Ó¾äºÍJOIN²Ù×÷£¬ÒÔ´ïµ½ÓÃÆäËû±íÖÐÊý¾Ý¸üÐÂÖ¸¶¨ÁеÄÄ¿µÄ¡£ÔÚÉè¼Æ¹Øϵ±í´ïʽʱ£¬ÄúÐèÒª¾ö¶¨ÊÇ·ñÐèÒªµ¥Ò»ÐÐÆ¥Åä¶à¸öÐУ¨Ò»¶Ô¶à¹Øϵ£©£¬»òÕßÐèÒª¶à¸öÐÐÆ¥Åä±»Áª½Ó±íÖеĵ¥Ò» ......