Fedora10 É쵀 Oracle 10.2.0.1 ÊÖ¹¤½¨¿âÈ«¹ý³Ì
Fedora10 É쵀 Oracle 10.2.0.1 ÊÖ¹¤½¨¿âÈ«¹ý³Ì
NOTE:
(1)¼Ç×ÅÒªÔÚoracleÓû§Ï¶ø²»ÊÇrootÏÂÖ´ÐÐÕâЩ²Ù×÷£¬·ñÔòÒòΪȨÏÞµÄÎÊÌâ»á´øÀ´ÎÞÇîÎÞ¾¡µÄÂé·³
(2)Òª¼ì²é¹ý³ÌÖÐËùÓгöÏÖµÄĿ¼Ãû¶¼ÊǶÔÓ¦ÕýÈ·ÇÒÓÐЧµÄ£¬·ñÔò¼¸ºõûÓпÉÓõĴíÎóÐÅÏ¢À´²éÕÒÕâÖÖ´íÎó
(3)Òª¼ì²é¹ý³ÌÖÐËùÓгöÏÖµÄÃû³Æ¶¼ÊÇÕýÈ·¶ÔÓ¦µÄ£¬Èçinitbankdb.oraÖеÄundo_tbsÓëdatabase.sqlÖеÄÒ»ÖÂ
(4)scimÔÚFedora10Ó¢ÎÄ»·¾³ÖÐʹÓÃ: $ im-chooser
(1)ÉèÖû·¾³±äÁ¿
$ export ORACLE_BASE=/u01/app/oracle/oracle
$ export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
$ export ORACLE_SID=bankdb
(×¢£ºORACLE_BASEºÍORACLE_HOME±äÁ¿µÄÉèÖúͰ²×°OracleÀïµÄÉèÖÃÒ»Ñù¡£
Èç¹ûÄúÔÚͬһ·þÎñÆ÷ÉÏ°²×°Á˶à¸ö Oracle ²úÆ·»òÊý¾Ý¿â£¬Ôò ORACLE_HOME¡¢ORACLE_SID ºÍ PATH ±äÁ¿¿ÉÄÜ»á¸ü¸Ä¡£ORACLE_BASE ±äÁ¿²»Ó¦¸ü¸Ä£¬²¢¿ÉÒÔÔÚÐèҪʱÔÚÄúµÄµÇ¼ÅäÖÃÎļþÖÐÉèÖÃËü¡£
ORACLE_BASEÏÂÊÇadminºÍproduct£¬ORACLE_HOMEÏÂÔòÊÇORACLEµÄÃüÁî¡¢Á¬½Ó¿â¡¢°²×°ÖúÊÖ¡¢listenerµÈµÈһϵÁеĶ«¶«¡£ÕâÖ»ÊÇORACLE×Ô¼ºµÄ¶¨ÒåÏ°¹ß¡£ORACLE_HOME±ÈORACLE_BASEĿ¼Ҫ¸üÉîһЩ¡£Ò²¾ÍÊÇ˵£ºORACLE_HOME£½$ORACLE_BASE/product/version¡£
ORACLE_BASEÊÇoracleµÄ¸ùĿ¼£¬ORACLE_HOMEÊÇoracle²úÆ·µÄĿ¼¡£¼òµ¥Ëµ£¬ÄãÈç¹û×°ÁË2¸ö°æ±¾µÄoracle£¬ÄÇôORACLE_BASE¿ÉÒÔÊÇÒ»¸ö£¬µ«ORACLE_HOMEÊÇ2¸ö)
(2)½¨Á¢ÃÜÂëÎļþ
$ orapwd file=$ORACLE_HOME/dbs/bankdb.pwd password=oracle entries=30 force=y
(3)½¨³õʼ»¯²ÎÊýÎļþpfile
$ gedit $ORACLE_HOME/dbs/init$ORACLE_SID.ora
control_files = ( /u01/app/oracle/oradata/bankdb/control.001.dbf,
/u01/app/oracle/oradata/bankdb/control.002.dbf,
/u01/app/oracle/oradata/bankdb/control.003.dbf )
db_name &nbs
Ïà¹ØÎĵµ£º
1 ²éѯsqlÓÅ»¯
1.1 Ñ¡Ôñ×îÓÐЧÂʵıíÃû˳Ðò£¨Ö»ÔÚ»ùÓÚ¹æÔòµÄÓÅ»¯Æ÷ÖÐÓÐЧORACLE£©
½âÎöÆ÷°´ÕÕ´ÓÓÒµ½×óµÄ˳Ðò´¦Àífrom×Ó¾äÖеıíÃû£¬Òò´Ëfrom×Ó¾äÖÐдÔÚ×îºóµÄ±í£¨»ù´¡±ídriving table£©½«±»×îÏÈ´¦Àí¡£ÔÚfrom×Ó¾äÖаüº¬¶à¸ö±íµÄÇé¿öÏ£¬Äã±ØÐëÑ¡Ôñ¼Ç¼ÌõÊý×îÉٵıí ......
ת×Ô£ºhttp://blog.csdn.net/scorpio3k/archive/2009/05/09/4162079.aspx
ÔںܶàÇé¿öÏ£¬ÎÒÃÇʹÓÃHibernateÔÚÒѾ½¨Á¢ºÃÊý¾Ý¿âµÄ»ù´¡ÉÏ¡£ÔÚoracleÖУ¬Èç¹ûÒѾ½¨Á¢ºÃµÄÊý¾Ý¿âÖÐʹÓÃÁËsequence
,Ôò¿ÉÒÔ°´ÕÕÏÂÃæµÄ²½Öè°ÑËüÒýÈëµ½HibernateÖУº
1¡¢ÔÚoracle Ê×ÏÈ´´½¨sequence
......
Íⲿ±í×÷ÓÃ:¼ÓÔغÍжÔØÊý¾Ý
Íⲿ±í¶¼ÊÇÖ»¶Á±í,²»ÄܽøÐÐupdate,insert,delete²Ù×÷.
Oracle ÌṩÁ½ÖÖ·ÃÎÊÇý¶¯: ORACLE_LOADER, ORACLE_DATAPUMP(oracle 10.2ºóÐÂÔöµÄÇý¶¯)
ORACLE_LOADER: ËüÀûÓÃoracle loader¼¼Êõ´ÓÍⲿ±í¶ÁÈ¡Êý¾Ý. Ëü»¹¾ßÓÐÀàËÆSQL*Loader¹¤¾ß¿ØÖÆÎļþÓï·¨µÄÊý¾ÝÓ³ÉäÄÜÁ¦.
ORACLE_DAT ......
oracleÖУ¬
±í½á¹¹ÈçÏ£º
create table device
(
id number(10) not null primary key,
dept varchar2(50) not null
)
tablespace users
/
Òª½«dept×ֶθüгÉÈçÏÂÄÚÈÝ£ºselect * from message where name='tom'
ÎÒÊÔ¹ýʹÓÃÈçϵĸüÐÂÓï¾ä²»ÐУºupdate device set dept='selec ......
oracleȨÏÞÌåϵÖÐÓиödefault role£¬±È½ÏÄÑÒÔÀí½â¡£ÏÂÃæÓÃʵÀý˵Ã÷Ò»ÏÂ×÷Óá£
ÎÒÃÇ¿ÉÒÔ¸øij¸öÓû§·ÖÅäһЩ½ÇÉ«£¬±ÈÈçrole r1,r2,r3,r4£¬¶øÆäÖпÉÒÔ½«Ä³Ð©½ÇÉ«±ÈÈçr1ÉèÖÃΪdefault role£¬ÆäËûµÄ²»ÉèÖóÉdefault role£¬ÕâÑù£¬µ±¸ÃÓû§µÇ¼ʱ£¬×Ô¶¯¾ßÓÐdefault roleÖÐËù°üº¬µÄȨÏÞ£¬ÆäËûµÄ½ÇÉ«Ëù¾ßÓеÄȨÏÞҪͨ¹ýset role ½ÇÉ ......