Scheduling Snapshot refreshes

Hi
Need help here. The following is the script to create one of our snapshots.
CREATE SNAPSHOT PREEM_VIEW_SNP
PCTFREE 0
PCTUSED 99
INITRANS 2
MAXTRANS 255
STORAGE (
INITIAL 25600 K
NEXT 5120 K
MINEXTENTS 1
MAXEXTENTS 505
PCTINCREASE 0
FREELISTS 1
FREELIST GROUPS 1
BUFFER_POOL DEFAULT)
TABLESPACE BP_DATA
LOGGING
NOCACHE
NOPARALLEL
USING INDEX PCTFREE 10
INITRANS 2
MAXTRANS 255
STORAGE (
BUFFER_POOL DEFAULT)
REFRESH COMPLETE
NEXT TRUNC(SYSDATE+1) + 6.5/24
WITH ROWID
USING DEFAULT LOCAL ROLLBACK SEGMENT
DISABLE QUERY REWRITE AS
select cust_id customer_id,BTN || BTN_CUST_CD || RPAD(BTN_SORT_CD, 1) || RPAD(BTN_SFX, 4) || RPAD(BTN_ST_CD, 1)BLG_ACCT_TLPHN_NO
from CSBAN10V@UCDWP001
where ACCT_MKT_UN_ID in ('C', 'D', 'F', 'G', 'I',
'L', 'O', 'P', 'R', 'S', 'V', 'W')
Im concerned about the NEXT TRUNC(SYSDATE+1) + 6.5/24 part. It says the snapshot refreshes every day at 6:30 am.
I need to schedule the refreshes every day except Saturday and Sunday. Got any idea how can I do that?
Prash

You would probably want to use the dbms_job package to schedule the refresh in that case, rather than scheduling the refresh in the materialized view creation. Write a function that returns the next refresh time for your snapshot and pass that in when you create your job.
Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC

Similar Messages

  • Snapshot refresh DBMS Jobs

    Hello,
    I have a snapshot scheduled to refresh every hour. I have noticed that job is actually not running every hour. Here is an example of what i am trying to explain.
    DECLARE
    X NUMBER;
    BEGIN
    SYS.DBMS_JOB.SUBMIT
    ( job => X
    ,what => 'dbms_refresh.refresh(''"Schema"."FLODS_RENEW_MV"'');'
    ,next_date => TO_DATE('08/08/2006 09:22:00','dd/mm/yyyy hh24:mi:ss')
    ,INTERVAL => 'SYSDATE+1/24 '
    ,no_parse => TRUE
    SYS.DBMS_OUTPUT.PUT_LINE('Job Number is: ' || TO_CHAR(x));
    END;
    COMMIT;
    This runs approximately for 3 mins. And i noticed today that the next_date changed the time to next_date => TO_DATE('08/08/2006 10:25:00','dd/mm/yyyy hh24:mi:ss').
    So, is there any way to schedule a job every hour? Insted of every hour after the job finished executing?
    Thanks

    Hi,
    This is one of the good reasons for using dbms_scheduler instead of dbms_job. dbms_scheduler supports a calendar syntax (actually a modified iCal RFC 2445 standard) for scheduling at regular intervals. The following job skeleton runs every hour at 22 mins after the hour starting immediately
    begin
    dbms_scheduler.create_job(
    job_name=>'my_hourly_job',
    job_type=>'plsql_block',
    job_action=>'my_proc();',
    repeat_interval=>'freq=hourly;byminute=22;bysecond=0',
    enabled=>true , auto_drop=>true
    end;
    This is much clearer than using an ugly PL/SQL time function with TRUNC . It also deals automatically with daylight savings time switchovers which is uncertain with the PL/SQL time function.
    With the new calendar syntax there should really be no reason to revert to time functions.
    Hope this helps,
    Ravi.

  • Snapshot Refresh taking More Time

    Dear All,
    We are facing a Snapshot refresh problem currently in Production Environment.
    Oracle Version : Oracle8i Enterprise Edition Release 8.1.6.1.0
    Currently we have created a Snapshot on a Join with 2 remote tables using Synonyms.
    ex:
    CREATE SNAPSHOT XYZ REFRESH COMPLETE WITH ROWID
    AS
    SELECT a.* FROM SYN1 a, SYN2 b
    Where b.ACCT_NO=a.ACCT_NO;
    We have created a Index on the above Snapshot XYZ.
    Create index XYZ_IDX1 on XYZ (ACCT_NO);
    a. The Explain plan of the above query shows the Index Scan on SYN1.
    If we query above Select Statement,it hardly takes 2 seconds to exedute.
    b. But the Complete Refresh of Snapshot XYZ is almost taking 20 Mins for just truncating and inserting 500 records and is generating huge Disk Reads as SYN1 in remote table consists of 32 Million records whereas SYN2 contains only 500 Records.
    If we truncate and insert inot a table as performed by the Complete refresh of Snapshot,it hardly takes 4 Seconds to refresh the table.
    Please let me know what might be the possible reasons for the Complete refresh of Snapshot taking more time.

    Dear All,
    While refreshing the Snapshot XYZ,I could find the following.
    a. Sort/Merge operation was performed while inserting the data into Snapshot.
    INSERT /*+ APPEND */ INTO "XYZ"
    SELECT a.* FROM SYN1 a, SYN2 b Where b.ACCT_NO=a.ACCT_NO;
    The above operation performed huge disk reads.
    b. By Changing the session parameter sort_area_size ,the time decreased by 50% but still the disk reads are huge.
    I would like to know why Sort/Merge Operation is performed in the above Insert?
    Edited by: Prashanth Deshmukh on Mar 13, 2009 10:54 AM
    Edited by: Prashanth Deshmukh on Mar 13, 2009 10:55 AM

  • How to track Snapshot refresh error

    Hi
    I have a procedure which is doing the below transaction one after one:
    1- Refresh snapshot Snap1
    2- track snapshot refresh status If Ok do step 3 if not exit
    2- Insert agregate data from snapshot Snap1 to table
    3- Track insertion status if Ok proceed on next steps if not exit
    3- commit
    To refresh the snapshot here is the syntaxe i want to use.
    DBMS_SNAPSHOT.refresh('Snap1','F');
    If refresh ok then
    insert into T1 select ..... from Snap1;
    commit;
    end if;
    Thank you.

    I try to show/hide a div depending on the occurence of errors. I resolved this problem by doing this in javascript.
    function showEdu(){
    $("#edu").animate({ height: 'show', opacity: 'show' }, 'slow');
    $s('P6_EDU_SHOWN','Y');
    function hideEdu(){
    $("#edu").animate({ height: 'hide', opacity: 'hide' }, 'slow');
    $s('P6_EDU_SHOWN','N');
    function checkEduError(){
    if($("span").hasClass("errTxt") == true)
    {showEdu();}
    else
    if($v('P6_EDU_SHOWN') == 'Y')
    {showEdu();}
    else
    {hideEdu();}
    }

  • Snapshot Refresh

    Hi.,
    I am facing following error on during the snapshot refresh at 8i
    ORA-04052: error occurred when looking up remote object [email protected]
    ORA-00604: error occurred at recursive SQL level 2
    ORA-02085: database link RT.PRDU connects to RT
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 617
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 674
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 654
    ORA-06512: at line 1
    Provide me the suitable solution.
    Thanks in advance.

    Try to solve the following error :
    ORA-02085 database link string connects to string
    Cause: The database link attempted to connect to a database with a different name. The name of the database link must be the same name as the name of the database.
    Action: Create a database link with the same name as the database to which it connects.
    What's the name of the dblink ?
    Nicolas.
    Message was edited by:
    N. Gasparotto

  • Snapshot refresh interval

    Hi,
    I would like to know how to create a snapshot refresh group that would refresh the snapshot daily between 0800 hrs to 1700 hrs.
    Appreciate any inputs.
    Thanks & Kind Regards,
    Zaid

    Standard disclaimer-- 8.0.5 has been desupported for many years, you really ought to upgrade. Most of the folks on this and other forums haven't seen an 8.0.5 system in quite some time, so there may be version-specific caveats that we've long forgotten.
    When a job fails, the error should be written to the alert log.
    When a job fails, it will be rescheduled with an increasing delay (1 sec, 2 sec, 4 sec, 8 sec, ...) for 16 times. If it fails 16 times in a row, the job is marked as broken.
    You can use the DBMS_JOB.BROKEN method to indicate that a job is no longer broken. You generally want to fix the underlying problem first, though.
    Justin

  • XIR2 - Date format problem in pdf file when scheduled to refresh

    We have a number of Deski reports that are scheduled to refresh daily and then be saved as pdfs to a network drive.  Despite the date format being correctly displayed in the reports stored in the respository, when the scheduled jobs save the reports as pdfs, it is changing the date format to the American format, i.e. 11/13/2007 instead of 13/11/2007.  I've checked both the Date/Time and Regional Settings on the server and they are set correctly.  If I log into Deski on the server and open a report and manually save it as a pdf, it saves it with the UK format.
    So what do I need to change to get the scheduled job to use the UK date format?

    Hi Anne,
    If you schedule reports through Infoview then please perform below steps.
    - Login to Infovinfoview -> go to Preferences.
    - Change the My interface locale is to "English (UK)" and My current Timezone to appropriate time zone under Genera tab.
    - Log off and login again.
    - Try to schedule the report to PDF or any other format and check the issue.
    If you schedule reports through CMC, then change Timezone setting to appropriate timezone in Preferences and schedule the reports.
    Thanks and Regards,
    Purna.

  • Problem in scheduling data refresh of excel file that uses PowerPivot

    I think I have successfully created and enabled the gateway and data sources for refresh - they are both seeming to connect.  However, when I try to schedule a data refresh to occur in the PowerBI site for the Excel file I receive an error message
    that the connection could not be established and receive error message "Correlation ID: d118ab93-436d-44a9-8c09-564f64fe0c58".  Appreciate any assistance in figuring out how to resolve.  Thanks a lotl

    Let's track it here: https://social.technet.microsoft.com/Forums/en-US/42c806dc-2d82-4bcf-ab6e-c279e2692a68/problem-in-scheduling-data-refresh-of-excel-file-that-uses-powerquery-and-powerquery?forum=powerbiforoffice365 
    Ed Price, Azure & Power BI Customer Program Manager (Blog,
    Small Basic,
    Wiki Ninjas,
    Wiki)
    Answer an interesting question?
    Create a wiki article about it!

  • Changing time-out for scheduled data refresh

    Using a Power Query connection, is it possible to extend the time-out time for scheduled data refreshes? The amount of data to be retrieved is rather limited, but there's thousands of rows (NAV server).
    If not, any suggestions to how to reduce latency?
    Thanks.

    Thorm,
    Is this still an issue?
    Thanks!
    Ed Price, Azure & Power BI Customer Program Manager (Blog,
    Small Basic,
    Wiki Ninjas,
    Wiki)
    Answer an interesting question?
    Create a wiki article about it!

  • ORA-12008: error in snapshot refresh path

    I am getting this error even i am specifying to use other rollback segment
    ALTER ROLLBACK SEGMENT R02 SHRINK;
    SET TRANSACTION USE ROLLBACK SEGMENT R02;
    alter materialized view PAY_REV_BREAKUPWITHWOFF NOLOGGING;
    BEGIN dbms_mview.refresh('PAY_REV_BREAKUPWITHWOFF') ; END;
    ERROR at line 1:
    ORA-12008: error in snapshot refresh path
    ORA-01562: failed to extend rollback segment number 1
    ORA-01628: max # extents (505) reached for rollback segment SYS_RBS
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 617
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 674
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 654
    ORA-06512: at line 1

    The reason why it's still using SYS_RBS seems to be that since you are refreshing a materialized view, it might be doing parallel DMLs. In this case the clause of specifying a particular rollback segment is ignored.
    In addition to the above, try taking the rollback segment offline by executing
    alter rollback segment SYS_RBS offline;
    and then drop it by running
    drop rollback segment SYS_RBS;
    Then create new one and see if it works.
    if the above mentioned doesn't work somehow...
    try to change the extents storage parameter by running
    alter rollback segment sys_rbs storage (MAXEXTENTS 1000);
    Can't be sure as i currently don't have access to my system
    Hope this helps
    Message was edited by:
    thrilller

  • UNDO SPACE DURING SNAPSHOT REFRESH

    Hi All,
    I am seeing a weird issue with mu undo space in oracle 10g 10.2.0.3.
    Problem is ....
    I am doing a complete snapshot refresh from a remote database to source database. When I do this the snapshot refresh is consuming my all undo, I can see this by executing
    select distinct segment_name,sum(bytes)/1024/1024/1024 from dba_segments where tablespace_name='UNDO_TBS' group by segment_name;
    SEGMENT_NAME SUM(BYTES)
    _SYSSMU16$                    39.931324
    My total undo space is 40GB
    Why the snapshot refresh is consuming all the undo. Any idea? Appreciate your help.

    Hi,
    You can use the undocumented parameter "_mav_refresh_consistent_read" - refresh materialized views using consistent read snapshot (it will reduced the undo log issues).
    The Basic problem is "ATOMIC_REFRESH" is true or enable. try to make it false and check
    ATOMIC_REFRESH=>false
    Example :- execute DBMS_MVIEW.REFRESH(''view_name,'C’,ATOMIC_REFRESH=>false);
    - Pavan Kumar N

  • Error in schedule data refresh in Power BI

    Hi everybody,
    I have errors in schedule data refresh in Power BI. 
    In fact, whenever i plan an refresh, it says to me that there is an Error on Site (OnPremise): Sorry, the data source of this data connection is not registered with BI Power. Ask your BI Power Administrator to include the data source in the Administration
    Center Power BI. An error has occurred while processing the "X" table. The current operation was canceled because another operation in the transaction failed.
    I don't know what to do, please help :)

    Have you configured the Gateway and the data source and they pass test connection on the Power BI admin side?
    If you did, it will help if you share a correlation id and timeframe when this happened. If not, checkout
    this documentation
    GALROY

  • Snapshot Refresh (How to stop COMPLETE refresh and run FAST refresh)?

    Hi,
    I have a snapshot refresh executed as COMPLETE which is taking very long. When I try to kill this and try to run a FAST I get:
    ERROR at line 1:
    ORA-12057: materialized view "PORTALSNP1"."V21_BILLING_ACCOUNT" is INVALID an must complete refresh
    How can I resolve this to stop the COMPLETE refresh altogether and be able to run the FAST refresh.
    Also is there a way to get the time it will take to complete the running snapshot refresh?
    Please and thankYou!
    Regards,
    A

    You don't resolve it ... you drop the materialized view. Then you create a materialized view log. Then a properly coded MV.
    http://www.morganslibrary.org/library.html
    bookmark this link
    then look up "Materialized Views and "Materialized View Logs"
    The log must be created first.

  • ISCSI Target Scheduled Snapshots

    I know there are cmdlets to snapshot a target but is there a built in way to schedule snapshots?
    Alternatively, is there a cmdlet to list snapshots for a target so I can create a script to run on a schedule to remove old snapshots and create new ones.

    I know there are cmdlets to snapshot a target but is there a built in way to schedule snapshots?
    Alternatively, is there a cmdlet to list snapshots for a target so I can create a script to run on a schedule to remove old snapshots and create new ones.
    Yes, you can use Schedule Snapshot Wizard to have automatic snapshots. See:
    Creating and Managing Snapshots
    and Schedules
    http://technet.microsoft.com/en-us/library/gg232620(v=ws.10).aspx
    Creating
    and Scheduling Snapshots of Virtual Disks
    http://technet.microsoft.com/en-us/library/gg232610(v=ws.10).aspx
    Alternatively you can use cmdlets to deal with these tasks (PowerShell would give you more control over
    creation / deletion of a snapshots. See:
    iSCSI Target Cmdlets in Windows PowerShell
    http://technet.microsoft.com/en-us/library/jj612803.aspx
    The ones should be of your interest are Checkpoint-IscsiVirtualDisk and Remove-IscsiVirtualDiskSnapshot cmdlets.
    Also you may use SMI-S and WMI if you want to use say C# or C++ and not PowerShell. 
    Some more of the cmdlets use links (including samples). See:
    PowerShell
    cmdlets for the Microsoft iSCSI Target 3.3 (included in Windows Storage Server 2008 R2)
    http://blogs.technet.com/b/josebda/archive/2010/09/29/powershell-cmdlets-for-the-microsoft-iscsi-target-3-3-included-in-windows-storage-server-2008-r2.aspx
    (that's for Windows Server 2008 R2 and up)
    Managing
    iSCSI Target Server through Storage Cmdlets
    http://blogs.technet.com/b/filecab/archive/2013/09/28/managing-iscsi-target-server-through-storage-cmdlets.aspx
    (the most recent one about Windows Server 2012 R2)
    Hope this helped a bit. Good luck :)
    StarWind VSAN [Virtual SAN] clusters Hyper-V without SAS, Fibre Channel, SMB 3.0 or iSCSI, uses Ethernet to mirror internally mounted SATA disks between hosts.

  • Secure Store Service and Schedule Data Refresh

    Hi
    Can you please let us know how many (max) target application's we can create under 1 secure store service application? 
    As we know, Manage Data Refresh feature is only available for PowerPivot Service Report and we can access it from Sharepoint to schedule the Workbook for Data Refresh.
    As per our requirement, we need to build a interface to use this Schedule data refresh feature in a separate browser not from SharePoint. Please let us know how to build this interface, is there any option to use API Web Service.
    Thanks in advance.
    Regards
    K.V.B.Gururaaja

    Hi,
    For your first question, refer to the following link:
    https://social.technet.microsoft.com/Forums/en-US/ab7f24eb-0cbf-4101-931e-1f89446e2149/secure-store-service-target-application-max-number?forum=sharepointgeneral
    For your second problem, could you offer a screenshot about what is your intention?
    Besides, take a look at the article about  PowerPivot data refresh options:
    http://www.sqlchick.com/entries/2012/11/17/powerpivot-data-refresh-options.html
    Best Regards,
    Lisa Chen
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Lisa Chen
    TechNet Community Support

Maybe you are looking for

  • FBB1 - field payment term is missing

    Dear Guru, When i post vendor invoice in FB01, field payment term is appear as usual. But if we post with FBB1 (same posting key [31] and same customer number without special G/L), field payment term is missing. Could you please suggest, how can we a

  • Pictures in iPhoto unavailable

    When in iPhoto, the thumbnails of some events and pictures keep disapearing. When I try to view these photos, there's an unavailable sign, but the preview on the lower bar still shows. I can't find them in the iPhoto Library. Here's what's happening:

  • Dynamic Text  drive by ASP

    Hi I have figured out how to load dynamic text from an external text file. I need to do the same with an ASP file that pulls its data from a database. How is this done with Flash CS4? I can't find any tutorials anywhere and Adobe's documentation is n

  • Interface arduino

    bonjour à tous, je viens vers vous car j'ai un problème pour interfacer labview et ma carte arduino uno. je m'explique:    - j'ai bien installé le pack LIFA   - on voit bien  ma carte dans visa    - le port com est bien selectionné j'ai un problème p

  • MBP 17'' LED backlights is this Normal?

    i had my screen replaced on my mbp a few months ago but had never noticed this before the replacement.. please see attached picture..