ORACLE SQL ÓÅ»¯µÄÈô¸É·½·¨
Ò»¡¢ ÏȽéÉÜÒ»ÏÂoracleµÄSGA£ºÊý¾Ý¿âµÄϵͳȫ¾ÖÇø£¬SGAÖ÷ÒªÓÉÈý²¿·Ö¹¹³É£º¹²Ïí³Ø¡¢Êý¾Ý»º³åÇø¡¢ÈÕÖ¾»º³åÇø¡£ 1¡¢¹²Ïí³ØÓÖÓÉÁ½²¿·Ö¹¹³É£º¹²ÏíSQLÇøºÍÊý¾Ý×ֵ仺³åÇø¡£¹²ÏíSQLÇøרÃÅ´æ·ÅÓû§SQLÃüÁoracleʹÓÃ×î½ü×îÉÙʹÓõÈÓÅÏȼ¶Ëã·¨À´¸üи²¸Ç£»Êý¾Ý×ֵ仺³åÇø£¨library cache£©´æ·ÅÊý¾Ý¿âÔËÐеĶ¯Ì¬ÐÅÏ¢¡£Êý¾Ý¿âÔËÐÐÒ»¶Îʱ¼äºó£¬DBAÐèÒª²é¿´ÕâЩÄÚ´æÇøÓòµÄÃüÖÐÂÊÒÔ´ÓÊý¾Ý¿â½Ç¶È¶ÔÊý¾Ý¿âÐÔÄܵ÷ÓÅ¡£Í¨¹ýÖ´ÐÐÏÂÊöÓï¾ä²é¿´£º
select (sum(pins - reloads)) / sum(pins) "Lib Cache" from v$librarycache;
--²é¿´¹²ÏíSQLÇøµÄÖØÓÃÂÊ£¬×îºÃÔÚ90£¥ÒÔÉÏ£¬·ñÔòÐèÒªÔö¼Ó¹²Ïí³ØµÄ´óС¡£
select (sum(gets - getmisses - usage - fixED)) / sum(gets) "Row Cache" from v$rowcache;
--²é¿´Êý¾Ý×ֵ仺³åÇøµÄÃüÖÐÂÊ£¬×îºÃÔÚ90£¥ÒÔÉÏ£¬·ñÔòÐèÒªÔö¼Ó¹²Ïí³ØµÄ´óС¡£
2¡¢ Êý¾Ý»º³åÇø£º´æ·ÅsqlÔËÐнá¹ûץȡµ½µÄdata block£»
SELECT name, value from v$sysstat WHERE name IN ('db block gets', 'consistent gets','physical reads');
-- ²é¿´Êý¾Ý¿âÊý¾Ý»º³åÇøµÄʹÓÃÇé¿ö¡£²éѯ³öÀ´µÄ½á¹û¿ÉÒÔ¼ÆËã³öÀ´Êý¾Ý»º³åÇøµÄʹÓÃÃüÖÐÂÊ£½1 - ( physical reads / (db block gets + consistent gets) )¡£ÃüÖÐÂÊÓ¦¸ÃÔÚ90£¥ÒÔÉÏ£¬·ñÔòÐèÒªÔö¼ÓÊý¾Ý»º³åÇøµÄ´óС¡£
3¡¢ ÈÕÖ¾»º³åÇø£º´æ·ÅÊý¾Ý¿âÔËÐÐÉú³ÉµÄÈÕÖ¾¡£
select name,value from v$sysstat where name in ('redo entries','redo log space requests');
--²é¿´ÈÕÖ¾»º³åÇøµÄʹÓÃÇé¿ö¡£²éѯ³öµÄ½á¹û¿ÉÒÔ¼ÆËã³öÈÕÖ¾»º³åÇøµÄÉêÇëʧ°ÜÂÊ£ºÉêÇëʧ°ÜÂÊ£½requests/entries£¬ÉêÇëʧ°ÜÂÊÓ¦¸Ã½Ó½üÓÚ0£¬·ñÔò˵Ã÷ÈÕÖ¾»º³åÇø¿ªÉè̫С£¬ÐèÒªÔö¼ÓORACLEÊý¾Ý¿âµÄÈÕÖ¾»º³åÇø¡£
¶þ£®SqlÓï¾äµÄÖ´Ðв½Ö裺
Á˽âsqlµÄÖ´Ðв½ÖèÓÐÀûÓÚ¸üºÃµÄÓÅ»¯ËüÃÇ£¬Ã¿ÌõsqlÓï¾äÖ´ÐÐʱ¶¼Òª¾ÀúÒÔϼ¸²½£º
1. Create cursor £»
2. Parse, if it is not already in the shared pool.£»
3. Any query in the statement is processed.
4. Bind Variables
5. Execute.
6. If possible, the statement is parallelized.
7. Rows to be returned are fetched. ÆäÖУ¬Parse—ÊÇ×îÓÐÓÅ»¯Ç±Á¦µÄ½×¶Î¡£
Cursor´´½¨ºó£¬oracle½«ÔÚshare poolÖÐÑ°ÕÒÊÇ·ñ¸ÃsqlÓï¾äÒѾ´æÔÚ£¬ÈôÒѾ´æÔÚÇÒÒѾ±»parsed£¬Ôò²»ÐèÒªÔÙÖ´ÐÐparse£¬Ö±½Óµ½ÏÂÒ»²½¡£ÈôδÔÚshare poolÖÐÕ
Ïà¹ØÎĵµ£º
Õâ¸öÂß¼¹Øϵէ¿´ÆðÀ´±È½Ï¸´ÔÓ£¬ÅªÇå³þÁ˾ͺã¡
ÓÐÁ½¸ö±í£¬
student(
id,
name,
primary key (id)
);
studentInfo(
id,
age,
address,
foreign key(id) references outTable(id) on delete cascade on update cascade
);
µ±ÎÒÃÇɾ³ýstudent±íµÄʱºò×ÔȻϣÍûstudentInfoÀïµÄÏà¹ØÐÅÏ¢Ò²±»É¾³ý£¬Õâ¾ÍÊÇÍâ¼üÆð×÷Óà ......
SQL×Ö·û´®º¯Êýhttp://www.cnblogs.com/virusswb/archive/2008/09/10/1288576.html
selectÓï¾äÖÐÖ»ÄÜʹÓÃsqlº¯Êý¶Ô×ֶνøÐвÙ×÷£¨Á´½Ósql server£©£¬
select ×Ö¶Î1 from ±í1 where ×Ö¶Î1.IndexOf("ÔÆ")=1;
ÕâÌõÓï¾ä²»¶ÔµÄÔÒòÊÇindexof£¨£©º¯Êý²»ÊÇsqlº¯Êý£¬¸Ä³Ésql¶ÔÓ¦µÄº¯Êý¾Í¿ÉÒÔÁË¡£
left£¨£©ÊÇsqlº¯Êý¡£
select ×Ö ......
----------Dbf µ¼Èë Sql Server±í----------
ÒÔϾùÒÔSQL2000¡¢VFP6¼°ÒÔÉϵıíΪÀý
´úÂëµ¼È룺²éѯ·ÖÎöÆ÷ÖÐÖ´ÐÐÈçÏÂÓï¾ä(ÏÈÑ¡Ôñ¶ÔÓ¦µÄÊý¾Ý¿â)
-------------Èç¹û½ÓÊܵ¼ÈëÊý¾ÝµÄSQL±íÒÑ´æÔÚ
--Èç¹û½ÓÊܵ¼ÈëÊý¾ÝµÄSQL±íÒѾ´æÔÚ
Insert Into ÒѾ´æÔÚµÄSQL±íÃû Select * from openrowset('MSDASQL','Driver=Microso ......
±ê×¼µÄ sql µÄ½âÎö˳ÐòΪ: (1).from ×Ó¾ä ×é×°À´×Ô²»Í¬Êý¾ÝÔ´µÄÊý¾Ý
(2).where ×Ó¾ä »ùÓÚÖ¸¶¨µÄÌõ¼þ¶Ô¼Ç¼½øÐÐɸѡ
(3).group by ×Ó¾ä ½«Êý¾Ý»®·ÖΪ¶à¸ö·Ö×é
(4).ʹÓþۺϺ¯Êý½øÐмÆËã
(5).ʹÓà having ......
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Data.OleDb;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace Str
{
public partial class Form1 : F ......