TimesTen and subqueries

Does TimesTen support subqueries? What can I do, if not?

I really have other tables :)
T1 is
CREATE USERMANAGED CACHE GROUP "CGRP_AUTO_CALLS"
AUTOREFRESH MODE INCREMENTAL INTERVAL 5 MINUTES
STATE ON
FROM
"KVSTR"."AUTO_CALLS" (
"ATCL_ID" NUMBER(10) NOT NULL,
"SRLS_SRLS_ID" NUMBER(10),
"ATTP_ATTP_ID" NUMBER(10),
"CLNT_CLNT_ID" NUMBER(10),
"MSISDN" VARCHAR2(15 BYTE),
"CALL_DATE" DATE,
"DEL_USER" VARCHAR2(20 BYTE),
PRIMARY KEY("ATCL_ID"), READONLY
WHERE (DEL_USER IS NULL);
T2 is
CREATE USERMANAGED CACHE GROUP "CGRP_AUTO_ATTEMPTS"
AUTOREFRESH MODE INCREMENTAL INTERVAL 5 MINUTES
STATE ON
FROM
"KVSTR"."AUTO_ATTEMPTS" (
"ATAT_ID" NUMBER(10) NOT NULL,
"ATCL_ATCL_ID" NUMBER(10),
PRIMARY KEY("ATAT_ID"), READONLY
And query is
select
AUTO_CALLS.CLNT_CLNT_ID,
nvl(T.ATAT_ID_COUNT, 0)
from
AUTO_CALLS,
(select
AUTO_ATTEMPTS.ATCL_ATCL_ID,
count(AUTO_ATTEMPTS.ATAT_ID) ATAT_ID_COUNT
from
AUTO_ATTEMPTS
group by AUTO_ATTEMPTS.ATCL_ATCL_ID
) T
where (AUTO_CALLS.ATCL_ID = T.ATCL_ATCL_ID(+))
and (AUTO_CALLS.DEL_USER is null)
I cann't modify these tables or create some indexes, because these are commercial ORACLE tables.
ttIsql output:
Command> autocommit 0;
Command> indexes auto_calls;
Indexes on table KVSTR.AUTO_CALLS:
AUTO_CALLS: unique T-tree index on columns:
ATCL_ID
1 index found.
1 table found.
Command> indexes auto_attempts;
Indexes on table KVSTR.AUTO_ATTEMPTS:
AUTO_ATTEMPTS: unique T-tree index on columns:
ATAT_ID
1 index found.
1 table found.
Command> select count(*) from auto_calls;
< 1399714 >
1 row found.
Command> select count(*) from auto_attempts;
< 0 >
1 row found.
Command> commit;
Command> showplan 1;
Command> prepare 1 AUTO_CALLS.CLNT_CLNT_ID,
nvl(T.ATAT_ID_COUNT, 0)
from
AUTO_CALLS,
(select
AUTO_ATTEMPTS.ATCL_ATCL_ID,
count(AUTO_ATTEMPTS.ATAT_ID) ATAT_ID_COUNT
from
AUTO_ATTEMPTS
group by AUTO_ATTEMPTS.ATCL_ATCL_ID
) T
where (AUTO_CALLS.ATCL_ID = T.ATCL_ATCL_ID(+))
and (AUTO_CALLS.DEL_USER is null)
;Command> commit;
Command> statsupdate auto_calls;
Command> statsupdate auto_attempts;
Command> commit;
Command> free;
Command> showplan 1;
Command> prepare 1 AUTO_CALLS.CLNT_CLNT_ID,
nvl(T.ATAT_ID_COUNT, 0)
from
AUTO_CALLS,
(select
AUTO_ATTEMPTS.ATCL_ATCL_ID,
count(AUTO_ATTEMPTS.ATAT_ID) ATAT_ID_COUNT
from
AUTO_ATTEMPTS
group by AUTO_ATTEMPTS.ATCL_ATCL_ID
) T
where (AUTO_CALLS.ATCL_ID = T.ATCL_ATCL_ID(+))
and (AUTO_CALLS.DEL_USER is null)
;Command> commit;

Similar Messages

  • Exalytics OBIEE, TimesTen and Views

    Hi all,
    I'm currently working on a prototype with an Exalytics box. I have several schemas in the TimesTen database with caching groups using 11g in one Exadata as source. On TimesTen there's one extra schema that UNIONs ALL the information from all schemas into several Views. These Views are then used as OBIEE source.
    The first problem I ran into is that after adding the Views into OBIEE RPD Physical Layer, I'm not able to right click on the View and go into Physical Diagram, the option is not highlighted. I've imported tables from other schemas in TimesTen and was successfully able to join them in the Physical Diagram, the option is available to click, for Views it isn't, which is strange - You can use Oracle 11g Views as OBIEE source and it works perfectly.
    I've also tried to right click the Views in the RPD and View Data in the Physical Layer and OBIEE simply returns me a lot of errors, as can be seen below:
    [NQODBC][SQL_STATE:HY000][nQSError: 10058] A general error as occurred.
    [nQSError: 43113] Message returned from OBIS.
    [nQSError: 43093] An error occurred while processing the EXECUTE PHYSICAL statement.
    [nQSError: 16001] ODBC error state: 3700 code: 7025 message:
    [TimesTen][TimesTen 11.2.2.5.0 ODBC Driver][TimesTen]TT7025: Illegal use of reserved keyword "FROM", character position: 9 -- file "ptSqlY.y", lineno 9243, procedure "reserverd_word_or_syntax_error".
    [nQSError: 16014] SQL Statement preparation failed.
    Using TimesTen trace monitor I was able to see what query originated this error, and it was the following one:
    15:39:50.592 73 SQL      2L   11C   4393P Preparing: select  from DIM_DATE_VW
    15:39:50.592 74 SQL      4L   11C   4393P sbSqlCmdCompile1()(E): cmdType:100, cmdNum:1001123.
    15:39:50.592 75 ERR      4L   11C   4393P TT7025: Illegal use of reserved keyword "FROM", character position:9 -- file "ptSqlY.y", lineno 9243, procedure "reserved_word_or_syntax_error"
    Is this some sort of known bug or limitation between OBIEE, TimesTen and Views? Can anyone help?
    I'm running TimesTen 11.2.2.5.0, Oracle 11.2.0.3.0 and OBIEE 11.1.1.7.1.
    Best regards,
    André

    Who said you must buy Exalytics in order to use TT with OBIEE? If you already have it, just create an RPD connection pools and off you go. You won't be able to use all the nice bits 'n pieces a full Exalytics sports, but where OBIEE is concerned, it's just a source like any other.

  • TimesTen and Eclipse java development problem

    Hello all
    Using TimesTen with JDBC in from a Java code developed on Eclipse I encounter a problem: when running the program in debug mode, everything works fine. Running without debug, or outside Eclipse, results in the following error:
    java.sql.SQLException: [TimesTen][TimesTen 7.0.5.0.0 ODBC Driver][TimesTen]TT0837: Cannot attach data store shared-memory segment, error 8 -- file "db.c", lineno 7891, procedure "sbDbCreate"
    Does anyone know the cause of this, or can point me to logs or other resources I can look into?
    Regards,
    Shaul Peled
    Nuance Communication Inc.

    Okay, it is almost certainly an address space issue. Unfortunately 32-bit Windows is about the most problematic platform from this perspective. A TimesTen datastore is a single, contiguous memory region of size approximating PermSize+TempSize+LogBuffSize+DS header. In your case that will be about 1098 Mb. To 'connect' to this datastore, it is necessary to map the datastore memory (it is a shared mapping allocated from the Windows paging file) into your process (in this case the JVM) as a single region. Unfortunately, unlike most O/S, in Windows shared libraries (DLLs) have to be loaded at fixed locations in the address space defined when the DLL was linked. This means that although your process has a 4 GB address space (with quite a bit reserved for WIndows and other uses) that space is often highly fragmented with various DLLs (system and application) located all over the place. This means that often it is hard to find a single contiguous address space region to map a large datastore.
    into.
    To verify that this is the issue, could you try reducing the datastore size to say PermSize=128, TempSize=64 and see if you can connect then. If you can then you will have to experiment by slowly increasing Perm and Temp until you find the maximum size store you can accomodate. If you are using no logging (Are you sure that is what you want? You will end up with a single threaded datastore if you do that...) you could reduce LogBuffSize to the smallest allowed value (128 Kb).
    If it does turn out to be an address space issue then you have 3 options:
    1. Live with a smaller datastore size.
    2. Try and re-arrange the memory map by rebasing DLLs to create a larger contiguous region. Note that ijn any event it is very unlikely you will ever be able to exceed ~1.5 Gb for a datastore.
    3. Switch to 64-bit Windows, 64-bit TimesTen and a 64-bit JVM. Then the only limit on datastore size is available RAM.
    Let me know the outcome.
    Regards,
    Chris

  • Timesten and odbc driver

    i installed timesten 7.00.01, and created a mfc application(mfc 7.1).
    CDatabase is mfc class, see the following fraction code
    CDatabase     m_db;
    m_db.Open("mysql");//connect to mysql
    //m_db.Open("tt");//connect to timestamp
    CString sql("create table bar2(date1 char(20))");
    m_db.ExecuteSQL(sql);
    in timestamp, connect is ok, but when calling executesql, system complained
    "driver does not support this function"
    but in fact the table had been already created, i can see it using ttIsql
    in mysql, everything is ok.
    any idea about this? it seems to me it is a problem related to odbc drvier.

    sorry for my mistakenly typing.
    i found the reason is ::SQLMoreResults is not support in timesten.
    and this guy encounter the same problem as me.
    http://www.codeguru.com/forum/showthread.php?t=413620
    can anyone help? thanks in advance.

  • TimesTen and Memcached

    Hi,
    Memcached (http://www.danga.com/memcached/) is a product being used by highly transactional websites to cache data structures in memory.
    I beleive it is similar to what TimesTen does. I was trying to find comparison between TimesTen and Memcached at OTN, but no luck.
    Appreciate if someone can provide the comparison for these alongwith pros and cons of both technologies.
    Regards.

    memcached is a distributed memory object cache, it is commonly used to cache SQL resultsets, targeted at repetitive queries found in read intensive database web applications. The user application is responsible for managing and populating the cache, memcached does not provide data synchronization with the Oracle database.
    For example this is the logic the application developer needs to implement:
    * Wherever you go to do a database query, first check the memcache. If the memcache returns an undefined object, then go to the database, get what you're looking for, and put it in the memcache
    * To ensure the application does not see stale data, the application must update both the memcache and the database at the same time
    memcached does not understand SQL. If a memcached node dies, all data are lost and it is up to the application to reload the data from the source.
    TimesTen is a memory optimized SQL relational database, that can run standalone or as a cache in front of an Oracle database. Developers use standard JDBC, ODBC or SQL to access TimesTen. TimesTen provides real-time, updatable caching for Oracle database, the data synchronization between Oracle and TimesTen is automatically handled.
    The TimesTen database is persistent and supports full ACID transactions with recovery. TimesTen also offers real-time transactional replication between TimesTen databases for high availability and load sharing.
    Simon

  • Timesten and XLA

    I'm investigating TimesTen and am looking to implement trigger like functionality using XLA. The specific trigger-like behavior I'm trying to implement using XLA is to automatically increment table id values using sequences.
    After researching XLA, I don't see anything that would allow for "BEFORE INSERT" trigger functionality in order to provide a sequence's nextval as part of the same insert transaction.
    Am I looking at this the wrong way? Can I create true trigger-like functionality using XLA?
    Thanks

    While XLA provides some 'trigger like' capabilities it has many differences to triggers and not a general purpose replacement for triggers. The most significant differences between triggers and XLA are:
    1. XLA is an API which is called from coe executing outside the database whereas triggers are SQL constructs that reside, and execute, within the database.
    2. Transactional changes only become visible to XLA after a transaction commits and so XLA cannot change the outcome of any transaction directly. Triggers execute within the context of the database transaction and in general are invoked before the transaction commits; they are therefore able to directly influence the outcome of the transaction.
    I'm afraid that what you are looking to do is not possible in XLA. The closest that one could come would be to insert a record with a dummy value for the sequence derived field and then commit the insert. Your XLA based code could then detect the insert and, using SQL+ODBC calls on a separate ODBC connection, update the row with the value derived from the sequence. Note that if you are using this field as the primary key the nthis is still not possible since currently TimesTen does not allow primary key values to be updated...
    Chris

  • Running TimesTen and 9i together

    The application I'm running has lots of reads from some tables and fewer writes on other tables.
    I'm running a C++ code that works with Oracle 9i. I want to use the cache connect option to cache some of my tables but to do all the writing to the database (different tables).
    I'm connecting using OTL to the oracle and what I couldn't figure out is if I need to do any code changes. If so, how can I support both the connection to the 9i and the TimesTen and what are the minimum changes that are required.
    Help will be highly appreciated.
    Thanks,
    Amnon
    Message was edited by:
    user616300

    If my understanding is correct, your requirement is that you want to cache the frequently used Oracle tables which are read only in TimesTen; but you also need to update tables which only exist in the Oracle database.
    If so, there are a couple of ways to do this:
    1. Your application can establish and maintain two separate database connections, one (ODBC/JDBC) to TimesTen for accessing the readonly tables and another (SQL*Net) to update the Oracle tables.
    2. Use the Cache Connect PASSTHROUGH feature in TimesTen, which allows you to send SQL requests for non-cached data directly to the backend Oracle database.
    Using the 2nd approach means that your application only need to provide connections to TimesTen, and TimesTen will spawn and manage the connection to the Oracle backend database. In terms of performance the 1st approach will always be the best, since the Oracle UPDATE statements do not need to go via TimesTen.
    Regards
    Simon

  • Materialized view and  subqueries

    Hi everyone,
    I have a big SQL which has a lot of (select (select ...) as)
    statements (subqueries inside the relational projection
    statement). In Oracle 8i, as in 9i, I can4t create a
    materialized view with this kind on query. It gives me the
    error 'subqueries not allowed here'.
    But in Oracle 8i there is a workaround: create a view with the
    big SQL, and create a materialized view just with select * from
    BIGSQL.
    Now, in Oracle 9i it4not working anymore.
    Anyone can help me? It4s almost impossible to rewrite the query.
    It4s too big.
    TIA
    Flavio

    Hi,
    Oracle uses materialized views (also known as snapshots in prior releases) to replicate data to non-master sites in a replication environment and to cache expensive queries in a data warehouse environment.
    A materialized view is a replica of a target master from a single point in time. The master can be either a master table at a master site or a master materialized view at a materialized view site. Whereas in multimaster replication tables are continuously updated by other master sites, materialized views are updated from one or more masters through individual batch updates, known as a refreshes, from a single master site or master materialized view site.
    Regards,
    Jonathan Ferreira - Brazil
    http://www.ebs11i.com.br

  • Explain plan for timesten and Oracle

    we have a base table in our Oracle 10g database. We created a DSN for this in timesten 7.0 database and are able to connect. Now we have created 3 materialized views in timesten on top of the Oracle Base Table. How can we get the explain plan in timesten to find out when the table is being called by a custom java application, the materialized views are being used or not ? Please advice

    Hi Can you help me in this regards,
    i am getting the following error. Can you tell me how can i get rid of them?
    Command> call ttcachestart();
    15001: User lacks privilege ADMIN

  • TimesTen and Geo-spatial data

    Can TimesTen support geo-spatial data (and datatypes) as supported in Oracle? For example, if one created a set of Oracle tables that held geo-spatial data, could TimesTen be used in its "caching" form to speed geo-spatial queries?
    Thanks!
    --rick grehan                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    No, sorry. TimesTen does not support Geo-spatialo datatypes or functions.
    Chris

  • TimesTen and minimal logging

    As a matter of interest does TimesTen support minimal logging operations at database level? This will mean that TT contents are lost when TT goes down unexpectly. The advantage would be that fully logged operations will not be required, thus potentially speeding up TimesTen.
    Thanks,
    Mich

    TimesTen used to support 'no logging' mode (Logging=0) and a 'diskless logging' mode (Logging=2) but both have been removed in recent releases. Although both sounded attractive for special use cases, the limitations inherent in both modes meant they were of very limited usein reality and having to support them complicated the log manager code and was an impedance to implementing things like the parallel log manager that was introduced in TimesTen 11.2.1. Basically, delivering maximum performance, scalability and functionality for mainstream use cases was deemed more important than supporting niche options of limited usability.
    Chris

  • TimesTen and 4TB database

    Hi,
    I am investigating this product for use with a 4TB client/server OLTP oracle database. We plan to migrate to an n-tier architecture (Oracle iAS in the middle) and plan on keeping the oracle database. How will TimesTen help in this scenario? Will I have to store the entire 4TB in TT on the middle tier? How will updates on the backend be replicated to TT. In real time? How much memory will I require to store that much data in TT?
    For now I am looking for some high-level feedback on how TT actually works in my scenario.
    Thank you

    In this kind of scenario, typically you will cache just selected tables, or subsets of tables, in TimesTen in order to improve response times for key parts of the application. Before you can decide on how or if TimesTen can help you need to determine which parts of the application you need to speed up and whether the current bottleneck(s) relate to database access and/or the network hops related to database access. Then you should evaluate what data would need to be cached in TimesTen to enable those parts of the application to run against TimesTen rather than Oracle. You also need to evaluate what is involved in moving the application, and its SQL, from Oracle to TimesTen. What API(s)? does the application use to communicate with Oracle? Is any PL/SQL involved? Any esoteric database types? You should also perform some basic validation to confirm that for your data and queries, TimesTen provides a useful speed up over Oracle.
    Chris

  • TimesTen and OLAP

    Hello there,
    I'm on the mission to check what advanateges can give TimesTen in terms of OLAP database performance. TT is kind of new subject for me and I'd be thankful for helping me to figure out following thing:
    According to documentation TT is "memory resident relational database". I found out that one must use enhanced version of TT with OLAP database. Do I need Exalitycs for such activity or is it possible to deploy TT for OLAP on any system?

    So... I can install DB Sofware with OLAP option then create database using Data Warhouse template and then I can use TimesTen as database cache but only for relational structures? Yes, but TimesTen should be based on application level (server) where your BI application is based for achieving the best performance. TimesTen can cache data from Oracle tables only.
    I can live without columnar compression but using TT without rollups, cubes and so on is pointless. Am I correct? It depends. Previous TimesTen versions (11.2.1, 7.0.X) don't have these features at all :), but I know some customers who used TT 7.0.5 for BI purpose for instance. TimesTen 11.2.2 intoduced a lot of new SQL features like analytic functions (AVG, SUM, COUNT, MAX, MIN, DENSE_RANK, RANK, ROW_NUMBER, FIRST_VALUE and LAST_VALUE) clauses (OVER PARTITION BY and OVER ORDER BY) and etc.
    Full list you can find here (http://docs.oracle.com/cd/E21901_01/doc/timesten.1122/e21630/toc.htm#BEIBHIHG). These features absolutely free for using except (rollups, cubes and grouping set).
    Moreover, you can rewrite your SQL queries without using these operators.
    regards,
    Gennady

  • TimesTen and output binding parameters

    Does TimesTen support output binding parameters?

    Output binding parameters are normally only used with stored procedures that pass back values via input parameters. Since TimesTen does not currently support stored procedures, we also do not support that kind of parameter binding.
    We support regular parameter binding and of course columm binding to receive the results of select statements etc.
    Chris

  • IKMs and Subqueries

    I created a yellow interface with multiple datasets that can be used as a sub select for multiple interfaces. It has has a single step to create a query and it uses a customized IKM. If I execute the interface it produces the desired query.
    If I use the yellow interface in a parent interface (Use Temporary Interface as Derived Table (Sub Select)) the subquery IKM is ignored and the subquery is rewritten as a simple union of the multiple datasets.
    The custom IKM is fairly complex as it handles conditional unions, pivots and 1 to 4 data sets. It is preferred to get it to work as desired and not have to create working tables or views.
    Is this the expected funtionality of the IKMs for subqueries? Can the behaviour be modified? ODI is 11.1.1.6. All schemas are on an Oracle DB 11.2.0.3.

    Hi,
    As per my understanding, the IKM of the source interface is not used at all when you select the "Use Temporary Interface as Derived Table (Sub Select)" checkbox. The subquery is rebuilt by the IKM in the main interface.
    Regards,
    JeromeFr

Maybe you are looking for

  • I want to set up a second user on my viao with access to itunes....how do I do that?

    I want to set up a second user on my viao with access to itunes....how do I do that?

  • How to setup a supervisor in PPOMA_BBP?

    hi Gurus   We use SRM7.0 in Standalone Scenario.   there are 30 companies in our Org. plan. and each of the company has its purchasing organization and purchasing groups.   we need some supervisor users. which they can check, change all 30 companies'

  • Debugging Database in Release Build

    I've done something wrong and now my application, which runs perfectly when built in Debugging configuration gets Access Violation when built in Release configuration. I would like to run the Release build in the debugger to see what's going on but V

  • Security Domain

    Hello , Im a newbie to Java Card and have loads of questions, but ill start with the Security Domain. Could the experts please help me on this topic?? Main question : 1) What is a Security Domaain?? GP spec. says it is an application. 2) If it is an

  • PRT Production Resource Tools Counter

    Hi, I am trying to setup a production resource tool which is counted at time of production. I have setup the Material, Equipment, BOM, Counter, Routing. When executing a production order the Counter is not updated with the ammount produced. Does anyo