Oracle Êý¾Ý¿â¹ÜÀí½Å±¾ ÃüÃû¹æ·¶
Oracle ÖеÄÊý¾Ý×ÖµäÊÇÊý¾Ý¿âÖеķdz£ÖØÒªµÄÒ»²¿·Ö£¬ÌṩÁËÏà¹ØÊý¾Ý¿âµÄÐÅÏ¢£¬ËüÊÇËùÓÐ Oracle Óû§£¨´ÓÓ¦ÓõÄ×îÖÕÓû§¡¢Ó¦ÓõÄÉè¼Æ¿ª·¢Õßµ½Êý¾Ý¿â¹ÜÀíÔ±£©µÄ·Ç³£ÖØÒªµÄÐÅÏ¢À´Ô´¡£Êý¾Ý×ÖµäµÄ´´½¨£¬ÊÇÔÚ Oracle Êý¾Ý¿â´´½¨Íê±Ïºó£¬ÔËÐÐһЩÏà¹ØµÄÊý¾Ý¿â¹ÜÀí½Å±¾À´Íê³ÉµÄ¡£µ±²ÉÓà Oracle ͳһ°²×°Æ÷£¨ Oracle Universal Installer £©´´½¨Êý¾Ý¿âʱ£¬ Oracle ·þÎñÆ÷ÓйصÄ×ÖµäÊÓͼºÍ½Å±¾×îºó»á±»×Ô¶¯°²×°¡£µ«µ±ÐèÒªÉý¼¶Ä¿Ç°µÄ Oracle Êý¾Ý¿â·þÎñÆ÷ʱ£¬Êý¾Ý¿â¹ÜÀíÔ±±ØÐëÒªÊÖ¹¤ÖØÐÂÔËÐд´½¨ÕâЩÊÓͼ»ò½Å±¾µÄ SQL ¡£
°²×°ÍêÊý¾Ý¿âºó£¬ Oracle Êý¾Ý¿â¹ÜÀí½Å±¾¾Í´æ·ÅÔÚ²Ù×÷ϵͳÖС£¶ÔÓÚ UNIX ºÍ NT ²Ù×÷ϵͳ£¬·Ö±ðλÓÚ²»Í¬µÄÎïÀíĿ¼Ï£¬¼û±í 1 Ëùʾ£º
²Ù×÷ϵͳ
½Å±¾Ä¿Â¼Î»ÖÃ
UNIX
$ORACLE_HOME/rdbms/admin
NT
%ORACLE_HOME%\rdbms\admin
¡¡±í 1 Êý¾Ý¿â¹ÜÀí½Å±¾ÔÚ²Ù×÷ϵͳÖеÄÎïÀíλÖÃ
Oracle Öм¸ºõËùÓеÄϵͳ¹ÜÀí½Å±¾¶¼±£´æÔÚ¸ÃÎļþĿ¼Ï£¬¸ÃĿ¼Ïº¬ÓÐÉÏ°Ù¸ö²»Í¬Îļþ¡£ÕâЩ²»Í¬µÄÎļþ¶¼ÓÐʲô×÷ÓÃÄØ£¿±¾ÎĽ«ÏêϸÌÖÂÛ×é³É Oracle Êý¾Ý¿â¹ÜÀí½Å±¾µÄÃüÃû¹æ·¶¡£ÕâÑùÓû§¿´µ½Ä³¸öÎļþ´ó¸Å¾Í¿ÉÒÔÖªµÀ¸ÃÎļþÖ÷ÒªÓÃ;ÊÇʲô¡£¸ÃĿ¼ÏµÄÎļþ°´ÕÕ¹¦Äܲ»Í¬¿É·ÖΪ 4 ´óÀ࣬ Oracle ΪÁËÈÝÒ×Çø·ÖÕ⼸À಻ͬµÄÎļþ£¬¶ÔÓÚÎļþµÄÃüÃû×ñ´ÓÒ»¶¨µÄ¹æÔò¡£¼û±í 2 Ëùʾ¡£
ÃüÃû¹æÔò
¹¦ÄÜÃèÊö
cat*.sql
¹ØÓÚĿ¼ºÍÊý¾Ý×ÖµäÐÅÏ¢
dbms*.sql
Êý¾Ý¿âÖйØÓÚ°üµÄ˵Ã÷
prvt*.plb
¼ÓÃܹýµÄ°ü´úÂë
utl*.sql
Êý¾Ý¿âÆäËû¹¦ÄܵıíºÍÊÓͼ
±í 2 Êý¾Ý¿â¹ÜÀí½Å±¾ÃüÃû¹æ·¶
ÏÂÃæÀ´Ïêϸ½éÉÜÕâËÄÖÖ²»Í¬ÀàÐ͵Ľű¾¹¦ÄÜ£º
1 ¡¢ cat*.sql ½Å±¾
¸ÃÀà½Å±¾Ö÷ÒªÓÃÓÚ´´½¨Êý¾Ý×ÖµäÊÓͼ¡£ÆäÖУ¬½Å±¾ catalog.sql ºÍ catproc.sql ÊÇ´´½¨Êý¾Ý¿âºó±ØÐëÒªÔËÐеÄÁ½¸ö½Å±¾¡£ÕâÁ½¸ö½Å±¾µÄ¹¦ÄÜ˵Ã÷¼û±í 3 Ëùʾ¡£
½Å±¾
½Å±¾ËµÃ÷
catalog.sql
´´½¨ÏµÍ³³£ÓõÄÊý¾Ý×ÖµäÊÓͼºÍͬÒå´Ê
catproc.sql
ÔËÐзþÎñÆ÷¶ËËùÐèÒªµÄ PL/SQL ½Å±¾
±í 3 ´´½¨Êý¾Ý×ÖµäÊÓͼ½Å±¾ËµÃ÷
(1) catalog.sql
¸Ã½Å±¾´´½¨Ïà¶ÔÓÚϵͳ»ù±íµÄÊÓͼºÍϵͳ¶¯Ì¬ÐÔÄÜÊÓͼÒÔ¼°ËûÃǵÄͬÒå
Ïà¹ØÎĵµ£º
ËäȻѧϰJavaºÜ¾ÃÁË£¬×Ô¼ºÒ²Á¬½Ó¹ýһЩÊý¾Ý¿â£¬±ÈÈçmysqlÖ®ÀàµÄ£¬Èç½ñÄØ£¬Ò²Ñ§Ï°ÁËÒ»¶Îʱ¼äµÄOracle£¬È»¶øÄØ£¬½ñÌìÊÇÎÒµÚÒ»´ÎÁ¬½ÓOracle£¬ºÙºÙ£¬Ó¦¸Ã»¹²»ËãÌ«³Ù°É¡£
½ñÌìÄØ£¬Óе㱿׾£¬´ó¼ÒĪЦ£¡
ÎÒÕâÊÇÒ»¸ö²éѯÀý×Ó
Ê×ÏÈ£¬Ô ......
µ¼³öOracleÊý¾Ý¿â½á¹¹
1.·½·¨Ò»£ºÖ±½ÓдsqlÓï¾ä
//»ñÈ¡Ò»¸öSCHEMAϵÄËùÓн¨±íºÍ½¨Ë÷ÒýµÄÓï·¨£¬ÒÔscottΪÀý£º
spool portal_schema.sql
SELECT DBMS_METADATA.GET_DDL('TABLE',u.table_name)
from USER_TABLES u;
SELECT DBMS_METADATA.GET_DDL('INDEX',u.index_name)
from USER_INDEXES u;
spool off;
2. ......
½â¾ö°ì·¨£º
1.ʹÓÃOracleÓû§µÇ¼ϵͳ£¬ÔÚCMDÖÐÆôÓÃSQLPLUS
2.sqlplus /nolog
3.SQL> connect /as sysdba
¡¡¡¡¡¡ Connected.
4.SQL> alter user system account unlock;
¡¡¡¡¡¡ User altered.
Ëø¶¨Õ˺ŷ½·¨£º
1.SQL> alter user system account lock;
¡¡¡¡¡¡ & ......
£¨1£© Ñ¡Ôñ×îÓÐЧÂʵıíÃû˳Ðò(Ö»ÔÚ»ùÓÚ¹æÔòµÄÓÅ»¯Æ÷ÖÐÓÐЧ)£º
ORACLEµÄ½âÎöÆ÷°´ÕÕ´ÓÓÒµ½×óµÄ˳Ðò´¦Àífrom×Ó¾äÖеıíÃû£¬from×Ó¾äÖÐдÔÚ×îºóµÄ±í(»ù´¡±í driving table)½«±»×îÏÈ´¦Àí£¬ÔÚfrom×Ó¾äÖаüº¬¶à¸ö±íµÄÇé¿öÏÂ,Äã±ØÐëÑ¡Ôñ¼Ç¼ÌõÊý×îÉٵıí×÷Ϊ»ù´¡±í¡£Èç¹ûÓÐ3¸öÒÔÉϵıíÁ¬½Ó²éѯ, ÄÇ ......
·½°¸1 ÊÊÓÃÓÚoracle9iÒÔÉÏ£¡
select * from
(select row_number() over(order by sendid desc) rn,m.* from xxt_msgreceive m )
where rn <1010 and rn>=1000
·½°¸2
SELECT * from (SELECT A.*, ROWNUM RN from (SELECT * from xxt_msg where sendstatus=1 order by msgid desc) A WHERE ROWNUM < ......