oracleÓÅ»¯Æ÷
What circumstances we use ALL_ROWS and what circumstances we use FIRST_ROWS optimizer mode? This article is written in oracle9i.
First_rows attempts to optimize the query to get the very first row back to the client as fast as possible. This is good for an interactive client server environment where the client runs a query and shows the user the first 10 rows or so and waits for them to page down to get more.
All_rows attempts to optimize the query to get the very last row as fast as possible. This makes sense in a stored procedure for example where the client does not regain control until the stored procedure completes. You don't care if you have to wait to get the first row if the last row gets back to you twice as fast. In a client server/interactive application you may well care about that.
In TOAD or SQL Navigator, When we select the data, it display immediately. But it does not mean that, it is faster. If we scroll down, it might be fetching the data in the background mode. First_rows is best place for OLTP environment. Also in some reporting environment, if user wants to see initial data first and later see the rest of the data, then first_rows is good option. When we run the query in the stored procedure, first_rows would not be a good choice, all_rows is good option here, because, there is no use to fetch the first few records immediatley inside the stored procedure.
Let us demonstrate the FIRST_ROWS/ALL_ROWS optimizer hint.
Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.8.0 - Production
SQL> create table testtable as select * from user_objects;
Table created.
SQL> create index idx on testtable(object_type);
Index created.
SQL> EXECUTE DBMS_STATS.GATHER_TABLE_STATS(OWNNAME => 'SCREPORT',TABNAME => 'TESTTABLE',ESTIMATE_PER
CENT => 10, METHOD_OPT => 'FOR ALL COLUMNS SIZE 1', CASCADE => TRUE);
PL/SQL procedure successfully co
Ïà¹ØÎĵµ£º
ËäȻѧϰJavaºÜ¾ÃÁË£¬×Ô¼ºÒ²Á¬½Ó¹ýһЩÊý¾Ý¿â£¬±ÈÈçmysqlÖ®ÀàµÄ£¬Èç½ñÄØ£¬Ò²Ñ§Ï°ÁËÒ»¶Îʱ¼äµÄOracle£¬È»¶øÄØ£¬½ñÌìÊÇÎÒµÚÒ»´ÎÁ¬½ÓOracle£¬ºÙºÙ£¬Ó¦¸Ã»¹²»ËãÌ«³Ù°É¡£
½ñÌìÄØ£¬Óе㱿׾£¬´ó¼ÒĪЦ£¡
ÎÒÕâÊÇÒ»¸ö²éѯÀý×Ó
Ê×ÏÈ£¬Ô ......
Ò». ÀûÓÃrowidÀ´µÃµ½Ïà¹ØÐÅÏ¢
SQL> conn sys/admin as sysdba
ÒÑÁ¬½Ó¡£
SQL> create table bl(id number);
±íÒÑ´´½¨¡£
SQL> insert into bl values(1);
ÒÑ´´½¨ 1 ÐС£
SQL> select owner,segment_name,file_id,RELATIVE_FNO,block_id from dba_extents wh
ere owner='SYS' and segment_name='B ......
Ò».ÔÚWEBLOGICÉÏÅ䱸ÁËÒ»¸ö¶à³Ø£¬ÀûÓÃWEBLOGICÌṩµÄ¸ººÉ¾ùºâıÂÔ£¬½«²¢·¢¾ùºâµÄ¾÷±ðµ½Á½¸ö½ÚµãÉÏ¡£ÏêϸÅ䱸ÔÚÈç´Î²Î¿¼×ÊÁÏ»ò¸½¼þÖС£
²Î¿¼×ÊÁÏ:http://www.oracle.com/technology/products/weblogic/howto/rac/index.html
¶þ.Ö±½ÓÊ©ÓÃÁËRACµÄÔØºÉ¾ùºâ¶Ô²ß¡£
ÔÚOracleÖÐÕÒ³ötnsnames.oraÕâ¸ö×ÊÁÏ¡£ÔÚÅ䱸Êý¾ÝԴʱ£¬UR ......
2009Äê12ÔÂ15ÈÕ5:25:47
Äã²»µÃ²»³ÐÈÏË÷ÒýµÄÇÉÃî×÷ÓÃ,ÓÉÓÚÓбíµÄÖ÷¼üΨһ±êʶ,ʹµÃÎÒÃÇÔÚ¼ìË÷±íÖÐÊý¾Ýʱ,ËÙ¶ÈÉÏ´øÀ´µÄÌáÉý,ÊÇÏÔ¶øÒ×¼ûµÄ.±ÈÆðÎÒÃÇûÓÐË÷ÒýÏàͬÁ¿µÄ±í,´øÓÐË÷ÒýµÄ±íÃ÷ÏÔÓÐËÙ¶ÈÉϵÄÌáÉý.[¶ÁÕß¿ÉÒÔµ¼ÈëÒ»ÕÅ300~400ÍòµÄÊý¾Ý¼ì²âÒ»ÏÂ.]
Ë÷ÒýÊDZíµÄÒ»¸ö¸ÅÄ·Ö,ÓÃÀ´Ìá¸ß¼ìË÷Êý¾ÝµÄÐ ......
1¡¢ÏÂÔØoracleÈí¼þ
http://www.oracle.com/technology/software/tech/oci/instantclient/index.html
oracle-instantclient-basic-10.2.0.4-1.i386.rpm
oracle-instantclient-sqlplus-10.2.0.4-1.i386.rpm
oracle-instantclient-devel-10.2.0.4-1.i386.rpm
2¡¢°²×°rpm°ü
rpm -ivh oracle-instantclient-basic-10.2.0.4 ......