Delete vs truncate on materilized view

is it possible to truncate materilized view? if yes, is it faster than using delete from materialized view?
thanks.

user8837158 wrote:
is it possible to truncate materilized view? YES, for example;
dbms_mview.refresh( 'MY_MVIW_NAME' , 'C', atomic_refresh => FALSE ); => This does a TRUNCATE
if yes, is it faster than using delete from materialized view? Yes it is faster ; TRUNCATE is a DDL, no need as much undo as a DELETE, where a DELETE is a DML
DELETE operation will cause all DELETE triggers on the table to fire. Where with TRUNCATE no triggers will be fired.
thanks.

Similar Messages

  • Disable delete button in a maintenance view

    Hi,
    Does anyone knows how can I disable the delete button in a maintenance view so when a user that is not authorized can´t delete any row, or how can I lock the delete subroutine.
    Thanks!

    Hello Moises
    The problem with this solution is that if you ever need to modify your maintenance view (i.e. regenerate the dynpros because you may want to add new fields) your coding is gone.
    This is not the case if you are using event 19. Below you see same sample coding:
    ***INCLUDE LZUS_SDN_MAINTF01 .  " Function Group with maintenance views
    * Event 19: After Init. Global Variables, Field Symbols, etc.
    * http://help.sap.com/saphelp_nw2004s/helpdata/en/91/ca9f44a9d111d1a5690000e82deaaa/content.htm
    FORM exclude_gui_function.
    * define local data
      DATA: ls_excl   TYPE vimexclfun.
      ls_excl-function = 'DELE'.  " taken from standard GUI-status 'ZULG'
    BREAK-POINT.
      AUTHORITY-CHECK OBJECT 'F_BKPF_BUK'
               ID 'BUKRS' FIELD '1000'
               ID 'ACTVT' FIELD '02'.
      IF ( syst-subrc NE 0 ).
        APPEND ls_excl TO excl_cua_funct.
      ENDIF.
      APPEND ls_excl TO excl_cua_funct.  " Just for the purpose of demonstration
    ENDFORM.                    "exclude_gui_function
    Regards
      Uwe

  • How to update or delete records in a Complex View in Forms?

    Hi,
    I have a requirement to create a Form by using Complex View. Insertion is possible but updation and deletion is not working properly . I got FRM-40501 Error. I need How to update or delete records in a Complex View in Forms?
    Thanks & Regards,
    Hari Babu

    Depending on how complex your view is, forms is not able to determine how to appropiately lock a record, when you try to update or delete a record.
    One approach to using complex views in forms:
    1. Set the Key-mode of the block to "Non-Updateable"
    2. Mark the column which can be used to build the WHERE-condition to uniquely identify a record with "Primary Key" = "Yes"
    3. For doing INSERT, UPDATE and DELETE, create an INSTEAD-OF-trigger on the view.
    4. Create your own ON-LOCK-trigger in forms which does the locking of the records to update.

  • How to delete records from standard maintenance view

    Dear Sir/Madam,
            i want to delete records from standard view " v_mmim_rep_cust "
    This is a standard maintenance view , used in MBLB report.
    here i found the records with different report name but same fields as shown below...
    REPORT             TABLE NAME     FIELD NAME 
    RM07DOCS         MKPF                 BKTXT
    RM07DOCS         MKPF                 BLDAT
    RM07DOCS         MKPF                 BUDAT
    RM07DOCS         MSEG                 ANLN1
    RM07DOCS         MSEG                 ANLN2
    RM07DOCS         MSEG                 APLZL
    YRM07DOCS         MKPF                 BKTXT
    YRM07DOCS         MKPF                 BLDAT
    YRM07DOCS         MKPF                 BUDAT
    YRM07DOCS         MSEG                 ANLN1
    YRM07DOCS         MSEG                 ANLN2
    YRM07DOCS         MSEG                 APLZL
    I WANT TO DELETE THE RECORDS FROM THE VIEW WITH REPORT = YRM07DOCS.
    PLEASE HELP ME.
    Thanks in Advance,
    Dastagiri.

    Dear Sir,
          when i did so , it displays a message that  " entry mseg zeile  must not be deleted ".
    hense i went through writing a program to delete the records from table mmim_rep_cust
    but it says that record not found.
    program logic : 
    delete from mmim_rep_cust
        where report in report
          and TABNAME in TABNAME.
    if sy-subrc = 0.
    write ' RECORDS DELETED SUCCESSFULLY'.
    else.
    write ' RECORD NOT FOUND'.
    endif.
    please guide me to delete the records from the view.
    Thanks in advance,
    Dastagiri.

  • Deleting entries from a Standard View

    Hi,
         How do I delete duplicate entries from an Standard View in an Abap Code?
    Thanks,
    Pravs

    Then it becomes complicated. Are you trying to delete the duplicates from a view? Then look at your view definition and see if you can avoid duplicates by changing its selection criteria. Also take note of Rob's comment.
    If you are trying to delete from a database table as opposed to a view, then I don't know how you achieved the feat of having duplicate entries as any duplicate inserts with same key fields would have resulted in dump. Can you please clarify?

  • Stupid Mac OS bug - Won't delete open folders in list view

    This took some time to figure out and might help someone else... If you want to delete a folder while in list view, you must first close it before it will be deleted.  In the example below, you can select folder "Test 1", Move to Trash and it will be deleted.  Try the same thing with "Test 2" and nothing happens.  No error messages but it won't be deleted.  You must first close the folder (by clicking on the triangle), select the folder,  Move to Trash, then it will be deleted.  If you select a group of folders, all of the selected folders must be closed or none of them will be deleted. This bug only affects deleting folders while using list view (that I'm aware of).  You can rename the folder, you can move the folder.  You just can't delete the folder.  Occurs with the Public share as well as any other shares you created. There is no problem deleting folders while in icon view or column view.  2TB My Cloud with firmware v04.01.04-422Mac OS 10.9.5WD disc mounted on desktop with smb://< IP Address >Logged on to WD disc with username & password.  Account has full access.  

    Just tried it (rename, move and deletion on open folders) on my mac mini running Yosemite 10.10.4 and no problems here. Tried on both local drive and on the Cloud mapped by AFP and SMB. It could be an open file or something that is preventing the folder from being deleted, or if you are trying this on the cloud, it could be a different samba version since I'm still on firmware 3.04 here on my cloud. Try it locally as well as trying other protocols like connect to server AFP://WMyCloud/<yourcloudname> or smb://WDMyCloud/<yourcloudname>   

  • Delete or Truncate statement for data purging

    Hi,
    I am writting a stored procedure to purge data from table every month. There is no constraint on table column except primary key.
    I am using 'delete' statement as it records an entry in the transaction log for each deleted row. But it's a slow process compared to 'Truncate' statement.
    Can you please suggest what should I choose (Delete or truncate) as per best practice.
    Thanks
    Sandy
    SandyLeo

    If you want to  delete all rows in the table use TRUNCATE, otherwise I would suggest the below technique
    --SQL2008 and onwards
    insert into Archive..db
    select getdate(),d.*
    from (delete  from db1
            output deleted.*
            where col=<value>
    ) d
            go
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Rename & deletion of planning book & Data view

    Hi Experts,
    Is it possible to rename & deletion of planning book & Data view, if yes what is the procedure.
    Also suggest if hiding of same is possible

    Hello  jrd333
    You can delete planning book/data view via transaction /SAPAPO/SDP8B
    There you can choose PB/DV that needs corrections.
    Also you maybe need to deactivate your planning area to wich this PB is assigned.
    You can do this in transaction /SAPAPO/MSDP_ADMIN
    This things is related to custom Planning Books/Views.

  • Delete vs truncate

    Hi,
    We are using Oracle and we have a daily job of loading data to a table.
    The existing data needs to be cleaned and fresh insert need to be done. Should I use Delete or truncate to clean the data.
    If any error occurs i need to have old data ie previous load in my table.
    so which option should i use? Delete or truncate
    Thanks
    Harshini

    Given this requirement:
    If any error occurs i need to have old data ie previous load in my table.I would suggest you consider a process that uses partition exchange.
    Such as:
    Create a work_table, with the same columns as your target_table, with a single partition. It could really be partitioned on anything, since you want only 1. Probably a range partition where values < maxvalue.
    Add local indexes to your work_table, that are the same type and cover the same columns as the indexes on your target_table.
    For each load:
    Truncate table work_table; -- to instantly empty it
    insert or load your data into work_table
    alter table work_table exchange partition the_only_partition with table target_table including indexes without validation;Now your current data is in target_table, and your previous data is in work_table. At no point were you stuck with only some of your data. If your data is bad, you can just do the partition exchange to put the previous data back.

  • How do I un-embed a video? I deleted the youtube video from ibooks author on my iMac, but it won't delete from the ipad ibook view. It shows up in my book as a blank bar until I tap it, then it plays the video.

    How do I un-embed a youtube video? I deleted the youtube video from ibooks author on my iMac, but it won't delete from the ipad ibook view. It shows up in my book as a blank bar until I tap it, then it plays the video. I made a new page after deleting the original page in which I inserted the video; it still shows up. Only the advertisement from the video plays.

    delete the media widget in Author
    re-preview to your iPad
    hope this helps...

  • Hi, I tried to download a bunch of my favourite TV episodes.  I was unable to get them all due to lack of storage.  I increased my storage but the downloads didn't come.  I tried deleting the already downloaded and viewed episodes but don't know how.

    Hi, I tried to download a bunch of my favourite TV episodes.  I was unable to get them all due to lack of storage.  I increased my storage but the downloads didn't come.  I tried deleting the already downloaded and viewed episodes but don't know how.
    I'm wondering if I should increase my storage again but I'm not sure that's the issue.

    You need more storage on your iPad, however, it can't be increased. iCloud storage is ecternal to the iPad and is used for backup.
    You need to delete some item on the iPad.
    How much space is used by your Other? You may be able to reduce.
    How Do I Get Rid Of The “Other” Data Stored On My iPad Or iPhone?
    http://tinyurl.com/85w6xwn
    With an iOS device, the “Other” space in iTunes is used to store things like documents, settings, caches, and a few other important items. If you sync lots of documents to apps like GoodReader, DropCopy, or anything else that reads external files, your storage use can skyrocket. With iOS 5/6/7, you can see exactly which applications are taking up the most space. Just head to Settings > General > Usage, and tap the button labeled Show All Apps. The storage section will show you the app and how much storage space it is taking up. Tap on the app name to get a description of the additional storage space being used by the app’s documents and data. You can remove the storage-hogging application and all of its data directly from this screen, or manually remove the data by opening the app. Some applications, especially those designed by Apple, will allow you to remove stored data by swiping from left to right on the item to reveal a Delete button.
    There are some wireless external hard drives that can be used with the iPad.
    Best iPad External Hard Drive Storage Options
    http://www.unlocktips.com/2012/11/best-ipad-mini-external-hard-drive-memory-stor age-options/
    iPad Storage Solutions
    http://www.ipadstoragesolutions.com/iPadWirelessStorage.php
    SanDisk Connect Wireless Media Drive http://www.sandisk.com/products/wireless/media-drive/
    Another option:
    Expand your iPad's storage capacity with HyperDrive
    http://www.macworld.com/article/1153935/hyperdrive.html
    On the road with a camera, an iPad, and a Hyperdrive
    http://www.macworld.com/article/1160231/ipadhyperdrive.html
     Cheers, Tom

  • Materilized Views

    Dear All,
    Can you tell me exactly what is the difference between Materilized View and snap shots.
    when to opt for materilized views.
    Regards
    VNK

    Hello VNK,
    despite the changes in handling and maintainability of materialized views over the past db versions,
    the main difference lies in a feature called 'query rewriting'.
    When adding a materialized view to a schema, the cost based optimizer is able to decide
    whether to select from the materialized view or the underlying tables without a change in the application code.
    MV's are generally used in DSS / Data Warehousing environments rather than in OLTP applications.
    Bernd

  • DELETE, DROP, TRUNCATE의 비교

    제품 : ORACLE SERVER
    작성날짜 : 1998-06-23
    DELETE, DROP, TRUNCATE의 비교
    =============================
    TABLE에서 행을 삭제하는 세 가지 OPTION의 비교
    TABLE에서 모든 행을 삭제하는 방법에는 다음과 같은 세 가지 OPTION이 있다.
    1. DELETE 명령어 사용
         DELETE 명령어를 사용하여 TABLE의 행을 삭제할 수 있다.
         예를 들어 EMP TABLE에서 모든 행을 삭제하는 명령문은 다음과 같다.
         DELETE FROM emp;
         O. DELETE 문을 사용할 때 TABLE이나 CLUSTER에 행이 많으면 행이 삭제
    될 때마다 많은 SYSTEM 자원이 소모된다. 예를 들어 CPU 시간, REDO
    LOG 영역, TABLE이나 INDEX에 대한 ROLLBACK SEGMENT 영역 등의 자
    원이 필요하다.
         O. TRIGGER가 걸려 있다면 각 행이 삭제될 때 실행된다.
         O. 이전에 할당되었던 영역은 삭제되어 빈 TABLE이나 CLUSTER에 그대로
    남아 있게 된다.
    2. DROP 과 CREATE 명령어 사용
         TABLE을 삭제한 다음 재생성할 수 있다. 예를 들어 EMP TABLE을 삭제하
    고 재생성하는 명령문은 다음과 같다.
         DROP TABLE emp;
         CREATE TABLE emp (......);
         O. TABLE이나 CLUSTER를 삭제하고 재생성하면 모든 관련된 INDEX,
    CONSTRAINT,TRIGGER도 삭제되며, 삭제된 TABLE이나 CLUSTERED
         TABLE에 종속된 OBJECTS는 무효화 된다.
         O. 삭제된 TABLE이나 CLUSTERED TABLE에 부여된 권한도 삭제된다.
    3. TRUNCATE 명령어 사용
         SQL명령어 TRUNCATE를 사용하여 TABLE의 모든 행을 삭제할 수 있다.
         예를 들어 EMP TABLE을 잘라내는 명령문은 다음과 같다.
         TRUNCATE TABLE emp:
         O. TRUNCATE 명령어는 TABLE이나 CLUSTER에서 모든 행을 삭제하는 빠르
    고 효율적인 방법이다.
         O. TRUNCATE 명령어는 어떤 ROLLBACK 정보도 만들지 않고 즉시 COMMIT
    한다.
         O. TRUNCATE 명령어는 DDL 명령문으로 ROLLBACK될 수 없다.
         O. TRUNCATE 명령문은 잘라 버릴 TABLE과 관련된 구조(CONSTRAINT,
         TRIGGER 등)과 권한에 영향을 주지 않는다.
         O. TRUNCATE 명령문은 현재 TABLE에 할당된 영역을 잘라버린 후에 포함
    되는 TABLESPACE로 복귀되도록 지정한다.
    (REUSE STORAGE, DROP STORAGE OPTION 사용)
         - DROP STORAGE OPTION 사용 시 : TABLE EXTENTS 수를 MINEXTENTS의
         원래 설정값으로 줄인다.
                   해제된 확장영역은 SYSTEM에 복귀되며,
              다른 OBJECTS가 사용할 수 있다.
    - REUSE STORAGE OPTION 사용 시 : 현재 TABLE이나 CLUSTER에 할당된
    모든 영역이 할당된 채로 남아 있도록
    지정한다.
         O. TRUNCATE 명령문이 TABLE에서 ROW를 삭제하면 해당 TABLE에 걸려 있는
    TRIGGER는 실행되지 않는다.
         O. AUDIT 기능이 ENABLE되어 있으면, TRUNCATE 명령문은 DELETE 문에 해
    당하는 AUDIT 정보를 생성하지 않는다. 대신 발생한 TRUNCATE 명령문
    에 대한 단일 AUDIT RECORD를 생성한다.
    * HASH CLUSTER는 잘라버릴 수 없다.
    또한 HASH CLUSTER나 INDEX CLUSTER 내의 TABLE도 개별적으로 잘라버릴 수
    없다.
    INDEX CLUSTER를 잘라버리면 CLUSTER에 있는 모든 TABLE의 모든 ROW가 삭제
    된다.
    모든 ROW가 각각의 CLUSTERED TABLE에서 삭제되어야 한다면 DELETE 명령어를
    사용하거나 TABLE을 삭제하고 재생성한다.

    There Oracle says us about CASCADE keyword in ALTER TYPE ... DROP METHOD statement
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_43a.htm#2078974
    CASCADE Clause
    Specify the CASCADE clause if you want to propagate the type change to dependent types and tables. Oracle Database aborts the statement if any errors are found in the dependent types or tables unless you also specify FORCE.
    Try to find the dependences between your super - and subtypes.
    It would be better if you specify your complete objects
    hierarchy in the example.
    Rgds.

  • Deleting data from a table view

    I have a data source that is in dictionary form (for why, see here). I have the following code that gets called in the commitEditing method for the table view:
    - (void)removeObjectFromListAtIndex:(NSIndexPath *)indexPath {
    NSMutableDictionary *mutableDataDictionary = [[NSMutableDictionary alloc] initWithDictionary:[listContent mutableCopy]];
    dNSLog (@"listContent: %@, mutableDataDictionary: %@", listContent, mutableDataDictionary);
    dNSLog (@"indexPath.section is %d", indexPath.section);
    NSString *section = [[NSString alloc] init];
    switch (indexPath.section) {
    case 0:
    dNSLog (@"Case Zero");
    section = @"A";
    break;
    case 1:
    dNSLog (@"Case One");
    section = @"B";
    break;
    case 2:
    section = @"C";
    break;
    case 3:
    section = @"D";
    break;
    case 4:
    section = @"E";
    break;
    case 5:
    section = @"F";
    break;
    case 6:
    section = @"G";
    break;
    case 7:
    section = @"H";
    break;
    case 8:
    section = @"I";
    break;
    case 9:
    section = @"J";
    break;
    case 10:
    section = @"K";
    break;
    case 11:
    section = @"L";
    break;
    case 12:
    section = @"M";
    break;
    case 13:
    section = @"N";
    break;
    case 14:
    section = @"O";
    break;
    case 15:
    section = @"P";
    break;
    case 16:
    section = @"Q";
    break;
    case 17:
    section = @"R";
    break;
    case 18:
    section = @"S";
    break;
    case 19:
    section = @"T";
    break;
    case 20:
    section = @"U";
    break;
    case 21:
    section = @"V";
    break;
    case 22:
    section = @"W";
    break;
    case 23:
    section = @"X";
    break;
    case 24:
    section = @"Y";
    break;
    case 25:
    section = @"Z";
    break;
    default:
    dNSLog (@"Default");
    section = nil;
    break;
    if (mutableDataDictionary) {
    NSMutableArray *arrayForNameSection = [[[NSMutableArray alloc] initWithArray:[mutableDataDictionary objectForKey:section]] mutableCopy];
    [arrayForNameSection removeObjectAtIndex:indexPath.row];
    NSArray *array = [[NSArray alloc] initWithArray:arrayForNameSection];
    [mutableDataDictionary setObject:array forKey:section];
    listContent = [NSDictionary dictionaryWithDictionary:mutableDataDictionary];
    [array release];
    [arrayForNameSection release];
    [section release];
    [mutableDataDictionary release];
    The code works flawlessly the first time through, but when I try to delete a second item, it crashes with a CALayer exception involving copyWithZone. The analyzer in Xcode (3.2) is telling me something's going on with the NSString section, but I'm not sure what...I'd appreciate any help!
    BTW, Ray if you happen to get this, the code is identical to what I emailed you, except that I added this code. The method name is the same.

    I have a data source that is in dictionary form (for why, see here). I have the following code that gets called in the commitEditing method for the table view:
    - (void)removeObjectFromListAtIndex:(NSIndexPath *)indexPath {
    NSMutableDictionary *mutableDataDictionary = [[NSMutableDictionary alloc] initWithDictionary:[listContent mutableCopy]];
    // What happens to the mutableCopy? Looks like a leak.
    dNSLog (@"listContent: %@, mutableDataDictionary: %@", listContent, mutableDataDictionary);
    dNSLog (@"indexPath.section is %d", indexPath.section);
    NSString *section = [[NSString alloc] init];
    // Memory leak because in all cases you re-assign the variable.
    // Arrrgggg!
    NSString * section = nil;
    if((indexPath.section >= 0) || (indexPath.section < 26))
    section = [NSString stringWithFormat: @"%c", 'A' + indexPath.section];
    switch (indexPath.section) {
    case 0:
    dNSLog (@"Case Zero");
    section = @"A";
    break;
    case 1:
    dNSLog (@"Case One");
    section = @"B";
    break;
    case 2:
    section = @"C";
    break;
    case 3:
    section = @"D";
    break;
    case 4:
    section = @"E";
    break;
    case 5:
    section = @"F";
    break;
    case 6:
    section = @"G";
    break;
    case 7:
    section = @"H";
    break;
    case 8:
    section = @"I";
    break;
    case 9:
    section = @"J";
    break;
    case 10:
    section = @"K";
    break;
    case 11:
    section = @"L";
    break;
    case 12:
    section = @"M";
    break;
    case 13:
    section = @"N";
    break;
    case 14:
    section = @"O";
    break;
    case 15:
    section = @"P";
    break;
    case 16:
    section = @"Q";
    break;
    case 17:
    section = @"R";
    break;
    case 18:
    section = @"S";
    break;
    case 19:
    section = @"T";
    break;
    case 20:
    section = @"U";
    break;
    case 21:
    section = @"V";
    break;
    case 22:
    section = @"W";
    break;
    case 23:
    section = @"X";
    break;
    case 24:
    section = @"Y";
    break;
    case 25:
    section = @"Z";
    break;
    default:
    dNSLog (@"Default");
    section = nil;
    break;
    if (mutableDataDictionary) {
    NSMutableArray *arrayForNameSection = [[[NSMutableArray alloc] initWithArray:[mutableDataDictionary objectForKey:section]] mutableCopy];
    // Get rid of this copy too.
    [arrayForNameSection removeObjectAtIndex:indexPath.row];
    NSArray *array = [[NSArray alloc] initWithArray:arrayForNameSection];
    [mutableDataDictionary setObject:array forKey:section];
    listContent = [NSDictionary dictionaryWithDictionary:mutableDataDictionary];
    // This is autoreleased. You might want to retain it.
    [array release];
    [arrayForNameSection release];
    [section release];
    [mutableDataDictionary release];

  • I believe I have deleted something I need to view movies or shows from netflix can someone help?

    Please help in getting netflix to work on iPad

    I didn't delete the netflix app I think I deleted something that I needed to have to view the shows! One of the kids downloaded a lot of games and I deleted the games and wondr if I deleted something I needed or did I change a setting by mistake??

Maybe you are looking for

  • FI-AA: no depreciation in depr. 15 (income tax) in fiscal year when retired

    Hello all! I have a question concerning settings for a FI-AA depreciation key concerning depr. area 15 (income tax; Slovakia): Calculation of depreciation in depr. area 15 (income tax) must be ZERO in case of retirement during fiscal year (no pro rat

  • JS CS3 : Hyperlinks.add(y,z) always recreates the same object :-(

    Hi, I am trying to create hyperlinks from an index. The command works fine except that doc.hyperlinks.add(source,destination) always rewrites the former one. They don't stack and I need them to do this way. Could you help ? I write this function : fu

  • Is the Apple Universal Dock worth the price?

    Hi everyone, I was thinking of buying a Universal Dock. What do you think of it? Is it worth the price tag of € 49? I know that you get a sync cable, USB power adapter and apple remote (which alone have a value of 20+30+20=70) but what are your thoug

  • Regarding a function exit

    hi guys, i have extended an idoc and for this i am using a function exit to populate data in the added new segment z1segment under E!knvkm segment ( parent segment). I found which funtion exit to use but i could not make out the logic to populate the

  • Cannot use the same song at 2 different points in a project?

    I have a video with a song playing and then I have a break where I want to be able to hear the video's audio with no song, then start the song back up. I cannot seem to drag the song onto the project in the 2nd spot. Anyone know how to fix this? I co