Optimizer_mode problem
how can set optimizer mode
SQL> alter session set optimizer_goal = first_rows
2 /
alter session set optimizer_goal = first_rows
ERROR at line 1:
ORA-01986: OPTIMIZER_GOAL is obsolete
how can set this setting.
thanx in advance.
i am waiting for reply.
use OPTIMIZER_MODE instead.
alter session set optimizer_mode=first_rows;
Similar Messages
-
If I make an explain plan for a query of the following form:
SELECT a.*
FROM a, b
WHERE a.pk = b.fk
AND b.pk IN (1, 2);
the explain plan states, that a FULL-TABLE-SCAN on table b is performed and a HASH-JOIN is done to execute the query.
On 8.0.6 Database the Indexes on the tables are used and a NESTED-LOOP join is performed.
Why is the 9.2.0.2 Database using HASH-JOINS when the Database is explicitly set to optimizer_mode=RULE, as I think HASH-JOINS are only possible with CBO?
How can I force the 9.2.0.2 database to perform exactly like the 8.0.6 database with RBO?some options:
set the hash_join_enabled parameter to false in the init.ora file.
set the compatible parameter to 8.0 in the init.ora file.
documentation:
HASH_JOIN_ENABLED specifies whether the optimizer should consider using a
hash join as a join method. When set to FALSE, hash join is turned off; that is, it is
not available as a join method that the optimizer can consider choosing. When set to
TRUE, the optimizer will compare the cost of a hash join to other types of joins, and
choose it if it gives the best cost.
COMPATIBLE allows you to use a new release, while at the same time guaranteeing
backward compatibility with an earlier release. This is in case it becomes necessary
to revert to the earlier release. This parameter specifies the release with which the
Oracle server must maintain compatibility. Some features of the current release may
be restricted. -
Problem while setting OPTIMIZER_MODE =RULE
I want to set optimizer_mode=RULE in init.ora file for Oracle92
For this i have shutdown the d/b and set the optimizer_mode=RULE
but when i retsarted the d/b the chnages is not reflected it is showing optimizer_mode=CHOOSE
Is there changes we have to do to take d/b in RBO.
Thanx
Junubut getting following Oracle erroe message
ORA-02096 specified initialization parameter is not modifiable with this option
That's correct. You cannot change it using ALTER SYSTEM. See below:
SQL> select issys_modifiable from v$parameter where name='optimizer_mode';
ISSYS_MOD
FALSEAs you can see ISSYS_MODIFIABLE value is FALSE which means you cannot change it using ALTER SYSTEM.
Also there many init.ora and spfile files in 'admin' and other directory even iam unable to decide which is the current one?
During starting instance you can choose init.ora file.
See help here:
http://download-uk.oracle.com/docs/cd/B14117_01/server.101/b12170/ch13.htm#i2699631
Peter D. -
Problems with explain plan and statement
Hi community,
I have migrated a j2ee application from DB2 to Oracle.
First some facts of our application and database instance:
We are using oracle version 10.2.0.3 and driver version 10.2.0.3. It runs with charset Unicode 3.0 UTF-8.
Our application is using Tomcat as web container and jboss as application server. We are only using prepared statements. So if I talk about statements I always mean prepared statements. Also our application is setting the defaultNChar property to true because every char and varchar field has been created as an nchar and nvarchar.
We have some jsp sites that contains lists with search forms. Everytime I enter a value to the form that returns a filled resultset, the lists are performing great. But everytime I enter a value that returns an empty resultset, the lists are 100 times slower. The jsp sites are running in the tomcat environment and submitting their statements directly to the database. The connections are pooled by dbcp. So what can cause this behaviour??
To anaylze this problem I started logging all statements and filled-in search field values and combinations that are executed by the lists described above. I also developed a standalone helper tool that reads the logged statements, executes them to the database and generates an explain plan for every statement. But now there appears a strange situation. Every statement, that performs really fast within our application, is now executed by the helper tool extremely slow. So I edited some jsp pages within our application to force an explain plan from there (tomcat env). So when I'm executing the same statement I'm getting with the exactly same code two completely different explain plans.
First the statement itself:
select LINVIN.BBASE , INVINNUM , INVINNUMALT , LINVIN.LSUPPLIERNUM , LSUPPLIERNUMEXT , LINVIN.COMPANYCODE , ACCOUNT , INVINTXT , INVINSTS , INVINTYP , INVINDAT , RECEIPTDAT , POSTED , POSTINGDATE , CHECKCOSTCENTER , WORKFLOWIDEXT , INVINREFERENCE , RESPONSIBLEPERS , INVINSUM_V , INVINSUMGROSS_V , VOUCHERNUM , HASPOSITIONS , PROCESSINSTANCEID , FCURISO_V , LSUPPLIER.AADDRLINE1 from LINVIN, LSUPPLIER where LINVIN.BBASE = LSUPPLIER.BBASE and LINVIN.LSUPPLIERNUM = LSUPPLIER.LSUPPLIERNUM and LINVIN.BBASE = ? order by LINVIN.BBASE, INVINDAT DESC
Now the explain plan from our application:
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 101 | 28583 | 55 (0)| 00:00:01 |
| 1 | NESTED LOOPS | | 101 | 28583 | 55 (0)| 00:00:01 |
| 2 | TABLE ACCESS BY INDEX ROWID| LINVIN | 93709 | 12M| 25 (0)| 00:00:01 |
|* 3 | INDEX RANGE SCAN | LINV_INVDAT | 101 | | 1 (0)| 00:00:01 |
| 4 | TABLE ACCESS BY INDEX ROWID| LSUPPLIER | 1 | 148 | 1 (0)| 00:00:01 |
|* 5 | INDEX UNIQUE SCAN | PK_177597 | 1 | | 1 (0)| 00:00:01 |
Predicate Information (identified by operation id):
3 - access("LINVIN"."BBASE"=:1)
filter("LINVIN"."BBASE"=:1)
5 - access("LSUPPLIER"."BBASE"=:1 AND "LINVIN"."LSUPPLIERNUM"="LSUPPLIER"."LSUPPLIERNUM")
Now the one from the standalone tool:
| Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 93773 | 25M| | 12898 (1)| 00:02:35 |
| 1 | SORT ORDER BY | | 93773 | 25M| 61M| 12898 (1)| 00:02:35 |
|* 2 | HASH JOIN | | 93773 | 25M| 2592K| 7185 (1)| 00:01:27 |
| 3 | TABLE ACCESS BY INDEX ROWID| LSUPPLIER | 16540 | 2390K| | 332 (0)| 00:00:04 |
|* 4 | INDEX RANGE SCAN | LSUPPLIER_HAS_BASE_FK | 16540 | | | 11 (0)| 00:00:01 |
| 5 | TABLE ACCESS BY INDEX ROWID| LINVIN | 93709 | 12M| | 6073 (1)| 00:01:13 |
|* 6 | INDEX RANGE SCAN | LINVOICE_BMDT_FK | 93709 | | | 84 (2)| 00:00:02 |
Predicate Information (identified by operation id):
2 - access("LINVIN"."BBASE"="LSUPPLIER"."BBASE" AND "LINVIN"."LSUPPLIERNUM"="LSUPPLIER"."LSUPPLIERNUM")
4 - access("LSUPPLIER"."BBASE"=:1)
6 - access("LINVIN"."BBASE"=:1)
The size of the tables are: LINVIN - 383.692 Rows, LSUPPLIER - 115.782 Rows
As you can see the one executed from our application is much faster than the one from the helper tool. So why picks oracle a completely different explain plan for the same statement? An why is a hash join much slower than a nested loop? Because If I'm right a nested loop should only be used when the tables are pretty small..
I also tried to play with some parameters:
I set optimizer_index_caching to 100 and optimizer_index_cost_adj to 30. I also changed optimizer_mode to FIRST_ROWS_100.
I would really appreciated, if somebody can help me with this issue, because I'm really getting more and more distressed...
Thanks in advance,
Tobias
Edited by: tobiwan on Sep 3, 2008 11:49 PM
Edited by: tobiwan on Sep 3, 2008 11:50 PM
Edited by: tobiwan on Sep 4, 2008 12:01 AM
Edited by: tobiwan on Sep 4, 2008 12:02 AM
Edited by: tobiwan on Sep 4, 2008 12:04 AM
Edited by: tobiwan on Sep 4, 2008 12:06 AM
Edited by: tobiwan on Sep 4, 2008 12:06 AM
Edited by: tobiwan on Sep 4, 2008 12:07 AMtobiwan wrote:
Hi again,
Here ist the answer:
The problem, because I got two different explain plans, was that the external tool uses the NLS sesssion parameters coming from the OS which are in my case "de/DE".
Within our application these parameters are changed to "en/US"!! So if I'm calling in my external tool the java function Locale.setDefault(new Locale("en","US")) before connecting to the database the explain plans are finally equal.That might explain why you got two different execution plan, because one plan was obviously able to avoid a SORT ORDER BY operation, whereas the second plan required to run SORT ORDER BY operation, obviously because of the different NLS_SORT settings. An index by default uses the NLS_SORT = 'binary' order whereas ORDER BY obeys the NLS_SORT setting, which probably was set to 'GERMAN' in your "external tool" case. You can check the "NLS_SESSION_PARAMETERS" view to check your current NLS_SORT setting.
For more information regarding this issue, see my blog note I've written about this some time ago:
http://oracle-randolf.blogspot.com/2008/09/getting-first-rows-of-large-sorted.html
Now let me make a guess why you observe the behaviour that it takes so long if your result set is empty:
The plan avoiding the SORT ORDER BY is able to return the first rows of the result set very quickly, but could take quite a while until all rows are processed, since it requires potentially a lot of iterations of the loop until everything has been processed. Your front end probably by default only display the first n rows of the result set and therefore works fine with this execution plan.
Now if the result set is empty, depending on your data, indexes and search criteria, Oracle has to work through all the data using the inefficient NESTED LOOP approach only to find out that no data has been found, and since your application attempts to fetch the first n records, but no records will be found, it has to wait until all data has been processed.
You can try to reproduce this by deliberately fetching all records of a query that returns data and that uses the NESTED LOOP approach... It probably takes as long as in the case when no records are found.
Note that you seem to use bind variables and 10g, therefore you might be interested that due to the "bind variable peeking" functionality you might potentially end up with "unstable" plans depending on the values "peeked" when the statement is parsed.
For more information, see this comprehensive description of the issue:
http://www.pythian.com/blogs/867/stabilize-oracle-10gs-bind-peeking-behaviour-by-cutting-histograms
Note that this changes in 11g with the introduction of the "Adaptive Cursor Sharing".
Regards,
Randolf
Oracle related stuff blog:
http://oracle-randolf.blogspot.com/
SQLTools++ for Oracle (Open source Oracle GUI for Windows):
http://www.sqltools-plusplus.org:7676/
http://sourceforge.net/projects/sqlt-pp/ -
Oracle 11g with OPTIMIZER_MODE=RULE go faster!!
I recently migrated Oracle 9.2.0.8 to Oracle 11g but the querys doesn't work as I hope.
The same query takes 3:20 min aprox using optimizer_mode=ALL_ROWS and 0:20 using optimizer_mode=RULE or using RULE hint.
The query in CBO makes a cartesian product between the indexes of the table.
This is one query and the "autrotrace on" log on Oracle 11g:
SELECT /*+ NO_INDEX (PK0004111303310) */MIN(BASE.ID_SCHED_TASK)+1 I
FROM M4RJS_SCHED_TASKS BASE
WHERE NOT EXISTS
(SELECT BASE2.ID_SCHED_TASK
FROM M4RJS_SCHED_TASKS BASE2
WHERE BASE2.ID_SCHED_TASK>BASE.ID_SCHED_TASK
AND BASE2.ID_SCHED_TASK<BASE.ID_SCHED_TASK+2)
ORDER BY 1 ASC
Execution Plan
Plan hash value: 3937517195
| Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 14 | | 328 (2)| 00:00:04 |
| 1 | SORT AGGREGATE | | 1 | 14 | | | |
| 2 | MERGE JOIN ANTI | | 495 | 6930 | | 328 (2)| 00:00:04 |
| 3 | INDEX FULL SCAN | PK0004111303310 | 49487 | 338K| | 119 (1)| 00:00:02 |
|* 4 | FILTER | | | | | | |
|* 5 | SORT JOIN | | 49487 | 338K| 1576K| 209 (2)| 00:00:03 |
| 6 | INDEX FAST FULL SCAN| PK0004111303310 | 49487 | 338K| | 33 (0)| 00:00:01 |
Predicate Information (identified by operation id):
4 - filter("BASE2"."ID_SCHED_TASK"<"BASE"."ID_SCHED_TASK"+2)
5 - access("BASE2"."ID_SCHED_TASK">"BASE"."ID_SCHED_TASK")
filter("BASE2"."ID_SCHED_TASK">"BASE"."ID_SCHED_TASK")
Statistics
1 recursive calls
0 db block gets
242 consistent gets
8 physical reads
0 redo size
519 bytes sent via SQL*Net to client
524 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
1 rows processed
Thanks to all !Sorry Mschnatt, I posted the wrong query, i was testing with HINTS, the correct query is your posted query.
1* I analyzed the tables and the result is the same:
This is the query and "autorace on" log using OPTIMIZER_MODE=RULE on Oracle 11g:
SQL> R
1 SELECT MIN(BASE.ID_SCHED_TASK)+1 I
2 FROM M4RJS_SCHED_TASKS BASE
3 WHERE NOT EXISTS
4 (SELECT BASE2.ID_SCHED_TASK
5 FROM M4RJS_SCHED_TASKS BASE2
6 WHERE BASE2.ID_SCHED_TASK>BASE.ID_SCHED_TASK
7 AND BASE2.ID_SCHED_TASK<BASE.ID_SCHED_TASK+2)
8* ORDER BY 1 ASC
I
2
Elapsed: 00:00:00.33
Execution Plan
Plan hash value: 795265574
| Id | Operation | Name |
| 0 | SELECT STATEMENT | |
| 1 | SORT AGGREGATE | |
|* 2 | FILTER | |
| 3 | TABLE ACCESS FULL | M4RJS_SCHED_TASKS |
|* 4 | INDEX RANGE SCAN | PK0004111303310 |
Predicate Information (identified by operation id):
2 - filter( NOT EXISTS (SELECT 0 FROM "M4RJS_SCHED_TASKS" "BASE2"
WHERE "BASE2"."ID_SCHED_TASK"<:B1+2 AND "BASE2"."ID_SCHED_TASK">:B2))
4 - access("BASE2"."ID_SCHED_TASK">:B1 AND
"BASE2"."ID_SCHED_TASK"<:B2+2)
Note
- rule based optimizer used (consider using cbo)
Statistics
0 recursive calls
0 db block gets
101509 consistent gets
0 physical reads
0 redo size
519 bytes sent via SQL*Net to client
524 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed
This is the query and "autorace on" log using OPTIMIZER_MODE=ALL_ROWA on Oracle 11g:
Elapsed: 00:03:14.78
Execution Plan
Plan hash value: 3937517195
| Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 12 | | 317 (2)| 00:00:04 |
| 1 | SORT AGGREGATE | | 1 | 12 | | | |
| 2 | MERGE JOIN ANTI | | 495 | 5940 | | 317 (2)| 00:00:04 |
| 3 | INDEX FULL SCAN | PK0004111303310 | 49487 | 289K| | 119 (1)| 00:00:02 |
|* 4 | FILTER | | | | | | |
|* 5 | SORT JOIN | | 49487 | 289K| 1176K| 198 (3)| 00:00:03 |
| 6 | INDEX FAST FULL SCAN| PK0004111303310 | 49487 | 289K| | 33 (0)| 00:00:01 |
Predicate Information (identified by operation id):
4 - filter("BASE2"."ID_SCHED_TASK"<"BASE"."ID_SCHED_TASK"+2)
5 - access("BASE2"."ID_SCHED_TASK">"BASE"."ID_SCHED_TASK")
filter("BASE2"."ID_SCHED_TASK">"BASE"."ID_SCHED_TASK")
Statistics
0 recursive calls
0 db block gets
242 consistent gets
0 physical reads
0 redo size
519 bytes sent via SQL*Net to client
524 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
1 rows processed
3* This is an example query, the problem persist in other bigger queries.
Thanks for you help -
Slow response on data dictionary queries with optimizer_mode=rule in 10g
I have two dataabse: DB1 (9i) and DB2 (10g) on windows 2000
They are two development databases with the same schemas and same tables. The application executes the same commands but with different results and execution plans.
In DB2 the queries with the most slow response tima are the queries on the data dictionary (for example: all_synonyms).
These query are very fast with the optimizer_mode=cost and very slow with the optimizer_mode=rule.
And the the problem is this:
in DB1 and DB2 the application executes after the connection this command:
ALTER SESSION SET OPTIMIZER_MODE = 'RULE';
These are the traces of the session in db1 and db2:
The queries are created dynamically by the application.
Is there a solution for this?
thanks
Message was edited by:
user596611Here is a simple example of what can happen,
@>alter session set optimizer_mode=all_rows;
@>SELECT PLAN_TABLE_OUTPUT FROM TABLE(DBMS_XPLAN.DISPLAY());
PLAN_TABLE_OUTPUT
| Id | Operation | Name | Rows | Cost (%CPU)|
| 0 | SELECT STATEMENT | | 1 | 2 (0)|
| 1 | FAST DUAL | | 1 | 2 (0)|
@>alter session set optimizer_mode=rule;
@>SELECT PLAN_TABLE_OUTPUT FROM TABLE(DBMS_XPLAN.DISPLAY());
PLAN_TABLE_OUTPUT
| Id | Operation | Name |
| 0 | SELECT STATEMENT | |
| 1 | FAST DUAL | |
Note
- rule based optimizer used (consider using cbo)As you can see incomplete explain plans. Therefore it is not advised.
Adith -
Transactions fail when OPTIMIZER_MODE=choose
We are running an application XXL within Oracle APPS 11i (11.5.4)
This custom applciation XXL is built with Designer 6i
and Headstart for Oracle Applications v. 6.5.1.5.
During implementation we met some lack of performance. in our LOV's.
We solved this peerformance issue by running statistics on the application XXL.tables.
And indeed perfomance was okay.
But from that point we couldn't save any transaction anymore in our custom application XXL.
In our trace files we see that a transaction is opened in QMS_TRANSACTION.
But something is causing an error on the stack which holds Oracle headstart from closing the transaction sucessfully.
But in the form no error is raised. Only the form_status remains, so when we commit by pressing the save button Oracle returns "1 transaction applied and saved" the form status stays 'CHANGED'.
When exiting the application/form Oracle tells me there are changes, do you want to commit?
Pressing yes doesn't help, status remains 'CHANGED' although Oracle shows message transaction applied and saved.
Q. 1st. How can i trace which error occurs at huis moment?
Another issue is that when we change the OPTIMIZER_MODE of the database, which was initially CHOOSE, change it into RULE, all transactions are saved!!!! UNBELIEVEABLE?
But there is a problem because ORacle Apps 11i requires the database to start in CHOOSE to enforce CBO.
Q 2nd. Can anyone explain this behaviour?
Our goal is of course running the database CBO with optimizer_mode=CHOOSE, ran statistics and be able to save transactions in our custom application XXL.
thanks in advance
Auke QuistAuke,
I don't have an answer for you, but maybe your problem is related to the one in thread PL/SQL update not working against 9iR2 DB . I hope that the information in that thread can help you solve your problem.
kind regards,
Sandra -
Performance problems on a Oracle 11G with Windows 2008 64bits.
Hi everyone,
I have noticed that our db is going low and low every week. My server has 16GB RAM and 10GB are dedicated to the Oracle database, this is a 11.2.0.1 with Windows 2008 R2 SP1 64bits. I like to know acording to the nexts values what you guys recommend to adjust in the init.ora:
orcl.__db_cache_size=5402263552
orcl.__java_pool_size=33554432
orcl.__large_pool_size=33554432
orcl.__pga_aggregate_target=3657433088
orcl.__sga_target=6878658560
orcl.__shared_io_pool_size=0
orcl.__shared_pool_size=1308622848
orcl.__streams_pool_size=33554432
*.memory_target=10511974400
*.open_cursors=5000
*.optimizer_mode='RULE'
*.processes=300
Acording to the memory target on how values can be increased the processes, pga_agregate_target, etc.
Also we have problems related to the bug Bug 9593134 that “Connections to Oracle 11g are slow and can take anywhere from 10 seconds to 2 minutes.” there is a fix on linux by removing the dns names on it but anyone have experience on windows platforms?
Thanks for all and sorry for my english.
Regards.
Arturo.Regarding the long connection times, have you tried using network packet capture software (such as Wireshark) to determine what the client computer is doing when a connection attempt is initiated?
The Oracle Database time model statistics, along with the system wide wait events may help you diagnose the non-connection related performance issues (you should not just look at the statistics, but instead capture the current values, wait a period of time, capture the statistics again, and compare the changes in the statistic values). A statspack report might also help you - but a 10046 trace at level 8 or 12 is more appropriate if you are able to identify a couple of sessions that experience performance problems.
I do not suggest just blindly modifying parameters, although I am curious to know:
* Why the session level parameter OPEN_CURSORS is set to 5000 - do you expect a single session to hold open 5,000 cursors?
* Why are you using the deprecated RULE based optimizer?
* Why is the MEMORY_TARGET parameter used when the SGA_TARGET and PGA_AGGREGATE target are specified?
Charles Hooper
http://hoopercharles.wordpress.com/
IT Manager/Oracle DBA
K&M Machine-Fabricating, Inc. -
SQL is slow with optimizer_mode=ALL_ROWS
Hi.
We have an application layer with htmldb 2.0 running on 10.2 on HP-UX Itanium.
One of the applications runs a sql joining two tables and using bind variables as in the selection critieria.
The two tables has the following number of rows;
SQL> select count(1) from innsyn_kunde.kunde;
COUNT(1)
96708
SQL> select count(1) from innsyn_kunde.regning;
COUNT(1)
1867136
SQL>
The following intialization parameters are set on instances level:
SQL> show parameter optimiz
NAME TYPE VALUE
optimizer_dynamic_sampling integer 2
optimizer_features_enable string 10.2.0.1
optimizer_index_caching integer 80
optimizer_index_cost_adj integer 10
optimizer_mode string FIRST_ROWS
optimizer_secure_view_merging boolean TRUE
plsql_optimize_level integer 2
SQL>
All tables and indexes used by the application has fresh statistics gathered with dbms_stats.
The following sql is defined in htmldb:
select
regn.regningnr
,regn.appl_kode
,regn.regningtekst1
,regn.regningdato
,regn.kundenr
,kund.kundenavn kunde
from innsyn_kunde.regning regn
, innsyn_kunde.kunde kund
where
regn.appl_kode=kund.appl_kode
and regn.kundenr=kund.kundenr(+)
and regn.appl_kode = :P31_appl_kode
and regn.kundenr like upper(decode(:P31_kundenr,null,'%',:P31_kundenr||'%'))
and regn.regningnr like decode(:P31_regningnr,null,'%',:P31_regningnr||'%')
and kund.kundenavn like upper(decode(:P31_kundenavn,null,'%',:P31_kundenavn||'%'))
order by regn.regningdato desc
1) If we substitute the bind variables with actual values in the actual sql in order to fetch one row the query runs very fast:
select
regn.regningnr
,regn.appl_kode
,regn.regningtekst1
,regn.regningdato
,regn.kundenr
,kund.kundenavn kunde
from innsyn_kunde.regning regn
, innsyn_kunde.kunde kund
where
regn.appl_kode=kund.appl_kode
and regn.kundenr=kund.kundenr(+)
and regn.appl_kode = 'SKOL'
and regn.kundenr like '%'
and regn.regningnr like '1150456%'
and kund.kundenavn like '%'
order by regn.regningdato desc
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 2 0.00 0.00 5 8 0 1
total 4 0.00 0.00 5 8 0 1
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 95 (INNSYN_KUNDE)
Rows Row Source Operation
1 SORT ORDER BY (cr=8 pr=5 pw=0 time=343 us)
1 NESTED LOOPS (cr=8 pr=5 pw=0 time=315 us)
1 TABLE ACCESS BY INDEX ROWID REGNING (cr=4 pr=1 pw=0 time=182 us)
1 INDEX RANGE SCAN REGNING_IDX_03 (cr=3 pr=1 pw=0 time=165 us)(object id 68870)
1 TABLE ACCESS BY INDEX ROWID KUNDE (cr=4 pr=4 pw=0 time=129 us)
1 INDEX UNIQUE SCAN PK_KUNDE (cr=3 pr=3 pw=0 time=99 us)(object id 68356)
Rows Execution Plan
0 SELECT STATEMENT MODE: ALL_ROWS
1 SORT (ORDER BY)
1 NESTED LOOPS
1 TABLE ACCESS MODE: ANALYZED (BY INDEX ROWID) OF 'REGNING'
(TABLE)
1 INDEX MODE: ANALYZED (RANGE SCAN) OF 'REGNING_IDX_03'
(INDEX)
1 TABLE ACCESS MODE: ANALYZED (BY INDEX ROWID) OF 'KUNDE'
(TABLE)
1 INDEX MODE: ANALYZED (UNIQUE SCAN) OF 'PK_KUNDE' (INDEX
(UNIQUE))
2) If we use bind variables to reproduce the problem in htmldb from sqlplus like this we get the following result;
select
regn.regningnr
,regn.appl_kode
,regn.regningtekst1
,regn.regningdato
,regn.kundenr
,kund.kundenavn kunde
from innsyn_kunde.regning regn
, innsyn_kunde.kunde kund
where
regn.appl_kode=kund.appl_kode
and regn.kundenr=kund.kundenr(+)
and regn.appl_kode = :P31_appl_kode
and regn.kundenr like upper(decode(:P31_kundenr,null,'%',:P31_kundenr||'%'))
and regn.regningnr like decode(:P31_regningnr,null,'%',:P31_regningnr||'%')
and kund.kundenavn like upper(decode(:P31_kundenavn,null,'%',:P31_kundenavn||'%'))
order by regn.regningdato desc
call count cpu elapsed disk query current rows
Parse 3 0.00 0.00 0 0 0 0
Execute 3 0.00 0.00 0 0 0 0
Fetch 2 30.19 32.64 516728 1406955 0 1
total 8 30.19 32.64 516728 1406955 0 1
Misses in library cache during parse: 0
Parsing user id: 64 (INNSYN_WEB) (recursive depth: 1)
Rows Row Source Operation
1 SORT ORDER BY (cr=1406955 pr=516728 pw=75 time=32643407 us)
1 TABLE ACCESS BY INDEX ROWID REGNING (cr=1406955 pr=516728 pw=75 time=32643357 us)
1354432 NESTED LOOPS (cr=106950 pr=42778 pw=75 time=17612677 us)
50191 VIEW index$_join$_002 (cr=661 pr=736 pw=75 time=447634 us)
50191 HASH JOIN (cr=661 pr=736 pw=75 time=297306 us)
50191 INDEX RANGE SCAN PK_KUNDE (cr=258 pr=258 pw=0 time=163 us)(object id 68356)
96705 INDEX RANGE SCAN KUNDE_IDX01 (cr=403 pr=403 pw=0 time=97049 us)(object id 68688)
1304240 INDEX RANGE SCAN REGNING_IDX_01 (cr=106289 pr=42042 pw=0 time=3401535 us)(object id 68363)
Rows Execution Plan
0 SELECT STATEMENT MODE: ALL_ROWS
1 SORT (ORDER BY)
1 TABLE ACCESS MODE: ANALYZED (BY INDEX ROWID) OF 'REGNING'
(TABLE)
1354432 NESTED LOOPS
50191 VIEW OF 'index$_join$_002' (VIEW)
50191 HASH JOIN
50191 INDEX MODE: ANALYZED (RANGE SCAN) OF 'PK_KUNDE'
(INDEX (UNIQUE))
96705 INDEX MODE: ANALYZED (RANGE SCAN) OF 'KUNDE_IDX01'
(INDEX)
1304240 INDEX MODE: ANALYZED (RANGE SCAN) OF 'REGNING_IDX_01'
(INDEX)
By using bind-variables it uses 30 seconds to fetch one row that is returned in less than a second with standard litherals
3) And by doing something we probably not should, at least on 10.2 is to hint with RULE based optimization.
Parsing user id: 95 (INNSYN_KUNDE)
select /*+ RULE */
regn.regningnr
,regn.appl_kode
,regn.regningtekst1
,regn.regningdato
,regn.kundenr
,kund.kundenavn kunde
from innsyn_kunde.regning regn,
innsyn_kunde.kunde kund
where
regn.appl_kode=kund.appl_kode
and regn.kundenr=kund.kundenr (+)
and regn.appl_kode = :P31_appl_kode
and regn.kundenr like upper(decode(:P31_kundenr,null,'%',:P31_kundenr||'%'))
and regn.regningnr like decode(:P31_regningnr,null,'%',:P31_regningnr||'%')
and kund.kundenavn like upper(decode(:P31_kundenavn,null,'%',:P31_kundenavn||'%'))
order by regn.regningdato desc
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 2 0.13 0.12 1109 1122 0 1
total 4 0.13 0.12 1109 1122 0 1
Misses in library cache during parse: 0
Optimizer mode: RULE
Parsing user id: 95 (INNSYN_KUNDE)
Rows Row Source Operation
1 SORT ORDER BY (cr=1122 pr=1109 pw=0 time=123795 us)
1 FILTER (cr=1122 pr=1109 pw=0 time=123752 us)
1 MERGE JOIN OUTER (cr=1122 pr=1109 pw=0 time=123735 us)
1 SORT JOIN (cr=4 pr=0 pw=0 time=125 us)
1 TABLE ACCESS BY INDEX ROWID REGNING (cr=4 pr=0 pw=0 time=83 us)
1 INDEX RANGE SCAN REGNING_IDX_03 (cr=3 pr=0 pw=0 time=64 us)(object id 68870)
1 SORT JOIN (cr=1118 pr=1109 pw=0 time=123601 us)
96708 TABLE ACCESS FULL KUNDE (cr=1118 pr=1109 pw=0 time=199 us)
Rows Execution Plan
0 SELECT STATEMENT MODE: HINT: RULE
1 SORT (ORDER BY)
1 FILTER
1 MERGE JOIN (OUTER)
1 SORT (JOIN)
1 TABLE ACCESS MODE: ANALYZED (BY INDEX ROWID) OF
'REGNING' (TABLE)
1 INDEX MODE: ANALYZED (RANGE SCAN) OF
'REGNING_IDX_03' (INDEX)
1 SORT (JOIN)
96708 TABLE ACCESS MODE: ANALYZED (FULL) OF 'KUNDE' (TABLE)
By using Rule based it uses 0.1 second to fetch one row from the database.
Anyone seen this problems using Cost based with good statistics and bind variables giving such bad performance .
Any help would be apreciated.
rgds
KjellI have to add that sql that runs with bind variables is defined the following way:
variable P31_appl_kode varchar2(10);
variable P31_kundenr varchar2(10);
variable P31_regningnr varchar2(10);
variable P31_kundenavn varchar2(10);
begin
:p31_appl_kode := 'SKOL';
:p31_kundenr :=NULL;
:p31_regningnr :='1150456';
:p31_kundenavn := null;
end;
select /*+ RULE */
regn.regningnr
,regn.appl_kode
,regn.regningtekst1
,regn.regningdato
,regn.kundenr
,kund.kundenavn kunde
from innsyn_kunde.regning regn,
innsyn_kunde.kunde kund
where
regn.appl_kode=kund.appl_kode
and regn.kundenr=kund.kundenr (+)
and regn.appl_kode = :P31_appl_kode
and regn.kundenr like upper(decode(:P31_kundenr,null,'%',:P31_kundenr||'%'))
and regn.regningnr like decode(:P31_regningnr,null,'%',:P31_regningnr||'%')
and kund.kundenavn like upper(decode(:P31_kundenavn,null,'%',:P31_kundenavn||'%'))
order by regn.regningdato desc;
rgds
Kjell -
Problem with SQL,udfs & procedures
I have couple of problems with my database. Please suggest solution.
We are basically a web product With a Quite large Database
1. I am using functions both User Defined and Built in Functions in
SQL Statement. I want to optimize the query how do i do it.
why the usage of function in sql statements suppresses,the
usage of indexes internally. How to forceable make use of
the index even though function is used.
2. Whenver The Client makes a request to the Database server with a
Sql Query What are the steps we can take at the
client side to enhance the performance of the Query.
(i.e the Data Request ). How to optimize the usage of CPU at
client site?
3. what is the increase in the performance ration by having
separate table spaces for user data,system data and indexes.
4. Why the procedures are getting invalided
after some time. The procedure is
not getting executed at the front end.
Once the procedure is getting invalidated.
However even though the status of the
procedure is invalid the same is getting
executed at the back end.
Can anybody help me
Request for reply ASAP.
Regards
Koshal
null1. In Oracle 8i, one can create function-based indexes, where instead of indexing a column, one can index upper() of that column.
2. Optimizing client performance is trickier. One can tune the queries being
submitted by the client, but if getting the first row back -- which is how response time is generally perceived -- set the OPTIMIZER_MODE parameter in init.ora to FIRST_ROWS.
3. There is minimal benefit to having data, index, rollback, and temp tablespaces all separated unless all the datafiles for each tablespace reside on different disks (data on disk 1, index on disk 2, etc). It's recommended regardless, but unless the files are on separate volumes, there won't be a great performance benefit.
4. A procedure is invalidated whenever DDL is issued against any object that that procedure depends upon. For example, if you add a column to a table, any procedures which reference that table will be invalidated. Any procedures which reference views which reference that table will be invalidated, because the view will be invalidated. It's best to run a compile script which looks for and attempts to recompile any invalid objects on a daily basis.
Adam -
Hi,
I have a wierd problem with using ROWNUM for pagination. I'm using the query structure as below:
SELECT * FROM ( SELECT A.*, ROWNUM rowno FROM (MY_ACTUAL_QUERY) A WHERE ROWNUM <= 200 ) WHERE rowno > 0
In some cases of the MY_ACTUAL_QUERY, there exists records, but the pagination query is not returing records. If the where clause is replaced with "ROWNUM <= 361" or "ROWNUM <= 251" in some other cases, it returns records.
Also, when some fields in the select clause are commented out, the query returns records. Is this a problem with Oracle itself or am I doing something wrong?
Regards,
VenkatHi
in the past.. i have a oracle bug whit pagination querys when i use a ROW_NUMBER ... I reported them at Oracle (bug #7033904)
Text of bug at Metalink "...If a query contains multiple analytic functions and one of them is rank, dense_rank or row_number function and if there is a topn predicate (i.e. restricting the rows to topn ranks, dense_rank or row_number) in the outer query and if the results for the other analytic functions are incorrect, you may have encountered this bug...."
This bug is already fixed on 11.2.0.1.0.
My problem was by the optimizer mode, when the optimizer mode = all_rows the query return "bad results" and when the optimizer mode = rule return "good results"
try to run the query with the optimizer = rule and let me know what happen ...
alter session set optimizer_mode=rule; One Metalink note about that.. 734502.1
Edited by: dask99 on Oct 23, 2008 1:50 PM -
Problem with dataguard on 10g peace of !"·$%&/
Hello everyone
I have problems with the dataguard, when i switchover to physical standby the error ora-16775 the dmgrl log says:
0 2 0 ORA-16775 Error: the target standby database has some redo log(s) missing. Cannot proceed with the switchover operation
I have made i think all the solutions around here to send or activate the redo log transport, this happend to me because disable the log_archive_dest_state on physical standby, so y make a cold backup of the primary database and set this to standby with the commands:
SQL> STARTUP NOMOUNT;
SQL> ALTER DATABASE MOUNT STANDBY DATABASE;
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
I attach the orcla.ora and orclb.ora to this question:
ORCLA: (primary)
orcla.__db_cache_size=868220928
orcla.__java_pool_size=16777216
orcla.__large_pool_size=16777216
orcla.__shared_pool_size=163577856
orcla.__streams_pool_size=0
*.archive_lag_target=0
*.audit_file_dest='c:\oracle\product\10.2.0/admin/orcla/adump'
*.background_dump_dest='c:\oracle\product\10.2.0/admin/orcla/bdump'
*.compatible='10.2.0.1.0'
*.control_files='C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCLA\CONTROL01.CTL','C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCLA\CONTROL02.CTL','C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCLA\CONTROL03.CTL'#Restore Controlfile
*.core_dump_dest='c:\oracle\product\10.2.0/admin/orcla/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='ORCLA'
*.db_recovery_file_dest='c:\oracle\product\10.2.0/flash_recovery_area'
*.db_recovery_file_dest_size=2147483648
*.DB_UNIQUE_NAME='ORCLA'
*.dg_broker_start=TRUE
*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclaXDB)'
*.fal_client='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=SRV-LOGMEC-001)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=ORCLA_XPT)(INSTANCE_NAME=ORCLSID)(SERVER=dedicated)))'
*.fal_server='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=SRV-LOGMEC-002)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=ORCLB_XPT)(SERVER=dedicated)))'
*.instance_name='ORCLSID'
*.job_queue_processes=10
*.log_archive_config='dg_config=(ORCLB)'
*.log_archive_dest_1='LOCATION=D:\oradata\archivelogs\orcla VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=ORCLA'
orcla.log_archive_dest_1='location="D:\oradata\archivelogs\orcla"','valid_for=(ONLINE_LOGFILE,ALL_ROLES)'
*.log_archive_dest_2='service="(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=SRV-LOGMEC-002)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=ORCLB_XPT)(INSTANCE_NAME=ORCLSID)(SERVER=dedicated)))"',' LGWR ASYNC NOAFFIRM delay=0 OPTIONAL max_failure=0 max_connections=1 reopen=300 db_unique_name="ORCLB" register net_timeout=180 valid_for=(online_logfile,primary_role)'
*.log_archive_dest_state_1='ENABLE'
orcla.log_archive_dest_state_1='ENABLE'
*.log_archive_dest_state_2='ENABLE'
*.log_archive_format='DBSID_%t_%s_%r.arc'
orcla.log_archive_format='DBSID_%t_%s_%r.arc'
*.log_archive_max_processes=2
*.log_archive_min_succeed_dest=1
orcla.log_archive_trace=0
*.log_checkpoint_interval=10000
*.log_checkpoint_timeout=1800
*.open_cursors=3000
*.optimizer_mode='RULE'
*.pga_aggregate_target=16777216
*.processes=400
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_max_size=1073741824
*.sga_target=1073741824
orcla.standby_archive_dest=''
*.standby_file_management='auto'
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='c:\oracle\product\10.2.0/admin/orcla/udump'
ORCLB: (standby)
orclb.__db_cache_size=868220928
orclb.__java_pool_size=16777216
orclb.__large_pool_size=16777216
orclb.__shared_pool_size=163577856
orclb.__streams_pool_size=0
*.aq_tm_processes=0
*.archive_lag_target=0
*.audit_file_dest='c:\oracle\product\10.2.0/admin/orclb/adump'
*.background_dump_dest='c:\oracle\product\10.2.0/admin/orclb/bdump'
*.compatible='10.2.0.1.0'
*.control_files='c:\oracle\product\10.2.0/oradata/orclb/\stand.ctl'
*.core_dump_dest='c:\oracle\product\10.2.0/admin/orclb/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='ORCLA'
*.db_recovery_file_dest='c:\oracle\product\10.2.0/flash_recovery_area'
*.db_recovery_file_dest_size=2147483648
*.DB_UNIQUE_NAME='ORCLB'
*.dg_broker_start=TRUE
*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclaXDB)'
*.fal_client='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=SRV-LOGMEC-002)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=ORCLB_XPT)(INSTANCE_NAME=ORCLSID)(SERVER=dedicated)))'
*.fal_server='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=SRV-LOGMEC-001)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=ORCLA_XPT)(SERVER=dedicated)))'
*.instance_name='ORCLSID'
*.job_queue_processes=10
*.log_archive_config='dg_config=(ORCLA)'
*.log_archive_dest_1='LOCATION=C:\oracle\product\10.2.0\oradata\orclb VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=ORCLB'
orclb.log_archive_dest_1='location="C:\oracle\product\10.2.0\oradata\orclb"','valid_for=(ALL_LOGFILES,ALL_ROLES)'
*.log_archive_dest_2=''
orclb.log_archive_dest_2='location="D:\oradata\archivelogs\orclb"','valid_for=(STANDBY_LOGFILE,STANDBY_ROLE)'
*.log_archive_dest_state_1='ENABLE'
orclb.log_archive_dest_state_1='ENABLE'
*.log_archive_dest_state_2='ENABLE'
orclb.log_archive_dest_state_2='ENABLE'
*.log_archive_format='DBSID_%t_%s_%r.arc'
orclb.log_archive_format='DBSID_%t_%s_%r.arc'
*.log_archive_max_processes=2
*.log_archive_min_succeed_dest=1
*.log_archive_trace=0
orclb.log_archive_trace=0
*.log_checkpoint_interval=10000
*.log_checkpoint_timeout=1800
*.open_cursors=3000
*.optimizer_mode='RULE'
*.pga_aggregate_target=16777216
*.processes=400
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_max_size=1073741824
*.sga_target=1073741824
orclb.standby_archive_dest='D:\oradata\archivelogs\orclb'
*.standby_file_management='auto'
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='c:\oracle\product\10.2.0/admin/orclb/udump'
DGMGRL (primary)
DG 2009-11-11-22:05:17 0 2 702684180 DMON: CTL_ENABLE of ORCLB
DG 2009-11-11-22:05:17 0 2 702684180 requires reset of LOG XPT Engine
DG 2009-11-11-22:05:17 0 2 702684180 on Site ORCLA
DG 2009-11-11-22:05:17 0 2 0 Reset Log Transport Resource: SetState ONLINE, phase BUILD-UP, External Cond ENABLE
DG 2009-11-11-22:05:17 0 2 0 Set log transport destination: SetState ONLINE, phase BUILD-UP, External Cond ENABLE
DG 2009-11-11-22:05:17 0 2 0 Executing SQL [alter system set log_archive_dest_2 = 'service="(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=SRV-LOGMEC-002)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=ORCLB_XPT)(INSTANCE_NAME=ORCLSID)(SERVER=dedicated)))"', ' LGWR ASYNC NOAFFIRM delay=0 OPTIONAL max_failure=0 max_connections=1 reopen=300 db_unique_name="ORCLB" register net_timeout=180 valid_for=(online_logfile,primary_role)']
DG 2009-11-11-22:05:17 0 2 0 SQL [alter system set log_archive_dest_2 = 'service="(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=SRV-LOGMEC-002)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=ORCLB_XPT)(INSTANCE_NAME=ORCLSID)(SERVER=dedicated)))"', ' LGWR ASYNC NOAFFIRM delay=0 OPTIONAL max_failure=0 max_connections=1 reopen=300 db_unique_name="ORCLB" register net_timeout=180 valid_for=(online_logfile,primary_role)'] Executed successfully
DG 2009-11-11-22:05:17 0 2 0 Executing SQL [alter system set log_archive_dest_state_2 = 'ENABLE']
DG 2009-11-11-22:05:17 0 2 0 SQL [alter system set log_archive_dest_state_2 = 'ENABLE'] Executed successfully
DG 2009-11-11-22:05:17 0 2 0 Executing SQL [ALTER SYSTEM SWITCH ALL LOGFILE]
DG 2009-11-11-22:05:22 0 2 0 SQL [ALTER SYSTEM SWITCH ALL LOGFILE] Executed successfully
DG 2009-11-11-22:05:22 0 2 0 DMON: site 01001000, instance 00000001 queuing healthcheck lock request
DG 2009-11-11-22:05:22 0 2 0 DMON: Releasing healthcheck master lock
DG 2009-11-11-22:05:22 0 2 0 DMON: Health check master lock conversion successful
DG 2009-11-11-22:05:22 0 2 0 DMON: a process acquired the healthcheck master lock
DG 2009-11-11-22:05:22 0 2 702684180 DMON: status from rfi_post_instances() for ENABLE = ORA-00000
DG 2009-11-11-22:05:22 0 2 0 INSV: Received message for inter-instance publication
DG 2009-11-11-22:05:22 0 2 702684180 DMON: ENABLE Complete, Object ORCLB
DG 2009-11-11-22:05:22 0 2 0 req_id 2.1.702684180, opcode CTL_ENABLE, phase END, flags 5
DG 2009-11-11-22:05:22 0 2 702684180 enabled in State STANDBY
DG 2009-11-11-22:05:22 0 2 702684180 rfm_inst_phase_dispatch 16 END phase processing
DG 2009-11-11-22:05:22 0 2 0 INSV: All instances have replied for message
DG 2009-11-11-22:05:22 0 2 0 req_id 2.1.702684180, opcode CTL_ENABLE, phase END
DG 2009-11-11-22:05:22 0 2 702684180 DMON: CTL_ENABLE operation completed
DG 2009-11-11-22:05:22 0 2 702684180 DMON: Entered rfm_release_chief_lock for CTL_ENABLE
DGMGRL (standby)
SCOPE=SPFILE sid='orclb']
DG 2009-11-11-22:04:06 0 2 0 SQL [ALTER SYSTEM SET log_archive_format='DBSID_%t_%s_%r.arc' SCOPE=SPFILE sid='orclb'] Executed successfully
DG 2009-11-11-22:04:07 0 2 0 Setting init.ora parameter with SQL [ALTER SYSTEM SET standby_file_management='AUTO' SCOPE=BOTH sid='*']
DG 2009-11-11-22:04:07 0 2 0 Executing SQL [ALTER SYSTEM SET standby_file_management='AUTO' SCOPE=BOTH sid='*']
DG 2009-11-11-22:04:07 0 2 0 SQL [ALTER SYSTEM SET standby_file_management='AUTO' SCOPE=BOTH sid='*'] Executed successfully
DG 2009-11-11-22:04:07 0 2 0 Setting init.ora parameter with SQL [ALTER SYSTEM SET archive_lag_target=0 SCOPE=BOTH sid='*']
DG 2009-11-11-22:04:07 0 2 0 Executing SQL [ALTER SYSTEM SET archive_lag_target=0 SCOPE=BOTH sid='*']
DG 2009-11-11-22:04:07 0 2 0 SQL [ALTER SYSTEM SET archive_lag_target=0 SCOPE=BOTH sid='*'] Executed successfully
DG 2009-11-11-22:04:07 0 2 0 Setting init.ora parameter with SQL [ALTER SYSTEM SET log_archive_max_processes=2 SCOPE=BOTH sid='*']
DG 2009-11-11-22:04:07 0 2 0 Executing SQL [ALTER SYSTEM SET log_archive_max_processes=2 SCOPE=BOTH sid='*']
DG 2009-11-11-22:04:07 0 2 0 SQL [ALTER SYSTEM SET log_archive_max_processes=2 SCOPE=BOTH sid='*'] Executed successfully
DG 2009-11-11-22:04:07 0 2 0 Setting init.ora parameter with SQL [ALTER SYSTEM SET log_archive_min_succeed_dest=1 SCOPE=BOTH sid='*']
DG 2009-11-11-22:04:07 0 2 0 Executing SQL [ALTER SYSTEM SET log_archive_min_succeed_dest=1 SCOPE=BOTH sid='*']
DG 2009-11-11-22:04:07 0 2 0 SQL [ALTER SYSTEM SET log_archive_min_succeed_dest=1 SCOPE=BOTH sid='*'] Executed successfully
DG 2009-11-11-22:04:07 0 2 0 Executing SQL [ALTER SYSTEM SET fal_server='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=SRV-LOGMEC-001)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=ORCLA_XPT)(SERVER=dedicated)))']
DG 2009-11-11-22:04:07 0 2 0 SQL [ALTER SYSTEM SET fal_server='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=SRV-LOGMEC-001)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=ORCLA_XPT)(SERVER=dedicated)))'] Executed successfully
DG 2009-11-11-22:04:07 0 2 0 Executing SQL [ALTER SYSTEM SET fal_client='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=SRV-LOGMEC-002)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=ORCLB_XPT)(INSTANCE_NAME=ORCLSID)(SERVER=dedicated)))']
DG 2009-11-11-22:04:07 0 2 0 SQL [ALTER SYSTEM SET fal_client='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=SRV-LOGMEC-002)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=ORCLB_XPT)(INSTANCE_NAME=ORCLSID)(SERVER=dedicated)))'] Executed successfully
DG 2009-11-11-22:04:07 0 2 0 Database Resource SetState succeeded
DG 2009-11-11-22:04:07 0 2 0 RSM 0 received SETSTATE request: rid=0x02031000, sid=1, phid=2, econd=7, sitehndl=0x7fffffff
DG 2009-11-11-22:04:07 0 2 0 Physical Apply Resource: SetState ONLINE, phase BUILD-UP, External Cond ENABLE
DG 2009-11-11-22:04:07 0 2 0 Executing SQL [ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL]
DG 2009-11-11-22:04:13 0 2 0 SQL [ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL] Executed successfully
DG 2009-11-11-22:05:11 0 2 0 Executing SQL [ALTER DATABASE RECOVER MANAGED STANDBY DATABASE THROUGH ALL SWITCHOVER DISCONNECT USING CURRENT LOGFILE]
DG 2009-11-11-22:05:17 0 2 0 SQL [ALTER DATABASE RECOVER MANAGED STANDBY DATABASE THROUGH ALL SWITCHOVER DISCONNECT USING CURRENT LOGFILE] Executed successfully
DG 2009-11-11-22:05:17 0 2 0 INSV: All instances have replied for message
DG 2009-11-11-22:05:17 0 2 0 req_id 2.1.702684180, opcode CTL_ENABLE, phase BUILDUP
DG 2009-11-11-22:05:17 0 2 702684180 DMON: Entered rfm_release_chief_lock for CTL_ENABLE
DG 2009-11-11-22:05:22 0 2 702684180 DMON: Entered rfm_get_chief_lock() for CTL_ENABLE, reason 0
DG 2009-11-11-22:05:22 0 2 702684180 DMON: chief lock convert for write op CTL_ENABLE
DG 2009-11-11-22:05:22 0 2 702684180 DMON: chief lock convert for enable
DG 2009-11-11-22:05:22 0 2 702684180 DMON: CLSR being notified to enable services and startup standby instances as appropriate during ENABLE.
DG 2009-11-11-22:05:22 0 2 702684180 DMON: status from rfi_post_instances() for ENABLE = ORA-00000
DG 2009-11-11-22:05:22 0 2 0 INSV: Received message for inter-instance publication
DG 2009-11-11-22:05:22 0 2 0 req_id 2.1.702684180, opcode CTL_ENABLE, phase END, flags 5
DG 2009-11-11-22:05:22 0 2 702684180 rfm_inst_phase_dispatch 16 END phase processing
DG 2009-11-11-22:05:22 0 2 0 INSV: All instances have replied for message
DG 2009-11-11-22:05:22 0 2 0 req_id 2.1.702684180, opcode CTL_ENABLE, phase END
DG 2009-11-11-22:05:22 0 2 702684180 DMON: Entered rfm_release_chief_lock for CTL_ENABLE
DG 2009-11-11-22:05:22 0 2 702684180 DMON: Data Guard Broker initiated operation complete
DG 2009-11-11-22:05:22 0 2 702684180 DMON: CTL_ENABLE operation completed
Alert oracle primary:
FAL[server]: Fail to queue the whole FAL gap
GAP - thread 1 sequence 731-731
DBID 2809078314 branch 696087148
Wed Nov 11 22:05:17 2009
ALTER SYSTEM SET log_archive_dest_2='service="(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=SRV-LOGMEC-002)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=ORCLB_XPT)(INSTANCE_NAME=ORCLSID)(SERVER=dedicated)))"',' LGWR ASYNC NOAFFIRM delay=0 OPTIONAL max_failure=0 max_connections=1 reopen=300 db_unique_name="ORCLB" register net_timeout=180 valid_for=(online_logfile,primary_role)' SCOPE=BOTH;
Wed Nov 11 22:05:17 2009
ALTER SYSTEM SET log_archive_dest_state_2='ENABLE' SCOPE=BOTH;
Wed Nov 11 22:05:17 2009
Thread 1 cannot allocate new log, sequence 805
Private strand flush not complete
Current log# 2 seq# 804 mem# 0: C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCLA\REDO02.LOG
Thread 1 advanced to log sequence 805
Current log# 3 seq# 805 mem# 0: C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCLA\REDO03.LOG
Wed Nov 11 22:05:22 2009
LNS: Failed to archive log 2 thread 1 sequence 804 (3113)
LGWR: Setting 'active' archival for destination LOG_ARCHIVE_DEST_2
LNS: Standby redo logfile selected for thread 1 sequence 805 for destination LOG_ARCHIVE_DEST_2
Alter oracle standby
Primary database is in MAXIMUM PERFORMANCE mode
Wed Nov 11 22:05:22 2009
RFS LogMiner: Client disabled from further notification
Primary database is in MAXIMUM PERFORMANCE mode
RFS[1]: Successfully opened standby log 4: 'C:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\ORCLA\ONLINELOG\O1_MF_4_59HJ9T8L_.LOG'
Wed Nov 11 22:05:46 2009
FAL[client]: Failed to request gap sequence
GAP - thread 1 sequence 731-731
DBID 2809078314 branch 696087148
FAL[client]: All defined FAL servers have been attempted.
Check that the CONTROL_FILE_RECORD_KEEP_TIME initialization
parameter is defined to a value that is sufficiently large
enough to maintain adequate log switch information to resolve
archivelog gaps.
Wed Nov 11 22:06:01 2009
Redo Shipping Client Connected as PUBLIC
-- Connected User is Valid
RFS[2]: Assigned to RFS process 5848
RFS[2]: Identified database type as 'physical standby'
Wed Nov 11 22:17:54 2009
db_recovery_file_dest_size of 2048 MB is 0.00% used. This is a
user-specified limit on the amount of space that will be used by this
database for recovery-related files, and does not reflect the amount of
space available in the underlying filesystem or ASM diskgroup.
Can anyone see what !"·$%& is wrong whit this? maybe is the gap? this is a exact copy of the primary but set to standby.SQL> recover database using backup controlfile;
ORA-00279: el cambio 25608871 generado en 09/24/2009 23:08:11 es necesario para
el thread 1
ORA-00289: sugerencia: D:\ORADATA\ARCHIVELOGS\ORCLB\DBSID_1_731_696087148.ARC
ORA-00280: el cambio 25608871 para el thread 1 estß en la secuencia n·mero 731
Especificar log: {<RET>=sugerido | nombre_archivo | AUTO | CANCEL}
ORA-00308: no se puede abrir el archive log
'D:\ORADATA\ARCHIVELOGS\ORCLB\DBSID_1_731_696087148.ARC'
ORA-27041: no se ha podido abrir el archivo
OSD-04002: no se ha podido abrir el archivo
O/S-Error: (OS 2) El sistema no puede hallar el archivo especificado.
So how i can recreate this file if i dont have it? anyone can help, please!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -
I have recently upgraded to the about 9i and have experienced poor performance on many queries. In 8i selecting the max(a_date) from a table took milliseconds. In 9i the same query never seems to return. The explain plan also does not seem to accurately reflect the behavior performed by the query.
An related experiences would be welcomeNot much to go on. An open door, just in case you hadn't thought of it yourself:
Perhaps you are using cost based optimization in 9i where as in 8i you were using rule based. Take a look at the init.ora and see parameter OPTIMIZER_MODE is set the same in 9i as in 8i. Typically, if you go from RULE to COST but don't ANALYZE your objects, performance problems like these could happen.
Just a thought,
L. -
Hi people,
I have a seriuos performance problem regarding ApEx.
Via sqldeveloper is fast and feedback is normally fast.
Via browser (IE, FF or Opera) sometimes is fast, sometimes images are missing, sometimes white pages are displayed in the browser, and system respond is so dog slow...
In general configuration is
- VmWare ESX server 3.5
- Windows 2003 server R2 with 4GB Ram (1 reserved)
- Oracle 11g patch 12
- 2 CPU AMD64
- APEX 3.1.2
- 3 virtual disks 20G for win, 20G for Oracle 40G for datafiles
Any suggestion in order to start a serious analysis?
I'm desperate :(
Thanks
ClaudioI found these parameters:
audit_file_dest = <omitted>\ADUMP
audit_trail = DB
compatible = 11.1.0.0.0
control_files = ("<omitted>\CONTROL01.CTL", "<omitted>\CONTROL02.CTL", "<omitted>\CONTROL03.CTL")
control_management_pack_access = DIAGNOSTIC+TUNING
cursor_sharing = SIMILAR
db_block_size = 8192
db_cache_advice = ON
db_domain = <omitted>
db_name = silsvil
db_recovery_file_dest = <omitted>\flash_recovery_area
db_recovery_file_dest_size = 2147483648
diagnostic_dest = <omitted>\ORACLE
dispatchers = '(PROTOCOL=TCP) (SERVICE=<omitted>XDB)'
job_queue_processes = 1000
memory_max_target = 2147483648
memory_target = 1073741824
nls_language = ITALIAN
nls_territory = ITALY
open_cursors = 600
optimizer_mode = FIRST_ROWS
plsql_debug = TRUE
processes = 150
query_rewrite_enabled = FALSE
remote_login_passwordfile = EXCLUSIVE
session_cached_cursors = 60
shared_server_sessions = 10
sql_trace = FALSE
statistics_level = ALL
trace_enabled = TRUE
undo_tablespace = UNDOTBS1
For the Database Configuration Assistant it is in DEDICATED MODE....
Claudio
Edited by: Seek78 on Nov 27, 2008 5:26 PM -
I am trying to implement some kind of a server listening for requests. The listener part of the app, is a daemon thread that listens for connections and instantiates a handling daemon thread once it gets some. However, my problem is that i must be able to kill the listening thread at the user's will (say via a sto button). I have done this via the Sun's proposed way, by testing a boolean flag in the loop, which is set to false when i wish to kill the thread. The problem with this thing is the following...
Once the thread starts excecuting, it will test the flag, find it true and enter the loop. At some point it will LOCK on the server socket waiting for connection. Unless some client actually connects, it will keep on listening indefinatelly whithought ever bothering to check for the flag again (no matter how many times you set the damn thing to false).
My question is this: Is there any real, non-theoretical, applied way to stop thread in java safely?
Thank you in advance,
LeftyThis was one solution from the socket programming forum, have you tried this??
public Thread MyThread extends Thread{
boolean active = true;
public void run(){
ss.setSoTimeout(90);
while (active){
try{
serverSocket = ss.accept();
catch (SocketTimeoutException ste){
// do nothing
// interrupt thread
public void deactivate(){
active = false;
// you gotta sleep for a time longer than the
// accept() timeout to make sure that timeout is finished.
try{
sleep(91);
}catch (InterruptedException ie){
interrupt();
}
Maybe you are looking for
-
ATT charges on FaceTime?
Does anyone know how ATT handles the FaceTime charges? For example, my brother has an iPhone 4 in Europe and I am in the USA. Last weekend I placed a call with him and did FaceTime. It was great. Here are my 3 questions related to this: 1. Does ATT c
-
Unknown Error when starting the Group Policy Editor
On Windows 8.1 Professional, I opened the "Edit group policy" from the control panel and also tried to start gpedit.msc from an elevated CMD prompt. In both cases I get the following error message: In English: Failed to open GPO. You may not have app
-
Hi I dont really want to start a discussion but would like some quick advice please!
I m using a imac 28inch, and recently been working with the creative cloud. my main problem is working with dreamweaver, finding after awhile that if i move the page about it leaves a strobic static effect after , leaving the screen difficult to work
-
Hello All, I want to know the importance of following field in OVA8 (Maintenance of Automatic Credit Control) 1) Checks in Financial Accounting/ old A/R summary Payer Permitted Days -- Permitted Hours --- I want to give some g
-
CAN I DO DATA CACHING by JAVA BEAN persistence?
I need to keep Objects cached in the server side. so in order to make it persistence can i use JAVA BEANS. I am not interested to do for EJB. I need a cache component build in the server side . how can i do it in JAVA / J2EE platform?