Simple Query problem

Hi all,

Pike,
I believe that the problem has to do with an esoteric DB2 JDBC driver
issue to do with how we handle pooling.
If you set the MaxPool to some value greater than 0, I believe that
everything will work as expected.
-Patrick
On Thu, 10 Jul 2003 03:56:57 +0000, pike wrote:
Hi Patrick,
The contents of the kodo properties is:
# Kodo JDO Properties configuration
com.solarmetric.kodo.LicenseKey=KEY
com.solarmetric.kodo.ee.ManagedRuntimeProperties=TransactionManagerName=java:/TransactionManager
javax.jdo.PersistenceManagerFactoryClass=com.solarmetric.kodo.impl.jdbc.JDBCPersistenceManagerFactory
javax.jdo.option.ConnectionDriverName=com.ibm.db2.jcc.DB2Driver
javax.jdo.option.ConnectionUserName=USERNAME
javax.jdo.option.ConnectionPassword=PASSWORD
javax.jdo.option.ConnectionURL=jdbc:db2://HOST:PORT/DATABASE
javax.jdo.option.Optimistic=true
javax.jdo.option.RetainValues=true
javax.jdo.option.NontransactionalRead=true
# Changing these to a non-zero value will dramatically increase
# performance, but will cause in-memory databases such as Hypersonic
# SQL to never exit when your main() method exits, as the pooled
# connections in the in-memory database will cause a daemon thread to
# remain running.
javax.jdo.option.MinPool=0
javax.jdo.option.MaxPool=0
and my contents of the getPM() method is
     public StandaloneJDODemo() throws IOException {
          Properties props = new Properties ();
          props.load (getClass ().getResourceAsStream ("kodo.properties"));
          pmf = JDOHelper.getPersistenceManagerFactory (props);
     private PersistenceManager getPM ()
          PersistenceManager pm = pmf.getPersistenceManager ();
          return pm;
thanks,
pike
Patrick Linskey wrote:
Pike,
Can you post the properties that you're using to create your PMF, and
the contents of the getPM() method?
-Patrick
Patrick Linskey
SolarMetric Inc.
Patrick Linskey
SolarMetric Inc.

Similar Messages

  • 11.2.2.4.0 - Problem with temporary space in simple query

    ttVersion
    TimesTen Release 11.2.2.4.0 (64 bit Linux/x86_64) (timesten:53396) 2012-09-24T08:28:05Z
    Instance admin: root
    Instance home directory: /opt/TimesTen/timesten
    World accessible
    Daemon home directory: /var/TimesTen/timesten
    I get "TT0802: Database temporary space exhausted" error in simple query with small data amount; Timesten try to allocate *40000312* bytes
    describe adm.peer
    Table ADM.PEER:
    Name Null Type
    PEER_ID NOT NULL TT_SMALLINT
    CLUSTER_ID NOT NULL TT_TINYINT
    DIALECT NOT NULL TT_INTEGER
    HOST NOT NULL TT_VARCHAR(256 BYTE)
    REALM NOT NULL TT_VARCHAR(256 BYTE)
    ADDRESS TT_VARCHAR(256 BYTE)
    PORT NOT NULL TT_INTEGER
    PROTOCOL NOT NULL TT_INTEGER
    AUTO_CONNECT NOT NULL TT_TINYINT
    ENABLED NOT NULL TT_TINYINT
    PRIORITY NOT NULL TT_TINYINT
    MANDATORY NOT NULL TT_TINYINT
    TSTAMP BINARY(8)
    1 rows selected
    describe adm.session
    Table ADM.SESSION:
    Name Null Type
    SESSION_ID NOT NULL TT_VARCHAR(64 BYTE) inline
    OBJ_ID NOT NULL TT_BIGINT
    PR_OBJ_ID NOT NULL TT_BIGINT
    SUBSCRIBER_ID NOT NULL TT_VARCHAR(32 BYTE) inline
    IP NOT NULL TT_VARCHAR(15 BYTE) inline
    IPV6_PREFIX TT_VARCHAR(39 BYTE) inline
    IPV6_PREFIX_LEN NOT NULL TT_TINYINT
    CREATE_TIME NOT NULL TT_TIMESTAMP
    UPDATE_TIME NOT NULL TT_TIMESTAMP
    RULES_SET_ID NOT NULL TT_BIGINT
    PEER_ID NOT NULL TT_SMALLINT
    MY_PEER_ID NOT NULL TT_SMALLINT
    PROFILE_HASHC NOT NULL TT_BIGINT
    FLAGS NOT NULL TT_INTEGER
    QOS_POLICY_NAME NOT NULL TT_VARCHAR(32 BYTE) inline
    BSID NOT NULL TT_BIGINT
    CONGESTION_FLAG NOT NULL TT_TINYINT
    SERVICE_CATEGORY_ID TT_VARCHAR(32 BYTE) inline
    EVENT_CAUSE NOT NULL TT_TINYINT
    EVENT_TIME TT_TIMESTAMP
    TSTAMP BINARY(8)
    1 rows selected
    select * from adm.peer;
    PEER_ID CLUSTER_ID DIALECT HOST REALM ADDRESS PORT PROTOCOL AUTO_CONNECT ENABLED PRIORITY MANDATORY TSTAMP
    21 2 0 ddf1.server.com diameter.realm ddf1.server.com 3868 6 1 1 0 1 (null)
    22 2 0 ddf2.server.com diameter.realm ddf2.server.com 3868 6 1 1 1 1 (null)
    101 233 0 peer_101 testik.com peer_101.testik.com 3886 0 0 1 101 0 (null)
    102 233 0 peer_102 testik.com peer_102.testik.com 3886 0 0 1 102 0 (null)
    1 1 0 vr-t500.testik.com diameter.realm vr-t500.testik.com 3868 6 1 1 0 1 (null)
    5 rows selected
    select * from adm.session;
    SESSION_ID OBJ_ID PR_OBJ_ID SUBSCRIBER_ID IP IPV6_PREFIX IPV6_PREFIX_LEN CREATE_TIME UPDATE_TIME RULES_SET_ID PEER_ID MY_PEER_ID PROFILE_HASHC FLAGS QOS_POLICY_NAME BSID CONGESTION_FLAG SERVICE_CATEGORY_ID EVENT_CAUSE EVENT_TIME TSTAMP
    TEST_SESSION 13300000000020027 0 TEST_SUBSCRIBER 94.25.209.27 0 2012-10-18 12:56:07.155381000 2012-10-18 12:56:07.155381000 1 101 1 0 0 0 0 DEFAULT 0 (null) (null)
    TEST_SESSION2 13300000000020028 13300000000020027 TEST_SUBSCRIBER 94.25.209.27 0 2012-10-18 12:56:07.155687000 2012-10-18 12:56:07.155687000 1 102 1 0 4 0 0 DEFAULT 0 (null) (null)
    2 rows selected
    SELECT p.address, count(*) as session_count from session s, peer p where p.peer_id = s.peer_id group by p.address failed,
    TT0802: Database temporary space exhausted
    dssize
    PERM_ALLOCATED_SIZE:     307200.0
    PERM_IN_USE_SIZE:     61763.0
    PERM_IN_USE_HIGH_WATER:     69393.0
    TEMP_ALLOCATED_SIZE:     37888.0
    TEMP_IN_USE_SIZE:     13494.0
    TEMP_IN_USE_HIGH_WATER:     21307.0
    This is additional error info when this code exuted inside C code:
    [TimesTen][TimesTen 11.2.2.4.0 ODBC Driver][TimesTen]TT0802: Database temporary space exhausted -- file "blk.c", lineno 3477, procedure "sbBlkAlloc"
    ODBC Error/Warning = S1000, Additional Error/Warning = 802
    [TimesTen][TimesTen 11.2.2.4.0 ODBC Driver][TimesTen]TT6221: Temporary data partition free space insufficient to allocate *40000312* bytes of memory -- file "blk.c", lineno 3477, procedure "sbBlkAlloc"
    ODBC Error/Warning = S1000, Additional Error/Warning = 6221
    Edited by: Vladimir Romanov on 18.10.2012 13:13
    Edited by: Vladimir Romanov on 18.10.2012 13:51

    This may well be
    Bug 14634954 - SELECT WITH GROUP BY REQUESTS LARGE TEMP MEMORY GETS TT0802 / TT6221
    The bug is fixed in 11.2.2.4.1 which is hopefully due before the end of October. Can you run your test on 11.2.1 as well? The problem should not reproduce there as it is specific to 11.2.2

  • Simple SQL query problem

    Hi,
    I'm trying create a simple query which tells me the occurance of a particular football match on a particular date. The table is as follows...
    CREATE TABLE match
    (matchId NUMBER(5)
    CONSTRAINT match_matchId_nn NOT NULL,
    matchDate DATE
    CONSTRAINT match_date_nn NOT NULL,
    stadiumId          NUMBER(5)
    CONSTRAINT match_stadiumId_nn NOT NULL,
    CONSTRAINT matchId_pk PRIMARY KEY (matchId));
    Bascially, i'm trying to create a trigger which will implement the constraint that 'only one match can be at one stadium on a particular date'.
    Any ideas guys?
    Cheers...

    ALTER TABLE match ADD CONSTRAINT match_date_uk UNIQUE
    (stadiumId, matchDate)Bear in mind, though, that using dates in unique constraints can be problematic, because of the time element, which means there are 86400 unique values for each day. If your application enforces a rule that has only one match per stadium per day then all you need is a TRUNC() call in an insert/update trigger to make sure of that. If your application is going to allow more than one match per day the checking logic starts to get messy...
    Cheers, APC
    P.S. Oleg's solution is incorrect because it includes the primary key MatchId, which would thus permit duplicate combinations of stadium and date.

  • Simple Query in Oracle Linked Table in MS Access causes full table scan.

    I am running a very simple query in MS ACCESS to a linked Oracle table as follows:
    Select *
    From EXPRESS_SERVICE_EVENTS --(the linked table name refers to EXPRESS.SERVICE_EVENTS)
    Where performed > MyDate()
    or
    Select *
    From EXPRESS_SERVICE_EVENTS --(the linked table name refers to EXPRESS.SERVICE_EVENTS)
    Where performed > [Forms]![MyForm]![Date1]
    We have over 50 machines and this query runs fine on over half of these, using an Oracle Index on the "performed" field. Running exactly the same thing on the other machines causes a full table scan, therefore ignoring the Index (all machines access the same Access DB).
    Strangely, if we write the query as follows:
    Select *
    From EXPRESS_SERVICE_EVENTS
    Where performed > #09/04/2009 08:00#
    it works fast everywhere!
    Any help on this 'phenominon' would be appreciated.
    Things we've done:
    Checked regional settings, ODBC driver settings, MS Access settings (as in Tools->Options), we have the latest XP and Office service packs, and re-linked all Access Tables on both the slow and fast machines independantly).

    Primarily, thanks gdarling for your reply. This solved our problem.
    Just a small note to those who may be using this thread.
    Although this might not be the reason, my PC had Oracle 9iR2 installed with Administratiev Tools, where user machines had the same thing installed but using Runtime Installation. For some reason, my PC did not have 'bind date' etc. as an option in the workarounds, but user machines did have this workaround option. Strangely, although I did not have the option, my (ODBC) query was running as expected, but user queries were not.
    When we set the workaround checkbox accordingly, the queries then run as expected (fast).
    Once again,
    Thanks

  • Simple query takes 18 minutes to retrieve data....

    Hi,
    I am facing this problem at the customer site where a simple query on a table takes 18 minutes or more. Please find below the details.
    Table Structure
    CREATE TABLE dsp_data
    quantum_id NUMBER(11) NOT NULL,
    src      NUMBER(11) NOT NULL,
    call_status NUMBER(11) NOT NULL,
    dst NUMBER(11) NOT NULL,
    measurement_id NUMBER(11) NOT NULL,
    is_originating NUMBER(1)     NOT NULL,
    measurement_value NUMBER(15,4) NOT NULL,
    data_type_id NUMBER(3) NOT NULL,
    data VARCHAR2(200) NOT NULL
    TABLESPACE dsp_data_tspace
    STORAGE (PCTINCREASE 0 INITIAL 100K NEXT 1024K)
    PARTITION BY RANGE (quantum_id)
    (PARTITION dsp_data_default VALUES LESS THAN (100));
    CREATE INDEX dsp_data_idx ON dsp_data
    quantum_id,
    src,
         call_status,
    dst,
         measurement_id,
         is_originating,
    measurement_value,
    data_type_id
    TABLESPACE dsp_data_idx_tspace
    LOCAL;
    CREATE INDEX dsp_data_src_idx ON dsp_data
    src
    TABLESPACE dsp_data_idx_tspace
    LOCAL;
    CREATE INDEX dsp_data_dst_idx ON dsp_data
    dst
    TABLESPACE dsp_data_idx_tspace
    LOCAL;
    ALTER TABLE dsp_data
    ADD CONSTRAINT fk_dsp_data_1
    FOREIGN KEY
    quantum_id
    REFERENCES mds_measurement_intervals
    quantum_id
    ALTER TABLE dsp_data
    ADD CONSTRAINT fk_dsp_data_2
    FOREIGN KEY
    data_type_id
    REFERENCES mds_drilldown_types
    type_id
    ALTER TABLE dsp_data
    ADD CONSTRAINT pk_dsp_data
    PRIMARY KEY
    quantum_id,
    src,
    call_status,
    dst,
              measurement_id,
              is_originating,
    measurement_value,
    data_type_id,
    data
    USING INDEX
    TABLESPACE dsp_data_idx_tspace
    LOCAL;
    Table Space Creation
    All table space creation is done using following command
    CREATE TABLESPACE [tablespaceName]
    DATAFILE [tablespaceDatafile] SIZE 500M REUSE
    AUTOEXTEND ON NEXT 10240K
    DEFAULT STORAGE ( INITIAL 1024K
    NEXT 1024K
    MINEXTENTS 10
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    Server Configuration on CUtsomer Site
    (1)     2 x Dual PA8900 Proc = 4GHz
    (2)     RAM = 16GB
    (3)     3 x Internal HDDs
    (4)     1 x External MSA-30 storage array (oracle db)
    Record Information On Customer Site
    select count(*) from dsp_data;
    COUNT(*)
    181931197
    select min (quantum_id) from dsp_data where dst=2;
    This takes 18 minutes or more....
    SQL> SQL> SQL> explain plan for select min (quantum_id) from dsp_data where dst=2;
    Explained.
    SQL> @?/rdbms/admin/utlxpls
    PLAN_TABLE_OUTPUT
    Plan hash value: 999040277
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop |
    | 0 | SELECT STATEMENT | | 1 | 14 | 1 (0)| 00:00:01 | | |
    | 1 | SORT AGGREGATE | | 1 | 14 | | | | |
    | 2 | FIRST ROW | | 92 | 1288 | 1 (0)| 00:00:01 | | |
    | 3 | PARTITION RANGE ALL | | 92 | 1288 | 1 (0)| 00:00:01 | 1 | 29 |
    |* 4 | INDEX FULL SCAN (MIN/MAX)| DSP_DATA_IDX | 92 | 1288 | 1 (0)| 00:00:01 | 1 | 29 |
    As mentioned above the query takes 18 minutes or more. This is a critical issue at customer. Can you please give your suggestions how to improve and reduce the query time. Thanks in advance.

    Hi,
    I did the following changes in the indexes of table.
    drop index DSP_DATA_IDX;
    create index DSP_DATA_MEASUREMENT_ID_IDX on DSP_DATA (MEASUREMENT_ID) TABLESPACE dsp_data_idx_tspace LOCAL;
    After that I did explain plan,
    explain plan for select min(QUANTUM_ID) from mds.DSP_DATA where SRC=11;
    PLAN_TABLE_OUTPUT
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU
    | 0 | SELECT STATEMENT | | 1 | 11 | 3 (0
    | 1 | SORT AGGREGATE | | 1 | 11 |
    | 2 | FIRST ROW | | 430K| 4626K| 3 (0
    | 3 | PARTITION RANGE ALL | | 430K| 4626K| 3 (0
    | 4 | INDEX FULL SCAN (MIN/MAX)| PK_DSP_DATA | 430K| 4626K| 3 (0
    Note
    - 'PLAN_TABLE' is old version
    14 rows selected
    SELECT table_name, index_name, monitoring, used FROM v$object_usage;
    TABLE_NAME INDEX_NAME MONITORING USED
    DSP_DATA DSP_DATA_SRC_IDX YES NO
    It seems that DSP_DATA_SRC_IDX is not getting used in query. What changes do i need to make so that DSP_DATA_SRC_IDX index gets used.
    Also, you have stated that to create global index on src and dst. How do i create them.
    Thanks in Advance.
    Edited by: 780707 on Jul 8, 2010 11:58 PM

  • Help with a simple query

    Hi ,
    I'm running the following simple query in sql*plus on ORACLE9i. But this query stopped running after 30minutes, and the sql*plus die at the same time .I have no idea about this. Could somebody tell me how I can solve this problem. Thank you very much for your help.
    Select Distinct PERSADDRUSE. ADDRUSECD as "Application", PERS.PERSNBR as "Account",
    (PERS.FIRSTNAME || ' '|| PERS.MDLINIT ||' ' || PERS.LASTNAME ) as "Name1",' 'as "Name2",' 'as "Name3",
    AL1.TEXT as "Address1",AL2.TEXT as "Address2",AL3.TEXT as "Address3",
    (ADDR.CITYNAME ||' ' || ' '||ADDR.STATECD ||' '||ADDR.ZIPCD||' '|| ADDR.ZIPSUF) as "CityStateZip"
    From PERSADDRUSE
    Join PERS
    ON PERS.PERSNBR = PERSADDRUSE.PERSNBR
    --AND  PERS.ADDDATE = '12-JAN-2005'
    AND PERSADDRUSE.ADDRUSECD = 'PRI'
    join ADDR
    ON PERSADDRUSE.ADDRNBR = ADDR.ADDRNBR
    left JOIN ADDRLINE AL1
    ON ADDR.ADDRNBR = AL1.ADDRNBR
    AND AL1.LINENBR = 1
    left JOIN ADDRLINE AL2
    ON ADDR.ADDRNBR = AL2.ADDRNBR
    AND AL2.LINENBR = 2
    left JOIN ADDRLINE AL3
    ON ADDR.ADDRNBR = AL3.ADDRNBR
    AND AL3.LINENBR = 3;

    Thanks for reply. I have some other query running for 45m and it seems fine. The following are the explain plan I print out. I'm new to PL/SQL.Could you guys give me some other ideas?
    BMS_XPLAN.DISPLAY()(PLAN_TABLE_OUTPUT)
    PERSADDRUSE | 5726 | 68712 | 183 |'), DBMS_XPLAN_TYPE('| 8 | TABLE ACCESS FULL| PERS | 161K| 2839K| 431 |'), DBMS_XPLAN_TYPE('| 9 | TABLE ACCESS FULL | ADDR | 239K| 5145K| 298 |'), DBMS_XPLAN_TYPE('| 10 | TABLE ACCESS FULL | ADDRLINE | 82087 | 1683K| 240 |'), DBMS_XPLAN_TYPE('| 11 | TABLE ACCESS FULL | ADDRLINE | 82087 | 1683K| 240 |'), DBMS_XPLAN_TYPE('| 12 | TABLE ACCESS FULL | ADDRLINE | 82087 | 1683K| 240 |'), DBMS_XPLAN_TYPE('------------------------------------------------------------------------'), DBMS_XPLAN_TYPE(' '), DBMS_XPLAN_TYPE('Note: cpu costing is off, PLAN_TABLE'' is old version'))

  • Having a column name as a variable within a query,Problem!!!!

    I have a problem with a simple query shown below
    SELECT * FROM DisneyWHERE Upper(COLNAME) LIKE UPPER('%' || SEARCHSTRING || '%');SELECT * FROM Disney
    WHERE Upper(COLNAME) LIKE UPPER('%' || SEARCHSTRING || '%');
    My problem, The colname variable is not being recognised as a column name for example
    A user can select to view a set of characters from the DB by username, movies, etc etc (they select this from a combobox) They then enter a search string(textbox)
    colname = username
    Searchstring = pluto
    SELECT * FROM Disney
    WHERE Upper(COLNAME) LIKE UPPER('%' || SEARCHSTRING || '%');
    The problem is orac;e does not seem to be picking up that colname is a column name and seems to be doing a simple comparison. To make this clearer
    it' seems to be trying to match username = pluto
    rather than finding pluto in the username column.
    Has anyone got any ideas how i can get around this. I have a strange feeling it is something to do with dynamic pl/sql but i am new to oracle so i have no idea how to write dynamic queries. Any help would be muchly appreciated
    I am using oracle 11g and visual studio .net 2005

    user10372910 wrote:
    If you can refer me to any material you think i would find helpful to read or experiment with pls let me knowThe online documentation is a good place to look...
    http://www.oracle.com/pls/db102/homepage?remark=tahiti
    Start with the concepts guide which gives a good background to the Oracle database.
    Look up "bind variables", "hard parsing"/"soft parsing" of queries
    In light of what boneist highlighted, you may also want to do a search for "function based indexes".
    Those topics should give you some insight into the performance issues around queries and why it is better to write SQL that uses bind variables and get's soft parsed (re-usable SQL) rather than writing dynamic queries that become hard parsed (non-reusable SQL).

  • Help! no response when doing SIMPLE query!

    I meet a strange problem when I do a SIMPLE query on a table in Oracle 8.1.7, just like:
    SELECT id FROM person WHERE id='12345';
    Most of id values are ok to the query, except some values.
    Whether I use these values in sqlplus or JDBC, mostly, no response is returned!! And I find the session in Oracle always keeps the status 'Active'. But in few scenario I can get the result quickly.
    I don't know the reason. Help me please!
    Thanks a lot!
    Meyor

    I'm not sure if the 'id' column contains something else.
    When I shutdown and restart the database, the problem seems to be "solved". If the problem reoccurs again, I will try to use xTRIM functions.
    Thanks!
    Meyor

  • Simple Query returns no result

    We have a problem with a simple query on a "old" Table in our Database. The Table has following Structure:
    CREATE TABLE <table_name>
        ROLE_ID INTEGER NOT NULL,
        ROLE_NAME VARCHAR (99) ascii NOT NULL,
        OBJECTDATA LONG BYTE,
        UNIQUE (ROLE_NAME)
    The table containts two rows and following querys get these results:
    select role_id, role_name from <schema>.<table_name>
    --> 2 rows
    select role_id, role_name from <schema>.<table_name>
    order by role_id
    --> 2 rows
    select role_id, role_name from <schema>.<table_name>
    order by role_name
    --> 0 rows  ?? confusion
    When we create a "new" table with the same structure, and insert the same content to this new table,  the queries are working correctly.
    What happened with our "old" table,  so that these simple queries don't function anymore?
    (Database Kernel    7.6.05   Build 009-123-191-997)
    thx
    gerri
    Edited by: Gerfried on Jul 17, 2009 11:42 AM

    Ok, Gerfried send me the dump file and this is what was in it:
    INV ROOT/LEAF 15857  perm  entries : 0        [block 0]
         bottom  : 81         filevers: dummy     convvers: 9
                                                  writecnt: 1
    00001      nodepage.pno: 15857             nodepage.pt : data
    00006      nodepage.pt2: inv               nodepage.chk: checksumData
    00008      nodepage.mde: empty
    08181      nd_checksum : 61937             nodepge2.pno: 15857
    08189      nodepge2.pt : data              nodepge2.pt2: inv
    08191      nodepge2.chk: checksumData
    08192      nodepge2.mde: empty
    00009      nd_bottom   : 81                nd_rec_cnt  : 0
    00017      nd_level    : 0
    00019      nd_filestate: empty
    00020      nd_sorted   : false             nd_root     : 15857/F13D0000
    00025      nd_right    : nil_pno           nd_left     : nil_pno
    00033      nd_last     : nil_pno           nd_conv_vers: 9
    00045      nd_str_vers : nil_pno           nd_file_vers: dummy
    00052      ndPageVersio: 0                 nd_inv_usage: 0
    00057      nd_leaf_cnt : 1                 nd_treeleavs: nil
    00065      nd_trans_id : nil               ndInvRoot   : nil_pno
    00077      nd_write_cnt: 1
    END OF FILE
    Obviously the reason for not delivering any data for the query is: this index is empty.
    See "nd_filestate: empty" !
    For some reasons (that I really don't know - sorry about that) this index had not been maintained anymore, since a very long time.
    "nd_conv_vers: 9" tells us that it was the 9th savepoint that wrote down this page to the disks and that it had not been touched since then.
    To view the current converter version you may just use the db_restartinfo command in dbmcli.
    If you were a SAP customer the next thing I'd check would be with which database version these indexes had been created, what the internal file state is etc. - just to figure out the root cause.
    As such an analysis is basically not possible via this forum all I can propose is to look for those indexes (containing 0 entries although the table has more rows) and rebuild them.
    This statement should do the trick:
    select i.owner, i.indexname, i.tablename, if.*
    from files if join files tf  on if.primaryfileid=tf.fileid
                   join indexes i on if.fileid=i.fileid
    where if.entrycount =0
    and if.type ='INDEX'
    and tf.entrycount >0
    best regards,
    Lars

  • Simple query with like return wrong result

    Hi,
    I run simple query with like.
    If I use parameter I get wrong results.
    If I use query without parameter results are ok.
    My script:
    ALTER SESSION SET NLS_SORT=BINARY_CI;
    ALTER SESSION SET NLS_COMP=LINGUISTIC;
    -- drop table abcd;
    create table abcd (col1 varchar2(10));
    INSERT INTO ABCD VALUES ('122222');
    insert into abcd values ('111222');
    SELECT * FROM ABCD WHERE COL1 LIKE :1; -- wrong result with value 12%
    COL1
    122222
    *111222*
    select * from abcd where col1 like '12%'; -- result ok
    COL1
    122222
    I use Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    and query run in Oracle SQL Developer 3.1.07.

    Hi,
    welcome to the forum.
    When you put some code please enclose it between two lines starting with {noformat}{noformat}
    i.e.:
    {noformat}{noformat}
    SELECT ...
    {noformat}{noformat}
    You should specify exactly how you run your code.
    If I run this statement in SQL Plus:SQL> ALTER SESSION SET NLS_SORT=BINARY_CI;
    Session altered.
    SQL> ALTER SESSION SET NLS_COMP=LINGUISTIC;
    Session altered.
    SQL>
    SQL> -- drop table abcd;
    SQL> create table abcd (col1 varchar2(10));
    Table created.
    SQL>
    SQL> INSERT INTO ABCD VALUES ('122222');
    1 row created.
    SQL> insert into abcd values ('111222');
    1 row created.
    SQL>
    SQL> SELECT * FROM ABCD WHERE COL1 LIKE :1;
    SP2-0552: Bind variable "1" not declared.
    SQL>
    I got this error. So I wonder how you set value 12%
    Please specify exactly how you run your test as we cannot reproduce your problem.
    Regards.
    Al                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Simple query -- tuning

    Hi gurus,
    I have a very simple query
    Select * from emp
    where deptno = 10
    if this query has been executed on 10,000 records .. time taken is little bit slow .. but whereas it has been executed on 10,00,000 records .. its taking lot hell of time..
    the client is complaining about the time tacking .. I really do wonder, how can I tune this query .. Please help
    Regards

    Hi guys,
    I really appreciate from the bottom of my heart, for putting and taking lot of pains, in answering my question .. Well, that question has been asked in an interview .. I dont know whether its a real problem faced by him or his client ..
    He has asked, me, I have given the query "select * from emp where deptno = 10" .. and there is already an index associated with the query that too on deptno .. when it has been tested on a very huge database consisting of 10,00,000 my client has asked me to tune the query .. how can i achieve that ..
    Like some of you people, i have tried, in giving different answers, but he wasnt satisified .. so thought of asking or sharing with you, so that, I can get some different answer ..
    One of the gurus has been asking me .. whether are they same tables of EMP and DEPT which we normally use (dummy tables )... Yes , they are the same tables ..
    Now any suggestions please
    Regards

  • Printing simple query

    Hello.
    I want to create a button that send to the printer a simple query, for example...
    select text from orders
    where order_id = '735'
    My problem is that if I create a page to show this query, and try to print it through the browser "File / Print" command, other elements of the page are printed also.

    Hi Earl & everybody:
    I was trying to print without loss the format of the
    query result, which fit in the boxes in a pre printed
    paper.Have you created a form layout that matches your preprinted paper layout then?
    When I load the query in the sql query in the form
    region, the only way I can show the text in the right
    position,
    (' < here there are spaces > Sunday, October 15'
    ' < here there are spaces > Item < here there are
    spaces > Description < here there are spaces >
    Price')
    is modifying the query as
    SELECT '<PRE>' || ORDER_ROW || '</PRE>' RG
    FROM ORDERS
    which shows the right text position in the monospace
    font desired.I'm not sure why you're talking about modifying your SQL when you're having a page layout problem?
    But, an extra horizontal line is added between rows.
    the query result in sqlplus don't have the extra
    lines, and if I don't use the '<PRE>' and '</PRE>'
    tags in the query neither have the lines.
    I'm using a customized page POPUP pattern, with a css
    file, because the default patterns don´t displayed
    the monospace font.I think you need to put an example up on apex.oracle.com so we can see what you're doing.
    Earl

  • How to write a simple query.

    I have a table where I have data shown below. Now, I want to write a simple query which lists me the project and the count of the distinct effective dates for which data is existant there.
    Sample data:
    Project Task Effective Date (xx_proj_task_data)
    101 T1 01-Jan-2008
    101 T1 01-Feb-2008
    101 T1 01-Mar-2008
    101 T2 01-Jan-2008
    101 T2 01-Apr-2008
    101 T3 01-Apr-2008
    102 T1 01-Jan-2008
    102 T1 01-Feb-2008
    102 T2 01-Apr-2008
    103 T1 01-Jan-2008
    103 T1 01-Feb-2008
    103 T1 01-Mar-2008
    103 T1 01-Apr-2008
    103 T2 01-May-2008
    103 T3 01-Jun-2008
    103 T1 01-Jan-2008
    103 T1 01-Aug-2008
    103 T2 01-Apr-2008
    Output Reqd:
    Project Count(Distinct Effective Dates)
    101 4
    102 3
    103 7
    I can write a query that says:
    select project_id, count(1)
    from (select distinct project_id, effective_date
    from xx_proj_task_data) x
    group by project_id;
    But, is there a way I can achieve the same by avoiding the inner Query (x) and just by a simple query ?
    Thanks!

    Try below query:
    select project_id
    , count(distinct effective_date)
    from xx_proj_task_data
    group by project_id;
    --venkata                                                                                                                                                                                                                                                                                       

  • Error in the simple Query

    Dear Experts,
    Not able to Execute this simple query :
    Select T1.JobID , T1.BudgetValue,T1.ActualValue FROM [dbo].[Enprise_JobCost_ActualBudgetView] T1 WHERE T1.TransType = '[%0]'
    Regards

    Hello,
    View - A View in simple terms is a subset of a 'virtual table. It can be used to retrieve data from the tables, Insert, Update or Delete from the tables. The Results of using View are not permanently  stored in the database.
    Stored Procedure -  A stored procedure is a group of SQL statements which can be stored into the database and can be shared over the netwrok with different users.
    http://www.geekinterview.com/question_details/65914
    Better make a UDT for your requirement.
    Thanks
    Manvendra Singh Niranjan

  • Real simple xslt problem/question

    Hi, i have a real simple xslt problem but i just cant figure out how to do it by looking at various examples on the net. i have a xml document and in it are some elements with a "result" tag name. i want to use xslt to reproduce exactly the same xml document except with an attribute called "id" added to those elements with a "result" tag name. i'm sure that theres a simple solution to it but i just cant figure it out. any helps greatly appreciated, thanks

    Start with the XSLT identity transform (I don't have it handy and it's fairly long, but you should be able to google it up). Add this:<xsl:template match="result">
      <result id="">
        <xsl:apply-templates>
      </result>
    </xsl:template>

Maybe you are looking for

  • Can I use 640g HD with my 3000 G430?

    My HD just died and I wanna replace it with WD640g HD.  Can anyone confirm me if I can replace my old one(WD 250g) with WD 640g HD?  Thank you very much

  • How can I change the colour of an adf:inputrender tag

    Hello, I have an jsp page with an input render tag <adf:inputrender model="bindings.OutDateTime" /> Using a choose tag <c:choose> I want to change the colour of the tag if it is a mandatory field The test condition is simple <c:when test="${bindings[

  • Website does not load in my Mac

    Hi everyone, I have a problem loading a particular work-related webpage in Safari, or any other mac related browser. I have tried Firefox, Internet Explorer for Mac. After getting through password and the OTP, the page loads, however where the icons

  • I have disabled the drop down menu system during run-time on a VI. How do I get it back?

    This occurred when I made a custom menu but deleted it and replaced the menu with the default. Thanks

  • Enable jumbo frame on Nexus switch

    I read following phrase in configuration guide of Nexus 5020 The Cisco Nexus 5000 Series switch is a Layer 2 device. This means it does not fragment frames. As a result, the switch cannot have two ports in the same Layer 2 domain with different maxim