Home » RDBMS Server » Server Administration » From Rule based optimizer to cost based optimizer
From Rule based optimizer to cost based optimizer [message #63313] Mon, 27 September 2004 03:26 Go to next message
sanjay kumar
Messages: 7
Registered: February 2002
Junior Member
Hi,

Please let me know how can I switch from rule based optimizer to cost base optimizer and vice-versa.

 

Regards

Sanjay

 
Re: From Rule based optimizer to cost based optimizer [message #63314 is a reply to message #63313] Mon, 27 September 2004 03:49 Go to previous messageGo to next message
dilip kumar
Messages: 111
Registered: December 2003
Senior Member
Hi

you can easily shift to any optimizer when your session is running

execute a following command

alter session set optimizer_mode = rule/choose/fist_rows/all_rows

u can specify any one option. A rule reserve word will use RBO and others will use CBO.

but one point need to be remember if your operation is to get execution plan then first analyze all the objects of ur schema...b.cos even though u specify CBO but ur schema/objects are not analyzed then oracle will force to use RBO

regards

D.Dilip
Re: From Rule based optimizer to cost based optimizer [message #63324 is a reply to message #63313] Mon, 27 September 2004 11:48 Go to previous messageGo to next message
croK
Messages: 170
Registered: April 2002
Senior Member
Edit your init.ora file as follows:
optimizer_mode=CHOOSE
then, analyze tables and indexes in your db.
You can analyze all tables or some of them only.
But if not analyzed, oracle will choose rule based instead.
Can be also changed by alter session statement.

Best regards.
Oracle Consultant and remote DBA for hire.
Re: From Rule based optimizer to cost based optimizer [message #63464 is a reply to message #63313] Thu, 07 October 2004 03:39 Go to previous message
Santosh Kaduskar
Messages: 44
Registered: October 2004
Member
Oracle optimizer find out the best way to search data for oracle SQL-Engine.There r two type of optimizer
Rule base i.e.RBO & Cost Base i.e.CBO.
By default its RBO.we can change from RBO to CBO by
using command :

alter session set optimizer_mode=<mode>

<Mode> May be ALL_ROWS, FIRST_ROWS, RULE, FIRST_ROWS_1, FIRST_ROWS_10, FIRST_ROWS_100, FIRST_ROWS_1000.

For CBO we have to analyze the table first.

Thanks bye.

Santosh.
Previous Topic: import error ora-01874 time zone
Next Topic: trouble with installing jre
Goto Forum:
  


Current Time: Fri Jan 24 23:19:51 CST 2025