Oracle ±Ê¼Ç
µÚ1Ò³
1. Oracle µÄʹÓÃ
1.1. SQLPLUS µÄÃüÁî
³õʼ»¯±íµÄλÖãº
set
NLS_LANG=american_america.us7ascii (ÉèÖñàÂë²Å¿ÉÒÔʹÓÃÏÂÃæ½Å±¾)
cd
$ORACLE_HOME/rdbms cd demo summit2.sql
*********************************
ÎÒÃÇĿǰʹÓõÄÊÇoralce 9i
9201 °æ±¾
select * from
v$version;
»Ö¸´Á·Ï°±íÃüÁ
sqlplus **/** @summit2.sql //shellÒªÔÚÕâ¸öÎļþµÄλÖá£
µÇ½ oracleµÄÃüÁ
sqlplus Óû§Ãû/ÃÜÂë
show user
ÏÔʾµ±Ç°µÇ½µÄÉí·Ý.
set pause on
set pause off
·ÖÒ³ÏÔʾ.
oracle ÖÐĬÈÏÈÕÆÚºÍ×Ö·ûÊÇ×ó¶ÔÆ룬Êý×ÖÊÇÓÒ¶ÔÆë
table or view
does not
exist ; ±í»òʾͼ²»´æÔÚ
edit ÃüÁîÓÃÓÚ×Ô¶¯´ò¿ªvi Ð޸ĸÕÐÞÖ´ÐйýµÄ sql µÄÃüÁî¡£
Ð޸ķ½·¨¶þ£º
l 3 Ïȶ¨Î»µ½ÐÐ c /¾É´®/д®
Ö´Ðгö´íʱ£¬ÀûÓôíÎóºÅÀ´²é´íÎó:
!oerr ora
942 (×°Íêϵͳºó»á×°Ò»¸ö oerr ¹¤¾ß£¬ÓÃÓÚͨ¹ý´íÎóºÅÀ´²é¿´´íÎóµÄ¾ß
ÌåÐÅÏ¢)
ÏëÔÚ sql ÖÐÖ´ÐÐ
unix ÃüÁîʱ£¬°ÑËùÓеÄÃüÁîÇ°¼ÓÒ»¸ö!¾Í¿ÉÒÔ£¬ »òÕß
host( ÓÃÓÚ
´Ó sql ´ÓÇл»ÖÁunix»·¾³ÖÐÈ¥)
/*** ³õ´ÎʹÓÃʱעÒâ ****
ÔËÐнDZ¾Ê±µÄÃüÁ
ÏÈÇл»µ½ unix»·¾³Ï£¬cd
$oracle_home cd sqlplus cd demo ÏÂÃæÓÐÁ½¸ö½Ç±¾
½¨±íÓï¾ä¡£ µÚ2Ò³
@demobld.sql
sqlplus
nanjing/nanjing @demobid.sql Ö±½ÓÔËÐнDZ¾£¬ºóÃæ¸úµ±Ç°Ä¿Â¼»òÕßÊǾø¶Ô
·¾¶
±£´æ¸Õ²ÅµÄ sql Óï¾ä£º save ÃüÁî µÚ¶þ´Î±£´æʱҪÌ滻֮ǰµÄ½Ç±¾ save
ÎļþÃû
replace
°Ñ¸Õ²Å±£µÄ sql ÖØзÅÈë buffer ÖÐ
spool on ¿ªÆô¼Ç¼
spool off ¹Ø±Õ¼Ç¼
spool ÎļþÃû ´ËÃüÁî»á°ÑËùÓеIJÙ×÷´æÔÚij¸öÎļþÖÐÈ¥
³£¼ûËõд£º
nls national
langua
Ïà¹ØÎĵµ£º
oracle±í¿Õ¼ä²Ù×÷Ïê½â
1
2
3×÷Õߣº À´Ô´£º ¸üÐÂÈÕÆÚ£º2006-01-04
5
6
7½¨Á¢±í¿Õ¼ä
8
9CREATE TABLESPACE data01
10DATAFILE '/ora ......
¼ÙÉèÊý¾Ý¿âµÄÓµÓÐÕßΪoracle£¬Êý¾Ý¿âµÄÓû§Îªscott£¬Æä¿ÚÁîΪtrigger£¬
OracleÊý¾Ý¿âµÄ²ÎÊý$ORACLE_HOMEΪ/usr/oracle£¬$ORACLE_SIDΪoracle1£¬ÔòʵÏÖ²½ÖèÈçÏ£º
1¡¢½¨Á¢ÊµÏÖ±¸·ÝµÄshell
ÔÚ/usr/oracleÖÐÓÃviÃüÁÁ¢Îļþbackup.sh£¬ÆäÄÚÈÝΪ:
ORACLE_HOME=/usr/oracle; <br>export ORACLE_HOME;
ORACLE_SID= ......
¸ü¸Ä±íµÄ½á¹¹
1.±à¼±íµÄ×Ö¶Î
ÐÞ¸ÄÒ»¸öÁеÄÊý¾ÝÀàÐÍ(Ò»°ãÏÞÓÚÐ޸ij¤¶È£¬ÐÞ¸ÄΪһ¸ö²»Í¬ÀàÐÍʱÓÐÖî¶àÏÞÖÆ):
Óï·¨:
ALTER TABLE ±íÃû MODIFY(ÁÐÃû Êý¾ÝÀàÐÍ);
eg1:
alter table skate_test modify (author number(10,0) )
ÔÚÐÞ¸ÄÁеij¤¶Èʱºò,Ö»Äܱ ......
Ä¿Ç°£¬ÕýÔò±í´ïʽÒѾÔںܶàÈí¼þÖеõ½¹ã·ºµÄÓ¦Ó㬰üÀ¨*nix£¨Linux, UnixµÈ£©£¬HPµÈ²Ù×÷ϵͳ£¬PHP£¬C#£¬JavaµÈ¿ª·¢»·¾³¡£
Oracle 10gÕýÔò±í´ïʽÌá¸ßÁËSQLÁé»îÐÔ¡£ÓÐЧµÄ½â¾öÁËÊý¾ÝÓÐЧÐÔ£¬ Öظ´´ÊµÄ±æÈÏ, Î޹صĿհ׼ì²â£¬»òÕß·Ö½â¶à¸öÕýÔò×é³É
µÄ×Ö·û´®µÈÎÊÌâ¡£
Oracle 10gÖ§³ÖÕýÔò±í´ïʽµÄËĸöк¯Êý ......
Ò»¡¢Á˽ⱸ·ÝµÄÖØÒªÐÔ
¡¡¡¡¿ÉÒÔ˵£¬´Ó¼ÆËã»úϵͳ³öÊÀµÄÄÇÌìÆ𣬾ÍÓÐÁ˱¸·ÝÕâ¸ö¸ÅÄ¼ÆËã»úÒÔÆäÇ¿´óµÄËٶȴ¦ÀíÄÜÁ¦£¬È¡´úÁ˺ܶàÈËΪµÄ¹¤×÷£¬µ«ÊÇ£¬ÍùÍùºÜ¶àʱºò£¬ËüÓÖÊÇÄÇôÈõ²»½û·ç£¬Ö÷°åÉϵÄоƬ¡¢Ö÷°åµç·¡¢ÄÚ´æ¡¢µçÔ´µÈÈκÎÒ»Ïî²»ÄÜÕý³£¹¤×÷£¬¶¼»áµ¼Ö¼ÆËã»úϵͳ²»ÄÜÕý³£¹¤×÷¡£µ±È»£¬ÕâЩË𻵿ÉÒÔÐÞ¸´£¬²»»áµ¼ÖÂÓ¦Óú ......