Oracle Database µÄѧϰ±Ê¼Ç
SQL:½á¹¹»¯²éѯÓïÑÔ
C R U D: Ôöɾ¸Ä²é
table : name age score
desc+±íÃû ---> ²éѯ±í½á¹¹
»òÕßÓà describe ÃüÁî (descÊÇdescribeµÄ¼òд)
²éѯÓïÑÔ£ºSELECT [DISTINCT] {*,column[alias],...} from table;
SELECT identifies what columns from identifies which table
******* SELECT ²éʲô from ´ÓÄÄÀï²é *******
SELECT dept_id,last_name,manager_id from s_emp;
Óöµ½¿Õֵʱ¿ÉÒÔÕâÑù²Ù×÷£º
SELECT last_name,title,salary*NVL(commission_pct,0)/100 COMM from s_emp;
Åųý²éѯʱ³öÏÖÖØÃûÏÖÏó £¬Óùؼü×Ö DISTINCT
eg: SELECT DISTINCT name from s_dept;
ÅųýÁ½¸ö×Ö¶ÎÁ¬ºÏÆðÀ´»¹ÓÐÖظ´µÄÏÖÏó£º
eg: SELECT DISTINCT dept_id,title from s_emp;
¶Ô²éѯµÄ½á¹û½øÐÐÅÅÐòÓà ORDER BY;
eg: SELECT last_name "ÐÕÃû",salary "¹¤×Ê" from s_emp ORDER BY salary;
(ĬÈÏÊÇÉýÐòÅÅÐò)
eg: SELECT last_name "ÐÕÃû",salary "¹¤×Ê" from s_emp ORDER BY salary asc;
(ascÖ¸¶¨ÎªÉýÐòÅÅÐò)
eg: SELECT last_name "ÐÕÃû",salary "¹¤×Ê" from s_emp ORDER BY salary desc;
(descÖ¸¶¨Îª½µÐòÅÅÐò)
×ܽ᣺order by ÅÅÐò
asc ÉýÐò
desc ½µÐò
select last_name EMPLOYEE,start_date from s_emp order by EMPLOYEE desc;
(ÔÚÅÅÐòµÄʱºò¿ÉÒÔÓñðÃûµ±×ö×Ö¶Î[ÅÅÐòµÄ¸ù¾Ý]½øÐÐÅÅÐò)--->ÕâÀïÊÇ£¨EMPLOYEE£©¡£
select last_name,salary*12 from s_emp order by 2;
(ÕâÀïµÄ2ÊÇÓÃÀ´Ö¸¶¨×ֶεÄλÖã¬ÕâÀïÖ¸Ïò salary*12 ,¼´°´Ô±¹¤µÄÄêнÅÅÐò)
select last_name,dept_id,salary from s_emp order by dept_id,salary desc;
(ÏÈ°´dept_idµÄÉýÐò½øÐÐÅÅÐò£¬ÅÅÍêºóÔÙ°´salaryµÄ½µÐò½øÐÐÅÅÐò)
×¢£ºÕâÀïdept_idºóûÓÐÖ±½ÓÖ¸ÅÅÐò¹æÔò£¬°´Ä¬ÈϵÄÉýÐòÅÅÐò¡£
WHERE¹Ø¼ü×Ö£º
SELECT ÐÕÃû£¬²¿ÃÅID from s_emp WHERE dept_id = 42;
(
Ïà¹ØÎĵµ£º
TO_DATE¸ñʽ(ÒÔʱ¼ä:2007-11-02 13:45:25ΪÀý)
Year:
yy two digits Á½Î»Äê ......
ÊÖ¹¤ÅäÖÃOracle 10G Enterprise Manage
×î½üÔÚѧϰ°²×°Êý¾Ý¿âµÄʱºò£¬ÓÃÁ˶àÖÖ·½·¨´´½¨£¬Èçdbca´´½¨£¬ÊÖ¹¤´´½¨£¬ÓÃÄ£°æ´´½¨µÈµÈ£¬µ±ÓÃdbca´´½¨Êý¾Ý¿âµÄʱºò£¬Ã»ÓÐÑ¡Ôñ“ʹÓÃEnterprise ManagerÅäÖÃÊý¾Ý¿â”£¬Ôì³ÉºóÀ´ÏëÓÃem²»ÄÜʹÓ㬱ØÐèÓõ½ÊÖ¹¤ÅäÖÃem²ÅÄÜʹÓã¬ÏÂÃæ¾Í½éÉÜÁ½ÖÖµ¥ÊµÀý»·¾³ÊµÏÂemÅäÖÆ¡£
µÚÒ»ÖÖ ......
oracleÌṩÈýÖָ߼¶±¸·Ý¹¦ÄÜ
¸ß¼¶¸´ÖÆ£¨Advanced Replication£©
Á÷¸´ÖÆ£¨Streams Replication£©
±¸¿â£¨Dataguard£©
Ò» dataguard£º
dataguardÔڸ߿ÉÓü°ÈÝÔÖ·½ÃæÒ»°ãÊÇdbaµÄÊ×Ñ¡£¬²»¹ÜÊÇÎïÀí±¸Óÿ⣨physical standby database£©»¹ÊÇÂß¼±¸Óÿ⣨logical standby database£©£¬ËüÃǶ¼¾ßÓÐһЩ¹²Í¬µÄ´ýÕ÷¡£
ÅäÖú͹ÜÀí· ......
OracleÖзÖÎö±íµÄ×÷ÓÃ
http://diegoball.javaeye.com/blog/568009
ÎÄÕ·ÖÀà:Êý¾Ý¿â
1.·ÖÎö¸üбíµÄͳ¼ÆÐÅÏ¢,,ÓпÉÄܵ¼ÖÂÖ´Ðмƻ®¸Ä±ä..
2.ÒÔµÄanalyze table abc compute statistics;ÕâÌõΪÀý£¬Éú³ÉµÄͳ¼ÆÐÅÏ¢»á´æÔÚÓÚuser_tablesÕâ¸öÊÓͼ£¬²é¿´Ò»ÏÂselect * from user_tables where table_name='ABC';
¹Û²ìÒ»ÏÂNUM_RO ......