DBMS_ADVISOR.quick_tune

Hi,
Iam trying to execute the following in my database.
BEGIN
DBMS_ADVISOR.quick_tune(
advisor_name => DBMS_ADVISOR.SQLACCESS_ADVISOR,
task_name => 'emp_tune',
attr1 => 'Delete from employee where emp_id= 400001 and dept = 5 and status = ''ABORTED'' );
END;
SET LONG 100000
SET PAGESIZE 50000
SELECT DBMS_ADVISOR.get_task_script('emp_tune') AS script FROM dual;
SET PAGESIZE 24
I am getting only the following as output.Why is it not displaying any tuning suggestions?Can anyone pls guide me since iam using this for the first time.
SCRIPT
Rem SQL Access Advisor: Version 11.1.0.7.0 - Production
Rem
Rem Username: EMPUSER
Rem Task: emp_tune
Rem Execution date:
Rem

Hi,
Iam trying to learn about DBMS_ADVISOR.This query is taking more elapsed time.So used this query.One more issue is as follows
begin
DBMS_ADVISOR.IMPORT_SQLWKLD_STS('MY_STS_WORKLOAD', 'MY_SQL_TUNING_SET', 'NEW', 1, :saved_stmts, :failed_stmts);
end;
ERROR at line 1:
ORA-13751: "SQL Tuning Set" "MY_SQL_TUNING_SET" does not exist for owner "SYS" or user "SYS" does not have permission to access the "SQL Tuning
Set".
How do i give permission?

Similar Messages

  • DBMS_ADVISOR

    dba user
    ========
    i have given
    GRANT ADVISOR TO user1;
    in normal user
    =======
    BEGIN
    sys.DBMS_ADVISOR.quick_tune(
    advisor_name => DBMS_ADVISOR.SQLACCESS_ADVISOR,
    task_name => 'aa_quick_tune',
    attr1 => 'SELECT e.* FROM aa e ');
    END;
    select sys.DBMS_ADVISOR.GET_TASK_REPORT ('aa_quick_tune') from dual;
    it returns the following errors
    ===================
    ORA-13699: Advisor feature is not currently implemented.
    ORA-06512: at "SYS.PRVT_ADVISOR", line 2043
    ORA-06512: at "SYS.DBMS_ADVISOR", line 560
    ORA-06512: at line 1
    please help me what is wrong here..

    Hi,
    CREATE DIRECTORY advisor_results AS 'dir_path';
    exec DBMS_ADVISOR.CREATE_FILE  
            DBMS_ADVISOR.GET_TASK_SCRIPT('task_name'),
            'ADVISOR_RESULTS',
            'script_name.sql'
            ); https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&doctype=BULLETIN&id=259188.1
    BR,
    IM

  • Problem in QUICK TUNE advisor

    begin
    DBMS_ADVISOR.QUICK_TUNE(DBMS_ADVISOR.SQLACCESS_ADVISOR,'my task','select * from sadat.test');
    end;
    This code give these errors:
    ORA-13600: error encountered in Advisor
    QSM-00784: the table SH.% referenced in the list SH.% is invalid for parameter
    VALID_TABLE_LIST
    ORA-06512: at "SYS.PRVT_ACCESS_ADVISOR", line 1501
    ORA-06512: at "SYS.WRI$_ADV_SQLACCESS_ADV", line 176
    ORA-06512: at "SYS.PRVT_ADVISOR", line 2594
    ORA-06512: at "SYS.DBMS_ADVISOR", line 726
    can anyone help me?

    begin
    BMS_ADVISOR.QUICK_TUNE(DBMS_ADVISOR.SQLACCESS_ADVISOR,
    'my task','select * from sadat.test');
    end;
    dot "." between sadat and test is problem use following , it will work
    exec DBMS_ADVISOR.QUICK_TUNE(DBMS_ADVISOR.SQLACCESS_ADVISOR, 'my task','select * from sadat'||'.'||'test');
    Virag

  • Using loop in dbms_advisor Package

    Dears,,
    I used dbms_advisor package as following below
    dbms_advisor.create_object
    task_name => name,
    object_type => 'TABLE',
    attr1 => 'HR',
    attr2 => 'Employees',
    attr3 => NULL,
    attr4 => NULL,
    attr5 => NULL,
    object_id => obj_id
    what i need is to use loop to retrieve all tables at once then use them one by one in the script above without inserting table name myself.
    In another meaning (See the following):
    * loop to retrieve all tables
    * dbms_advisor.create_object
    task_name => name,
    object_type => 'TABLE',
    attr1 => 'HR',
    attr2 => 'TAB', Which TAB retrieved from loop one by one by itself
    attr3 => NULL,
    attr4 => NULL,
    attr5 => NULL,
    object_id => obj_id
    * end loop;
    How can i make this please?
    Thanks & Regards,,
    Edited by: . . Oracle DBA . . on Apr 10, 2011 5:56 AM

    . . Oracle DBA . . wrote:
    How can i make this please?
    begin
        for v_rec in (select owner,table_name from dba_tables) loop
          dbms_advisor.create_object(
                                     task_name => v_rec.owner || '_' || v_rec.table_name,
                                     object_type => 'TABLE',
                                     attr1 => v_rec.owner,
                                     attr2 => v_rec.table_name,
                                     attr3 => NULL,
                                     attr4 => NULL,
                                     attr5 => NULL,
                                     object_id => obj_id
        end loop;
    end;
    /SY.

  • How to get a create a script from dbms_advisor.create_file

    Hi
    I Used the dbms_advisor.tune_mview to get the tuned materialised view.
    I can see the task number and the query it generated.But i want to have it in a text file.So i try to implement the dbms_advisor.create_file package
    i have a directory /export/home for which i have access to it
    so i gave
    exec dbms_advisor.create_file(dbms_advisor.get_task_script('task_5'),'/export/home','mview.txt')
    But when i ran this,it gave me invalid directory path error
    can you help me in this

    Oracle is expecting the Database Directory name instead of the OS Directory path.
    You need to create the directory as Database Directory. Then use the Database Directory name in the exec command instead of the full OS directory path.
    e.g
    SQL>create or replace directory my_db_dir as '/export/home';
    SQL>exec dbms_advisor.create_file(dbms_advisor.get_task_script('task_5'),'my_db_dir','mview.txt');

  • DBMS_ADVISOR execute task

    Since the upgrade from Oracle 10 to 11 I see that DBMS_ADVISOR.EXECUTE_TASK() fails with error message:
    ORA-01843: not a valid month
    ORA-06512: at "SYS.DBMS_ADVISOR", line 201
    ORA-06512: at line 30I tried to look in dbmsadv.sql but couldn't find the reason. It used to work with Oracle 10.

    Could someone give me some suggestion as to why I am getting invalid month? Below is my sqlset. This worked fine with 10g:
    spool output.dat
    --Create SQL Workload - easily done with the statements gathered in a snapshot.
    --For example, from 7am to 8am, snapid range is 3153 - 3154
    #Use this for new SQLSET
    exec DBMS_SQLTUNE.DROP_SQLSET('E_TEST_SQLSET');
    exec DBMS_SQLTUNE.CREATE_SQLSET('E_TEST_SQLSET');
    declare
      baseline_ref_cursor DBMS_SQLTUNE.SQLSET_CURSOR;
    begin
      open baseline_ref_cursor for
         select value(p) from table (DBMS_SQLTUNE.SELECT_WORKLOAD_REPOSITORY(9027, 9029,  'execut
    ions > 1 and disk_reads > 100', NULL, 'disk_reads')) p;
      DBMS_SQLTUNE.LOAD_SQLSET('E_TEST_SQLSET', baseline_ref_cursor);
    end;
    --To see what qualifies for analysis execute the following
    set long 1024
    select SQL_TEXT from table(DBMS_SQLTUNE.SELECT_SQLSET('E_TEST_SQLSET'));
    --To analyize the tuning set:
    VARIABLE name VARCHAR2(20)
    begin
      :name := 'E_TEST_WORKLOAD';
      :task_name := 'E_SQLACCESS_TASK';
      DBMS_ADVISOR.DELETE_TASK (:task_name);
      DBMS_ADVISOR.DELETE_SQLWKLD(:name);
      DBMS_ADVISOR.CREATE_SQLWKLD(:name);
    end;
    variable saved_stmts NUMBER
    variable failed_stmts NUMBER
    begin
      DBMS_ADVISOR.IMPORT_SQLWKLD_STS('E_TEST_WORKLOAD', 'E_TEST_SQLSET', 'NEW', 1, :saved_st
    mts, :failed_stmts);
    end;
    PRINT saved_stmts
    PRINT failed_stmts
    VARIABLE task_id NUMBER
    VARIABLE task_name VARCHAR2(255)
    begin
           :task_name := 'E_SQLACCESS_TASK';
           DBMS_ADVISOR.CREATE_TASK ('SQL Access Advisor', :task_id, :task_name);
    end;
    PRINT task_id
    --Now we need to associate the SQL Workload with the Tuning Task:
    begin
        DBMS_ADVISOR.ADD_SQLWKLD_REF('E_SQLACCESS_TASK', 'E_TEST_WORKLOAD');
    end;
    PRINT task_name
    --Now execute the advisor task
    begin
           DBMS_ADVISOR.EXECUTE_TASK('E_SQLACCESS_TASK');
         end;
    SELECT rec_id, action_id, substr(command,1,30) AS command
         FROM user_advisor_actions
         WHERE task_name = :task_name
         ORDER BY rec_id, action_id;
    create directory advisor_results as '/tmp/tunedir';
    exec DBMS_ADVISOR.CREATE_FILE(DBMS_ADVISOR.GET_TASK_SCRIPT(:task_name), 'DUMPDIR', 'sts_scrip
    t.sql');
    -- Rank based on cost
    SELECT r.type, r.Rank, r.benefit, f.impact_type, f.impact, f.message
    FROM dba_advisor_recommendations r, dba_advisor_findings f
    WHERE r.task_name = 'TASK_4502' AND r.finding_id = f.finding_id AND r.task_id =  f.task_id
    ORDER BY r.rank ASC, r.benefit DESC;I get
    TASK_NAME
    E_SQLACCESS_TASK
    begin
    ERROR at line 1:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-01843: not a valid month
    ORA-06512: at "SYS.DBMS_ADVISOR", line 201
    ORA-06512: at line 2

  • Can DBMS_ADVISOR package be used for SQL Tuning Advisor ?

    Can DBMS_ADVISOR package be used for SQL Tuning Advisor ?

    SQL> SELECT * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    PL/SQL Release 11.1.0.6.0 - Production
    CORE    11.1.0.6.0      Production
    TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
    NLSRTL Version 11.1.0.6.0 - Production

  • How to estimate size of dimension & cube

    Hi,
    Is there any guideline avialable to estimate the space required for a dimension or for a cube? I mean if a dimension table is of 200GB, how much space I will be needing to create a dimension in analytic workspace?
    Also, when we refresh the dimension/cube, are used spaces freed and re-used?
    Thanks a lot in advance for your help.
    AKG

    You could try using the new 10g diagnostisc tuning advisor : ADDM
    In SQLPlus do the following:
    1) exec dbms_workload_repository.create_snapshot();
    2) run your AWM build
    3) exec dbms_workload_repository.create_snapshot();
    4) run the following script:
    set long 1000000
    set pagesize 50000
    column get_clob format a80
    spool tuning_report.txt
    select dbms_advisor.get_task_report(task_name, 'TEXT', 'ALL')
    as ADDM_report
    from dba_advisor_tasks
    where task_id=(
    select max(t.task_id)
    from dba_advisor_tasks t
    , dba_advisor_log l
    where t.task_id = l.task_id
    and t.advisor_name='ADDM'
    and l.status= 'COMPLETED');
    spool off
    this will generate something like the following:
    FINDING 1: 100% impact (343 seconds)
    Significant virtual memory paging was detected on the host operating system.
    RECOMMENDATION 1: Host Configuration, 100% benefit (343 seconds)
    ACTION: Host operating system was experiencing significant paging but no
    particular root cause could be detected. Investigate processes that
    do not belong to this instance running on the host that are consuming
    significant amount of virtual memory. Also consider adding more
    physical memory to the host.
    RECOMMENDATION 2: DB Configuration, 100% benefit (343 seconds)
    ACTION: Total PGA memory used was above the specified
    "pga_aggregate_target" value for 26% of the time. Consider increasing
    your current "pga_aggregate_target". Note that the sum of
    "pga_aggregate_target" and SGA size should be less than the physical
    memory available on the host.
    RATIONALE: The value of parameter "pga_aggregate_target" was "107 M"
    during the analysis period.
    These are a good starting point before turning the Oracle database tuning guide.
    Hope this helps
    Keith Laker
    Data Warehouse Solution Architect
    Oracle EMEA Consulting
    BI Blog : http://oraclebi.blogspot.com
    DM Blog : http://oracledmt.blogspot.com

  • Error in generating ADDM Report(Oracle 11g 64 bit EE on linux RHEL 5)

    I collected .dmp file from production using awrextr.sql and imported in our development side using awrload.sql .
    I am able to generate awr snapshots report out of it without any trouble.
    But When I try to generate addm report using addmrpti.sql I am facing following error(Please see output pasted below)
    Specify the Report Name
    ~~~~~~~~~~~~~~~~~~~~~~~
    The default report file name is addmrpt_1_7149_7156.txt. To use this name,
    press <return> to continue, otherwise enter an alternative.
    Enter value for report_name:
    Using the report name addmrpt_1_7149_7156.txt
    Running the ADDM analysis on the specified pair of snapshots ...
    begin
    ERROR at line 1:
    ORA-13711: Some snapshots in the range [7149, 7156] are missing key statistics.
    ORA-06512: at "SYS.DBMS_ADVISOR", line 201
    ORA-06512: at line 27
    Generating the ADDM report for this analysis ...
    ERROR:
    ORA-13608: The specified name NULL is invalid.
    ORA-06512: at "SYS.PRVT_ADVISOR", line 3122
    ORA-06512: at "SYS.DBMS_ADVISOR", line 585
    ORA-06512: at line 1
    End of Report
    Report written to addmrpt_1_7149_7156.txt
    SQL>
    Any clue or help will be really helpful for us.

    hello,
    have a look at this'
    ORA-13711:Some snapshots in the range [string, string] are missing key statistics.
    Cause:      Some AWR tables encountered errors while creating one or more
    snapshots in the given range. The data present in one or more of these missing
    tables is necessary to perform an ADDM analysis.
    Action:      Look in DBA_HIST_SNAP_ERROR to find what tables are missing in
    the given snapshot range. Use the ERROR_NUMBER column in that view
    together with the alert log to identify the reason for failure and take necessary action to
    prevent such failures in the future. Try running ADDM on a different snapshot range
    that does not include any incomplete snapshots.thanks and regards
    VD
    Edited by: Dixit on Aug 31, 2009 1:52 AM
    Edited by: Dixit on Aug 31, 2009 1:53 AM

  • Error while executing tuning task in 10gr2

    10.2.0.5 on RHEL/5.
    select name, status
    from dba_sql_profiles
    where status = 'ENABLED'
    / 2 3 4
    no rows selected
    SELECT task_name, EXECUTION_START,EXECUTION_END,status,ERROR_MESSAGE FROM dba_advisor_log WHERE task_name = '1nqbz1wytzjps_tuning_task';
    TASK_NAME EXECUTION EXECUTION STATUS ERROR_MESS
    1nqbz1wytzjps_tuning_task 24-JAN-13 24-JAN-13 COMPLETED
    EXEC DBMS_SQLTUNE.execute_tuning_task(task_name => '1nqbz1wytzjps_tuning_task');
    ERROR at line 1:
    ORA-13630: The task 1nqbz1wytzjps_tuning_task contains execution results and cannot be executed.
    ORA-06512: at "SYS.PRVT_ADVISOR", line 1709
    ORA-06512: at "SYS.DBMS_ADVISOR", line 186
    ORA-06512: at "SYS.DBMS_SQLTUNE", line 1019
    ORA-06512: at line 1
    Elapsed: 00:00:00.02
    1) I have already executed tuning task on Jan/24 and I'm getting above error while re-executing. What is the correct way to re-execute a tuning task ?
    2) How to find whether a sql_profile is stale and how to re-profile it?
    3) I understood that, sql profiles are stored in dictionary cache, If we flush shared pool, what happens to the sql profiles?
    4) Automatic sql advisor suggest that to consider accepting sql profile. Before going to accept sql profile, How to keep sql_profile up-to-date? fyi..
    1- SQL Profile Finding (see explain plans section below)
    A potentially better execution plan was found for this statement.
    Recommendation (estimated benefit: 99.65%)
    - Consider accepting the recommended SQL profile.
    execute dbms_sqltune.accept_sql_profile(task_name =>'1nqbz1wytzjps_tuning_task', replace => TRUE);
    Thanks !

    Error:     ORA-13630 (ORA-13630)
    Text:     The task %s contains execution results and cannot be executed.
    Cause:The user attempted to execute a task that already contains
         execution results.
    Action:Reset the task to its initial state and retry the operation.

  • Database error when creating a new ADDM

    Hi Guys,
    In my dbconsole 10.1.0.4 i got this error when trying to create a snapshot:
    Database Error
    Task TASK_38223 has been created, but following error occurs during the execution time : ORA-13707: Either the start snapshot 19110 or the end snapshot 19111 is incomplete or missing
    key statistics. ORA-06512: at "SYS.PRVT_ADVISOR", line 1283 ORA-06512: at "SYS.DBMS_ADVISOR",
    line 190 ORA-06512: at line 1
    everything else is OK.
    Please advise,
    Regards,
    Firas

    Hi,
    I checked the trace files in BDUMP and found this:
    Oracle process number: 13
    Unix process pid: 21443, image: oracle@xxxxx (m000)
    *** ACTION NAME:(Auto-Flush Slave Action) 2008-04-15 12:00:22.103
    *** MODULE NAME:(MMON_SLAVE) 2008-04-15 12:00:22.103
    *** SERVICE NAME:(SYS$BACKGROUND) 2008-04-15 12:00:22.103
    *** SESSION ID:(156.413) 2008-04-15 12:00:22.103
    *** KEWROCISTMTEXEC - encountered error:
    ( ORA-00001: unique constraint (SYS.WRH$_SQLTEXT_PK) violated )
    *** SQLSTR: total-len=632, dump-len=240,
    STR={INSERT INTO wrh$_sqltext                      (sql_id, dbid, sql_text,                       command_type, snap_id, ref_count)      SELECT /*+ ord
    ered use_nl(s1) index(s1) */             sie.sqlid_kewrsie, :dbid, s1.sql_fulltext,           }
    *** KEWRAFM1: Error=13509 encountered by kewrfteh
    Please advise,
    Cheers,
    Firas

  • Peformance of a Materialized view

    Hi,
    I have created materialized view the below
    CREATE MATERIALIZED VIEW SUMMARY.V_OSFI_FEED_CORE_DATA_ADJ
    TABLESPACE RCDW_CAD_SUM_1M_DAT01
    PCTUSED    0
    PCTFREE    0
    INITRANS   2
    MAXTRANS   255
    STORAGE    (
                INITIAL          64K
                MINEXTENTS       1
                MAXEXTENTS       UNLIMITED
                PCTINCREASE      0
                BUFFER_POOL      DEFAULT
    NOCACHE
    LOGGING
    NOCOMPRESS
    NOPARALLEL
    BUILD DEFERRED
    REFRESH FORCE ON DEMAND
    WITH PRIMARY KEY
    AS
    /* Formatted on 2010/01/27 14:49 (Formatter Plus v4.8.8) */
    SELECT orgn.month_end_date month_end_date,
           orgn.ntrl_k_odc_instrument ntrl_k_odc_instrument,
           orgn.processing_system processing_system,
           orgn.source_system source_system,
           DECODE (UPPER (adjstd.ssb_type_indicator),
                   'NULL', NULL,
                   NVL (adjstd.ssb_type_indicator, orgn.ssb_type_indicator)
                  ) ssb_type_indicator,
           DECODE (UPPER (adjstd.basel_exposure_class),
                   'NULL', NULL,
                   NVL (adjstd.basel_exposure_class, orgn.basel_exposure_class)
                  ) basel_exposure_class,
           DECODE (UPPER (adjstd.basel_exposure_subclass),
                   'NULL', NULL,
                   NVL (adjstd.basel_exposure_subclass,
                        orgn.basel_exposure_subclass
                  ) basel_exposure_subclass,
           DECODE (UPPER (TRIM (adjstd.ccis_product_code)),
                   'NULL', NULL,
                   NVL (adjstd.ccis_product_code, orgn.ccis_product_code)
                  ) ccis_product_code,
           orgn.warehouse_instrument_key warehouse_instrument_key,
           DECODE (UPPER (adjstd.instrument_status),
                   'NULL', NULL,
                   NVL (adjstd.instrument_status, orgn.instrument_status)
                  ) instrument_status,
           DECODE (UPPER (adjstd.instrument_open_flag),
                   'NULL', NULL,
                   NVL (adjstd.instrument_open_flag, orgn.instrument_open_flag)
                  ) instrument_open_flag,
           DECODE (UPPER (adjstd.instrument_dwo_flag),
                   'NULL', NULL,
                   NVL (adjstd.instrument_dwo_flag, orgn.instrument_dwo_flag)
                  ) instrument_dwo_flag,
           DECODE (UPPER (adjstd.instrument_closed_flag),
                   'NULL', NULL,
                   NVL (adjstd.instrument_closed_flag,
                        orgn.instrument_closed_flag)
                  ) instrument_closed_flag,
           DECODE (UPPER (adjstd.instrument_arrears_flag),
                   'NULL', NULL,
                   NVL (adjstd.instrument_arrears_flag,
                        orgn.instrument_arrears_flag
                  ) instrument_arrears_flag,
           DECODE (UPPER (adjstd.instrument_npna_flag),
                   'NULL', NULL,
                   NVL (adjstd.instrument_npna_flag, orgn.instrument_npna_flag)
                  ) instrument_npna_flag,
           DECODE (UPPER (adjstd.account_open_dt),
                   'NULL', TO_DATE (NULL),
                   NULL, orgn.account_open_dt,
                   TO_DATE (adjstd.account_open_dt, 'dd-MON-YYYY')
                  ) account_open_dt,
           DECODE (UPPER (adjstd.account_close_dt),
                   'NULL', TO_DATE (NULL),
                   NULL, orgn.account_close_dt,
                   TO_DATE (adjstd.account_close_dt, 'dd-MON-YYYY')
                  ) account_close_dt,
           DECODE (UPPER (adjstd.instrument_insured_ind),
                   'NULL', NULL,
                   NVL (adjstd.instrument_insured_ind,
                        orgn.instrument_insured_ind)
                  ) instrument_insured_ind,
           DECODE
              (UPPER (adjstd.instrument_securitized_ind),
               'NULL', NULL,
               NVL (adjstd.instrument_securitized_ind,
                    orgn.instrument_securitized_ind
              ) instrument_securitized_ind,
           DECODE (UPPER (adjstd.country_code),
                   'NULL', NULL,
                   NVL (adjstd.country_code, orgn.country_code)
                  ) country_code,
           DECODE (UPPER (TRIM (adjstd.province)),
                   'NULL', NULL,
                   NVL (adjstd.province, orgn.province)
                  ) province,
           COALESCE (adjstd.presec_outstanding_bal,
                     orgn.presec_outstanding_bal,
                     NULL
                    ) presec_outstanding_bal,
           COALESCE (adjstd.postsec_outstanding_bal,
                     orgn.postsec_outstanding_bal,
                     NULL
                    ) postsec_outstanding_bal,
           COALESCE (adjstd.presec_authorized_limit,
                     orgn.presec_authorized_limit,
                     NULL
                    ) presec_authorized_limit,
           DECODE (UPPER (adjstd.interest_rate_type),
                   'NULL', NULL,
                   NVL (adjstd.interest_rate_type, orgn.interest_rate_type)
                  ) interest_rate_type,
           COALESCE (adjstd.ltv, orgn.ltv, NULL) ltv,
           DECODE (UPPER (adjstd.arrears_cycle_type),
                   'NULL', NULL,
                   NVL (adjstd.arrears_cycle_type, orgn.arrears_cycle_type)
                  ) arrears_cycle_type,
           COALESCE (adjstd.recovery_amt, orgn.recovery_amt, NULL) recovery_amt,
           COALESCE (adjstd.wrtoff_amt, orgn.wrtoff_amt, NULL) wrtoff_amt,
           COALESCE (adjstd.utilization_rate,
                     orgn.utilization_rate,
                     NULL
                    ) utilization_rate,
           DECODE (UPPER (adjstd.pd_pool),
                   'NULL', NULL,
                   NVL (adjstd.pd_pool, orgn.pd_pool)
                  ) pd_pool,
           COALESCE (adjstd.pd_value_pct, orgn.pd_value_pct, NULL) pd_value_pct,
           DECODE (UPPER (adjstd.lgd_pool),
                   'NULL', NULL,
                   NVL (adjstd.lgd_pool, orgn.lgd_pool)
                  ) lgd_pool,
           COALESCE (adjstd.lgd_value_pct, orgn.lgd_value_pct,
                     NULL) lgd_value_pct,
           DECODE (UPPER (adjstd.ead_pool),
                   'NULL', NULL,
                   NVL (adjstd.ead_pool, orgn.ead_pool)
                  ) ead_pool,
           COALESCE (adjstd.presec_precrm_ead,
                     orgn.presec_precrm_ead,
                     NULL
                    ) presec_precrm_ead,
           COALESCE (adjstd.postsec_precrm_ead,
                     orgn.postsec_precrm_ead,
                     NULL
                    ) postsec_precrm_ead,
           COALESCE (adjstd.postsec_postcrm_ead,
                     orgn.postsec_postcrm_ead,
                     NULL
                    ) postsec_postcrm_ead,
           COALESCE (adjstd.expected_loss_amt,
                     orgn.expected_loss_amt,
                     NULL
                    ) expected_loss_amt,
           COALESCE (adjstd.postsec_rwa, orgn.postsec_rwa, NULL) postsec_rwa,
           DECODE (UPPER (adjstd.risk_rating_system),
                   'NULL', NULL,
                   NVL (adjstd.risk_rating_system, orgn.risk_rating_system)
                  ) risk_rating_system,
           DECODE (UPPER (adjstd.default_ind),
                   'NULL', NULL,
                   NVL (adjstd.default_ind, orgn.default_ind)
                  ) default_ind,
           DECODE (UPPER (adjstd.LOB),
                   'NULL', NULL,
                   NVL (adjstd.LOB, orgn.LOB)
                  ) LOB,
           DECODE (UPPER (adjstd.row_source),
                   'NULL', NULL,
                   NVL (adjstd.row_source, orgn.row_source)
                  ) row_source,
           COALESCE (adjstd.postsec_authorized_limit,
                     orgn.postsec_authorized_limit,
                     NULL
                    ) postsec_authorized_limit,
           COALESCE (adjstd.recovery_amt_calc,
                     orgn.recovery_amt_calc,
                     NULL
                    ) recovery_amt_calc,
           adjstd.adj_cycle_id adj_cycle_id,
           orgn.curr_warehouse_inst_key curr_warehouse_inst_key,
           orgn.curr_ccis_prod curr_ccis_prod, adjstd.load_time load_time,
           adjstd.update_time update_time
      FROM summary.osfi_feed_core_data orgn, summary.ncr_adj_data adjstd
    WHERE orgn.ntrl_k_odc_instrument = adjstd.ntrl_k_odc_instrument
    UNION ALL
    SELECT orgn.month_end_date, orgn.ntrl_k_odc_instrument,
           orgn.processing_system, orgn.source_system, orgn.ssb_type_indicator,
           orgn.basel_exposure_class, orgn.basel_exposure_subclass,
           orgn.ccis_product_code, orgn.warehouse_instrument_key,
           orgn.instrument_status, orgn.instrument_open_flag,
           orgn.instrument_dwo_flag, orgn.instrument_closed_flag,
           orgn.instrument_arrears_flag, orgn.instrument_npna_flag,
           orgn.account_open_dt, orgn.account_close_dt,
           orgn.instrument_insured_ind, orgn.instrument_securitized_ind,
           orgn.country_code, orgn.province, orgn.presec_outstanding_bal,
           orgn.postsec_outstanding_bal, orgn.presec_authorized_limit,
           orgn.interest_rate_type, orgn.ltv, orgn.arrears_cycle_type,
           orgn.recovery_amt, orgn.wrtoff_amt, orgn.utilization_rate,
           orgn.pd_pool, orgn.pd_value_pct, orgn.lgd_pool, orgn.lgd_value_pct,
           orgn.ead_pool, orgn.presec_precrm_ead, orgn.postsec_precrm_ead,
           orgn.postsec_postcrm_ead, orgn.expected_loss_amt, orgn.postsec_rwa,
           orgn.risk_rating_system, orgn.default_ind, orgn.LOB, orgn.row_source,
           orgn.postsec_authorized_limit, orgn.recovery_amt_calc, 0,
           orgn.curr_warehouse_inst_key curr_warehouse_inst_key,
           orgn.curr_ccis_prod curr_ccis_prod, SYSDATE, SYSDATE
      FROM osfi_feed_core_data orgn
    WHERE NOT EXISTS (SELECT ntrl_k_odc_instrument
                         FROM ncr_adj_data
                        WHERE ntrl_k_odc_instrument = orgn.ntrl_k_odc_instrument);When i refresh the materialized view its taking 5 to 6 mins. I have used DBMS_ADVISOR.TUNE_MVIEW to tune the query, but it raised error as
    ORA-13600: error encountered in Advisor
    QSM-03113: Cannot tune the MATERIALIZED VIEW statement
    QSM-02091: mv references a non-repeatable or session-sensitive expression
    QSM-02164: the materialized view is BUILD DEFERRED
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 86
    ORA-06512: at "SYS.PRVT_ACCESS_ADVISOR", line 202
    ORA-06512: at "SYS.PRVT_TUNE_MVIEW", line 1232
    ORA-06512: at "SYS.DBMS_ADVISOR", line 753
    ORA-06512: at line 221
    Can anyone suggest some methods to increase the peformance of the view.

    Hi,
    Here is the explain plan of the query,
    Plan
    SELECT STATEMENT  ALL_ROWSCost: 626  Bytes: 35,803,043  Cardinality: 144,937                                     
        18 PX COORDINATOR                                 
            17 PX SEND QC (RANDOM) PARALLEL_TO_SERIAL SYS.:TQ10002                            
                16 BUFFER SORT PARALLEL_COMBINED_WITH_PARENT Cost: 626  Bytes: 35,803,043  Cardinality: 144,937                         
                    15 UNION-ALL PARALLEL_COMBINED_WITH_PARENT                    
                        7 HASH JOIN PARALLEL_COMBINED_WITH_PARENT Cost: 314  Bytes: 7,803  Cardinality: 17                 
                            4 BUFFER SORT PARALLEL_COMBINED_WITH_CHILD            
                                3 PX RECEIVE PARALLEL_COMBINED_WITH_PARENT Cost: 3  Bytes: 3,859  Cardinality: 17         
                                    2 PX SEND BROADCAST PARALLEL_FROM_SERIAL SYS.:TQ10000 Cost: 3  Bytes: 3,859  Cardinality: 17     
                                        1 TABLE ACCESS FULL TABLE SUMMARY.NCR_ADJ_DATA Cost: 3  Bytes: 3,859  Cardinality: 17 
                            6 PX BLOCK ITERATOR PARALLEL_COMBINED_WITH_CHILD Cost: 310  Bytes: 33,625,384  Cardinality: 144,937             
                                5 TABLE ACCESS FULL TABLE PARALLEL_COMBINED_WITH_PARENT SUMMARY.OSFI_FEED_CORE_DATA Cost: 310  Bytes: 33,625,384  Cardinality: 144,937         
                        14 HASH JOIN RIGHT ANTI PARALLEL_COMBINED_WITH_PARENT Cost: 312  Bytes: 35,795,240  Cardinality: 144,920                 
                            11 BUFFER SORT PARALLEL_COMBINED_WITH_CHILD            
                                10 PX RECEIVE PARALLEL_COMBINED_WITH_PARENT Cost: 1  Bytes: 255  Cardinality: 17         
                                    9 PX SEND BROADCAST PARALLEL_FROM_SERIAL SYS.:TQ10001 Cost: 1  Bytes: 255  Cardinality: 17     
                                        8 INDEX FULL SCAN INDEX SUMMARY.INDEX_2 Cost: 1  Bytes: 255  Cardinality: 17 
                            13 PX BLOCK ITERATOR PARALLEL_COMBINED_WITH_CHILD Cost: 310  Bytes: 33,625,384  Cardinality: 144,937             
                                12 TABLE ACCESS FULL TABLE PARALLEL_COMBINED_WITH_PARENT SUMMARY.OSFI_FEED_CORE_DATA Cost: 310  Bytes: 33,625,384  Cardinality: 144,937          There is no index on the tables and it contains lakhs of records.

  • Error trying to generate addmrpt (ADDM Report) on Oracle 10.1.0.4

    Hello,
    When I launch $ORACLE_HOME/rdbms/admin/addmrpt.sql on my Fedora 3 Oracle 10g connected using sys as sysdba (or system), I get the following error :
    Specify the Begin and End Snapshot Ids
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Entrez une valeur pour begin_snap : 210
    Begin Snapshot Id specified: 210
    Entrez une valeur pour end_snap : 211
    End Snapshot Id specified: 211
    Specify the Report Name
    ~~~~~~~~~~~~~~~~~~~~~~~
    The default report file name is addmrpt_1_210_211.txt. To use this name,
    press <return> to continue, otherwise enter an alternative.
    Entrez une valeur pour report_name :
    Using the report name addmrpt_1_210_211.txt
    Running the ADDM analysis on the specified pair of snapshots ...
    begin
    ERREUR a la ligne 1 :
    ORA-13711: Des statistiques de cle sont absentes de certains cliches dans la
    plage [210, 211].
    ORA-06512: a "SYS.PRVT_ADVISOR", ligne 1283
    ORA-06512: a "SYS.DBMS_ADVISOR", ligne 190
    ORA-06512: a ligne 27
    Generating the ADDM report for this analysis ...
    ERROR:
    ORA-14552: operation DDL, COMMIT ou ROLLBACK interdite dans une instruction DML
    ou une interrogation
    ORA-06512: a "SYS.PRVT_ADVISOR", ligne 1750
    ORA-13608: Le nom de tache ou d'objet NULL n'est pas valide.
    ORA-06512: a "SYS.DBMS_ADVISOR", ligne 569
    ORA-06512: a ligne 1
    Any help to solve this problem ?
    Oups, when I use awrrpt on the same snapshot, I get a correct report.
    Regards,
    Freddy

    Please refer to the patchnote.htm that is bundled with 10.1.0.4.0 patch set. Only you are aware of what type of database configuration you have. You will want to pay close attention to "7.2.1.3 Set the SHARED_POOL_SIZE and JAVA_POOL_SIZE Initialization Parameters" and "7.2.2 Upgrade the Release 10.1 Database".
    Basically, I believe you have missed these required steps after installing the 10.1.0.4.0 patch set from the OUI:
    (pasted from the patchnote.htm)
    13.     Enter the following SQL*Plus commands:
    14.     SQL> STARTUP UPGRADE
    15.     SQL> SPOOL patch.log
    16.     SQL> @ORACLE_BASE\ORACLE_HOME\rdbms\admin\catpatch.sql
    17.     SQL> SPOOL OFF
    18.     
    19.     Review the patch.log file for errors and inspect the list of components that is displayed at the end of catpatch.sql script.
    This list provides the version and status of each SERVER component in the database.
    20.     If necessary, rerun the catpatch.sql script after correcting any problems.
    21.     Restart the database:
    22.     SQL> SHUTDOWN
    23.     SQL> STARTUP
    24.     
    25.     Run the utlrp.sql script to recompile all invalid PL/SQL packages now instead of when the packages are accessed for the first time. This step is optional but recommended.
    26.     SQL> @ORACLE_BASE\ORACLE_HOME\rdbms\admin\utlrp.sql

  • Error when running Oracle provided Segment Advisor

    Can anyone tell me how to fix this error. The Automatic Segment Advisor job which is provided by default by oracle is failing with this error. I am not able to edit this job.
    Errors in file c:\oracle\product\10.2.0\admin\devptc6\bdump\devptc6_j000_3312.trc:
    ORA-12012: error on auto execute of job 8887
    ORA-20000: ORA-20000: Content of the tablespace specified is not permanent or tablespace name is invalid
    ORA-06512: at "SYS.PRVT_ADVISOR", line 1624
    ORA-06512: at "SYS.DBMS_ADVISOR", line 186
    ORA-06512: at "SYS.DBMS_SPACE", line 1338
    ORA-06512: at "SYS.DBMS_SPACE", line 1554
    -Nags

    The issue has been resolved finally i can able to run the seeded page.
    Thank you all.
    Regards,
    CSK

  • DBMS_STATS package error message

    Hi,
    I have Oracle DBA II class and when I do my homework assignment, I encountered this error when exec the DBMS_STATS package......(unsupported construct or internal error). What did I do wrong? Can anyone help? Thanks. - katie
    ===============================================
    SQL> exec dbms_advisor.set_default_task_parameter('ADDM','DB_ACTIVITY_MIN',30);
    PL/SQL procedure successfully completed.
    SQL> create table addm(id number, name varchar2(2000));
    Table created.
    SQL> exec DBMS_STATS.GATHER_TABLE_STATS(-ownname=>'ADDM', tabname=>'ADDM',-estimate_percent=>DBMS_ST
    ATS.AUTO_SAMPLE_SIZE);
    BEGIN DBMS_STATS.GATHER_TABLE_STATS(-ownname=>'ADDM', tabname=>'ADDM',-estimate_percent=>DBMS_STATS.
    ERROR at line 1:
    ORA-06550: line 1, column 37:
    PLS-00707: unsupported construct or internal error [2603]
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored

    Thank you so much. It works! I removed the dash (-) sign in front of the variable name. Thanks again.
    SQL> exec DBMS_STATS.GATHER_TABLE_STATS(ownname=>'ADDM', tabname=>'ADDM',estimate_percent=>DBMS_STAT
    S.AUTO_SAMPLE_SIZE);
    PL/SQL procedure successfully completed.

Maybe you are looking for

  • Ipod classic corrupted and cannot save music..

    Suddenly I found out that my iPod Classic 5th Gen reset by itself and lost all music in it.  I thought the hard drive was corrupted and tried to restore the iPod with iTunes.  After that I mannually copied music back into iPod using iTunes.  But soon

  • Windows 8.1 BSoD & driver issue

    Hello, I was hoping someone could help me out here. Let me describe the issue. For quite a while I was using Windows 8.1 fine and did not have any problems, however I recently burned my PSU somehow and then the problems started. Which I somewhy find

  • Simple calculations in Universe not working for XI 3.0

    Simple calculations in Universe using key figures are not working in XI 3.0(without any Fix Pack) Below is the steps I followed. 1. Using key figure [Jan] I am trying to round the values by deviding it by 1000. <EXPRESSION>@Select([Jan])/1000</EXPRES

  • How do i change the channel to my cable modem

    How do I change the channel for my cable modem?  My broadband speed slows down during peak hours, and I was advised to change the channel from 11 to 6 for example, but that I would have to do it through my airport extreme. Thank you. Cable modem is a

  • My 'paid-for' version of Roboform, ( v. 6.10.2) works with FF v. 3.6.17, so why doesn't it work in FF v. 4?

    I have a 'paid-for' copy of Roboform, (v. 6.10.2) which works just fine and free on Firefox v. 3.6.17. But it does not work on Firefox version 4. I do not want to buy another version of Roboform to use on FFv4. What happened? Why does it not work any