SQL summary

DROP TABLE PETS;

CREATE TABLE ANIMALS

(RACE VARCHAR2 (30), MALE NUMBER (3),)

NUMBER (3)) FEMALE;

INSERT. PETS

VALUES ('LAB', 50, 11);

INSERT. PETS

VALUES ('TER', 10, 20);

INSERT. PETS

VALUES ("DOB", 5, 4);

Is it possible to get the output using pure sql next? without sql * plus column orders etc.

RACE Male FEMALE
Come on!54
LAB5011
TER1020
TOTAL6535
% ALL THE6535

Thank you

Dane

WITH DOMESTIC ANIMALS (BREED, MALE, FEMALE)
Did YOU (SELECT ' LABORATORY', 50, 11 FROM dual UNION ALL
SELECT "TER", 10, 20 double UNION ALL
SELECT "DOB", 5, 4 DOUBLE)
SELECT the BOX GROUPING (breed)
WHEN 1 THEN 'TOTAL '.
Of DIFFERENT race
end as breed, sum (male) like sum (female), male as female
Pets
GROUP OF ROLLUP (breed)
UNION ALL
«SELECT ' % ALL THE»
, sum (male) * 100 / sum (nvl(male,0) + nvl(female,0)) LIKE a man
, sum (female) * 100 / sum (nvl(male,0) + nvl(female,0)) AS woman
pets

/

@John: the number of pets may not always 100 if a percentage would be more logical then...

HTH

Tags: Database

Similar Questions

  • Where can I find journal summary for SQL writer please?

    I have Windows update with SQL writer error & the instructions are telling me to go in the SQL summary papers & enter this SQL Server\90\Setup Bootstrap\Log\Hotfix %programfile%\Microsoft but I do not know where to look & am not computer literate - please help!

    There are several newspapers depending on the error.  Here is an article that describes some of the mistakes and where to find the summary papers:http://msdn.microsoft.com/en-us/library/ms143702.aspx.

    I hope this helps.

    Good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • Plans of multiple executions for the same SQL statement

    Dear experts,

    awrsqrpt. SQL shows several plans for a single SQL statement executions. How is it possible that a single SQL statement will be several Plans of executions within the AWR report.

    Here is the output of the awrsqrpt for your reference.

    WORKLOAD REPOSITORY SQL Report
    
    Snapshot Period Summary
    
    DB Name         DB Id    Instance     Inst Num Release     RAC Host
    ------------ ----------- ------------ -------- ----------- --- ------------
    TESTDB          2157605839 TESTDB1               1 10.2.0.3.0  YES testhost1
    
                  Snap Id      Snap Time      Sessions Curs/Sess
                --------- ------------------- -------- ---------
    Begin Snap:     32541 11-Oct-08 21:00:13       248     141.1
      End Snap:     32542 11-Oct-08 21:15:06       245     143.4
       Elapsed:               14.88 (mins)
       DB Time:               12.18 (mins)
    
    SQL Summary                            DB/Inst: TESTDB/TESTDB1  Snaps: 32541-32542
    
                    Elapsed
       SQL Id      Time (ms)
    ------------- ----------
    51szt7b736bmg     25,131
    Module: SQL*Plus
    UPDATE TEST SET TEST_TRN_DAY_CL = (SELECT (NVL(ACCT_CR_BAL,0) + NVL(ACCT_DR_BAL,
    0)) FROM ACCT WHERE ACCT_TRN_DT = (:B1 ) AND TEST_ACC_NB = ACCT_ACC_NB(+)) WHERE
     TEST_BATCH_DT = (:B1 )
    
              -------------------------------------------------------------
    
    SQL ID: 51szt7b736bmg                  DB/Inst: TESTDB/TESTDB1  Snaps: 32541-32542
    -> 1st Capture and Last Capture Snap IDs
       refer to Snapshot IDs witin the snapshot range
    -> UPDATE TEST SET TEST_TRN_DAY_CL = (SELECT (NVL(ACCT_CR_BAL,0) + NVL(AC...
    
        Plan Hash           Total Elapsed                 1st Capture   Last Capture
    #   Value                    Time(ms)    Executions       Snap ID        Snap ID
    --- ---------------- ---------------- ------------- ------------- --------------
    1   2960830398                 25,131             1         32542          32542
    2   3834848140                      0             0         32542          32542
              -------------------------------------------------------------
    
    
    Plan 1(PHV: 2960830398)
    -----------------------
    
    Plan Statistics                        DB/Inst: TESTDB/TESTDB1  Snaps: 32541-32542
    -> % 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)                            25,131       25,130.7     3.4
    CPU Time (ms)                                23,270       23,270.2     3.9
    Executions                                        1            N/A     N/A
    Buffer Gets                               2,626,166    2,626,166.0    14.6
    Disk Reads                                      305          305.0     0.3
    Parse Calls                                       1            1.0     0.0
    Rows                                        371,735      371,735.0     N/A
    User I/O Wait Time (ms)                         564            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)                                 26            N/A     N/A
              -------------------------------------------------------------
    
    Execution Plan
    ------------------------------------------------------------------------------------------------
    | Id  | Operation                    | Name            | Rows  | Bytes | Cost (%CPU)| Time     |
    ------------------------------------------------------------------------------------------------
    |   0 | UPDATE STATEMENT             |                 |       |       |  1110 (100)|          |
    |   1 |  UPDATE                      | TEST            |       |       |            |          |
    |   2 |   TABLE ACCESS FULL          | TEST            |   116K|  2740K|  1110   (2)| 00:00:14 |
    |   3 |   TABLE ACCESS BY INDEX ROWID| ACCT            |     1 |    26 |     5   (0)| 00:00:01 |
    |   4 |    INDEX RANGE SCAN          | ACCT_DT_ACC_IDX |     1 |       |     4   (0)| 00:00:01 |
    ------------------------------------------------------------------------------------------------
    
    
    
    
    Plan 2(PHV: 3834848140)
    -----------------------
    
    Plan Statistics                        DB/Inst: TESTDB/TESTDB1  Snaps: 32541-32542
    -> % 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)                                 0            N/A     0.0
    CPU Time (ms)                                     0            N/A     0.0
    Executions                                        0            N/A     N/A
    Buffer Gets                                       0            N/A     0.0
    Disk Reads                                        0            N/A     0.0
    Parse Calls                                       0            N/A     0.0
    Rows                                              0            N/A     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)                                 26            N/A     N/A
              -------------------------------------------------------------
    
    Execution Plan
    ---------------------------------------------------------------------------------------------
    | Id  | Operation                    | Name         | Rows  | Bytes | Cost (%CPU)| Time     |
    ---------------------------------------------------------------------------------------------
    |   0 | UPDATE STATEMENT             |              |       |       |     2 (100)|          |
    |   1 |  UPDATE                      | TEST         |       |       |            |          |
    |   2 |   TABLE ACCESS BY INDEX ROWID| TEST         |     1 |    28 |     2   (0)| 00:00:01 |
    |   3 |    INDEX RANGE SCAN          | TEST_DT_IND  |     1 |       |     1   (0)| 00:00:01 |
    |   4 |   TABLE ACCESS BY INDEX ROWID| ACCT         |     1 |    26 |     4   (0)| 00:00:01 |
    |   5 |    INDEX RANGE SCAN          | INDX_ACCT_DT |     1 |       |     3   (0)| 00:00:01 |
    ---------------------------------------------------------------------------------------------
    
    
    
    Full SQL Text
    
    SQL ID       SQL Text
    ------------ -----------------------------------------------------------------
    51szt7b736bm UPDATE TEST SET TEST_TRN_DAY_CL = (SELECT (NVL(ACCT_CR_BAL, 0) +
                  NVL(ACCT_DR_BAL, 0)) FROM ACCT WHERE ACCT_TRN_DT = (:B1 ) AND PB
                 RN_ACC_NB = ACCT_ACC_NB(+)) WHERE TEST_BATCH_DT = (:B1 )
    Your contribution is very much appreciated.

    Thank you for taking your time to answer my question.


    Concerning

    Oracle Lover3 wrote:
    How will I know (from Plan 1 and Plan 2) whose execution plan chose for the current run?

    Since you're already on 10.2, you can identify the actual execution plan by checking in V$ SESSION SQL_ID and SQL_CHILD_NUMBER column. This can be used to identify the plan in V$ SQL_PLAN (columns SQL_ID and CHILD_NUMBER) and in 10g, you can use the convenient DBMS_XPLAN. Function DISPLAY_CURSOR for the information of the real plan using these two parameters.

    Kind regards
    Randolf

    Oracle related blog stuff:
    http://Oracle-Randolf.blogspot.com/

    SQLTools ++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676 /.
    http://sourceforge.NET/projects/SQLT-pp/

  • Performance problem in production; Please help me out

    Hi all,

    I'd really appreciate if someone can help me with this.

    Every night, the server's SWAP, Sysadmin add more space disk swap every night and for the last 4 days.
    I run ADDM report from 22:00 to 04:00 (when the server is running out of memory)
    I had the problem of performance of this query:
    RECOMMENDATION 4: SQL Tuning, 4.9% benefit (1329 seconds)
          ACTION: Investigate the SQL statement with SQL_ID "b7f61g3831mkx" for 
             possible performance improvements.
             RELEVANT OBJECT: SQL statement with SQL_ID b7f61g3831mkx and 
             PLAN_HASH 881601692
    I can't find what the problem is and why it is a source of performance problem, could you help me please
    *WORKLOAD REPOSITORY SQL Report*
    
    Snapshot Period Summary
    
    DB Name         DB Id      Instance     Inst Num Release     RAC Host        
    ------------ ----------- ------------ -------- ----------- --- ------------
    ****       1490223503 ****             1 10.2.0.1.0  NO  ****
    
                  Snap Id      Snap Time      Sessions Curs/Sess
                --------- ------------------- -------- ---------
    Begin Snap:      9972 21-Apr-10 23:00:39       106       3.6
      End Snap:      9978 22-Apr-10 05:01:04       102       3.4
       Elapsed:              360.41 (mins)
       DB Time:              451.44 (mins)
    
    SQL Summary                         DB/Inst: ****/****  Snaps: 9972-9978
    
                    Elapsed 
       SQL Id      Time (ms)
    ------------- ----------
    b7f61g3831mkx  1,329,143
    Module: DBMS_SCHEDULER
     GATHER_STATS_JOB
    select /*+ no_parallel(t) no_parallel_index(t) dbms_stats cursor_sharing_exact u
    se_weak_name_resl dynamic_sampling(0) no_monitoring */ count(*),count("P_PRODUCT
    _ID"),count(distinct "P_PRODUCT_ID"),count("NAME"),count(distinct "NAME"),count(
    "DESCRIPTION"),count(distinct "DESCRIPTION"),count("UPC"),count(distinct "UPC"),
    
              -------------------------------------------------------------       
    
    SQL ID: b7f61g3831mkx               DB/Inst: ***/***  Snaps: 9972-9978
    -> 1st Capture and Last Capture Snap IDs
       refer to Snapshot IDs witin the snapshot range
    -> select /*+ no_parallel(t) no_parallel_index(t) dbms_stats cursor_shari...
    
        Plan Hash           Total Elapsed                 1st Capture   Last Capture
    #   Value                    Time(ms)    Executions       Snap ID        Snap ID
    --- ---------------- ---------------- ------------- ------------- --------------
    1   881601692               1,329,143             1          9973           9974
              -------------------------------------------------------------       
    
    
    Plan 1(PHV: 881601692)
    ---------------------- 
    
    Plan Statistics                     DB/Inst: ***/***  Snaps: 9972-9978
    -> % 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,329,143    1,329,142.7     4.9
    CPU Time (ms)                                26,521       26,521.3     0.7
    Executions                                        1            N/A     N/A
    Buffer Gets                                 551,644      551,644.0     1.3
    Disk Reads                                  235,239      235,239.0     1.5
    Parse Calls                                       1            1.0     0.0
    Rows                                              1            1.0     N/A
    User I/O Wait Time (ms)                     233,212            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)                                 71            N/A     N/A
              -------------------------------------------------------------       
    
    Execution Plan
    ---------------------------------------------------------------------------------------------------
    | Id  | Operation               | Name    | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
    ---------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT        |         |       |       | 24350 (100)|          |       |       |
    |   1 |  SORT GROUP BY          |         |     1 |   731 |            |          |       |       |
    |   2 |   PARTITION RANGE SINGLE|         |  8892 |  6347K| 24350   (1)| 00:04:53 |   KEY |   KEY |
    |   3 |    PARTITION LIST ALL   |         |  8892 |  6347K| 24350   (1)| 00:04:53 |     1 |     5 |
    |   4 |     TABLE ACCESS SAMPLE | PRODUCT |  8892 |  6347K| 24350   (1)| 00:04:53 |   KEY |   KEY |
    ---------------------------------------------------------------------------------------------------
     
    
    
    Full SQL Text
    
    SQL ID       SQL Text                                                         
    ------------ -----------------------------------------------------------------
    b7f61g3831mk select /*+ no_parallel(t) no_parallel_index(t) dbms_stats cursor_
                 _sharing_exact use_weak_name_resl dynamic_sampling(0) no_monitori
                 ng */ count(*), count("P_PRODUCT_ID"), count(distinct "P_PRODUCT_
                 ID"), count("NAME"), count(distinct "NAME"), count("DESCRIPTION")
                 , count(distinct "DESCRIPTION"), count("UPC"), count(distinct "UP
                 C"), count("ADV_PRODUCT_URL"), count(distinct "ADV_PRODUCT_URL"),
                  count("IMAGE_URL"), count(distinct "IMAGE_URL"), count("SHIPPING
                 _COST"), count(distinct "SHIPPING_COST"), sum(sys_op_opnsize("SHI
                 PPING_COST")), substrb(dump(min("SHIPPING_COST"), 16, 0, 32), 1, 
                 120), substrb(dump(max("SHIPPING_COST"), 16, 0, 32), 1, 120), cou
                 nt("SHIPPING_INFO"), count(distinct "SHIPPING_INFO"), sum(sys_op_
                 opnsize("SHIPPING_INFO")), substrb(dump(min(substrb("SHIPPING_INF
                 O", 1, 32)), 16, 0, 32), 1, 120), substrb(dump(max(substrb("SHIPP
                 ING_INFO", 1, 32)), 16, 0, 32), 1, 120), count("P_STATUS"), count
                 (distinct "P_STATUS"), sum(sys_op_opnsize("P_STATUS")), substrb(d
                 ump(min(substrb("P_STATUS", 1, 32)), 16, 0, 32), 1, 120), substrb
                 (dump(max(substrb("P_STATUS", 1, 32)), 16, 0, 32), 1, 120), count
                 ("EXTRA_INFO1"), count(distinct "EXTRA_INFO1"), sum(sys_op_opnsiz
                 e("EXTRA_INFO1")), substrb(dump(min(substrb("EXTRA_INFO1", 1, 32)
                 ), 16, 0, 32), 1, 120), substrb(dump(max(substrb("EXTRA_INFO1", 1
                 , 32)), 16, 0, 32), 1, 120), count("EXTRA_INFO2"), count(distinct
                  "EXTRA_INFO2"), sum(sys_op_opnsize("EXTRA_INFO2")), substrb(dump
                 (min(substrb("EXTRA_INFO2", 1, 32)), 16, 0, 32), 1, 120), substrb
                 (dump(max(substrb("EXTRA_INFO2", 1, 32)), 16, 0, 32), 1, 120), co
                 unt("ANALISIS_DATE"), count(distinct "ANALISIS_DATE"), substrb(du
                 mp(min("ANALISIS_DATE"), 16, 0, 32), 1, 120), substrb(dump(max("A
                 NALISIS_DATE"), 16, 0, 32), 1, 120), count("OLD_STATUS"), count(d
                 istinct "OLD_STATUS"), sum(sys_op_opnsize("OLD_STATUS")), substrb
                 (dump(min("OLD_STATUS"), 16, 0, 32), 1, 120), substrb(dump(max("O
                 LD_STATUS"), 16, 0, 32), 1, 120) from "PARTNER_PRODUCTS"."PRODUCT
                 " sample ( 12.5975349658) t where TBL$OR$IDX$PART$NUM("PARTNER_PR
                 ODUCTS"."PRODUCT", 0, 4, 0, "ROWID") = :objn
                 

    Dear friend,

    Why do you think you have problems with shared pool? In the ASH report you are provided, there was just 2.5 medium active sessions and 170 requests during this period, he is very low with swimming pool shared, problems
    you have some queries that use literals, it will be better to replace literals with bind variable if possible, or you can set the init cursor_sharing parameter to force or similar, this is the dynamic parameter.
    But it is not so dramatic problem in your case!

    From ASHES of your report, we can see that top wait events is "CPU + wait for CPU", "RMAN backup & recovery i/o" and "log file sync" and 65% of your database of waiting time. And even in the background waiting events.
    If I understand well report, you have two members in your redo log groups, you have problems with log IO writer speed, check the distribution of files on the disc, newspaper editor is slow causing it to wait for the other sessions. High
    processor can be related to rman compression. Best service can we sea GATHER_STATS_JOB consumes 16% of activity 33% consumes rman and only 21% your applications and also there is something running
    SQL * more under the sys (?) account. There is from the top of the sql page, this is the sql in your application, if I understand correctly, 'scattered db reading file' event indicates that full scans have a place, is it normal that your application? If Yes, then try using
    running in parallel, as we can see in the section "Sessions running PQs Top" your report there is no running in parallel, but as I understand it there are 8 processors, try to use parallel executions or avoid full scans. But consider that
    When you do full scans in parallel PGA memory not used CMS, then decrees setting pga_aggregate_target SGA and increase respectively.

    Is there another application or a program running on the server except oracle?
    Is the performance degradation was strong, I mean yesterday, everything was ok, but today all the evil, or it was good?

    Check the reasons for the slow newspaper writer, it can greatly affect performance.
    Also of 90% of the performance problems generally because of the poor sql, poor execution plans.
    Also if you use automatic memory management, tap Settings, but you must know that in this case the settings will identify the minimum values, this is why define them to lower values in oracle can manage
    entirely.
    Don't increase your SGA at this stage, get the awr report, use @$ORACLE_HOME/rdbms/admin/awrrpt.sql, check your cover shot.

    BUT first, you must change your backup strategy, look at my first post, after that check performance again, before you do that it will be very difficult to help you.

    Good luck

  • Can I make reference to a column of summary in my sql query?

    Basically, the object asking all this. I have a report very complex which has many queries of data related to the "main" request One of these queries of linked data has a subquery that it contains that references the primary key of the main request. I can't do the data binding (I can, but it's useless) using this field, because it is a subquery that has the link and this particular link. I tried to create a summary column that gives me the 'first' (and the only one, so it is safe) to reference it in the SQL block, but no go. I think that it is not still possible? Anyone have any ideas? At the moment I'm referencing that I have in a PL/SQL block (: CS_PK), but it is just considered as a parameter that never happened. Does not read the analytical column. Hmmm... I'm stuck.

    Try it with the datalink 'column-less ". Lets say query one is named Q1 with his group G1 and query is named two Q2 with the Group G2. Now create a data link between G1 and G2 do not drag a column of G1 in G2, but dragging the group header of the G1 to G2 od group header.

    Now, the detail query must be executed once for each master and you should be able to reference the value master directly in your auxiliary request.

    I hope this helps.

  • SQL Help: How to collect summary number in group by?


    Hello

    I have the following table:

    create table tb_class_info (classNbr number (5), number (2) of ClassType, classTeacherNbr number (4));

    insert into tb_class_info values (101, 1, 12);

    insert into tb_class_info values (001, 2, 12);

    insert into tb_class_info_values (001, 2, 13);

    insert into tb_class_info_values (002, 2, 12);

    insert into tb_class_info_values (002, 2, 12);

    I would like to get statistics on the cnt, cnt for classType = 2 classTeacherNbr classNbr. I expect to have the following results:

    classNbr classType2Cnt classTeacherCnt

    101                0                         0

    001                2                          2

    002                2                          1

    The following SQL code I use:

    SELECT classNbr,

    SUM (CASE when classType = 2 THEN 1 ELSE END 0) as classTypeCnt,

    SUM (CASE when classType = 2 SO unique classTeacherNbr ELSE 0 END) as classTeacherCnt

    OF tb_class_info

    GROUP BY classNbr;

    However, I have the ' ORA-00905: lack of keyword ' error. Any suggestion on this subject?

    Thanks for your help!

    Select classnbr

    sum (case when classtype = 2 then 1 end)

    , count (distinct case when classtype = 2 then teachernbr end)

    of tb_class_into

    Classnbr group;

  • Summary of a table in SQL

    I need a print request overview of the table in a single query without using PLSQL...

    List of tables

    with t as

    (

    Select 1 table_number 't1' double table_name

    Union of all the

    Select 2 table_number, 't2' double table_name

    Union of all the

    Select 2 table_number, "t3" double table_name

    )

    Select * from t;

    Table1:

    with t1 as

    (

    Select country_code 'US', 'SYSTEM1' source, 1 emp_num, "Unprocessed" status of double

    Union of all the

    Select country_code 'India', 'SYSTEM1' source, emp_num 2, "Valid" status of double

    Union of all the

    Select 'India' country_code 'SYSTEM2' source, 3 emp_num, 'Error' State of double

    Union of all the

    Select country_code 'India', 'SYSTEM2' source, emp_num 4, "Valid" status of double

    )

    Select * from t1;

    I need a query where with the input as table_number parameter...

    for example 1... I want the output should be grouped by table_name, country_code and source

    output like

    table_name country_code source total_records valid_records error_records not_processed_records valid_records_percentage

    T1 India 1 1 0 0 100 SYSTEM1

    T1 India 2 1 1 0 50 SYSTEM2

    t1         US          SYSTEM1  1             0             0              1                     0

    Total                                     4             2             1              1                     50

    and I total need for them in the last record

    You are looking for the name of the table dynamically? In this case, try this.

    SQL > select * from t;

    TABLE-NAME TABLE_NUMBER
    ------------ -----------
    1 t1
    2 t2
    2 t3

    SQL > select * from t1;

    EMP_NUM STATUS OF THE SOURCE COUNTRY_CODE
    ------------- ------- ---------- -------------
    Untreated SYSTEM1 US 1
    The India SYSTEM1 2 valid
    The India SYSTEM2 error 3
    The India SYSTEM2 4 valid

    SQL > select case when grouping_id (table_name)
    2 + grouping_id (country_code)
    3 + grouping_id (source_) = 0 then table_name
    4 other 'Total '.
    5 end table_name


    6, country_code
    7, source_
    8, count (*) total_record
    9, County (decode (status, "Unprocessed", 1)) not_processed
    10, County (decode (status, "Valid", 1)) valid
    11, County (decode (status, 'Error', 1)) error_
    12 years of)
    13. Select t.table_name
    14, t1.country_code
    15, t1.source_
    16, t1.emp_num
    17, t1.status
    18 of)
    19 select table_name
    20, dbms_xmlgen.getxmltype ("select * from ' |") table_name) xml_output
    21 t
    22 where table_number = 1
    23                   ) t
    24, xmltable
    25                   (
    26 "/ LINES/LINES" adoption t.xml_output
    27 columns
    path varchar2 (100) of 28 country_code "COUNTRY_CODE"
    path of varchar2 (100) source_ 29 "SOURCE."
    path of number 30 emp_num "EMP_NUM"
    path varchar2 (100) status 31 'STATUS '.
    32                   ) t1
    33         )
    Group 34
    35 by rollup
    36         (
    table_name 37
    38, country_code
    39, source_
    40         )
    41 after having grouping_id (table_name)
    42 + grouping_id (country_code)
    43 + grouping_id (source_) in (0, 3);

    TABLE_NAME COUNTRY_CODE SOURCE_ TOTAL_RECORD NOT_PROCESSED VALID ERROR_
    ----------- ------------- ---------- ------------ ------------- ---------- ----------
    t1          US            SYSTEM1               1             1          0          0
    T1 India SYSTEM1 1 0 1 0
    T1 India 2 0 1 1 SYSTEM2
    Total                                           4             1          2          1

    SQL >

    To do all the table that are passed must have the same structure. But then comes the question why you have different tables with the same structure

  • a summary of the set which are accepted by the developer SQL commands...

    Sorry, I searched for a list of commands that are used by the SQL Developer such as "game check out | on", etc.

    Can someone point me to a list of these commands (equivalent to SQL * more set controls)?

    Thanks in advance!
    Tom

    Hi Tom,

    Try help | Table of contents | SQL Developer concepts and use. With the help of the SQL worksheet | SQL * more statements support and not supported in the SQL worksheet.

    What you see depends on your version of SQL Developer. Over time, SQL * more supported continues to improve.

    Kind regards
    Gary Graham
    SQL development team

  • Microsoft SQL Server 2005 Express Edition - Configuration has failed.

    Time: 06/10/2010 13:16:39.639

    Number of KB: KB954606

    Computer: ComputerName

    OS version: Professional (Build 7600)

    Language package: 1033 (ENU)

    Platform: x 86

    Package SP level: 2

    Package Version: 3073

    Specified command line parameters:

    Cluster installation: No.

    **********************************************************************************

    Prerequisites Check & status

    SQLSupport: adopted

    **********************************************************************************

    Products detected language Patch level Platform Edition

    SQL Server Database Services 2005 (THUBDBSERVER) SP2 ENU 2005.090.3042.00 x 86 EXPRESS

    Tools SQL Server and Workstation components 2005 ENU 9.2.3042 SP2 x 86 EXPRESS

    **********************************************************************************

    Disqualified & reason products

    Reason of product

    **********************************************************************************

    File-locking process

    Process name function Type PID username

    **********************************************************************************

    Product Installation status

    Product: SQL Server Database Services 2005 (THUBDBSERVER)

    (Previous) product version: 3042

    Version of the product (Final):

    Status: failed

    Log file: C:\Program Files (x 86) \Microsoft SQL Server\90\Setup Bootstrap\LOG\Hotfix\SQL9_Hotfix_KB954606_sqlrun_sql.msp.log

    SQL Express features:

    Error number: 1601

    Error description: cannot install Windows Installer MSP file

    ----------------------------------------------------------------------------------

    Product: Tools of SQL Server and Workstation components 2005

    (Previous) product version: 3042

    Version of the product (Final):

    Status: failed

    Log file: C:\Program Files (x 86) \Microsoft SQL Server\90\Setup Bootstrap\LOG\Hotfix\SQLTools9_Hotfix_KB954606_sqlrun_tools.msp.log

    SQL Express features:

    Error number: 1601

    Error description: cannot install Windows Installer MSP file

    ----------------------------------------------------------------------------------

    **********************************************************************************

    Summary

    One or several products could not install, see above for more details

    Exit Return Code: 1601

    Thank you Henry http://www.RedandBlueGraphics.com

    Try to re-post in the SQL Server Setup & Upgrade forum for appropriate assistance: http://social.msdn.microsoft.com/forums/en-US/sqlsetupandupgrade/threads/ ~ Robear Dyer (PA Bear) ~ MS MVP (that is to say, mail, security, Windows & Update Services) since 2002 ~ WARNING: MS MVPs represent or work for Microsoft

  • I try to install the update update of security for SQL 2005 service pake 3. I have vista 2 this update applies to my computer I get an error code ff or c0000005

    I try to install the update update of security for SQL 2005 service pake 3.  I have vista 2 this update applies to my computer I get an error code ff or c0000005

    1. navigate to the following registry key (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\Setup)

    2. find the "Summary" (REG_DWORD), and then change its decimal value from 1 to 0

    3. restart the computer

    4. install the same update.  It should work.

  • SQL Server Setup fails due to error XML Serializer

    I tried (19 times) to install SQL Server 2008 Express on my Windows XP Home Edition with SP 3. Whenever it produces a "generation of the document XML error". I contacted the support for the software vendor of the program that requires SQL Server must be installed. There were attributed to an error in the XML serializer in Windows, they do not have the expertise to help me fix it. How can I fix it?

    I have not messed with the "bowels" of Windows or edited before registry keys (which many solutions to similar questions seem to demand), so I'll need pretty detailed instructions.

    The summary of the last attempt log is:
    Summary of all:
    Final result: failed: see details below
    Exit code (decimal):-2068774911
    Exit facility code: 1201
    Exit error code: 1
    Exit message: there was an error generating the XML document.
    Start time: 2009-10-15 10:45:31
    End time: 2009-10-15 10:45:56
    Requested action: RunRules

    Computer properties:
    The machine processor count: 1
    OS version: Windows XP
    Operating system service pack: Service Pack 3
    Region of the BONE: United States
    OS language: English (United States)
    Operating system architecture: x 86
    Process architecture: 32-bit
    Cluster OS: No.

    The package properties:
    Description: SQL Server Database Services 2008
    SQLProductFamilyCode: {628F8F38-600E-493D-9946-F4178F20A8A9}
    ProductName: SQL2008
    Type: RTM
    Version: 10
    SPLevel: 0
    Installation location: c:\3c69b307a229367a4cccd3b804\x86\setup\
    Edition of installation: EXPRESS

    The user input parameters:
    ACTION: RunRules
    CONFIGURATIONFILE:
    FEATURES: SQL, TOOLS
    HELP: false
    INDICATEPROGRESS: false
    INSTANCENAME: SQLEXPRESS
    MEDIASOURCE: c:\3c69b307a229367a4cccd3b804\
    QUIET: true
    QUIETSIMPLE: false
    RULES: GlobalRules
    X 86: false

    Configuration file: C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20091015_104514\ConfigurationFile.ini

    Detailed results:

    Rules with failures:

    Global rules:

    There is no scenario-specific rules.

    Carry-over rules file: report of result of rule file is not available.

    Exception of summary:
    What follows is an exception stack listing the exceptions in outermost to deep order
    Inner exceptions are being indented

    Exception type: Microsoft.SqlServer.Chainer.Infrastructure.ChainerInfrastructureException
    Message:
    There was an error generating the XML document.
    Data:
    DisableWatson = true
    Battery:
    at Microsoft.SqlServer.Chainer.Infrastructure.DataStoreService.SerializeObject (String rootPath, Object objectToSerialize, Boolean saveToCache)
    at Microsoft.SqlServer.Chainer.Infrastructure.DataStoreService.SerializeObject (object objectToSerialize)
    at Microsoft.SqlServer.Chainer.Infrastructure.InputSettingService.SaveInputSettingValueToObject (InputSettingInfo inputSettingInfo, values from list 1)
    at Microsoft.SqlServer.Chainer.Infrastructure.InputSettingService.SaveParsedArgumentsIntoInputSettingStore (InputSettingSource source, dictionary 2 parsedArguments, Boolean chainerSetting, Boolean ignoreSettingsForNotAllowedScnearios)
    at Microsoft.SqlServer.Chainer.Infrastructure.InputSettingService.ProcessCommandLineArguments (String [] commandLineArguments, Boolean chainerSetting)
    at Microsoft.SqlServer.Configuration.BootstrapExtension.ProcessFeatureCommandLineArgumentsAction.ExecuteAction (String actionId)
    at Microsoft.SqlServer.Chainer.Infrastructure.Action.Execute (String actionId, TextWriter errorStream)
    at Microsoft.SqlServer.Setup.Chainer.Workflow.ActionInvocation.InvokeAction (WorkflowObject metabase, TextWriter statusStream)
    at Microsoft.SqlServer.Setup.Chainer.Workflow.PendingActions.InvokeActions (WorkflowObject metaDb, TextWriter loggingStream)
    Type of the internal exception: System.InvalidOperationException
    Message:
    There was an error generating the XML document.
    Battery:
    to System.Xml.Serialization.XmlSerializer.Serialize (XmlWriter xmlWriter, Object o, namespaces in XmlSerializerNamespaces, String encodingStyle, string id)
    to System.Xml.Serialization.XmlSerializer.Serialize (TextWriter textWriter, Object o, XmlSerializerNamespaces namespaces)
    to System.Xml.Serialization.XmlSerializer.Serialize (TextWriter textWriter, Object o)
    at Microsoft.SqlServer.Chainer.Infrastructure.DataStoreService.SerializeObject (String rootPath, Object objectToSerialize, Boolean saveToCache)
    The inner exception type: System.Security.Cryptography.CryptographicException
    Message:
    The system cannot find the specified file.
                           
    Battery:
    at System.Security.Cryptography.ProtectedData.Protect (Byte [], Byte [] optionalEntropy, DataProtectionScope scope userData)
    to Microsoft.SqlServer.Common.SqlSecureString.WriteXml (XmlWriter writer)
    to System.Xml.Serialization.XmlSerializationWriter.WriteSerializable (serializable IXmlSerializable, String name, String ns, Boolean isNullable, Boolean wrapped)
    at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterSqlEngineSetupPublic.Write6_SqlEngineSetupPublic (String n, String ns, SqlEngineSetupPublic o, Boolean isNullable, Boolean needType)
    at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterSqlEngineSetupPublic.Write7_SqlEngineSetupPublic (Object o)

    The relevant error is:

    The inner exception type: System.Security.Cryptography.CryptographicException
    Message:
                            The system cannot find the specified file.
                           
    Battery:
    at System.Security.Cryptography.ProtectedData.Protect (Byte [], Byte [] optionalEntropy, DataProtectionScope scope userData)
    to Microsoft.SqlServer.Common.SqlSecureString.WriteXml (XmlWriter writer)
    to System.Xml.Serialization.XmlSerializationWriter.WriteSerializable (serializable IXmlSerializable, String name, String ns, Boolean isNullable, Boolean wrapped)
    at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterSqlEngineSetupPublic.Write6_SqlEngineSetupPublic (String n, String ns, SqlEngineSetupPublic o, Boolean isNullable, Boolean needType)
    at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterSqlEngineSetupPublic.Write7_SqlEngineSetupPublic (Object o)

    Looks like it's either just a missing file or you do not have permission to open it. Are you an administrator on the system you are trying to install this on? Have you tried all the options found here CIW (http://blogs.msdn.com/sqlexpress/archive/2009/06/15/installing-sql-server-2008-guidance.aspx)?

  • Partitions don't synchronize only not - Oracle SQL Developer 4.1.3.20

    Hello

    First of all, thanks a lot for developers for this great tool.

    I use the Data Modeler which comes with Oracle SQL Developer 4.1.3.20.

    In the 12 c database, I created the following table:

    CREATE

    TABLE MMOURA. TEST_TABLE

    (

    NUMBER OF ID_TEST_TABLE (10) NOT NULL

    DATE_TEST_TABLE DATE NOT NULL

    )

    ORGANIZATION HEAP PCTFREE 10

    LOGGING NOCOMPRESS NO INMEMORY

    NOCACHE NOPARALLEL NOROWDEPENDENCIES DISABLE THE MOVEMENT OF THE LINE;

    I import with Data Modeler and add the partition:

    CREATE

    TABLE MMOURA. TEST_TABLE

    (

    NUMBER OF ID_TEST_TABLE (10) NOT NULL

    DATE_TEST_TABLE DATE NOT NULL

    )

    ORGANIZATION HEAP PCTFREE 10 TABLESPACE SYSTEM NOT LOGGING NOCOMPRESS NO INMEMORY RANGE PARTITION

    (

    DATE_TEST_TABLE

    )

    INTERVAL OF

    (

    NUMTOYMINTERVAL (1, 'MONTH')

    )

    (

    PARTITION P_BEFORE_2010 VALUES LESS THAN (TO_DATE (JANUARY 1, 2010 ',' DD/MM/YYYY "")) NOCOMPRESS

    )

    NOCACHE NOPARALLEL NOROWDEPENDENCIES DISABLE THE MOVEMENT OF THE LINE;

    So I can create a partition and generates the correct code.

    I click on "Synchronize data dictionary with model" and see the differences with the model and the database.

    In the models 'compare', 'Physical Details' is red. 'Partition' is red, "Selected" are marked, "Source table: TEST_TABLE ' is YES and" target Table: TEST_TABLE "is no.

    "Partitioning" is marked, and I can see the new partition "P_BEFORE_2010."

    teste_partition_chamado_oracle.png

    But when I click on 'Overview of DOF', theres no changes:

    -Generated by Oracle SQL Developer Data Modeler 4.1.3.901

    -in: 2016-01-14 14:19:50 BRST

    -site: database Oracle 12 c

    -type: Oracle Database 12 c

    -Oracle SQL Developer Data Model Summary Report:

    --

    -CREATE TABLE 0

    -CREATION OF INDEX 0

    ...

    ...

    In the tool preferences, model, synchronization, it is marked:

    FUNCTION

    PACKAGE

    PROCEDURE

    ROLE

    SEQUENCE

    SYNONYM

    TABLESPACE

    In "Import Options", it is marked:

    Partitions

    Triggered

    What I am doing wrong? Is this some sort of bug?

    Hi Marcio,

    I'm afraid that data Modeler does not "DOF Preview" statements for changes in the distribution.

    Kind regards

    David

  • Unable to connect the SQL Developer PDB

    Hello

    I am unable to connect to my pdb1 for SQL Developer.

    Oracle@Solaris:~$ lsnrctl status

    LSNRCTL for Solaris: Version 12.1.0.2.0 - Production on 4 January 2016 13:50:37

    Copyright (c) 1991, 2014, Oracle.  All rights reserved.

    Connection to (ADDRESS = (PROTOCOL = tcp)(HOST=) (PORT = 1521))

    STATUS of the LISTENER

    ------------------------

    Alias LISTENER

    For Solaris TNSLSNR version: Version 12.1.0.2.0 - Production

    Start date 4 January 2016 10:57:08

    Uptime 0 days 2 h 53 min 29 s

    Draw level off

    Security ON: OS Local Authentication

    SNMP OFF

    Parameter Listener of the /u01/12.1.0/grid/network/admin/listener.ora file

    The listener log file /U01/app/grid/diag/tnslsnr/Solaris/listener/alert/log.XML

    Summary of endpoints listening...

    (DESCRIPTION = (ADDRESS = (PROTOCOL = tcp)(HOST=solaris) (PORT = 1521)))

    (DESCRIPTION = (ADDRESS = (PROTOCOL = ipc) (KEY = EXTPROC1521)))

    Summary of services...

    Service '+ ASM' a 1 instance (s).

    Instance '+ ASM' READY State, has 1 operation for this service...

    Service 'cdb01' has 1 instance (s).

    'Cdb01' instance, State LOAN, has 1 operation for this service...

    Service 'cdb01XDB' has 1 instance (s).

    'Cdb01' instance, State LOAN, has 1 operation for this service...

    Service "Pdb1" has 1 instance (s).

    'Cdb01' instance, State LOAN, has 1 operation for this service...

    The command completed successfully

    Oracle@Solaris:~$

    SQL Developer:

    Status: Failure-Test failed: listener refused the connection with the following error:

    ORA-12505, TNS:listener is not currently of SID given in connect descriptor

    Type of connection is that fundamental role is SYSDBA

    But I can connect to my CBD01 of SQL Developer.

    //

    Thank you

    Christophe

    SQL Developer:

    Status: Failure-Test failed: listener refused the connection with the following error:

    ORA-12505, TNS:listener is not currently of SID given in connect descriptor

    As another reviewer said Oracle 12 c requires SERVICE_NAME and no SID to connect to the PDB files.

    http://www.Oracle.com/technetwork/articles/database/multitenant-part1-PDBs-2193987.html

    What is a database of the container

    So, what is the big advantage in this configuration, you may ask? Couldn't we have just created several ordinary vanilla instead of several PDB databases? Yes, we could have; but each of these 'plain vanilla' databases would have then his own load of instance (process and memory). PDB do not have an instance associated with them, eliminating this overload. Let's look at the installer with an example. Suppose you have a CBD (database container - the real database that hosts the other PDB files) called CONA, who has a calledPDB1 of the PDB. If you check the Oracle instance, you will see that there is one - that of the CBD. First, let's check the ORACLE_SID:

    [oracle@prosrv1 ~]$ echo $ORACLE_SID CONA
    

    That's all. There is only a single SID; not one for each PDB. Then we will check the process, especially very important that known as 'pmon ":

    See this last sentence above? See this line in the status of listening port you have posted?

    Service "Pdb1" has 1 instance (s).

    Pdb1 has a 'service' - a SERVICE_NAME allows to connect to him and all other PDB files.

  • Question of the ODI - java.sql.SQLException: unexpected token :) in select [...]

    Hello

    I use ODI 10.1.3.6.10 and get the error message below when a package is run. This package is used to load it please could you help me solve this problem.

    org.apache.bsf.BSFException: exception of Jython:

    Traceback (innermost last):

    "< String >" file, line 24, in there?

    java.sql.SQLException: unexpected token :) in the statement [select...]

    Also, I am getting below the exception in other packaging even though it is running without failure.

    org.apache.bsf.BSFException: exception of Jython:

    Traceback (innermost last):

    "< String >" file, line 2, in there?

    Essbase extract summary data:

    Number of rows processed successfully: 1344

    Number of lines rejected: 0

    Thank you

    Michel K

    Select * from RATES where (1 = 1) and (ACCOUNT = 'RATE')

    (PERIOD and)<=>

    And (YEAR =)

    According to the statement select in the error message above it seems that the filter for the PERIOD and YEAR settings are not correctly and this causes the SQL statement syntax error.

    How is the critria to filter for these fields is the value? that is pre-programmed, through variables etc.

  • AWR SQL Report does not report the stats

    AWR report only stats beyond a certain level? I have a statement select simple I know is running (executions of v$ sql increases), but when I run a report AWR SQL (awrsqrpt), it says "no data exists for this section of the report.

    Snap Id Snap time Sessions Curs/Sess

    --------- ------------------- -------- ---------

    BEGIN Snap: 370936 10 June 15 07:00:24 856 36.1

    End Snap: 370937 10 June 15 07:20:26 881 38.9

    Elapsed time: 20.02 (mins)

    DB time: 754.82 (min.)

    Summary of SQL DB/Inst: CAMPRD/camprd snaps: 370936-370937

    There is no data for this section of the report.

    -------------------------------------------------------------

    SQL ID: 84kfv4p500pgh DB/Inst: CAMPRD/camprd Snaps: 370936-370937

    There is no data for this section of the report.

    -------------------------------------------------------------

    Full text of SQL

    There is no data for this section of the report.

    I ran the report on the last 4 days and reports

    ORA-20025: SQL 84kfv4p500pgh ID does not exist for this database instance.

    and yet, the executions of V$ SQL continues to increase

    Thank you

    Ian

    CWA only captures statements considered to be Top N (DBA_HIST_WR_CONTROL. TOPNSQL)

    You can use DBMS_WORKLOAD_REPOSITORY. ADD_COLORED_SQL sort AWR it will include

Maybe you are looking for