How to drop index or truncate partion prior to load data

I would like to add few sql command prior to execute the load data into table. Basically I would like to mark ununable index on specific partition and truncate that partitiion prior to load data. Please advice me some guideline. Thank you.

Take a look here
Re: How to truncate a partition in owb

Similar Messages

  • HOW TO DROP INDEX OF OTHER SCHEMA

    hi,
    I want to know how can we refer to objects that are of other schema. i need to drop an index of a table that belongs to some other schema and so if i write :
    drop tablename.indexname; - its not working.
    Please Help
    Thanks

    You are trying to drop an index on a table that belong to a different schema you are connected to.
    Do not add the table name to your command.
    Simply try
    drop index schema_name.index_name;
    Nico P.

  • How to filter the records in the process of loading data into ODS

    Hi All,
    I am doing some data extraction from R/3 system. But I need to ignore(don't need to load) the records with a date field (Purchase Order date) that is blank.
    So how can I filter out the records with the blank date field?
    Some one suggested me to write some select statement (looping the data packages) in the start routine but I am not that experianced with the ABAP routines. So can anyone provide some sample format of the routine or can you suggest me some other way to  filter out this data.

    Ram Kumar,
    I used this in the start routine but it gives me an error saying ...
    No component exists with the name "TRAN_STRUCTURE-BEDAT"
    <b>delete datapak where TRAN_STRUCTURE-BEDAT = '' OR
                         TRAN_STRUCTURE-BADAT = '' OR
                         TRAN_STRUCTURE-ERDAT = '' OR
                         TRAN_STRUCTURE-FRGDT = '' OR
                         TRAN_STRUCTURE-UDATE = ''.</b>
    I have taken out the TRAN_STRUCTURE part and just typed
    delete datapak where BEDAT = '' OR
                         BADAT = '' OR
                         ERDAT = '' OR
                         FRGDT = '' OR
                         UDATE = ''.
    This above statement has no syntax errors. but this statement doesn't filter out the records with a the date fields that are blank.
    Please help me out here.
    This is kind of urgent.
    Thanks,

  • How to use Index, Match, or lookup for multi cell data..

    Hey all,  I'm new to using numbers (any spreadsheet really).  I can't figure out how to make this work.
    What I want to do for example is lookup a weight value in (F) by matching all the criteria in (A),(B),(C),(D) & (E).  If possible I would like my search criteria to match everything exactly except the Temp in (E).  The search temp can be warmer or greater than the temp listed. 
    I've tried using Index and Match together but I can't figure out how to match more than one valvue.  If all the other criteria is matched there should only be one weight to return.  I can match one criteria valvue but it only returns the first or last match.  I need it to match each item and return one weight.  What am I doing wrong??
    Please help, and keep it simple for the stupid me.
    Thanks

    The difficulty here is that MATCH and VLOOKUP return the values from the single row with the first match best fitting the type of match specified. VLOOKUP searches from the bottom of the column, MATCH form the top.
    I'd suggest a rearrangement of your data to allow a search with fewer steps.
    Since you want an exact match for the first four columns and a 'smallest value equal to or greater than' match for the fifth column I would suggest concatenating the values in columns A through E into a single value in a new column F inserted after column E.
    For the part of the data table shown, this concatenated value would remain the same for 13 rows, while the temperature ranges in five degree steps from -20 to +45, then a single three-degree step to 48.
    One value in those concatenated then changes, and the new concatenated value repeats for the next 13 rows with the temperature passing through the same range with the same steps.
    If this pattern is consistent (or even reasonably consistent) through the whole table. then a rearrangement of the data as shown below will greatly reduce table size and search time.
    Each distinct set of values A though D is presented on only a single row, the four values are concatenated in column E, and are followed by the temperature values, one per column, in the header row, with the associated weights for those conditions and that temperature listed across that row.
    Note: weights in row 2 (runway 13) are taken from your table. Boredom with retyping then set in, so those in row 2 (runway 31) are formula generated to present a series of decreasing weights, but bear no other relation to those in your table.
    With the table presented in this form, the search is reduced to a single OFFSET expression, with the ROW offset determined by matching the concatenated value of columns A-D of the Query table with their exact counterpart in the Data table, and the column offset determined by matching the temperature in the Query with its closest less than or equal to match in row 1 of Data.
    Formula:
    Query::F2: =OFFSET(Data :: $A$1,MATCH(A&B&C&D,Data :: $E,0)-1,MATCH(E,Data :: $1:$1,1)-1)
    Not handled: What do you want returned for temperatures less than -20 or greater than +48 degrees? As written, the formula will return a not found error for -21 and below, and the value associated with 48° for 49 and above.
    Regards,
    Barry

  • How to create index on a varchar column that represent date?

    Hello there,
    I have a column in my table that is a VARCHAR2 and represent a datetime like '2010-08-23 19:00:00' I want to create an index on it and with an specific large like '2010-08-23 19' so i can filter per HOURS.
    Any one knows the sentence for this?
    Thanx in advance

    Vladimir Zakharychev wrote:
    I'd highly recommend you heed the advice given: store dates as DATE, numbers as NUMBER, strings as VARCHAR2. I can't imagine any valid reason for storing dates like that (except the undisputable "because I want it that way.") You are likely to see all sorts of inefficiencies with your current design (it will not sort correctly, for example, because it will sort strings, not dates, and the rules for sorting them are different.) The function-based index you created will only work if your query will use that same exact function you created the index on.Not to mention that there is no way the database can enforce the "date" data to actually be a valid date . . . and there will come a time that the application *will not" enforce it ...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to clear the Managed Bean Values prior to load a JSF page

    Hello.
    I have a jsf page that contains fields that need to be cleared BEFORE the page is loaded.
    My managed bean where the fields are linked (I�m using the value attribute) is in the SESSION scope because I need to control they values across a popup window and if I use request scope, my vectors that load objects like dataTable are cleared when I post the form.
    My question is :
    How I CLEAR all the values in the managed bean BEFORE the page is loaded ???
    In the WebForms (Microsoft .NET) I have an method on the codebehind called Page_Load where I put my initialization code for my page.
    Thanks in advance.
    Rog�rio

    Rog�rio,
    You can do this with a PhaseListener. Just regiser a new listener for the RESTORE_VIEW phase, and implement the beforePhase method; you can do this in the backing bean's constructor, or somewhere elase. This is pretty much the same as the Page_Load event handler in .NET.
    Kito D. Mann
    Author, JSF in Action
    http://www.jsfcentral.com - JSF news, info, and FAQ
    Hello.
    I have a jsf page that contains fields that need to be
    cleared BEFORE the page is loaded.
    My managed bean where the fields are linked (I�m using
    the value attribute) is in the SESSION scope because I
    need to control they values across a popup window and
    if I use request scope, my vectors that load objects
    like dataTable are cleared when I post the form.
    My question is :
    How I CLEAR all the values in the managed bean BEFORE
    the page is loaded ???
    In the WebForms (Microsoft .NET) I have an method on
    the codebehind called Page_Load where I put my
    initialization code for my page.
    Thanks in advance.
    Rog�rio

  • How to use local variables in control files for loading data

    i want to count the number of records which have odd number like...
    Data in data.txt
    1 a
    2 b
    3 c
    So my count = 2, i will write this to another file.
    Plz help me how to achieve this

    If you want to extract some rows from a file and write them to another one, why do you need Oracle? What is your requirement?
    Or are you asking out of curiosity how can this be done in Oracle?
    You can create an external table for this input file, select the rows you want from it and write them to another file using utl_file.
    External tables: http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/et_concepts.htm#SUTIL011
    UTL_FILE: http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_file.htm#sthref14095

  • How to increase the number of processes taken for loading data?

    Hi,
    While loading data from R/3 to BW, we found that the particular load is taking 2 processes to load data into Cube.
    Is there anyway to increase the number to 4 ?
    Thanks in advance.
    Bobby.

    Bobby,
       to my knowledge we can't change that. Let me explain this, we have setting in the source system for DS default Data Transfer. there we will assign the processes. if you want to assign 4 you need to change the setting in the source system. For flat files we can change in BW System. We can maintain the setting in the Infopackage level(wht we are assigned in the Source System), but we can't change the process.
    in order to check the setting in source system  SBIW--> General Settings --> Control Parameters for Data Transfer.
    we need to change here, this will effect to all the Data Sources. Before making changes check with your basis.
    All the best.
    Regards,
    Nagesh Ganisetti.

  • How to Create an R/3 source system and load data from there

    Hello All,
    Till now I have only worked with Flat files. I want to create an R/3 source system and extract data from there on to my Info Providers.
    Does anyone has detailed steps for that. I am using BW 3.5 system
    Thanks n Regards,
    Abhishek

    1. Type Transaction WE30. Check iDoc types
    2. Type Transaction SM59. Maintain RFC destinations
    a.) Open the RFC Destinations. b.) Find your Source System and double click on it. c.) Technical setting should contain information regarding yoursource system d.) Logon Information should contain source system client and name & password for you remote logon. We use RFC_SAB for BW logon to R/3 and RFC_AAE for R/3 logon to BW. Password for both is always xxxxxxx. e.) Execute your 'Test Connection' & 'Remote Logon'. You should NOT be prompted for a password, if you are then the logon info is incorrect. f.) Repeat above to verify RFCs for other systems (CRM etc)
    3. Type Transaction WE21. iDoc Processing Ports.
    a.) Select 'Ports' and then 'Transactional RFC'. b.) Click on the Port # for you source system. c.) Verify description & SAP R/3 version.(BW 2.1C should be release 4.x) d.) RFC Destination should be one created in SM59. If non-existent then create one
    4. Type Transaction SE16. Data browser (for R/3 &#61663;&#61664; BW Connections)
    5. Type Transaction SM30. Msg Types & Assignment to iDocs
    Enter 'EDIMSG' in the Table/View field. Click on the 'Enter Conditions' option for Restrict Data Range. Click 'Maintain'. Select Message Type. Then enter 'RSSEND' in "From' field. Verify that the Basic Type matches what is in your RSBASIDOCtable for each of your connections. If any are missing any entries you must create them as follows: Create another session and type Transaction WE30. Enter IDoc Type (ZSBAXXX) in Obj. Name field (Suggestion: Start new type with 'ZS' + Transfer Structure Prefix + (3)#'s) Select Create. Select "Create from Copy'. Enter 'RSSEND" in 'Copy From' field Enter Description (i.e. IDoc Type for BW Development) Execute (Green Check). Repeat for other missingentries.
    6. Go to the SM30 main screen. Clients Overview
    Enter 'T000' in the Table/View field. Click 'Maintain'. Verify correct Client and Description. If incorrect enter.
    8. On BW Type Transaction WE20. Partner Profiles
    9. On R/3 Type Transaction WE20. Partner Profiles
    10. Check all is correct

  • How I can Load Data in Excel File On Table in Pl/SQL

    Dear All
    I have Excel File and I need To Load Data on Table Using PL/SQL.
    How I Can It.
    Thanks In advance.

    user8942603 wrote:
    load data
    infile 'C:\Documents and Settings\pc computer\Desktop\calling code.csv'
    into table MSR_CALLING_CODE
    fields terminated by "," optionally enclosed by '"'
    ( code,COUNTRY )
    When Use this Code the error Occurred
    ERROR at line 1:
    ORA-00900: invalid SQL statement
    what the problemThat's because you have to set up SQL*Loader with a a control file and then run the sqlldr command from the command line. It's not an SQL command.
    If your file is CSV you would be better using external tables instead, although that means that your data will have to be on the database server first.
    If the file is located on your local computer then you would have to use SQL Loader.

  • How to drop several indexes

    Hi.
    Could anybody tell me how can i drop several bad indexes.
    There are lots of indexes to columns which have duplicated values. I need to drop these all indexes. but not in manual way like
    drop index one;
    drop index two;
    Is there some way of inserting a select statement into drop? And how to run it for all tables in schema?

    As usual Jonathan's advice sums it up pretty good. I'm all for using Oracle or a script to identify indexes for 'potential' removal but I'm not convinced you can automatically remove them safely without considering other factors that Oracle simply can't know.
    IMO indexes should never be added without a valid reason. Part of the problem is that the reason is often never documented anywhere. Another part is that as incremental app changes are made Oracle may start using that index for purposes other than the original reason.
    Some indexes that might be considered 'duplicate' in an OLTP environment might not be duplicate at all for OLAP purposes. I have often created a new index that adds a single column to an existing index just so that a key query can use the index to get the column value and not have to access the table of that index; sort of a mini index-organized table that provides one or two commonly queried columns in the index to avoid table access.
    If you drop one of those 'duplicate' indexes it could cause a lot of execution plans to change.

  • How to include Drop index in PL/SQL

    Hi,
    In my PL/SQL, I put a drop index statement in between, but it gave me an error of
    "PLS-00103: Encountered the symbol "DROP" when expecting one of the following:
    begin declare exit for goto if loop mod null pragma raise
    return select update while <an identifier>
    <a double-q"
    My statement is structured as:
    DECLARE
    BEGIN
    DROP INDEX index_name;
    COMMIT;
    END;
    Why is this error occuring? When I execute the drop index statement seperately it is ok. When i put it in the PL/SQL it gave me error.
    Do I need special syntax to include a Drop index statement in a PL/SQL?
    Thanks

    Any DDL commands in PL/SQL must be executed using dynamic SQL:
    execute immediate 'drop index index_name';

  • How to Drop an index from a used table. online

    I need to drop an index from a table that is constantly used , read and write.
    The DML's are locking the table and preventing the index drop (ORA-00054: resource busy and acquire with NOWAIT specified )
    I tried to lock the table first - using 'lock table TAB1 in exclusive mode'
    but when i ran the 'drop index' command , the drop (as all DDL's) first commits and this frees the lock which cause again the ORA-00054: resource busy and acquire with NOWAIT specified error.
    I would appriciate any help .I can't take the DB or table or Application writing to the table offline. I need something like 'create index IND1 online' for DROP but there is none as far as I know...
    Thanks in advanve.
    Amit Zor

    "It is requsted for the removal of an ORDER BY clause from a CPU consuming query.
    The extra field enables me to remove it as the result set comes back ordered by the index"
    It might do that today, but it is not guaranteed to do it tomorrow. Oracle may be able to retrieve the records ordered using that index, but I would leave it in your query if you are depending on the rows being ordered. The CBO is smart enough to not actually sort the rows (i.e. act on the ORDER BY clause) if it can get them sorted using the index, but if it decides to use another access path for one of many reasons your results will not be sorted without the ORDER BY.
    Since the CBO seems to think that your existing index is useful (which is why you cannot get the lock on it), your only option is to wait for a period of really low activity on the database and try it then.
    John

  • How to drop a index

    I am trying to drop one index but its failling
    SQL> select INDEX_NAME,DROPPED from dba_indexes where INDEX_NAME='XXCCI_HZ_CODE_ASSIGNMENTS_N1';
    INDEX_NAME DRO
    XXCCI_HZ_CODE_ASSIGNMENTS_N1 NO
    SQL> Drop index XXCCI_HZ_CODE_ASSIGNMENTS_N1;
    Drop index XXCCI_HZ_CODE_ASSIGNMENTS_N1
    ERROR at line 1:
    ORA-01418: specified index does not exist
    what is the problem plz help.

    Ya the Edited time and Posted times are probably correct on your computer but on mine, it shows your posted time in my timezone but your edited time in your timezone. They should keep it standard.
    Posted: Sep 18, 2008 3:15 PM - RTSEN TIMEZONE
    Edited by: Anand... on Sep 19, 2008 2:46 AM - ANAND TIMEZONEEdit - Sorry to the OP for redirecting the thread, i'll post this in the feedback forum to see if this is an error.
    Edited by: rkhtsen on Sep 18, 2008 3:36 PM

  • Dropping index gives ORA-29861

    Hello
    We have an application which reads data from MapInfo Spatialware using MapInfo Professional and upload this data into Oracle Spatial tables using MapInfo Easy Loader utility.
    The constraint is that tables in oracle spatial must not be dropped. So we have written a stored procedure which queries unique and spatial indexes of a feature table, then it drops them and truncates the table.
    Easy loader then uploads fresh data into these truncated tables and re creates spatial and unique indexes.
    This solution is working fine except for 1 feature table "ZONE". The stored procedure is unable to drop the indexes and error log shows error "ORA-29861: domain index is marked LOADING/FAILED/UNUSABLE".
    I looked into discussion forums and they say to drop the indexes specifying keyword "FORCE" but how can i query whether index is corrupt and i must force drop it. Index state is all VALID which i check them...
    below is the stored procedure....
    CREATE OR REPLACE
    PROCEDURE Spa_Initializetables
         (     TNAME          IN     VARCHAR2,
         SPATIALCOL          IN     VARCHAR2,
              ERROR_CODE OUT     NUMBER,
              ERROR_MESSAGE     OUT     VARCHAR2
    IS
    CURSOR c1 IS
    SELECT * FROM user_sdo_index_info WHERE table_name LIKE UPPER(TNAME) AND column_name LIKE UPPER(SPATIALCOL);
    BEGIN
    --Truncate the given table
    EXECUTE IMMEDIATE 'TRUNCATE TABLE ' || TNAME;
    --Loop through all the indexes found and drop them one by one
    FOR cur_ts IN c1 LOOP
    --DBMS_OUTPUT.PUT_LINE(cur_ts.index_name);
    EXECUTE IMMEDIATE 'DROP INDEX '|| cur_ts.index_name;
    END LOOP;
    ERROR_CODE := 0;
    EXCEPTION
         WHEN OTHERS THEN
         ERROR_CODE          :=     1;
         ERROR_MESSAGE     := SQLERRM;     
    END Spa_Initializetables;
    please let me know what best i can do
    Regards
    Sam

    Sorry, but I can't simulate this troulbe. look:
    create table a (id number, lmao mdsys.sdo_geometry)
    INSERT INTO mdsys.sdo_geom_metadata_table (SDO_OWNER,SDO_TABLE_NAME,SDO_COLUMN_NAME,SDO_DIMINFO,SDO_SRID)
    VALUES ('GIS','A','LMAO',SDO_DIM_ARRAY(
    SDO_DIM_ELEMENT('X', -180,180, 5e-4),
    SDO_DIM_ELEMENT('Y', -180,180, 5e-4)), NULL);                         
    create index a_g_idx on a(lmao) indextype is mdsys.spatial_index;
    insert into a values (1,SDO_geometry(2003,NULL,NULL,SDO_elem_info_array(1,1003,3),SDO_ordinate_array(1,1, 2,2)));
    commit;
    truncate table a;
    insert into a values (2,SDO_geometry(2003,NULL,NULL,SDO_elem_info_array(1,1003,3),SDO_ordinate_array(1,1, 2,2)));
    drop table a;
    No errors :(
    I have 10.2.0.3
    May be i didn't understood you ?

Maybe you are looking for