Fast query in Oracle 10 but slow in Oracle 11

Hello all,
We have a query that is running smooth in Oracle 10g. It takes less then a second. We have setup a second server and used export/import to create the same database on 11g. On this 11g database the query takes a lot of time (like 8s or more).
Below are the details. Maybe somebody can point us to the reason why this happens.
We are talking about this statement :
Select nvl(sum(BM_OPENST_D - BM_OPENST_CR),0)
from bh.bh123gh
where
F123_AR_NR>='4400000000' and
F123_AR_NR<='4404000000' and
F123_KL_LEV_AR_NR='0631001000' and
SRT_REK=2 and
F123_BKJR>=0000 and
F123_BKJR<=2011 and
F123_FIRMA=2;Database version is 11.2.0.1.0
SQL>
SQL> show parameter optimizer
NAME                                 TYPE        VALUE
optimizer_capture_sql_plan_baselines boolean     FALSE
optimizer_dynamic_sampling           integer     2
optimizer_features_enable            string      11.2.0.1
optimizer_index_caching              integer     0
optimizer_index_cost_adj             integer     100
optimizer_mode                       string      ALL_ROWS
optimizer_secure_view_merging        boolean     TRUE
optimizer_use_invisible_indexes      boolean     FALSE
optimizer_use_pending_statistics     boolean     FALSE
optimizer_use_sql_plan_baselines     boolean     TRUE
SQL>
SQL> show parameter db_file_multi
NAME                                 TYPE        VALUE
db_file_multiblock_read_count        integer     6
SQL>
SQL> show parameter db_block_size
NAME                                 TYPE        VALUE
db_block_size                        integer     8192
SQL>
SQL> show parameter cursor_sharing
NAME                                 TYPE        VALUE
cursor_sharing                       string      EXACT
SQL>
SQL> column sname format a20
SQL> column pname format a20
SQL> column pval2 format a20
SQL>
SQL> select         sname
  2              , pname
  3              , pval1
  4              , pval2
  5  from
  6              sys.aux_stats$;
SNAME                PNAME                     PVAL1 PVAL2
SYSSTATS_INFO        STATUS                          COMPLETED
SYSSTATS_INFO        DSTART                          03-30-2010 11:05
SYSSTATS_INFO        DSTOP                           03-30-2010 11:05
SYSSTATS_INFO        FLAGS                         1
SYSSTATS_MAIN        CPUSPEEDNW           1183.90219
SYSSTATS_MAIN        IOSEEKTIM                    10
SYSSTATS_MAIN        IOTFRSPEED                 4096
SYSSTATS_MAIN        SREADTIM
SYSSTATS_MAIN        MREADTIM
SYSSTATS_MAIN        CPUSPEED
SYSSTATS_MAIN        MBRC
SYSSTATS_MAIN        MAXTHR
SYSSTATS_MAIN        SLAVETHR
13 rows selected.
Elapsed: 00:00:00.03
SQL>
SQL> explain plan for
  2  Select nvl(sum(BM_OPENST_DEB - BM_OPENST_CR),0)
  3  from bh.bh123gh
  4  where
  5  F123_AR_NR>='4400000000' and
  6  F123_AR_NR<='4404000000' and
  7  F123_KL_LEV_AR_NR='0631001000' and
  8  SRT_REK=2 and
  9  F123_BKJR>=0000 and
10  F123_BKJR<=2011 and
11  F123_FIRMA=2;
Explained.
Elapsed: 00:00:00.10
SQL>
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
Plan hash value: 3488495774
| Id  | Operation                    | Name             | Rows  | Bytes | Cost (%CPU)| Time     |
|   0 | SELECT STATEMENT             |                  |     1 |    38 |  1792   (1)| 00:00:22 |
|   1 |  SORT AGGREGATE              |                  |     1 |    38 |            |          |
|*  2 |   TABLE ACCESS BY INDEX ROWID| BH123GH          |  5059 |   187K|  1792   (1)| 00:00:22 |
|*  3 |    INDEX RANGE SCAN          | I_BH123GH_ISABEL |  5059 |       |   145   (0)| 00:00:02 |
Predicate Information (identified by operation id):
   2 - filter("F123_BKJR">=0000 AND "F123_BKJR"<=2011)
   3 - access("F123_FIRMA"=2 AND "SRT_REK"=2 AND "F123_KL_LEV_AR_NR"='0631001000'
              AND "F123_AR_NR">='4400000000' AND "F123_AR_NR"<='4404000000')
       filter("F123_AR_NR"<='4404000000' AND "F123_AR_NR">='4400000000')
18 rows selected.
Elapsed: 00:00:00.20
SQL>
SQL> rollback;
Rollback complete.
Elapsed: 00:00:00.01
SQL>
SQL> rem Set the ARRAYSIZE according to your application
SQL> set autotrace traceonly arraysize 100
SQL>
SQL> alter session set tracefile_identifier = 'mytrace1';
Session altered.
Elapsed: 00:00:00.01
SQL>
SQL> rem if you're using bind variables
SQL> rem define them here
SQL>
SQL> rem variable b_var1 number
SQL> rem variable b_var2 varchar2(20)
SQL>
SQL> rem and initialize them
SQL>
SQL> rem exec :b_var1 := 1
SQL> rem exec :b_var2 := 'DIAG'
SQL>
SQL> alter session set events '10046 trace name context forever, level 8';
Session altered.
Elapsed: 00:00:00.03
SQL>
SQL> -- put your statement here
SQL> Select nvl(sum(BM_OPENST_D - BM_OPENST_CR),0)
  2  from bh.bh123gh
  3  where
  4  F123_AR_NR>='4400000000' and
  5  F123_AR_NR<='4404000000' and
  6  F123_KL_LEV_AR_NR='0631001000' and
  7  SRT_REK=2 and
  8  F123_BKJR>=0000 and
  9  F123_BKJR<=2011 and
10  F123_FIRMA=2;
Elapsed: 00:00:09.92
Execution Plan
Plan hash value: 3488495774
| Id  | Operation                    | Name             | Rows  | Bytes | Cost (%CPU)| Time     |
|   0 | SELECT STATEMENT             |                  |     1 |    38 |  1792   (1)| 00:00:22 |
|   1 |  SORT AGGREGATE              |                  |     1 |    38 |            |          |
|*  2 |   TABLE ACCESS BY INDEX ROWID| BH123GH          |  5059 |   187K|  1792   (1)| 00:00:22 |
|*  3 |    INDEX RANGE SCAN          | I_BH123GH_ISABEL |  5059 |       |   145   (0)| 00:00:02 |
Predicate Information (identified by operation id):
   2 - filter("F123_BKJR">=0000 AND "F123_BKJR"<=2011)
   3 - access("F123_FIRMA"=2 AND "SRT_REK"=2 AND "F123_KL_LEV_AR_NR"='0631001000'
              AND "F123_AR_NR">='4400000000' AND "F123_AR_NR"<='4404000000')
       filter("F123_AR_NR"<='4404000000' AND "F123_AR_NR">='4400000000')
Statistics
          1  recursive calls
          0  db block gets
      11104  consistent gets
       9434  physical reads
          0  redo size
        574  bytes sent via SQL*Net to client
        519  bytes received via SQL*Net from client
          2  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
          1  rows processed
SQL>
SQL> disconnect
Disconnected from Oracle Database 11g Release 11.2.0.1.0 - 64bit Production
SQL>
SQL> spool offTrace output :
TKPROF: Release 11.2.0.1.0 - Development on Tue Nov 22 13:58:33 2011
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
Trace file: C:\Oracle\diag\rdbms\oravopak\oravopak\trace\oravopak_ora_7352_mytrace1.trc
Sort options: default
count    = number of times OCI procedure was executed
cpu      = cpu time in seconds executing
elapsed  = elapsed time in seconds executing
disk     = number of physical reads of buffers from disk
query    = number of buffers gotten for consistent read
current  = number of buffers gotten in current mode (usually for update)
rows     = number of rows processed by the fetch or execute call
Select nvl(sum(BM_OPENST_D - BM_OPENST_CR),0)
from bh.bh123gh
where
F123_AR_NR>='4400000000' and
F123_AR_NR<='4404000000' and
F123_KL_LEV_AR_NR='0631001000' and
SRT_REK=2 and
F123_BKJR>=0000 and
F123_BKJR<=2011 and
F123_FIRMA=2
call     count       cpu    elapsed       disk      query    current        rows
Parse        1      0.01       0.00          0          0          0           0
Execute      1      0.00       0.00          0          0          0           0
Fetch        2      0.03       9.86       9434      11104          0           1
total        4      0.04       9.87       9434      11104          0           1
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: SYS
Rows     Row Source Operation
      1  SORT AGGREGATE (cr=11104 pr=9434 pw=0 time=0 us)
  67250   TABLE ACCESS BY INDEX ROWID BH123GH (cr=11104 pr=9434 pw=0 time=10500177 us cost=1792 size=192242 card=5059)
  67250    INDEX RANGE SCAN I_BH123GH_ISABEL (cr=526 pr=550 pw=0 time=44363 us cost=145 size=0 card=5059)(object id 75061)
Elapsed times include waiting on following events:
  Event waited on                             Times   Max. Wait  Total Waited
  ----------------------------------------   Waited  ----------  ------------
  SQL*Net message to client                       2        0.00          0.00
  Disk file operations I/O                        1        0.00          0.00
  db file sequential read                      8893        0.10          9.26
  db file scattered read                          7        0.01          0.05
  db file parallel read                           1        0.02          0.02
  SQL*Net message from client                     2        0.00          0.00
********************************************************************************DBMS_XPLAN.DISPLAY_CURSOR output :
SQL>
SQL> select * from table(dbms_xplan.display_cursor(null, null, 'ALLSTATS LAST'));
PLAN_TABLE_OUTPUT
SQL_ID  g6pkv639sdfgw, child number 0
Select /*+ gather_plan_statistics */ nvl(sum(BM_OPENST_DEB -
BM_OPENST_CR),0) from bh.bh123gh where F123_AR_NR>='4400000000'
and F123_AR_NR<='4404000000' and F123_KL_LEV_AR_NR='0631001000' and
SRT_REK=2 and F123_BKJR>=0000 and F123_BKJR<=2011 and
F123_FIRMA=2
Plan hash value: 3488495774
| Id  | Operation                    | Name             | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  |
|   0 | SELECT STATEMENT             |                  |      1 |        |      1 |00:00:08.07 |   11104 |  13531 |
|   1 |  SORT AGGREGATE              |                  |      1 |      1 |      1 |00:00:08.07 |   11104 |  13531 |
|*  2 |   TABLE ACCESS BY INDEX ROWID| BH123GH          |      1 |   5059 |  67250 |00:00:10.90 |   11104 |  13531 |
|*  3 |    INDEX RANGE SCAN          | I_BH123GH_ISABEL |      1 |   5059 |  67250 |00:00:00.05 |     526 |    550 |
Predicate Information (identified by operation id):
   2 - filter(("F123_BKJR">=0 AND "F123_BKJR"<=2011))
   3 - access("F123_FIRMA"=2 AND "SRT_REK"=2 AND "F123_KL_LEV_AR_NR"='0631001000' AND
              "F123_AR_NR">='4400000000' AND "F123_AR_NR"<='4404000000')
       filter(("F123_AR_NR"<='4404000000' AND "F123_AR_NR">='4400000000'))
27 rows selected.
Elapsed: 00:00:01.15
SQL>
SQL> spool off

I still find that my Oracle 10 DB is a tad faster.
Comparing the plans shows that my Oracle 10 DB does less physical reads. I think I will get the same speed if I can find a way to change that behaviour on my Oracle 11 DB or can find the reason why it does that.
SQL>
SQL> show parameter user_dump_dest
NAME                                 TYPE        VALUE
user_dump_dest                       string      C:\ORACLE\PRODUCT\10.2.0\ADMIN
                                                 \ORAMULT\UDUMP
SQL>
SQL> show parameter optimizer
NAME                                 TYPE        VALUE
optimizer_dynamic_sampling           integer     2
optimizer_features_enable            string      10.2.0.3
optimizer_index_caching              integer     0
optimizer_index_cost_adj             integer     100
optimizer_mode                       string      ALL_ROWS
optimizer_secure_view_merging        boolean     TRUE
SQL>
SQL> show parameter db_file_multi
NAME                                 TYPE        VALUE
db_file_multiblock_read_count        integer     16
SQL>
SQL> show parameter db_block_size
NAME                                 TYPE        VALUE
db_block_size                        integer     8192
SQL>
SQL> show parameter cursor_sharing
NAME                                 TYPE        VALUE
cursor_sharing                       string      EXACT
SQL>
SQL> column sname format a20
SQL> column pname format a20
SQL> column pval2 format a20
SQL>
SQL> select         sname
  2              , pname
  3              , pval1
  4              , pval2
  5  from
  6              sys.aux_stats$;
SNAME                PNAME                     PVAL1 PVAL2
SYSSTATS_INFO        STATUS                          COMPLETED
SYSSTATS_INFO        DSTART                          04-17-2007 04:50
SYSSTATS_INFO        DSTOP                           04-17-2007 04:50
SYSSTATS_INFO        FLAGS                         1
SYSSTATS_MAIN        CPUSPEEDNW           470.445344
SYSSTATS_MAIN        IOSEEKTIM                    10
SYSSTATS_MAIN        IOTFRSPEED                 4096
SYSSTATS_MAIN        SREADTIM
SYSSTATS_MAIN        MREADTIM
SYSSTATS_MAIN        CPUSPEED
SYSSTATS_MAIN        MBRC
SYSSTATS_MAIN        MAXTHR
SYSSTATS_MAIN        SLAVETHR
13 rows selected.
Elapsed: 00:00:00.01
SQL>
SQL> explain plan for
  2  Select nvl(sum(BM_OPENST_DEB- BM_OPENST_CR),0)
  3  from bh.bh123gh
  4  where
  5  F123_AR_NR>='4400000000' and
  6  F123_AR_NR<='4404000000' and
  7  F123_KL_LEV_AR_NR='0631001000' and
  8  SRT_REK=2 and
  9  F123_BKJR>=0000 and
10  F123_BKJR<=2011 and
11  F123_FIRMA=2;
Explained.
Elapsed: 00:00:00.00
SQL>
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
Plan hash value: 3488495774
| Id  | Operation                    | Name             | Rows  | Bytes | Cost (%CPU)| Time     |
|   0 | SELECT STATEMENT             |                  |     1 |    38 |  1594   (1)| 00:00:20 |
|   1 |  SORT AGGREGATE              |                  |     1 |    38 |            |          |
|*  2 |   TABLE ACCESS BY INDEX ROWID| BH123GH          |  4776 |   177K|  1594   (1)| 00:00:20 |
|*  3 |    INDEX RANGE SCAN          | I_BH123GH_ISABEL |  4776 |       |   140   (1)| 00:00:02 |
Predicate Information (identified by operation id):
   2 - filter("F123_BKJR">=0000 AND "F123_BKJR"<=2011)
   3 - access("F123_FIRMA"=2 AND "SRT_REK"=2 AND "F123_KL_LEV_AR_NR"='0631001000'
              AND "F123_AR_NR">='4400000000' AND "F123_AR_NR"<='4404000000')
       filter("F123_AR_NR"<='4404000000' AND "F123_AR_NR">='4400000000')
18 rows selected.
Elapsed: 00:00:00.32
SQL>
SQL> rollback;
Rollback complete.
Elapsed: 00:00:00.00
SQL>
SQL> rem Set the ARRAYSIZE according to your application
SQL> set autotrace traceonly arraysize 100
SQL>
SQL> alter session set tracefile_identifier = 'mytrace1';
Session altered.
Elapsed: 00:00:00.00
SQL>
SQL> rem if you're using bind variables
SQL> rem define them here
SQL>
SQL> rem variable b_var1 number
SQL> rem variable b_var2 varchar2(20)
SQL>
SQL> rem and initialize them
SQL>
SQL> rem exec :b_var1 := 1
SQL> rem exec :b_var2 := 'DIAG'
SQL>
SQL> alter session set events '10046 trace name context forever, level 8';
Session altered.
Elapsed: 00:00:00.00
SQL>
SQL> -- put your statement here
SQL> Select nvl(sum(BM_OPENST_DEB- BM_OPENST_CR),0)
  2  from bh.bh123gh
  3  where
  4  F123_AR_NR>='4400000000' and
  5  F123_AR_NR<='4404000000' and
  6  F123_KL_LEV_AR_NR='0631001000' and
  7  SRT_REK=2 and
  8  F123_BKJR>=0000 and
  9  F123_BKJR<=2011 and
10  F123_FIRMA=2;
Elapsed: 00:00:00.12
Execution Plan
Plan hash value: 3488495774
| Id  | Operation                    | Name             | Rows  | Bytes | Cost (%CPU)| Time     |
|   0 | SELECT STATEMENT             |                  |     1 |    38 |  1594   (1)| 00:00:20 |
|   1 |  SORT AGGREGATE              |                  |     1 |    38 |            |          |
|*  2 |   TABLE ACCESS BY INDEX ROWID| BH123GH          |  4776 |   177K|  1594   (1)| 00:00:20 |
|*  3 |    INDEX RANGE SCAN          | I_BH123GH_ISABEL |  4776 |       |   140   (1)| 00:00:02 |
Predicate Information (identified by operation id):
   2 - filter("F123_BKJR">=0000 AND "F123_BKJR"<=2011)
   3 - access("F123_FIRMA"=2 AND "SRT_REK"=2 AND "F123_KL_LEV_AR_NR"='0631001000'
              AND "F123_AR_NR">='4400000000' AND "F123_AR_NR"<='4404000000')
       filter("F123_AR_NR"<='4404000000' AND "F123_AR_NR">='4400000000')
Statistics
          1  recursive calls
          0  db block gets
      11001  consistent gets
          0  physical reads
          0  redo size
        459  bytes sent via SQL*Net to client
        396  bytes received via SQL*Net from client
          2  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
          1  rows processed
SQL>
SQL> disconnect
Disconnected from Oracle Database 10g Release 10.2.0.3.0 - Production
SQL>
SQL> spool off

Similar Messages

  • TimeCapsule works fast with one macbook, but slow with a macbook pro

    Hey there,
    i have a new time capsule 2gb, set up as a sole wireless router in my network. My macbook pro works fine with it but it needs about 3 hours for copying 40 gigabyte of data to the time capsule. Yesterday a friend came over with her macbook and was able to copy the same amount in about 50 minutes. I can't figure out any difference in the two systems. Can you help?
    Thanks.
    Tilmann

    tilmannkuhla wrote:
    i have a new time capsule 2gb, set up as a sole wireless router in my network. My macbook pro works fine with it but it needs about 3 hours for copying 40 gigabyte of data to the time capsule. Yesterday a friend came over with her macbook and was able to copy the same amount in about 50 minutes. I can't figure out any difference in the two systems.
    Welcome to Apple's discussion groups.
    You might try measuring the signal and noise levels that each Mac sees using these instructions:
    http://discussions.apple.com/thread.jspa?threadID=2347845&start=1
    One possible explanation might be that your Mac has a metal case while the other may have a plastic case.

  • Firefox starts fast in safe mode, but slow in normal mode with all extensions and add-ons turned off.

    It's only the first screen/tab I open after firefox is completely shut off... it shows the borders of the screen for 5 seconds, before showing the content (empty page) and then I can start and everything after that is fine.
    In safe mode it opens without delay, so my question is, what in the normal start-up could be causing this delay, I have reinstalled firefox, disabled all extensions and plugins.

    Hello ellina, try disabling graphics hardware acceleration and check it again.
    You might need to restart Firefox in order for this to take effect, so save all work first (e.g., mail you are composing, online documents you're editing, etc.).
    Then perform these steps:
    #Open Firefox ''Options'' window (''Preferences'' on Mac or Linux) as follows:
    #* In Firefox 29.0 and above, click the menu button [[Image:New Fx Menu]] and select ''Options'' for Windows or ''Preferences'' on Mac or Linux.
    #In the Firefox Options (or Preferences) window, click the ''Advanced'' tab, then select ''General''.
    #In the settings list, you should find the ''Use hardware acceleration when available'' checkbox. Uncheck this checkbox.
    #Now, restart Firefox and see if the problems persist.
    Additionally, please check for updates for your graphics driver by following the steps mentioned in the following Knowledge base articles:
    * [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]]
    * [[Upgrade your graphics drivers to use hardware acceleration and WebGL]]
    '''In safe mode, also, hardware acceleration is disable''', see : http://kb.mozillazine.org/Safe_mode
    Thank you.

  • Query works on Oracle 9i, but fails on Oracle 10g - puzzling...

    In porting an application from Oracle 9i to Oracle 10g, I hit a problem that for a while I assumed was some bug of mine. But I eventually isolated the problem and can reproduce this using a single sql script and then a single delete. The amazing thing is that it works fine on Oracle 9i (always) and fails on Oracle 10g (always).
    Have I found a bug? (I would be pretty amazed).
    Here's the situation. I have four tables and a trigger set on one of those tables.
    The tables are configured so that there is the "parent" table (A). Table B has a foreign key dependency on A's primary key, with "on delete cascade". Table B also has a trigger that runs on the delete. Table C (which has no data) has an integrity constraint on A's primary key. Table D holds information used by the trigger to determine if/when table C should be dropped. (I have a script that sets all this up).
    After setting up the tables and the few data records needed, I delete a record from Table A. This causes the records in Table B to be deleted. That fires the trigger, which determines that Table C can be dropped, so the trigger drops Table C. Then, Oracle decides it still needs to check the integrity constraint on Table C (after all, C depended on A and we have deleted a record in A). Oracle then issues a query against table C, but of course table C has already been dropped and an error results.
    The exact same script followed by the delete works fine on Oracle 9i. Is this a bug or is this a documented change in behavior? Any known workarounds? Unfortunately, the application needs all the integrity constraints that are present in the schema and also runs on SQL Server, so modifications in the integrity constraints are probably not what I am seeking).
    Thanks so much!
    RB

    I wasn't sure how to post the script, but it is short enough to include below. Many thanks for the quick response.
    To connect the script below to my original post, the names are:
    Table A = OT_AW_PROCESSDEF
    Table B = OT_AW_PROCESS_APPDATADEF
    Table C = OT_AW_AD_OneLoop_1
    Table D = OT_AW_APPDATA_TABLEINFO
    The trigger is also included in the script. After running this script, the command:
    delete from OT_AW_ProcessDef where processdefId = 101
    will cause the failure on Oracle10g, but succeeds on Oracle 9i.
    Thanks again!
    RB
    /* *********************** CLEAN UP ********************************** */
    /* Order the dropping of objects in reverse of creation */
    DROP TABLE OT_AW_AD_OneLoop_1 CASCADE CONSTRAINTS
    DROP TABLE OT_AW_PROCESS_APPDATADEF CASCADE CONSTRAINTS
    DROP TABLE OT_AW_APPDATA_TABLEINFO CASCADE CONSTRAINTS
    DROP TABLE OT_AW_PROCESSDEF CASCADE CONSTRAINTS
    /* ******************* DATA TABLES *********************************** */
    /* OT_AW_PROCESSDEF(Process Definition) Table */
    /* ********** NOTE: OT_AW_PROCESSDEF and AW_PROCESS TABLES SHOULD ALWAYS HAVE THE SAME SET OF COLUMNS ********* */
    create table OT_AW_PROCESSDEF (
    processDefId NUMBER /* Id for the process definition */
    , processDefName NVARCHAR2(255) /* Name of the process definition */
    , CONSTRAINT OT_AW_PROCESSDEF_PK PRIMARY KEY(processDefId)
    insert into OT_AW_PROCESSDEF (
    processDefId, processDefName
    values (
    1, 'ADHOC'
    /* OT_AW_APPDATA_TABLEINFO(List of all application Data tables in the system) Table */
    create table OT_AW_APPDATA_TABLEINFO (
    namespace VARCHAR2(65) NOT NULL, /* name of the namespace to which it belongs */
    tableName VARCHAR2(128) , /* Name of the appdata table */
    adLevel NUMBER(38) NOT NULL /* Appdata table level: 0=>PROCESS, 1=>CONVERSATION */
    , CONSTRAINT OT_AW_APPDATA_TABLEINFO_PK PRIMARY KEY ( tableName )
    , CONSTRAINT OT_AW_APPDATA_TABLEINFO_UNQ UNIQUE( namespace, tableName, adLevel )
    /* OT_AW_PROCESS_APPDATADEF(Process level application data definition) Table */
    create table OT_AW_PROCESS_APPDATADEF (
    processDefId NUMBER NOT NULL /* Id for the process definition */
    , name VARCHAR2(65) NOT NULL /* Name of the application data field, This name may be pointing to a shared namespace field */
    , tableName VARCHAR2(128) /* Name of the table that holds the value for the field, may be same as local namespace table name */
    , namespace VARCHAR2(65) NOT NULL /* Name of the namespace to which this field belongs */
    , mappedNamespace VARCHAR2(65) null /* Name of the shared namespace to which this field is mapped, if there is any mapping */
    , CONSTRAINT OT_AW_PROCESS_APPDATADEF_PK PRIMARY KEY (namespace, processDefId, name)
    , CONSTRAINT OT_AW_PROCESS_APPDATADEF_FK FOREIGN KEY (processDefId) REFERENCES OT_AW_PROCESSDEF(processDefId) on delete cascade
    CREATE TABLE OT_AW_AD_OneLoop_1(processDefId number , processId number ,FromRole number null, ToRole number null, Anyone number null,
    CONSTRAINT OT_AW_AD_OneLoop_1_FK1 FOREIGN KEY (processDefId) REFERENCES OT_AW_PROCESSDEF(processDefId) )
    /* TRIGGERS */
    CREATE OR REPLACE TRIGGER OT_AW_PROCESS_APPDATADEF_DEL
    AFTER DELETE ON OT_AW_PROCESS_APPDATADEF
    FOR EACH ROW
    DECLARE
    PRAGMA AUTONOMOUS_TRANSACTION;
    tableName_var OT_AW_PROCESS_APPDATADEF.tableName%TYPE;
    tempStr_var varchar2(128) :=null;
    deletedId OT_AW_PROCESS_APPDATADEF.processDefId%TYPE;
    deletedMNsp OT_AW_PROCESS_APPDATADEF.mappedNamespace%TYPE;
    numReferences number :=-1;
    tableExists number :=0;
    CURSOR ADPTable_cursor
    IS
    SELECT apa.tableName, apa.processDefId, apa.mappedNamespace
    FROM OT_AW_PROCESS_APPDATADEF apa
    WHERE apa.tableName = :old.tableName
    AND apa.processDefId = :old.processDefId;
    BEGIN
    dbms_output.put_line('Starting TRIGGER OT_AW_PROCESS_APPDATADEF_DEL');
    OPEN ADPTable_cursor;
    LOOP
    FETCH ADPTable_cursor
    INTO tableName_var, deletedId, deletedMNsp;
    EXIT WHEN ADPTable_cursor%NOTFOUND;
    BEGIN
    IF (deletedMNsp IS NULL) THEN
    BEGIN
    select count(*) into numReferences from OT_AW_PROCESS_APPDATADEF where tableName = tableName_var
    and processDefId <> deletedId;
    IF ( numReferences = 0 ) THEN
    BEGIN
    SELECT count(*) INTO tableExists FROM OT_AW_APPDATA_TABLEINFO where
              tableName=tableName_var;
    IF (tableExists > 0) THEN
    BEGIN
    --dbms_output.put_line('About to alter first table');
    -- EXECUTE IMMEDIATE 'ALTER TABLE ' || tableName_var || ' DROP CONSTRAINT ' || tableName_var ||'_FK1';
    --dbms_output.put_line('About to alter second table');
    -- EXECUTE IMMEDIATE 'ALTER TABLE ' || tableName_var || ' DROP CONSTRAINT ' || tableName_var ||'_FK2';
    dbms_output.put_line('About to drop table named: ' || tableName_var);
    tempStr_var := 'DROP TABLE ' || tableName_var;
    EXECUTE IMMEDIATE tempStr_var;
    dbms_output.put_line(tempStr_var);
    dbms_output.put_line('Table dropped');
    --dbms_output.put_line('Not dropping table now');
    END;
    END IF;
    delete from OT_AW_APPDATA_TABLEINFO where
              tableName=tableName_var;
    dbms_output.put_line('OT_AW_APPDATA_TABLEINFO updated');           
    END;
    END IF;
    END;
    END IF;
    END;
    END LOOP;
    dbms_output.put_line('Loop ended');
    CLOSE ADPTable_cursor;
    dbms_output.put_line('Cursor closed');
    COMMIT WORK;
    dbms_output.put_line('Work committed');
    dbms_output.put_line('Ending TRIGGER OT_AW_PROCESS_APPDATADEF_DEL');
    END;
    show errors;
    /* Set up data to simulate the creation of OT_AW_AD_OneLoop_1 */
    insert into OT_AW_PROCESSDEF (
    processDefId, processDefName
    values (
    101, 'OneLoop'
    insert into OT_AW_PROCESS_APPDATADEF (
    processDefId, name, tableName, namespace
    values (
    101, 'FromRole', 'OT_AW_AD_OneLoop_1', 'OneLoop'
    insert into OT_AW_PROCESS_APPDATADEF (
    processDefId, name, tableName, namespace
    values (
    101, 'ToRole', 'OT_AW_AD_OneLoop_1', 'OneLoop'
    insert into OT_AW_APPDATA_TABLEINFO (
    namespace, tablename, adlevel
    values (
    'OneLoop', 'OT_AW_AD_OneLoop_1', 0
    /

  • CR XI & XI R2 - PutLocation() Extremely Slow on Oracle Database

    Hello,
    I have an issue very similar to others posted in this forum, but was asked to start a new thread.
    I'm using Crystal XI and XI R2,updated with SP6.
    I develop using C++ on VS2008 using the crystal COM object.
    I have common database tables, in which I have views on these tables. The views depict a collection, and when the report is to run on a different collection I need to change the views on all of the tables (including those in subreports), as well as provide the credentials for connection.
    I'm using Oracle 10g, and changing a couple of properties using the following sequence for each table to change the login information and the table's current view (each view is a portion of the overall table):
    IDatabaseTablePtr table = tables->GetItem(tableN);          
    table->SetLogOnInfo(TheApp.GetDataSource(), TheApp.GetDatabase(), userID, pwd);
    char tableLocation[201];
    char tempTable[201], newTable[201];
    strcpy(tableLocation, table->GetLocation());
    // make new table name, put into newTable
    table->PutLocation(newTable);
    if (!table->TestConnectivity())
      ShowCrystalRE_Error(job);
    Stepping through in my debugger, the SetLogOnInfo seems very quick, it's the PutLocation( ) that seems to be taking alot of time, several seconds per call, whereas the other calls are as quick as I can step through my code.
    Any help would be greatly appreciated.
    This is extremely fast on SQL Server, only noticeably slow on Oracle.
    My database connections for the report utilize ODBC (The ORACLE installed driver, not the MS driver), which is how our application talks to the database, and provides a connection to crystal.
    I can have upwards of 20 tables/views in a report, and this can take 1/2 to a full minute to accomplish.
    In addition, I optionally provide a user the ability to add criteria and sorting to the report; and perform a table/column collection to show them to the user for seleciton. This same process is used on all views (including those in subreports), so proper data lists can be provided from the correct views.
    Does anyone have a solution for this?
    Edited by: BobOfPlanet on Mar 3, 2010 7:36 PM

    Ludek, thanks for the response.
    I think it might be best if I cite your response and comment on it.
    1) Only CR 10.5 and CR 2008 (12.x) are supported in .NET 2008.
    I'm using VS2008 with C, not .Net.   Everything works fine, including all of the API calls, it is only the performance of this particular call to PutLocation( ) that is slow using Crystal engine XI.
    2) You actually appear to be using the RDC (craxdrt.dll) in .NET, which is also not supported in .NET - any version of .NET. See this article for details and also see this blog.
    See #1 above, not using .NET.
    3) You are using SetLogOnInfo. This method was deprecated in version 9 of Crystal Reports and you now must use the connection properties bag. See this article for more details.
         I'm previewing the article you cited above, iew the Connection Property to see if this will work for me.
    If you somehow manage to overcome the above issues, you will have to also resolve the issue of how and which CR runtime to distribute. RDC? CR for .NET? Both?
          For distribution, I copied the 4 MSM files from the installation to my Installshield Redistributables, select all four to be included in my package, the license is the only one requiring a keycode, which I took as the product code used to do my install (as instructed by Macrovision/Business Objects support several years ago when we first upgraded to Crystal XI and I did our interface rewrite to use the COM object.
    CrystalReports11_RDC_Designtime.msm
    CrystalReports11_RDC_License.msm
    CrystalReports11_RDC_Reportengine.msm
    CrystalReports11_RDC_Runtime.msm
    With the recent upgrade to SP4 (which made Crystal XI into XI R2) and then SP6, I found the following which I've started using since March 2nd in an attempt to resolve the Performance issue outlined in this thread.
    CrystalReports11_5_RDC_Designtime.msm
    CrystalReports11_5_RDC_License.msm
    CrystalReports11_5_RDC_Reportengine.msm
    CrystalReports11_5_RDC_Runtime.msm
    Do you have any further insight while I preview the "Report Designer Component 9" PDF you cited?
    Thanks again in advance,
    Bob

  • Linking Access tables, creating a query with using both Access and Oracle

    Hello,
    I am using 3.0.04.34 version Oracle Developer. I am supposed to create a script/procedure to use both Access tables and oracle tables together. There is an option in developer to copy the access tables into oracle. But it doesn't help me. Because when we updated the access tables
    the copied ones are not be updated. How can I created a linked access tables to oracle and create a query with using both access and oracle table together.
    I will appreciate if you guys help me. I look forward to hearing from you guys.
    Thanks,
    Pinar

    Pinar,
    to be able to query MS Access tables in Oracle you need an additional product, the Oracle Database Gateway for ODBC. It allows you to link any foreign database into an Oracle database using a suitable ODBC driver. You can then access the MS Access tables through a database link based on the Database Gateway for ODBC. This will also allow you to join local Oracle and remote MS Access tables from your Oracle database.
    There's a note on My Oracle Support which gives you more details:Document 233876.1 Options for Connecting to Foreign Data Stores and Non-Oracle Databases - For example - DB2, SQL*Server, Sybase, Informix, Teradata, MySQL
    And there's also a dedicated Forum: Heterogeneous Connectivity

  • Query using link server to an Oracle database failswhile similar query works

    I have two queries almost the same that use a link to an Oracle database. One works ok, the other is a copy of the first with a few fields selects removed.  The first one works fine, the copy fails with: Cannot get the data of the row from the OLE DB
    provider "OraOLEDB.Oracle" for linked server "linkname".
    They are so similar, why would one work but not the other? 
    First query, this one works:
    SET
    ANSI_NULLS ON
    GO
    SET
    QUOTED_IDENTIFIER ON
    GO
    CREATE
    PROCEDURE [dbo].[procedure_name]
    -- Add the parameters for the stored procedure here
    @Begindate  Datetime,
    @Enddate Datetime
    AS
    BEGIN
    --SET NOCOUNT ON added to prevent extra result sets from
    --interfering with SELECT statements.
    SET NOCOUNT
    ON;
    -- Insert statements for procedure here
    select p.patientid, p.testid,
    mdx."Dx_4", td.acquisitiondatetime_dt, td.democompletedatetime_dt,
    td.editdatetime_dt,
    CAST(STUFF(STUFF(mn."Arrival_Time_9",
    9, 0,
    ' '), 12, 0,
    AS datetime)
    as Arrival_date,
    CAST(STUFF(STUFF(mt."Comp_D_T_22",
    9, 0,
    ' '), 12, 0,
    AS datetime)
    as Order_date, td.confirmdatetime_dt
    (CAST(DATEDIFF
    (MINUTE,
    CAST (STUFF
    (STUFF
    (MN."ARRIVAL_TIME_9", 9,0,
    ' '), 12, 0,
    AS DATETIME), TD.DEMOCOMPLETEDATETIME_DT) 
    as char(10))
    + 'min')
    AS "ARRIVAL TO COMPLETE",
    (CAST(DATEDIFF
    (MINUTE,
    CAST (STUFF
    (STUFF
    (MT."COMP_D_T_22", 9,0,
    ' '), 12, 0,
    AS DATETIME), TD.DEMOCOMPLETEDATETIME_DT)
    as char(10))
    + 'min') 
    AS "ORDER TO COMPLETE"
    from linknametosqldb.sqldbname.dbo.tstpatientdemographics
    as p inner
    join linknametosqldb.sqldbname dbo.tsttestdemographics
    as td on p.testid
    = td.testid
    left
    outer join linknametooracledb."M01Tab01_Main" mn
    on td.visitnumber
    = mn."Pt_Acct_5"
    inner
    JOIN linknametooracledb."M01Tab06_Ord" mt
    ON mn."Master_Recid_1"
    = mt."Master_Recid_1"
    inner
    join linknametooracledb."M01Tab09_Dx" mdx
    on mn."Master_Recid_1"
    = mdx."Master_Recid_1"
    where td.location
    in (2, 4)
    and mt.order_4
    like 'EKG%' 
    and mdx."Dx_4"
    like '%Chest Pain%'
    and
    (td.acquisitiondatetime_dt
    >= @Begindate and td.acquisitiondatetime_dt
    < @Enddate)
    order
    by p.patientfullname_last, p.patientfullname_first
    END
    GO
    Second query, copied from first with some fields selects removed, this does not work:
    SET
    ANSI_NULLS ON
    GO
    SET
    QUOTED_IDENTIFIER ON
    GO
    CREATE
    PROCEDURE [dbo].[procedure_name_2]
    -- Add the parameters for the stored procedure here
    @Begindate  Datetime,
    @Enddate Datetime
    AS
    BEGIN
    --SET NOCOUNT ON added to prevent extra result sets from
    --interfering with SELECT statements.
    SET NOCOUNT
    ON;
    -- Insert statements for procedure here
    select p.patientid, mdx."Dx_4",
    td.democompletedatetime_dt,
    CAST(STUFF(STUFF(mn."Arrival_Time_9",
    9, 0,
    ' '), 12, 0,
    AS datetime)
    as EDIS_Arrival_date,
    (CAST(DATEDIFF
    (MINUTE,
    CAST (STUFF
    (STUFF
    (MN."Arrival_Time_9", 9,0,
    ' '), 12, 0,
    AS DATETIME), TD.DEMOCOMPLETEDATETIME_DT) 
    as char(10))
    + 'min')
    AS "ARRIVAL TO COMPLETE"
    from linknametosqldb.dbo.tstpatientdemographics
    as p inner
    join linknametosqldb.dbo.tsttestdemographics
    as td on p.testid
    = td.testid
    left outer
    join linknametooracledb."M01Tab01_Main" mn
    on td.visitnumber
    = mn."Pt_Acct_5"
    inner
    JOIN linknametooracledb."M01Tab06_Ord" mt
    ON mn."Master_Recid_1"
    = mt."Master_Recid_1"
    inner
    join linknametooracledb M01Tab09_Dx" mdx
    on mn."Master_Recid_1"
    = mdx."Master_Recid_1"
    where td.location
    in (2, 4)
    and mt.order_4
    like 'EKG%' 
    and mdx."Dx_4"
    like '%Chest Pain%'
    and
    (td.acquisitiondatetime_dt
    >= @Begindate and td.acquisitiondatetime_dt
    < @Enddate)
    order
    by p.patientid
    END
    GO
    Thanks very much for any help with this.

    * Consider putting parentheses around the 3 oracle tables so the 3 of them can possibly be treated as a unit.  Assuming there's some performance impact due to the linked server, this MIGHT help, may do a little joining over on the Oracle side of
    the world.  In either case, it's a little cleaner.  They syntax below, including a few extra line breaks for clarity, should be correct.  (try the change to the ON clause suggested above too, though).
    The parentheses will not help much. SQL Server will remote (as the term is) the query to the Oracle instance if this appears to have a lower cost and there is nothing the blocks remoting.
    On the other hand, OPENQUERY can be an alternative to ensure that this happens:
     left outer join
        OPENQUERY (linknametooracledb,
                   'SELECT ...
                    FROM   "M01Tab01_Main" mn
                    JOIN   "M01Tab06_Ord" mt ON mn."Master_Recid_1" = mt."Master_Recid_1"
                    JOIN   "M01Tab09_Dx" mdx on mn."Master_Recid_1" = mdx."Master_Recid_1"') mn on td.visitnumber = mn."Pt_Acct_5"
    But this presumes that you there are no columns from the SQL Server side that are used to select data from the Oracle side. That is, the above could lead to far much data being brought across the wire.
    Then again, this does not really seem to relate to the original problem where a stored procedure was not working at all. That problem is not very easy to assist with since code post is the not the authentic code as pointed out in the thread. For instance
    inner JOIN linknametooracledb."M01Tab06_Ord"
    Has nothing to do with Oracle, but accesses a table in the schema linknametooracledb.
    I think to help dmcm, you need a really good crystal ball - at least as long he/she does not share the actual code.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Query to connect Java Applet to Oracle 10g.

    I am developing an Applet in Java 1.5.0.7.My database is Oracle 10g.Now when i connect Oracle to Java I get the Error : java.lang.ExceptionInInitializerError
    and it does not get connected.Please help me anyone.
    Below is the code which i have written.
    import java.awt.*;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.MouseEvent;
    import java.beans.PropertyChangeEvent;
    import java.beans.PropertyChangeListener;
    import java.sql.*;
    import java.util.ArrayList;
    import javax.swing.JApplet;
    import javax.swing.JButton;
    import javax.swing.JLabel;
    public class tt7 extends JApplet
         implements ActionListener, PropertyChangeListener
    private int m_uniqueID = 0;
         JLabel m_lblRadius;
         // A button the user can click to display the Add Theme wizard.
         JButton m_btnAddTheme;
         static String m_mapxtremeURL = null;
         // TODO: Specify a map file name such as "uk.mdf" (if the mdf file is in
         // in same directory that the applet was loaded from),
         // or an URL to a map file, such as "http://host.com/maps/uk.mdf".
         // Or, instead of specifying this URL explicitly here, you can specify it
         // in the HTML page that loads the applet (using the 'filetoload' param).
    ResultSet rs=null ;
    ArrayList arrlist=null;
    ArrayList arrlist1=null;
    ArrayList arrlist2=null;
    //Connection con=null;
    Statement st=null;
         public void start()
         } // start method
         public void init()
    try{
    // System.out.println("helloooooooo");
    Class.forName("oracle.jdbc.driver.OracleDriver");
    //Class.forName("oracle.jdbc.driver.OracleDriver");
    Connection con= DriverManager.getConnection("Jdbc:oracle:thin:@asl005:1521:geo","system","1234567");//"jdbc:oracle:thin:@asl005:1521:geo","system","1234567");
    System.out.println("helloooooooo");
    System.out.println("CON:"+con.toString());
    st = con.createStatement();
    System.out.println("St:"+st);
    catch(Exception e2){System.out.println("Exception :"+e2);}
    catch(ExceptionInInitializerError s)
    System.out.println("Exception2 :"+s);
    }// If the HTML page specified parameters, use them to
              // override our default values.
              // See if a MapDef file was specified in the HTML file.
         }     // propertyChange method
         // Respond to the user actions, such as clicking
         // the Add Theme button.
    public void actionPerformed(ActionEvent e)
    // LocalDataProviderRef localDPRef = null;
    // a static label displayed in the applet
    public void propertyChange(PropertyChangeEvent evt) {
    This is the HTML CODE...
    <HTML>
    <HEAD>
    <TITLE>SimpleMap applet demonstration</TITLE>
    </HEAD>
    <BODY>
    <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    WIDTH = 600 HEIGHT = 440
    codebase="http://java.sun.com/products/plugin/1.3.1/jinstall-131-win32.cab#Version=1,3,1,0">
    <PARAM NAME = CODE VALUE = "tt7.class" >
    <PARAM NAME=archive VALUE="classes12.jar">
    <PARAM NAME="type" VALUE="application/x-java-applet;version=1.5">
    <COMMENT>
    <EMBED type="application/x-java-applet;version=1.5"
    CODE = "tt7.class"
    WIDTH = 600 HEIGHT = 440
    archive="classes12.jar"
    pluginspage="http://java.sun.com/products/plugin/1.3.1/plugin-install.html">
    <NOEMBED></COMMENT>
    alt="Your browser understands the &lt;APPLET&gt; tag but isn't running the applet, for some reason."
    Your browser is completely ignoring the &lt;APPLET&gt; tag!
    </NOEMBED></EMBED>
    </OBJECT>
    </BODY>
    </HTML>

    My dear colleague, You better consider asking this question in Jdeveloper forum.
    I have a simple code for Windows application. You can easily convert it into Applet application..
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    import oracle.jdbc.*;
    import oracle.sql.*;
    public class QueryFrame extends Frame {
    TextField inputText;
    public QueryFrame() {
    super("Query Interface");
    setSize(450, 250);
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    ActionListener printListener = new ActionListener() {
    public void actionPerformed(ActionEvent ae) {
    ConnectAndRun(inputText.getText());
    Panel toolbar = new Panel();
    toolbar.setLayout(new FlowLayout(FlowLayout.LEFT));
    Button queryButton = new Button("Run Query");
    queryButton.addActionListener(printListener);
    toolbar.add(queryButton);
    inputText = new TextField(14);
    toolbar.add(inputText);          
    // The "preferred" BorderLayout add call
    add(toolbar, BorderLayout.NORTH);
    public static void main(String args[]) {
    QueryFrame tf1 = new QueryFrame();
    tf1.setVisible(true);
         public void ConnectAndRun(String s)
              String sqlquery;
              if (s.equals(""))
              sqlquery ="select * from DEPT where LOC is null";
              else
              sqlquery ="select * from DEPT where LOC like '" + s + "'";
              System.out.println(sqlquery);
              try
              DriverManager.registerDriver (new oracle.jdbc.OracleDriver());
         Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@localhost:1521:HELLO","scott","tiger");
         Statement stmt = conn.createStatement ();
              ResultSet rset = stmt.executeQuery (sqlquery);
              while (rset.next ())
                   System.out.println( rset.getInt("DEPTNO"));
                   System.out.println( rset.getString("DNAME"));
                   System.out.println (rset.getString("LOC"));
              rset.close();
         stmt.close();          
              catch (SQLException se)
                   System.out.println(se);
    Make sure you have appropriate libraries in classpath...

  • Oracle Server slow

    Some help !
    I have a Db with 9.2.0.7 on windows 2003
    Development people has made some change, but I dont know what they changed.
    Now the server is very slow, some process pass from 4 to 6 hours.
    Index are ok, tablespaces have space too.
    What can I do ?
    Thanks.

    A: Oracle Server slow

    I know that have contention on disk, but i have only a disk !!
    Redo files are 100 Mb each . Not are multiplex !!
    sequence 348645
    Current log# 3 seq# 348645 mem# 0: D:\ORACLE\ORADATA\K01USCT\REDO03.LOG
    Sun May 17 06:35:13 2009
    Thread 1 advanced to log sequence 348646
    Current log# 1 seq# 348646 mem# 0: D:\ORACLE\ORADATA\K01USCT\REDO01.LOG
    Sun May 17 06:35:30 2009
    Thread 1 advanced to log sequence 348647
    Current log# 5 seq# 348647 mem# 0: D:\ORACLE\ORADATA\K01USCT\REDO05.LOG
    Sun May 17 06:35:45 2009
    Thread 1 advanced to log sequence 348648
    Current log# 4 seq# 348648 mem# 0: D:\ORACLE\ORADATA\K01USCT\REDO04.LOG
    Sun May 17 06:35:58 2009
    Thread 1 advanced to log sequence 348649
    Current log# 2 seq# 348649 mem# 0: D:\ORACLE\ORADATA\K01USCT\REDO02.LOG
    Sun May 17 06:36:19 2009
    Thread 1 advanced to log sequence 348650
    Current log# 3 seq# 348650 mem# 0: D:\ORACLE\ORADATA\K01USCT\REDO03.LOG
    Sun May 17 06:36:29 2009
    Thread 1 advanced to log sequence 348651
    Current log# 1 seq# 348651 mem# 0: D:\ORACLE\ORADATA\K01USCT\REDO01.LOG
    Thread 1 advanced to log sequence 348652
    Current log# 5 seq# 348652 mem# 0: D:\ORACLE\ORADATA\K01USCT\REDO05.LOG
    Sun May 17 06:36:47 2009
    Thread 1 advanced to log sequence 348653
    Current log# 4 seq# 348653 mem# 0: D:\ORACLE\ORADATA\K01USCT\REDO04.LOG
    Thread 1 advanced to log sequence 348654
    Current log# 2 seq# 348654 mem# 0: D:\ORACLE\ORADATA\K01USCT\REDO02.LOG
    Thread 1 advanced to log sequence 348655
    Current log# 3 seq# 348655 mem# 0: D:\ORACLE\ORADATA\K01USCT\REDO03.LOG
    Sun May 17 06:37:19 2009
    Thread 1 advanced to log sequence 348656
    Current log# 1 seq# 348656 mem# 0: D:\ORACLE\ORADATA\K01USCT\REDO01.LOG
    Sun May 17 06:37:32 2009
    Thread 1 advanced to log sequence 348657
    Current log# 5 seq# 348657 mem# 0: D:\ORACLE\ORADATA\K01USCT\REDO05.LOG
    Sun May 17 06:37:42 2009
    Thread 1 advanced to log sequence 348658
    Current log# 4 seq# 348658 mem# 0: D:\ORACLE\ORADATA\K01USCT\REDO04.LOG
    Sun May 17 06:38:03 2009
    Thread 1 advanced to log sequence 348659
    Current log# 2... [Show more]

    Read other 15 answers

  • SetTableLocation EXTREMELY SLOW IN ORACLE

    <p>
    Hi I am using the code below to change my database provider at runtime. <br />
    Unfortunately this line <code>ReportDocument.ReportClientDocument.DatabaseController.SetTableLocation</code> is extremely slow trying to change table location in Oracle. It takes 2 or more seconds per table so it is unacceptable for us.
    Please I need a solution as soon as possible.<br />
    It is weird, becaus with SqlServer it works fine! so I don't understand what's the problem with CrystalReports and Oracle.<br />
    Ther is anyone who have a solution?<br />
    We are using: CrystalReports 12, Oracle 10, 11.<br />
    Thank you very much.
    </p>
    <code>
    public partial class _Default : System.Web.UI.Page<br />
    {<br />
          protected void Page_Load(object sender, EventArgs e)<br />
          {<br />
                ReportDocument report = this.ChangeConnectionInfo();   <br />    
                this.CrystalReportViewer1.ReportSource=report;<br />
                this.CrystalReportViewer1.RefreshReport();<br />
          }<br />
        <br /><br />
          private ReportDocument ChangeConnectionInfo()<br />
          {<br />
                ReportDocument boReportDocument = new ReportDocument();<br />
                string reportFileName = Server.MapPath("CrystalReport1.rpt");<br />
                //*EDIT* Change the path and report name to the report you want to change.<br />
                boReportDocument.Load(reportFileName, OpenReportMethod.OpenReportByTempCopy);<br />
    <br />
                //Create a new Database Table to replace the reports current table.<br />
                CrystalDecisions.ReportAppServer.DataDefModel.Table boTable = new CrystalDecisions.ReportAppServer.DataDefModel.Table();<br />
    <br />
                //boMainPropertyBag: These hold the attributes of the tables ConnectionInfo object<br />
                PropertyBag boMainPropertyBag = new PropertyBag();<br />
                //boInnerPropertyBag: These hold the attributes for the QE_LogonProperties<br />
                //In the main property bag (boMainPropertyBag)<br />
                PropertyBag boInnerPropertyBag = new PropertyBag();<br />
    <br />
                //Set the attributes for the boInnerPropertyBag<br />
                boInnerPropertyBag.Add("Data Source", "oracle1");<br />
                boInnerPropertyBag.Add("Locale Identifier", "3082");<br />
                boInnerPropertyBag.Add("OLE DB Services", "-5");<br />
                boInnerPropertyBag.Add("Provider", "MSDAORA");<br />
                boInnerPropertyBag.Add("Use DSN Default Properties", "False");<br />
    <br />
                //Set the attributes for the boMainPropertyBag<br />
                boMainPropertyBag.Add("Database DLL", "crdb_ado.dll");<br />
                boMainPropertyBag.Add("QE_DatabaseName", "");<br />
                boMainPropertyBag.Add("QE_DatabaseType", "OLE DB (ADO)");<br />
                //Add the QE_LogonProperties we set in the boInnerPropertyBag Object<br />
                boMainPropertyBag.Add("QE_LogonProperties", boInnerPropertyBag);<br />
                boMainPropertyBag.Add("QE_ServerDescription", "oracle1");<br />
                boMainPropertyBag.Add("QE_SQLDB", "True");<br />
                boMainPropertyBag.Add("SSO Enabled", "False");<br />
    <br />
                //Create a new ConnectionInfo object<br />
                CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo boConnectionInfo = new CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo();<br />
                //Pass the database properties to a connection info object<br />
                boConnectionInfo.Attributes = boMainPropertyBag;<br />
                //Set the connection kind<br />
                boConnectionInfo.Kind = CrConnectionInfoKindEnum.crConnectionInfoKindCRQE;<br />
                //*EDIT* Set the User Name and Password if required.<br />
                boConnectionInfo.UserName = "oracle";<br />
                boConnectionInfo.Password = "oracle";<br />
                //Pass the connection information to the table<br />
                boTable.ConnectionInfo = boConnectionInfo;<br />
    <br />
                //Get the Database Tables Collection for your report<br />
                CrystalDecisions.ReportAppServer.DataDefModel.Tables boTables;<br />
                boTables = boReportDocument.ReportClientDocument.DatabaseController.Database.Tables;<br />
            <br />
                //For each table in the report:<br />
                // - Set the Table Name properties.<br />
                // - Set the table location in the report to use the new modified table<br />
                boTable.Name = "TABLE1";<br />
                boTable.QualifiedName = "SCHEMA1.TABLE1";<br />
                boTable.Alias = "TABLE1";<br />
    <br />
    <br />
            <span class="style1">    //<br />
                //THIS LINE IS EXTREMELY SLOW IN ORACLE<br />
                //<br />
                boReportDocument.ReportClientDocument.DatabaseController.SetTableLocation(boTables[0], boTable);<br />
    <br /></span>
                boReportDocument.VerifyDatabase();<br />
            <br />
    <br />
                return boReportDocument;<br />
          }<br />
    }<br />
    </code>

    I have a very similar issue using Crystal XI, and now more recently XI R2 updated  through SP6.
    My database connections for the report utilize ODBC, which is how our application talks to the database, and provides a connection to crystal.
    Oracle version is 10g R2, patched on client with 10.3.
    I have a common databaes, in which I have views on many tables.  The views depict a collection, and when the report is to run on a different collection I need to change the views on all of the tables (including those in subreports), as well as provide the credentials for connection.
    I'm using VStudio2008 C++ with PutLocation( )
    First using GetLocation() to find the initial location, then PutLocation to change it
    using
    IDatabaseTablePtr table;
    try {
         strcpy(tableLocation, table->GetLocation());
    // make my changes to the table's location (the view)
         table->PutLocation(tableLocation);
    catch (_com_error& e) {
    // if problems, handle and display errors.
    HandleError(NULL, e);
    I can have upwards of 20 tables/views in a report, and this can take 1/2 to a full minute to accomplish.
    In addition, I optionally provide a user the ability to add criteria and sorting to the report; and perform a table/column collection to show them to the user for seleciton.  This same process is used on all views (including those in subreports), so proper data lists can be provided from the correct views.
    Does anyone have a solution for this?
    Edited by: BobOfPlanet on Mar 3, 2010 5:58 PM

  • Help with translating SQL query from SQL Server syntax to Oracle syntax

    Hi,
    is it someone that can help me translate following SQL query from SQL Server syntax to Oracle syntax.
    SELECT ID,
    [LMT(MTR)] = MAX(case when TYPE = 'LMT' then VALUE end),
    [AAD(KGM)] = MAX(case when TYPE = 'AAD' then VALUE end),
    [VOL(MTQ)] = MAX(case when TYPE = 'VOL' then VALUE end)
    FROM yourtable
    GROUP BY ID
    Your help is highly appreciated, thanks in advance.

    Like this,
    SELECT ID,
    MAX(case when TYPE = 'LMT' then VALUE end) LMT_MTR,
    MAX(case when TYPE = 'AAD' then VALUE end) AAD_KGM ,
    MAX(case when TYPE = 'VOL' then VALUE end) VOL_MTQ
    FROM yourtable
    GROUP BY ID-Arun

  • Forms based on query?  Is it possible in Oracle Portal?

    here is my code that i want to use
    SELECT a.first, a.last, b.Position_CD, c.skill_cd, d.team_name, d.team_country, d.club, e.structure_name
    FROM Roster a, Roster_position b, roster_skill c, team d, team_structure e
    where (a.Roster_ID = b.roster_id (+) and (b.roster_id = c.roster_id (+) ) and (a.team_cd = d.team_cd(+)) and (a.team_structure_cd = e.team_structure_cd (+)))
    order by a.roster_id;
    Is it possible for oracle portal to support such a query in a form?
    Oracle portal supports single tables or views...master-detal...and forms based on procedures.
    Since the above query associates with moro then one table..how might one create a form based on that query? Is their a way in oracle portal to create a form and have its record source be based on such a complex query and be able to update and insert data? I know and have tested that it works in Ms Access and i can update and add data in that above query. Hopefully oracle supports this. (*cross fingers*)
    If i cant do what i said above...what advice or suggestions you guys have for me? If i use master-detail it won't work right because i need to involve all 5 tables.
    Any help or comments are greatly appreciated!

    When i made the above query a view and created an oracle portal form. I get this error when I try to retrieve all the records in that view i made above.
    An unexpected error occurred: ORA-01445: cannot select ROWID from a join view without a key-preserved table (WWV-16016)
    What does the "key-preserved table" mean?

  • Query on handling else condition in Oracle Business Rules.

    Hi all.
    I am working on Jdeveloper 11.1.1.1.0 Business Rules. While creating rules... i am able to write if conditions around the facts and attributes and also replicate the same using decision tables and is able to derive the action.
    My Question is.. can i write an else condition which should be executed when none of the if condition are matched. If we can how... Instead of else condition, is there any way that we can initialize the facts and attributes to be derived to a default value.
    Please help me guys in this... If this is not the right foru,... please redirect me to the correct one.. coz i couldnt find a forum for oracle business rules..
    Thanks
    Eldho

    Thanks a lot for the response..
    I have posted the query in
    Query on handling else condition in Oracle Business Rules.
    Thanks
    Eldho

  • Database link works for OS user "oracle" but not for other clients

    My DBA connects as user1 to db1 and successfully queries over database link db2.
    [oracle@linux19 ODA]$ sqlplus user1/****@db1
    SQL*Plus: Release 11.2.0.3.0 Production on Fri Apr 12 07:39:49 2013
    Copyright (c) 1982, 2011, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> SELECT * FROM DUAL@db2;
    D
    XI log in from a Windows XP client and test the same database link with a ORA-12154 result.
    C:\>sqlplus user1/****@db1
    SQL*Plus: Release 11.2.0.1.0 Production on Fri Apr 12 11:18:18 2013
    Copyright (c) 1982, 2010, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> SELECT * FROM DUAL@db2;
    SELECT * FROM [email protected]
    ERROR at line 1:
    ORA-12154: TNS:could not resolve the connect identifier specifiedI can create and successfully use database links by including the full TNS entry in the USING string.
    What are some possible causes for the different results?
    What additional information might I supply to help troubleshoot?
    Thanks very much.
    - Doug
    Edited by: enquad on Apr 12, 2013 2:56 PM
    changed "database link db1" to "database link db2" per comments by SB
    Edited by: enquad on Apr 12, 2013 3:00 PM
    Changed "user" to "OS user" in subject for clarity

    enquad wrote:
    Sorry gentlemen and SB, but my question is still not answered. It is a new question, which I have not found answered elsewhere.
    To summarize:
    SB97025 informs me that db1 is not a database link, but I never said that it was. It is the second database (anonymized as "db2") that is connected to through the database link "db2.mycompany.net".
    SB97025 also wonders intriguingly if my DBA and I are we really connecting to the same database when we each connect to user1 on db1. Perhaps the Oracle server and my PC have TNSNAMES.ORA files that lead us to different databases for the same TNS alias? I do not believe this is the case, because my DBA created that user1 and that database link in the db1 database specifically for the purpose of doing this test and I see that same link when I connect to user1 on db1. Unless my DBA is spoofing me by creating user1 in two different databases - only one of which contains a working dblink named db2.mycompany.net - just for the purpose of throwing me off, I would have to conclude that he and I are actually connecting to the same database.There is no reason to "believe" (or not) that "this is the case". The entire point of SB's comment on that was to get you to verify. President Reagan famously said "trust but verify". He never worked as a DBA. I say "don't trust, just verify".
    Obviously something is different. And at this point the most likely and easiest to confirm is that you and your DBA really are connecting to the same database, on the same host server, using the same link. And at this point all we really have is to trust your DBAs statement.
    >
    Ed Stevens reminds me that db1 is acting as a client to db2 and so the solutions to the ORA-12154 are the same as for any client connection as listed on his blog (which I had already read), none of which solve my problem. Rembember, the DBA can use the database link, so by whatever means the TNS lookup is happening when he uses it, the correct connection description is being found. The question is not "why does this stinkin' database link not work"? It does work for the DBA.
    Pierre wants to make sure I know that it is the Oracle server's TNSNAMES file that is the important thing, not my client's TNSNAMES file, which is true but not relevant to my problem and I was never so naive. He also says that I could try creating a database link by including the full TNS entry in the USING string, which does work as I had already mentioned in my original post.
    Amar asks if my DBA can: sqlplus username/password@db2.
    The answer is yes. The dba can use SQL*Plus to connect to db2 from the server hosting db1 and can connect to db1 from the server hosting db2. There is almost nothing my DBA cannot do.
    None of the posters addressed the key information in my post, which was the different result my DBA and I get when using the same database link in the same schema on the same database. That AND the fact that my DBA is logged on to Linux Oracle serve as user "oracle" and I am logged in to my PC. Why should it matter to a database link which computer is running SQL*Plus or who the OS user is?
    Also the GLOBAL_NAMES parameter is set to FALSE.
    - Doug

  • Environment creating But Not Connecting  Oracle through  OCCI

    hi Guys,
    Environment creating But Not Connecting Oracle through OCCI in VC++2005 .NET ..... ,Oracle 10G ,
    But Same Code is Working VC++2003 .....
    giving the Following Error......
    This application has requested the Runtime to terminate it in an unusual way.
    Please contact the application's support team for more information.
    I try to download INSTANTCLIENT new one for VC++2005 that One is Not down loading... therefore the same down instantclient is copied in VC++2005...
    http://www.oracle.com/technology/tech/oci/occi/occidownloads.html
    I downloaded abobe URL for VC++8 and copied into that INSTANT client.....
    But still not connecting.....somebody who has done in VC++2005 connection through OCCI... help me step by step Plzzzzzzzzz....
    friends can anybody tell how to connect OCCI .....
    advance thanx ......
    yours LUV

    Hi guys,
    I have the same problem. I've tried using the supplied demo in instantclient sdk but I keep getting this SQLException without a message.
    Any help is welcomed.
    Cheers,
    Sorin

Maybe you are looking for

  • ADC to VGA

    On my Power Mac G5 (June 2004 with ATI Radeon 9600 XT), I'm trying to add a second CRT monitor, and I've been having terrible luck finding anyone that still carries an ADC to VGA adaptor. I do have a spare DVI to VGA adaptor. So, would a ADC to DVI a

  • Veritas volume manager needed?

    any one has veritas volume manager for unix systems? can you make me a copy? i'll pay you some money too? i need it for a practice only? my email address is : [email protected] thanks.

  • HT3986 How do I start up Mac after the Windows has been installed.

    How do I start up Mac after the Windows has been installed? And after I installed the Windows, my Audio is gone. How can I get it back?

  • How can I configure a third party VME board with A24 address space using a VME-MXI-2?

    Hi! We are trying to establish communications to a Galil Motion controller with a VME interface. Galil states that they are using a A24 address scheme with A16 data space for their board. I am confused how to configure that board in the VME chassis p

  • User downloads movie into premade web page?

    Hello all, I'll try to explain this as best I can. Bascially, I have an interface that allows users to select a video clip from a large library of files. Once the user selects the movie they then have 3 options. Option 1 is to simply play the movie (