Reg : SQL Queries and Global warming -

Hi Experts,
I got a doubt while I was going through the Mar/Apr-2013 edition of Oracle Magazine. http://www.oracle.com/technetwork/issue-archive/2013/13-mar/o23peer-1906471.html
Article - <tt>'Peer-To-Peer'</tt> on Oracle ACE - Satyendra Kumar Pasalapudi where he says :
>
Q - What green practices do you use in your work?
A - I always avoid excessive disk I/Os by optimizing queries and creating indexes, which in turn saves power by avoiding unnecessary disk spindles and excessive heat dissemination in the data centers. And I use my Kindle extensively, to save paper.
>
This sounds really interesting.
What I'm not getting is the concept of <tt>'Disk Spindles'</tt>. What is that exactly and how it causes heat dissemination?
Help much appreciated!
Thanks,
Ranit

rp0428 wrote:
>
Not everything written on the 'Net is true.
>
Now you are confusing us!
I just read your statement above on the net but if not everything written on the 'Net' is true then your statement might be false.
But if your statement is false, then everything written on the 'Net' is true.
Which means your statement must be true!
My head is spinning! :DGuy: Where did you hear that?
Girl: On the internet
Guy: And you believed it?
Girl: Sure. They can't put anything on the internet that isn't true
Guy: Where did you hear that?
Girl: On the internet. Oh, here comes my date. He's a French Model.
Guy 2 (with sly wink) : Bonjour

Similar Messages

  • Generating XML from SQL queries and saving to an xml file?

    Hi there,
    I was wondering if somebody could help with regards to the following:
    Generating XML from SQL queries and saving to a xml file?
    We want to have a procedure(PL/SQL) that accepts an order number as an input parameter(the procedure
    is accessed by our software on the client machine).
    Using this order number we do a couple of SQL queries.
    My first question: What would be our best option to convert the result of the
    queries to xml?
    Second Question: Once the XML has been generated, how do we save that XML to a file?
    (The XML file is going to be saved on the file system of the server that
    the database is running on.)
    Now our procedure will also have a output parameter which returns the filename to us. eg. Order1001.xml
    Our software on the client machine will then ftp this XML file(based on the output parameter[filename]) to
    the client hard drive.
    Any information would be greatly appreciated.
    Thanking you,
    Francois

    If you are using 9iR2 you do not need to do any of this..
    You can create an XML as an XMLType using the new SQL/XML operators. You can insert this XML into the XML DB repository using DBMS_XDB.createResource. You can then access the document from the resource. You can also return the XMLType containing the XML directly from the PL/SQL Procedure.

  • Generating XML from SQL queries and saving to a xml file?

    Hi there,
    I was wondering if somebody could help with regards to the following:
    Generating XML from SQL queries and saving to a xml file?
    We want to have a stored procedure(PL/SQL) that accepts an order number as an input parameter(the procedure
    is accessed by our software on the client machine).
    Using this order number we do a couple of SQL queries.
    My first question: What would be our best option to convert the result of the
    queries to xml?
    Second Question: Once the XML has been generated, how do we save that XML to a file?
    (The XML file is going to be saved on the file system of the server that
    the database is running on.)
    Now our procedure will also have a output parameter which returns the filename to us. eg. Order1001.xml
    Our software on the client machine will then ftp this XML file(based on the output parameter[filename]) to
    the client hard drive.
    Any information would be greatly appreciated.
    Thanking you,
    Francois

    Hi
    Here is an example of some code that i am using on Oracle 817.
    The create_file procedure is the one that creates the file.
    The orher procedures are utility procedures that can be used with any XML file.
    PROCEDURE create_file_with_root(po_xmldoc OUT xmldom.DOMDocument,
    pi_root_tag IN VARCHAR2,
                                            po_root_element OUT xmldom.domelement,
                                            po_root_node OUT xmldom.domnode,
                                            pi_doctype_url IN VARCHAR2) IS
    xmldoc xmldom.DOMDocument;
    root xmldom.domnode;
    root_node xmldom.domnode;
    root_element xmldom.domelement;
    record_node xmldom.domnode;
    newelenode xmldom.DOMNode;
    BEGIN
    xmldoc := xmldom.newDOMDocument;
    xmldom.setVersion(xmldoc, '1.0');
    xmldom.setDoctype(xmldoc, pi_root_tag, pi_doctype_url,'');
    -- Create the root --
    root := xmldom.makeNode(xmldoc);
    -- Create the root element in the file --
    create_element_and_append(xmldoc, pi_root_tag, root, root_element, root_node);
    po_xmldoc := xmldoc;
    po_root_node := root_node;
    po_root_element := root_element;
    END create_file_with_root;
    PROCEDURE create_element_and_append(pi_xmldoc IN OUT xmldom.DOMDocument,
    pi_element_name IN VARCHAR2,
                                            pi_parent_node IN xmldom.domnode,
                                            po_new_element OUT xmldom.domelement,
                                            po_new_node OUT xmldom.domnode) IS
    element xmldom.domelement;
    child_node xmldom.domnode;
    newelenode xmldom.DOMNode;
    BEGIN
    element := xmldom.createElement(pi_xmldoc, pi_element_name);
    child_node := xmldom.makeNode(element);
    -- Append the new node to the parent --
    newelenode := xmldom.appendchild(pi_parent_node, child_node);
    po_new_node := child_node;
    po_new_element := element;
    END create_element_and_append;
    FUNCTION create_text_element(pio_xmldoc IN OUT xmldom.DOMDocument, pi_element_name IN VARCHAR2,
    pi_element_data IN VARCHAR2, pi_parent_node IN xmldom.domnode) RETURN xmldom.domnode IS
    parent_node xmldom.domnode;                                   
    child_node xmldom.domnode;
    child_element xmldom.domelement;
    newelenode xmldom.DOMNode;
    textele xmldom.DOMText;
    compnode xmldom.DOMNode;
    BEGIN
    create_element_and_append(pio_xmldoc, pi_element_name, pi_parent_node, child_element, child_node);
    parent_node := child_node;
    -- Create a text node --
    textele := xmldom.createTextNode(pio_xmldoc, pi_element_data);
    child_node := xmldom.makeNode(textele);
    -- Link the text node to the new node --
    compnode := xmldom.appendChild(parent_node, child_node);
    RETURN newelenode;
    END create_text_element;
    PROCEDURE create_file IS
    xmldoc xmldom.DOMDocument;
    root_node xmldom.domnode;
    xml_doctype xmldom.DOMDocumentType;
    root_element xmldom.domelement;
    record_element xmldom.domelement;
    record_node xmldom.domnode;
    parent_node xmldom.domnode;
    child_node xmldom.domnode;
    newelenode xmldom.DOMNode;
    textele xmldom.DOMText;
    compnode xmldom.DOMNode;
    BEGIN
    xmldoc := xmldom.newDOMDocument;
    xmldom.setVersion(xmldoc, '1.0');
    create_file_with_root(xmldoc, 'root', root_element, root_node, 'test.dtd');
    xmldom.setAttribute(root_element, 'interface_type', 'EXCHANGE_RATES');
    -- Create the record element in the file --
    create_element_and_append(xmldoc, 'record', root_node, record_element, record_node);
    parent_node := create_text_element(xmldoc, 'title', 'Mr', record_node);
    parent_node := create_text_element(xmldoc, 'name', 'Joe', record_node);
    parent_node := create_text_element(xmldoc,'surname', 'Blogs', record_node);
    -- Create the record element in the file --
    create_element_and_append(xmldoc, 'record', root_node, record_element, record_node);
    parent_node := create_text_element(xmldoc, 'title', 'Mrs', record_node);
    parent_node := create_text_element(xmldoc, 'name', 'A', record_node);
    parent_node := create_text_element(xmldoc, 'surname', 'B', record_node);
    -- write the newly created dom document into the buffer assuming it is less than 32K
    xmldom.writeTofile(xmldoc, 'c:\laiki\willow_data\test.xml');
    EXCEPTION
    WHEN xmldom.INDEX_SIZE_ERR THEN
    RAISE_APPLICATION_ERROR(-20120, 'Index Size error');
    WHEN xmldom.DOMSTRING_SIZE_ERR THEN
    RAISE_APPLICATION_ERROR(-20120, 'String Size error');
    WHEN xmldom.HIERARCHY_REQUEST_ERR THEN
    RAISE_APPLICATION_ERROR(-20120, 'Hierarchy request error');
    WHEN xmldom.WRONG_DOCUMENT_ERR THEN
    RAISE_APPLICATION_ERROR(-20120, 'Wrong doc error');
    WHEN xmldom.INVALID_CHARACTER_ERR THEN
    RAISE_APPLICATION_ERROR(-20120, 'Invalid Char error');
    WHEN xmldom.NO_DATA_ALLOWED_ERR THEN
    RAISE_APPLICATION_ERROR(-20120, 'Nod data allowed error');
    WHEN xmldom.NO_MODIFICATION_ALLOWED_ERR THEN
    RAISE_APPLICATION_ERROR(-20120, 'No mod allowed error');
    WHEN xmldom.NOT_FOUND_ERR THEN
    RAISE_APPLICATION_ERROR(-20120, 'Not found error');
    WHEN xmldom.NOT_SUPPORTED_ERR THEN
    RAISE_APPLICATION_ERROR(-20120, 'Not supported error');
    WHEN xmldom.INUSE_ATTRIBUTE_ERR THEN
    RAISE_APPLICATION_ERROR(-20120, 'In use attr error');
    WHEN OTHERS THEN
    dbms_output.put_line('exception occured' || SQLCODE || SUBSTR(SQLERRM, 1, 100));
    END create_file;

  • ? in SQL Queries and not using prepared statements

    Using EclipseLink 1.1.1
    Prepared Statements are disabled
    In our production server something went wrong and one of our Read Queries started erroring. A DatabaseException was thrown and we log the "getQuery.getSQLString()" statement. We found this query in the logs:
    SELECT t1.ID, t1.NAME, t1.DESCRIPTION, t1.EXTREFID, t1.STYLESHEET, t1.DDSVNVERSION, t1.FIRSTNAME, t1.LASTNAME, t1.EMAILADDR, t1.PHONENUMBER, t1.ADDRESS, t1.ADDRESS2, t1.CITY, t1.STATE, t1.POSTALCODE, t1.COUNTRY, t1.ADMINACCTNAME, t1.HASDOCUMENTS, t1.HASTIMEDNOTIFICATIONS, t1.STATUS, t1.ENTRYDATE, t1.EVALEXPDATE, t1.LASTREMINDDATE, t1.FULLUSERS, t1.LIMUSERS, t1.REQUSERS, t1.ISENTERPRISE, t1.EXPDATE, t1.ISDISABLED, t1.DISABLEDDATE, t1.NEEDLICENSEAGREEMENT, t1.ISWARNINGDISABLED, t1.LOCALE, t1.TIMEZONE, t1.CURRENCY, t1.DOMAIN, t1.DOCUMENTSIZE, t1.EXTRADOCUMENTSTORAGE, t1.ONDEMANDOPTIONS, t1.SSOTYPE, t1.RESELLERID, t1.ACCOUNTREPID, t1.LASTUSAGEREPORTDATE, t1.NEXTUSAGEREPORTDATE, t1.USAGEREPORTATTEMPTS FROM T_SSOOPTIONS t0, T_CUSTOMERS t1 WHERE *((((t0.SSOENABLED = ?) AND (t1.SSOTYPE IN (?, ?))) AND (UPPER(t1.DOMAIN) = ?)) AND (t0.CUSTOMERID = t1.ID))*
    Notice the values weren't entered into the where clause. We had to bounce the application to fix the problem. I've never seen this before. I've added more debugging statements to the code - so if this happens again in the future I'll have more information to report on. In the mean time I'm wondering if anyone else has every seen a problem of this nature.

    Database error due to invalid SQL statement.
    I don't have a stack, we were catching the exception and not printing the stack :(
    Like I mentioned in my first post, I added more debugging code (e.printStackTrace()). I understand this is hard to track down without more information. I was just hoping you guys had seen something like this before and had any insight. Like I mentioned before: this is on our production server. I've never seen this type of error before. That particular server (we run in a cluster mode) had been up for several days and then started generating that error. IT bounced the node and everything went back to normal. We have been using toplink for about 5 years now and have never seen this problem, until August 3rd 2009. The only thing that has changed recently is our migration from toplink 10 to EclipseLink. I was wondering if anyone knows if anything had changed in EclipseLink/toplink 11 with the generation of SQL queries.
    I'll keep looking. There is more debugging code in there now. Since the error was "Database error due to invalid SQL statement" this implies the SQL was generated, exited that part of the code and was sent to the db where it failed. I'm afraid the printStackTrace won't help if this error happens again.

  • Poorly Performing SQL Queries and AWR

    version : 10.2.0.4 on OEL 5.
    Snapshot duration is 30 mins. Its long, but sorry that is what is available right now.
    I have three queries in my database which are performing pretty slow. I took AWR reports for these queries and they are as follows:
    Query 1:
    ======
        Plan Hash           Total Elapsed                 1st Capture   Last Capture
    #   Value                    Time(ms)    Executions       Snap ID        Snap ID
    1   3714475000                113,449             9         60539          60540
    -> % Total DB Time is the Elapsed Time of the SQL statement divided  into the Total Database Time multiplied by 100
    Stat Name                                Statement   Per Execution % Snap
    Elapsed Time (ms)                           113,449       12,605.4     3.9
    CPU Time (ms)                               108,620       12,068.9     4.0
    Executions                                        9            N/A     N/A
    Buffer Gets                                4.25E+07    4,722,689.0    11.7
    Disk Reads                                        0            0.0     0.0
    Parse Calls                                       9            1.0     0.0
    Rows                                             20            2.2     N/A
    User I/O Wait Time (ms)                           0            N/A     N/A
    Cluster Wait Time (ms)                            0            N/A     N/A
    Application Wait Time (ms)                        0            N/A     N/A
    Concurrency Wait Time (ms)                        0            N/A     N/A
    Invalidations                                     0            N/A     N/A
    Version Count                                     2            N/A     N/A
    Sharable Mem(KB)                                252            N/A     N/AQuery 2:
    ======
        Plan Hash           Total Elapsed                 1st Capture   Last Capture
    #   Value                    Time(ms)    Executions       Snap ID        Snap ID
    1   4197000940              1,344,458             3         60539          60540
    -> % Total DB Time is the Elapsed Time of the SQL statement divided   into the Total Database Time multiplied by 100
    Stat Name                                Statement   Per Execution % Snap
    Elapsed Time (ms)                         1,344,458      448,152.7    46.5
    CPU Time (ms)                             1,353,670      451,223.3    49.7
    Executions                                        3            N/A     N/A
    Buffer Gets                                3.42E+07   11,383,856.7     9.4
    Disk Reads                                        0            0.0     0.0
    Parse Calls                                       3            1.0     0.0
    Rows                                             48           16.0     N/A
    User I/O Wait Time (ms)                           0            N/A     N/A
    Cluster Wait Time (ms)                            0            N/A     N/A
    Application Wait Time (ms)                        0            N/A     N/A
    Concurrency Wait Time (ms)                        0            N/A     N/A
    Invalidations                                     0            N/A     N/A
    Version Count                                     2            N/A     N/A
    Sharable Mem(KB)                                270            N/A     N/AQuery 3:
    ======
        Plan Hash           Total Elapsed                 1st Capture   Last Capture
    #   Value                    Time(ms)    Executions       Snap ID        Snap ID
    1   2000299266                104,060             7         60539          60540
    -> % Total DB Time is the Elapsed Time of the SQL statement divided   into the Total Database Time multiplied by 100
    Stat Name                                Statement   Per Execution % Snap
    Elapsed Time (ms)                           104,060       14,865.7     3.6
    CPU Time (ms)                               106,150       15,164.3     3.9
    Executions                                        7            N/A     N/A
    Buffer Gets                                4.38E+07    6,256,828.1    12.1
    Disk Reads                                        0            0.0     0.0
    Parse Calls                                       7            1.0     0.0
    Rows                                             79           11.3     N/A
    User I/O Wait Time (ms)                           0            N/A     N/A
    Cluster Wait Time (ms)                            0            N/A     N/A
    Application Wait Time (ms)                        0            N/A     N/A
    Concurrency Wait Time (ms)                        0            N/A     N/A
    Invalidations                                     0            N/A     N/A
    Version Count                                     2            N/A     N/A
    Sharable Mem(KB)                                748            N/A     N/AAny Ideas please as what is wrong with the above statistics? And what should I do next with it?
    Thanks.

    Here is one of the plan for query:
    | Id  | Operation                            | Name                   | Rows  | Bytes | Cost (%CPU)|
    Time     |
    |   0 | SELECT STATEMENT                     |                        |       |       |  9628 (100)|
              |
    |   1 |  VIEW                                |                        |    73 | 58546 |  9628   (1)|
    00:01:56 |
    |   2 |   WINDOW SORT PUSHED RANK            |                        |    73 | 22630 |  9628   (1)|
    00:01:56 |
    |   3 |    FILTER                            |                        |       |       |            |
              |
    |   4 |     NESTED LOOPS                     |                        |    73 | 22630 |  9627   (1)|
    00:01:56 |
    |   5 |      NESTED LOOPS                    |                        |    73 | 20586 |  9554   (1)|
    00:01:55 |
    |   6 |       NESTED LOOPS OUTER             |                        |    72 | 15552 |  9482   (1)|
    00:01:54 |
    |   7 |        NESTED LOOPS                  |                        |    72 | 13320 |  9410   (1)|
    00:01:53 |
    |   8 |         NESTED LOOPS                 |                        |    72 | 12168 |  9338   (1)|
    00:01:53 |
    |   9 |          NESTED LOOPS                |                        |  4370 |   277K|    29   (0)|
    00:00:01 |
    |  10 |           TABLE ACCESS BY INDEX ROWID| test_ORG                |     1 |    34 |     2   (0)|
    00:00:01 |
    |  11 |            INDEX UNIQUE SCAN         | test_ORG_PK             |     1 |       |     1   (0)|
    00:00:01 |
    |  12 |           TABLE ACCESS FULL          | test_USER               |  4370 |   132K|    27   (0)|
    00:00:01 |
    |  13 |          TABLE ACCESS BY INDEX ROWID | REF_CLIENT_FOO_ACCT   |     1 |   104 |     7   (0)|
    00:00:01 |
    |  14 |           INDEX RANGE SCAN           | RCFA_test_ORG_IDX       |   165 |       |     2   (0)|
    00:00:01 |
    |  15 |         TABLE ACCESS BY INDEX ROWID  | test_ACCOUNT            |     1 |    16 |     1   (0)|
    00:00:01 |
    |  16 |          INDEX UNIQUE SCAN           | test_CUSTODY_ACCOUNT_PK |     1 |       |     0   (0)|
              |
    |  17 |        TABLE ACCESS BY INDEX ROWID   | test_USER               |     1 |    31 |     1   (0)|
    00:00:01 |
    |  18 |         INDEX UNIQUE SCAN            | test_USER_PK_IDX        |     1 |       |     0   (0)|
              |
    |  19 |       TABLE ACCESS BY INDEX ROWID    | REF_FOO               |     1 |    66 |     1   (0)|
    00:00:01 |
    |  20 |        INDEX UNIQUE SCAN             | REF_FOO_PK            |     1 |       |     0   (0)|
              |
    |  21 |      TABLE ACCESS BY INDEX ROWID     | REF_FOO_FAMILY        |     1 |    28 |     1   (0)|
    00:00:01 |
    PLAN_TABLE_OUTPUT
    |  22 |       INDEX UNIQUE SCAN              | REF_FOO_FAMILY_PK     |     1 |       |     0   (0)|
              |
    40 rows selected.
    SQL>

  • SQL queries and projection

    Hi,
    we need to use the sql-query functionality in kodo for some of our
    queries. When doing this, we would like to fetch the information for the
    candidate object out together with the primary key as in:
    select id, name
    from mytable
    where some-condition
    mapping to an object X having the name as field, id as primary key. The
    benefit here is that the name is then stored inside the
    persistence-capable object and is also stored in kodos cache.
    In a few queries, we furthermore need to get extra information from the
    query. Is this possible?? For instance:
    select id, name, count(*)
    from mytable
    where some-condition
    group by xxxx
    I know that I can map this to a custom result-class, but is it possible to
    get it out as a persistence capable object X and the count?? And if so,
    how?

    Henning-
    Unfortunately, you can't mix in a persistent class with other data in a
    single query using the ResultClass mechanism. You'll need to either
    using a custom ResultObjectProvider to perform the extra interpretation,
    or else execute separate queries.
    Henning Andersen wrote:
    Hi,
    we need to use the sql-query functionality in kodo for some of our
    queries. When doing this, we would like to fetch the information for the
    candidate object out together with the primary key as in:
    select id, name
    from mytable
    where some-condition
    mapping to an object X having the name as field, id as primary key. The
    benefit here is that the name is then stored inside the
    persistence-capable object and is also stored in kodos cache.
    In a few queries, we furthermore need to get extra information from the
    query. Is this possible?? For instance:
    select id, name, count(*)
    from mytable
    where some-condition
    group by xxxx
    I know that I can map this to a custom result-class, but is it possible to
    get it out as a persistence capable object X and the count?? And if so,
    how?--
    Marc Prud'hommeaux
    SolarMetric Inc.

  • SQL Inseting a Set Of Data To Run SQL Queries and Produce a Data Table

    Hello,
    I am an absolute newbie to SQL.
    I have purchased the book "Oracle 10g The Complete Reference" by Kevin Loney.
    I have read through the introductory chapters regarding relational databases and am attempting to copy and paste the following data and run an SQL search from the preset data.
    However when I attempt to start my database and enter the data by using copy and paste into the following:
    C:\Windows\system32 - "Cut Copy & Paste" rem **************** onwards
    I receive the following message: drop table Newspaper;
    'drop' is not recognised as an external or internal command, operable programme or batch file.
    Any idea how one would overcome this initial proble?
    Many thanks for any solutions to this problem.
    rem *******************
    rem The NEWSPAPER Table
    rem *******************
    drop table NEWSPAPER;
    create table NEWSPAPER (
    Feature VARCHAR2(15) not null,
    Section CHAR(1),
    Page NUMBER
    insert into NEWSPAPER values ('National News', 'A', 1);
    insert into NEWSPAPER values ('Sports', 'D', 1);
    insert into NEWSPAPER values ('Editorials', 'A', 12);
    insert into NEWSPAPER values ('Business', 'E', 1);
    insert into NEWSPAPER values ('Weather', 'C', 2);
    insert into NEWSPAPER values ('Television', 'B', 7);
    insert into NEWSPAPER values ('Births', 'F', 7);
    insert into NEWSPAPER values ('Classified', 'F', 8);
    insert into NEWSPAPER values ('Modern Life', 'B', 1);
    insert into NEWSPAPER values ('Comics', 'C', 4);
    insert into NEWSPAPER values ('Movies', 'B', 4);
    insert into NEWSPAPER values ('Bridge', 'B', 2);
    insert into NEWSPAPER values ('Obituaries', 'F', 6);
    insert into NEWSPAPER values ('Doctor Is In', 'F', 6);
    rem *******************
    rem The NEWSPAPER Table
    rem *******************
    drop table NEWSPAPER;
    create table NEWSPAPER (
    Feature VARCHAR2(15) not null,
    Section CHAR(1),
    Page NUMBER
    insert into NEWSPAPER values ('National News', 'A', 1);
    insert into NEWSPAPER values ('Sports', 'D', 1);
    insert into NEWSPAPER values ('Editorials', 'A', 12);
    insert into NEWSPAPER values ('Business', 'E', 1);
    insert into NEWSPAPER values ('Weather', 'C', 2);
    insert into NEWSPAPER values ('Television', 'B', 7);
    insert into NEWSPAPER values ('Births', 'F', 7);
    insert into NEWSPAPER values ('Classified', 'F', 8);
    insert into NEWSPAPER values ('Modern Life', 'B', 1);
    insert into NEWSPAPER values ('Comics', 'C', 4);
    insert into NEWSPAPER values ('Movies', 'B', 4);
    insert into NEWSPAPER values ('Bridge', 'B', 2);
    insert into NEWSPAPER values ('Obituaries', 'F', 6);
    insert into NEWSPAPER values ('Doctor Is In', 'F', 6);

    You need to be in SQL*Plus logged in as a user.
    This page which I created for my Oracle students may be of some help:
    http://www.morganslibrary.org/reference/setup.html
    But to logon using "/ as sysdba" you must be in SQL*Plus (sqlplus.exe).

  • Reg : SQL Trace and ECAT

    Hi Floks ,
    Any body knowing The SQL trace analysis and Ecat tool .send me how to work on this issues .Please send me with snap shot it's will help to who don't know how to utilize this tools.
    thanks,
    suresh

    Hi suresh,
    Check these links.
    SQL trace
    http://www.sapdevelopment.co.uk/perform/perform_sqltrace.htm
    Go to st05 and activate trace, go back and run your transaction or report again go to st05 deactivate trace and click display trace here you can find information with this you can performence analysis, database tables, fields etc.
    ECAT
    eCATT stands for extended Computer Aided Test Tool (eCATT) which is built is testing tool to test SAP system. By using testing tool we can test the entire business process, and we can also use this tool with a third party testing tool (I am not covering this topic). Execution of every test script ends with a log, which explains the results of the test script.
    By using eCATT we can do following operations,
    ·        Test transactions, reports, and scenarios
    ·        Call BAPIs and function modules
    ·        Test remote systems
    ·        Check authorizations (user profiles)
    ·        Test updates (database, applications, GUI)
    ·        Test the effect of changes to customizing settings
    ·        Check system messages
      For more information go to
    http://help.sap.com/saphelp_erp2004/helpdata/en/2a/121e3bd711bb04e10000000a114084/frameset.htm
    To develop a test script in eCATT we need to follow the following steps,
    1. Creating Test Scripts.
    2. Creating Test Data Containers[16] .
    3. Understanding System Data Containers[17] .
    4. Executing Test Configurations.
    There is a very good web blog on eCATT in sdn.com which explains eCATT with necessary screen shots.
    To read document click here Blog on eCATT
    http://www.sapdevelopment.co.uk/testing/ecatt.htm

  • PLSQL Blocks and SQL Queries in APEX

    Hello,
    Is it possible at all to view undelrying Oracle PLSQL and SQL queries in a run time APEX 3.2 application?
    More elaboratively, can a smart APEX Site user or visitor find a way to see underlying SQL queries and PLSQL code objects?
    Thanks,
    R

    Hi,
    If you just want to see what sql is executed by a session you can use sql trace. This can be switched on for a whole system but is usually more usable when switched on for individual users. The problem with a system like APEX is that database sessions are not directly associated with APEX users and APEX sessions can share database sessions.
    I haven't tried it, but one method that may work is to put a schema logon trigger on the APEX_PUBLIC_USER which switches on tracing when ever this user logs on to the database. It may take a little detective work to understand the sequence of things but all the SQL executed by this user will be recorded and can be analyzed for performance etc. The command to enable SQL tracing could be embedded in the APEX app, but it may be a little random as to which db session has it enabled.
    Perhaps a better tracing option could be seen as a feature request in a future version of APEX.
    Regards
    Andre

  • Multiple SQL Queries in SAP BPC  5.1 EVMODIFY

    Hi All,
    We have multiple SQL Queries in Outlooksoft 4.2 which extracts data from Oracle source system with different set of selections and conditions and parameters. We were able to use multiple SQL Queries in Outlooksoft 4.2 using Transform Data Flow Task and paste parameters using evModify dynamic script task, where ever extract to source system is needed.
    According to  SAP BPC 5.1, all these multiple SQL Queries and extracts by passing parameters will be coded in EVMODIFY dynamic script editor.But, EVMODIFY dynamic script editor is not working with the sets of multiple SQL Queris.It's able to recognize and execute the first SQL Query, but not able to execute from the second SQL Query.
    Does any body, did multiple extracts using SQL Queries to the source system by passing parameters using SAP BPC 5.1 data  manager and SSIS Packages, please let me know, how you did achieve the above functionality.
    Regards,
    Sreekanth.

    Hi Sorin,
    Thanks for your update, I tried declaring the variable between %%....GLOBAL(%GTIMEID%,%SELECTION%) and the package runs now but the problem is that the package is executed using the default date value for the variable GTIMEID declared in the DTSX package and its not taken the date that I'm trying to pass from BPC.  As showed below, please if you could take a look to the ModifyScript and see the last line for the global variable and line 13  PROMTP(SELECTINPUT,%SELECTION%,,,%TIME_DIM%) where I am selecting the TIMEID:
    DEBUG(ON)
    PROMPT(INFILES,,"Import file:",)
    PROMPT(TRANSFORMATION,%TRANSFORMATION%,"Transformation file:",,,Import.xls)
    PROMPT(RADIOBUTTON,%CLEARDATA%,"Select the method for importing the data from the source file to the destination database",0,{"Merge data values (Imports all records, leaving all remaining records in the destination intact)","Replace && clear data values (Clears the data values for any existing records that mirror each entity/category/time combination defined in the source, then imports the source records)"},{"0","1"})
    PROMPT(RADIOBUTTON,%RUNLOGIC%,"Select whether to run default logic for stored values after importing",1,{"Yes","No"},{"1","0"})
    PROMPT(RADIOBUTTON,%CHECKLCK%,"Select whether to check work status settings when importing data.",1,{"Yes, check for work status settings before importing","No, do not check work status settings"},{"1","0"})
    INFO(%TEMPFILE%,%TEMPPATH%%RANDOMFILE%)
    PROMPT(SELECTINPUT,%SELECTION%,,,%TIME_DIM%)
    TASK(CONVERT Task,INPUTFILE,%FILE%)
    TASK(CONVERT Task,OUTPUTFILE,%TEMPFILE%)
    TASK(CONVERT Task,CONVERSIONFILE,%TRANSFORMATION%)
    TASK(CONVERT Task,STRAPPSET,%APPSET%)
    TASK(CONVERT Task,STRAPP,%APP%)
    TASK(CONVERT Task,STRUSERNAME,%USER%)
    TASK(Dumpload Task,APPSET,%APPSET%)
    TASK(Dumpload Task,APP,%APP%)
    TASK(Dumpload Task,USER,%USER%)
    TASK(Dumpload Task,DATATRANSFERMODE,1)
    TASK(Dumpload Task,CLEARDATA,1)
    TASK(Dumpload Task,FILE,%TEMPFILE%)
    TASK(Dumpload Task,RUNTHELOGIC,1)
    TASK(Dumpload Task,CHECKLCK,1)
    GLOBAL(%GTIMEID%,%SELECTION%)
    Do you guess That I am missing something?
    Thanks in advanced
    Regards

  • I want to combine a bunch of queries and dump the results - spreadsheet

    I have a bunch of SQL queries. I want to run the SQL queries and dump the results into one single spreadsheet in a formatted fashon.
    Assume that one of my queries returns the following:
    Week 10, Door, 15
    Week 10, Window, 20
    Week 10, Stair, 25
    Week 11, Door, 50
    Week 11, Window, 75
    Week 11, Stair, 100
    Week 12, Door, 1
    Week 12, Window, 2
    Week 12, Stair, 3
    I would then want to take all these results and put them into a spreadsheet with a bunch of other results:
    So header would look like:
    Week 1, Week 2, Week 3, ...Week 10, Week 11, Week 12...
    Then, down below there would be three rows which have the following in Col A:
    Door
    Window
    Stair
    So in row "Door", under Col "Week 10", there would be a 15
    Under "Window", under Col "Week 11", there would be a 75
    Under "Stair", under Col "Week 12", there would be a 3
    The column headers would all be in weeks, but I want to basically make a matrix out of my SQL queries. So there would be many rows besides "Door", "Window", and "Stair", but they would all have similar results as supplied by my other queries. Anyone know how to do such mapping?

    Check this link --
    [url http://forums.oracle.com/forums/search.jspa?threadID=&q=pivot&objID=f75&dateRange=last90days&userID=&numResults=15]Pivot Search In Oracle
    Regards.
    Satyaki De.

  • Problem occured when create a tree table for master-detail view objects using SQL queries?

    I am programming a tree table for master-detail view objects using SQL queries and these 2 view objects are not simple singel tables queries, and 2 complex SQL are prepared for master and view objects. see below:
    1. Master View object (key attribute is SourceBlock and some varaible bindings are used for this view object.)
    SELECT  cntr_list.SOURCE_BLOCK,                   
            sum(                   
             case when cntr_list.cntr_size_q = '20'                   
                  then cntr_list.cntr_qty                   
                  else 0 end ) as cntr20 ,                   
            sum(                   
             case when cntr_list.cntr_size_q = '40'                   
                  then cntr_list.cntr_qty                   
                  else 0 end ) as cntr40 ,                   
             sum(                   
             case when cntr_list.cntr_size_q = '45'                   
                  then cntr_list.cntr_qty                   
                  else 0 end ) as cntr45                    
    FROM (       
        SELECT yb1.BLOCK_M as SOURCE_BLOCK,       
               scn.CNTR_SIZE_Q,        
               count(scn.CNTR_SIZE_Q) AS cntr_qty        
        FROM  SHIFT_CMR scm, SHIFT_CNTR scn, YARD_BLOCK yb1, YARD_BLOCK yb2       
        WHERE       
        scm.cmr_n = scn.cmr_n             
        AND (scm.plan_start_dt BETWEEN to_date(:DateFrom,'YYYY/MM/DD HH24:MI:SS') AND to_date(:DateTo,'YYYY/MM/DD HH24:MI:SS')                 
        OR scm.plan_end_dt BETWEEN to_date(:DateFrom,'YYYY/MM/DD HH24:MI:SS') AND to_date(:DateTo,'YYYY/MM/DD HH24:MI:SS'))                 
        AND scm.shift_mode_c = :ShiftModeCode                           
        AND scm.end_terminal_c = :TerminalCode      
        AND scm.start_terminal_c = yb1.terminal_c                  
        AND scm.start_block_n = yb1.block_n                  
        AND substr(scn.start_location_c,(instr(scn.start_location_c,',',1,5)+1),instr(scn.start_location_c,',',1,6)-(instr(scn.start_location_c,',',1,5)+1)) BETWEEN yb1.slot_from_n AND yb1.slot_to_n                  
        AND scm.end_terminal_c = yb2.terminal_c                  
        AND scm.end_block_n = yb2.block_n                  
        AND substr(scn.end_location_c,(instr(scn.end_location_c,',',1,5)+1),instr(scn.end_location_c,',',1,6)-(instr(scn.end_location_c,',',1,5)+1)) BETWEEN yb2.slot_from_n AND yb2.slot_to_n           
        AND scn.status_c not in (1, 11)             
        AND scn.shift_type_c = 'V'             
        AND scn.source_c = 'S'       
        GROUP BY yb1.BLOCK_M, scn.CNTR_SIZE_Q       
    ) cntr_list       
    GROUP BY cntr_list.SOURCE_BLOCK
    2. Detail View object (key attributes are SourceBlock and EndBlock and same varaible bindings are used for this view object.)
    SELECT  cntr_list.SOURCE_BLOCK, cntr_list.END_BLOCK,                
            sum(                     
             case when cntr_list.cntr_size_q = '20'                     
                  then cntr_list.cntr_qty                     
                  else 0 end ) as cntr20 ,                     
            sum(                     
             case when cntr_list.cntr_size_q = '40'                     
                  then cntr_list.cntr_qty                     
                  else 0 end ) as cntr40 ,                     
             sum(                     
             case when cntr_list.cntr_size_q = '45'                     
                  then cntr_list.cntr_qty                     
                  else 0 end ) as cntr45                      
    FROM (         
        SELECT yb1.BLOCK_M as SOURCE_BLOCK,     
               yb2.BLOCK_M as END_BLOCK,  
               scn.CNTR_SIZE_Q,          
               count(scn.CNTR_SIZE_Q) AS cntr_qty          
        FROM  SHIFT_CMR scm, SHIFT_CNTR scn, YARD_BLOCK yb1, YARD_BLOCK yb2         
        WHERE         
        scm.cmr_n = scn.cmr_n               
        AND (scm.plan_start_dt BETWEEN to_date(:DateFrom,'YYYY/MM/DD HH24:MI:SS') AND to_date(:DateTo,'YYYY/MM/DD HH24:MI:SS')                   
        OR scm.plan_end_dt BETWEEN to_date(:DateFrom,'YYYY/MM/DD HH24:MI:SS') AND to_date(:DateTo,'YYYY/MM/DD HH24:MI:SS'))                   
        AND scm.shift_mode_c = :ShiftModeCode                             
        AND scm.end_terminal_c = :TerminalCode        
        AND scm.start_terminal_c = yb1.terminal_c                    
        AND scm.start_block_n = yb1.block_n                    
        AND substr(scn.start_location_c,(instr(scn.start_location_c,',',1,5)+1),instr(scn.start_location_c,',',1,6)-(instr(scn.start_location_c,',',1,5)+1)) BETWEEN yb1.slot_from_n AND yb1.slot_to_n                    
        AND scm.end_terminal_c = yb2.terminal_c                    
        AND scm.end_block_n = yb2.block_n                    
        AND substr(scn.end_location_c,(instr(scn.end_location_c,',',1,5)+1),instr(scn.end_location_c,',',1,6)-(instr(scn.end_location_c,',',1,5)+1)) BETWEEN yb2.slot_from_n AND yb2.slot_to_n             
        AND scn.status_c not in (1, 11)               
        AND scn.shift_type_c = 'V'               
        AND scn.source_c = 'S'         
        GROUP BY yb1.BLOCK_M, yb2.BLOCK_M, scn.CNTR_SIZE_Q         
    ) cntr_list         
    GROUP BY cntr_list.SOURCE_BLOCK, cntr_list.END_BLOCK
    3. I create a view link to create master-detail relationship for these 2 view objects.
    masterview.SourceBlock (1)->detailview.SourceBlock (*).
    4. I create a tree table using these 2 view objects with master-detail relationship.
    When I set default value for variable bindings of these 2 view objects and the matching records exist, tree table can work well. I can expand the master row to display detail row in UI.
    But I need to pass in dymamic parameter value for variable bindings of these 2 view objects, tree table cannnot work again. when I expand the master row and no detail row are displayed in UI.
    I am sure that I pass in correct parameter value for master/detail view objects and matching records exist.
    Managed Bean:
            DCIteratorBinding dc = (DCIteratorBinding)evaluteEL("#{bindings.MasterView1Iterator}");
            ViewObject vo = dc.getViewObject();
            System.out.println("Before MasterView1Iterator vo.getEstimatedRowCount()="+ vo.getEstimatedRowCount());
            System.out.println("Before MasterView1Iterator ShiftModeCode="+ vo.ensureVariableManager().getVariableValue("ShiftModeCode"));
            vo.ensureVariableManager().setVariableValue("DateFrom", dateFrom);
            vo.ensureVariableManager().setVariableValue("DateTo", dateTo);
            vo.ensureVariableManager().setVariableValue("ShiftModeCode", shiftModeC);
            vo.ensureVariableManager().setVariableValue("TerminalCode", terminalCode);
            vo.executeQuery();
            System.out.println("MasterView1Iterator vo.getEstimatedRowCount()="+ vo.getEstimatedRowCount());
            DCIteratorBinding dc1 = (DCIteratorBinding)evaluteEL("#{bindings.DetailView1Iterator}");
            ViewObject vo1 = dc1.getViewObject();
            System.out.println("Before DetailView1Iterator vo1.getEstimatedRowCount()="+ vo1.getEstimatedRowCount());
            System.out.println("Before DetailView1Iterator ShiftModeCode="+ vo1.ensureVariableManager().getVariableValue("ShiftModeCode"));
            vo1.ensureVariableManager().setVariableValue("DateFrom", dateFrom);
            vo1.ensureVariableManager().setVariableValue("DateTo", dateTo);
            vo1.ensureVariableManager().setVariableValue("ShiftModeCode", shiftModeC);
            vo1.ensureVariableManager().setVariableValue("TerminalCode", terminalCode);
            vo1.executeQuery();
            System.out.println("after DetailView1Iterator vo1.getEstimatedRowCount()="+ vo1.getEstimatedRowCount());
    5.  What's wrong in my implementation?  I don't have no problem to implement such a tree table if using simple master-detail tables view object, but now I have to use such 2 view objects using complex SQL for my requirement and variable bindings are necessary for detail view object although I also think a bit strange by myself.

    Hi Frank,
    Thank you and it can work.
    public void setLowHighSalaryRangeForDetailEmployeesAccessorViewObject(Number lowSalary,
                                                                              Number highSalary) {
            Row r = getCurrentRow();
            if (r != null) {
                RowSet rs = (RowSet)r.getAttribute("EmpView");
                if (rs != null) {
                    ViewObject accessorVO = rs.getViewObject();
                    accessorVO.setNamedWhereClauseParam("LowSalary", lowSalary);
                    accessorVO.setNamedWhereClauseParam("HighSalary", highSalary);
                executeQuery();
    but I have a quesiton in this way. in code snippet, it is first getting current row of current master VO to determine if update variables value of detail VO. in my case, current row is possibly null after executeQuery() of master VO and  I have to change current row manually like below.
    any idea?
                DCIteratorBinding dc = (DCIteratorBinding)ADFUtil.evaluateEL("#{bindings.SSForecastSourceBlockView1Iterator}");
                ViewObject vo = dc.getViewObject();           
                vo.ensureVariableManager().setVariableValue("DateFrom", dateFrom);
                vo.ensureVariableManager().setVariableValue("DateTo", dateTo);
                vo.ensureVariableManager().setVariableValue("ShiftModeCode", shiftModeC);
                vo.ensureVariableManager().setVariableValue("TerminalCode", terminalCode);
                vo.executeQuery();
                vo.setCurrentRowAtRangeIndex(0);
                ((SSForecastSourceBlockViewImpl)vo).synchornizeAccessorVOVariableValues();

  • Parse SQL query and extract source tables and columns

    Hello,
    I have a set of SQL queries and I have to extract the source tables and columns from them.
    For example:
    Let's imagine that we have two tables
    CREATE TABLE T1 (col1 number, col2 number, col3 number)
    CREATE TABLE T2 (col1 number, col2 number, col3 number)
    We have the following query:
    SELECT
    T1.col1,
    T1.col2 + T1.col3 as field2
    FROM T1 INNER JOIN T2 ON T1.col2=T2.col2
    WHERE T2.col1 = 1
    So, as a result I would like to have:
    Order Table Column
    1 T1 col1
    2 T1 col2
    2 T1 col3
    Optionally, I would like to have a list of all dependency columns (columns used in "ON", "WHERE" and "GROUP BY" clauses:
    Table Column
    T1 col2
    T2 col1
    T2 col2
    I have tried different approaches but without any success. Any help is appreciated. Thank you in advance.
    Best regards,
    Beroetz

    I have a set of SQL queries and I have to extract the source tables and columns from them. In a recent db version you can use Re: sql injection question for this.

  • Datasource for SQL Queries

    Hi,
    SQL Server best practices indicates the use of Windows Authentication instead of Mixed Mode.
    In this case, if you need to create reports that connect to the database,you need to add the users accessing the data source to the sql server security.
    For reports that show error logs and table contents do you create a specific domain account for SQL queries and then specify it on the data source?
    Thank you

    Hi Pedro,
    A report server uses credentials to connect to external data sources that provide content to reports or recipient information to a data-driven subscription. You can specify credentials that use Windows Authentication, database authentication, no authentication,
    or custom authentication. When sending a connection request over the network, the report server will either impersonate a user account or the unattended execution account. For more information about the security context under which a connection request is
    made, see
    Data Source Configuration and Network Connections further on in this topic.
    The network environment determines the kinds of connections you can support. By default, when you create an datasoource the credential is "Windows Authentication(Windows integrated security)", as you know, the user must has permission to the server
    and database.
    Each user must have a Windows account. It can be a local account (i.e., an account on the report server) or a trusted domain account. The account must be added as an allowed user to the report server either individually or as part of a group. Furthermore,
    the client application must support Windows integrated security.
    More details information please reference to below article:
    Understanding SQL Server Reporting Services Authentication
    Specify Credential and Connection Information for Report Data Sources
    If you still have any problem, please feel free to ask.
    Regards,
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • Want to write sql queries online

    Hi,
    I want to write and test sql queries online. Because oracle database is too large I do not want to install it on my system. Is there any virtual environment where I can learn sql queries and test without installing it on my local machine?

    SQL Fiddle apparently offers a test bed for various databases including Oracle 11gR2.
    I haven't used it myself but it was highly recommended by SQL Indexing Tutorial | Use The Index, Luke! which is a good SQL performance tutorial.

Maybe you are looking for

  • [OIM 9.1.0.2] Access Policy being evaluated to an OIM user disabled.

    Hi Gurus, I have an Access Policy being evaluated and provisioning resource (AD) to an OIM user disabled. Any tip on what I should take a look? Thanks in advance.

  • How to change the type of a message

    hi all        i can i change an error message to a warning message in mm

  • 2 monitor

    I'm getting a no signal (check connected deivice's power, cable connection, and source seleciton on my TV monitor when I attach my HDMI cable .  It was working probably up to about a week ago then I stared getting this.  Checked the cable works with

  • Restoring 3.x Data Source

    Hi, Iam working on the BI 7.0 system which is new system, need to activate the content and all. So, while replicating the data source all has been replicated in 7.0, want to restore them in 3.x. I was trying from RSDS one by one, but what to know if

  • Portal domain under SunOS render a portlet 2 times without reason?

    Hi, I'm trying to deploy my portal and portlet on a server running under SunOS but what I got there was that my portlet is rendered twice in the portal. It runs perfectly under Windows where it was developed and on another one for test only, but the