Truncate partition on table

Hi,
Is there any alternative to sql "alter table schemaname.tablename truncate partition partition_name drop storage update global indexes;"? This SQL causes concurrency and blocks inserts for few minutes especially for a table having billion of rows.
Thanks in advance.
-Mal
Edited by: user11159757 on Sep 12, 2011 3:33 PM

If you have Global Indexes or Globally Partitioned Indexes (i.e. indexes that are NOT equi-partitioned with the table as LOCAL indexes).... you have to maintain those indexes.
There are two choices :
1. Use UPDATE GLOBAL INDEXES --- useful if you are truncating only 1 or a few partitions, that add up to a small proportion of the rows in the table (i.e. a relatively small portion of the whole Global Index)
2. Set those Indexes to UNUSABLE before the TRUNCATE and then REBUILD them after the TRUNCATE --- useful if you are truncating many partitions, many rows, that add up to a large portion of the rows in the table (i.e. a large portion of the whole Global Index)
If the Global Index is a Unique Index, you don't have much of a choice.
One more reason why one must think through very carefully when designing Partitioned Tables and indexes on them.
Hemant K Chitale

Similar Messages

  • What privs r required to run Alter table truncate partition update indexes?

    I rebuilt the indexes on the table. Know my problem is that when I truncate a partition on the table the unique index whic consist of the primary key fields becomes unusable which causes my to have to rebuild it after each truncate. I tried to runm the following statement from the master schema on but get
    an insufficient privs error when I use "update indexes":
    Alter table schema_name.table_name truncate partition partition_name storage update indexes;
    What priv does master need to perform statement successfully when there's data in it?
    Does using 'update indexes' needs extra priveleges?
    Thanks in Advance
    Gagan

    Hi Its Oracle 10.2.0.4 64 Bit on HP UX.
    I dont have the exact error as I got this much information only from the end user....It will be couple of hours more then he will be available again
    ok so for Truncate we need 'Drop any' privs but to use clause 'update indexes' alongwith do we need some extra privelege?
    Thanks again
    Gagan

  • Logical standby and truncate partition

    Hi,
    I'm evaluation whether a logical standby database would meet our needs.
    We have a live database and want a reporting database that is identical to the live one, just minutes behind in time to the live one, plus we want to create other summary tables etc on the reporting db.
    Logical standby seems to meet our needs but I have one query.
    - On the live db the most of the tables are organized by date partitions and only 5 days are kept with new partitions being created every night for the forthcoming days and the oldest date partitions being truncated.
    On the reporting database we want to keep 30 days partitions.
    Can we have all the DDL and DML from live being applied to the standby APART from the specific truncate partition statements?
    Many Thanks,
    Kailas

    Addendum.
    If you can , it is better to truncate the partition but not drop it, after exporting the partition for archive purposes. If you ever need to bring the data back, the data will go into the correct partition . If the table structure has been changed by adding or lengthening columns, this will still work OK where column names match.
    Test ease of restoration of archived data to existing and non-existing partitions with altered structure (dropped columns,added columns, renamed columns) for yourself though.
    Regards, Vin.
    PS. When splitting maxdata partition to create new 'highest' partition, use a small initial extent then the 'next' being the expected real size needed. When the partition is truncated, the only space that should remain un-claimable will be that allocated for the initial extent.

  • Partitioning the table ...

    I have procedure which inserts the data based on sysdate (everyday). I have partitioned the table using partition by list i have created 31 partitions on this table.
    say for example if tis 8th of sep then the partition will be xyz_08 and tommorow will be xyz_09 similarly i have 31 partitions.
    I was trying to insert manually by changing sys dates for example like sysdate -1, sysdate -2, sysdate -3 and so on. And it worked absolutely fine
    My requirement :- is once its reaches to 31st partition then it has to drop the 1st partition and so on it continues by droping old partitions everyday once its inserted with the latest partition.
    my questions
    - how do incorporate a logic of adding partitions everyday ?
    - how to drop the oldest partition(1st partition ) when it reaches the 31 partition ?
    - do i need to use cursors and for loop to archive this both above tasks ?
    Any logic with example would be great. Sample code will be wonderful ??
    Thank you so much i appreciate it. !!!

    user642297 wrote:
    let me share my code how i am implementing the partition by list ...Please use the *\* tag before and after a sample code block (or database output) that you post. This formats the code properly (as predefined text output) and is a lot easier on the eye to read. (yes - copy the tag exactly as you see it here and paste it into your posting).
    In my previous posting i mentioned about the droping the partition. But thats not the right way i guess. Because if i drop the partition then the data will not be loaded in the same partition next time since that partition will be dropped.
    The best way would be truncating the partition i guess. so next time we can load the data in the same partition ....
    Correct. You can simply truncate the partition to empty it and ready if for a new data set. However, as already mentioned, a range partition and not a list partition may be more suitable.
    One of the great features of partitioning is called +partition pruning+. This means Oracle, at run-time, figures out what partitions to use, and what partitions to ignore, for a specific SQL query. As the data is date based. it makes more sense to use a date range partition - this allows pruning to happen when you look for data for a specific date or date range. With a list partition, you need to use the list column as is as a predicate... and it will be unusual to construct queries that only look at the day number and not as the date as a whole.
    few more questions
    - if i drop the table, will partitions will also be dropped automatically ? or do i need to explicitly drop the partitions before dropping the table ?
    Yes. Partitions is part of the table (these are physical storage containers for the data). Drop the table. Partitions gone.
    - how would i drop all the partitions at once ???
    By dropping the table. You cannot drop all partitions either - at least one partition must remain behind as a table needs a "+storage container+". It cannot be a table without a means of storing the data inserted into the table somewhere.
    i know i can use ALTER TABLE TABLE_NAME DROP PARTITION PARTITION_NAME. This only drops the particular partition but not all the partitions right????
    Correct.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Pages 5.1 truncates text in tables

    Just discovered that Pages 5.1 truncates text in tables when exported to Pdf's even when created in Numbers and pasted. Superscripts were missing. Sometimes regular text after superscrips were missing. Too bad.

    It's a bug. Until fixed, you'll have to avoid baseline shift or use an earlier version of Pages. Submit Feedback from the Pages menu to let Apple know you are finding this bug.
    Jerry

  • Problem while partitioning The Table

    create table Employee ( empno number(3), name varchar2(10), deptno number(4))
    partition by range(deptno)
    (partition p1 values less than(11),
    partition p2 values less than(21),
    partition p3 values less than(31));
    create table Employee (
    ERROR at line 1:
    ORA-00439: feature not enabled: Partitioning
    Please help me for solving this problem and send me the details I need to partition my table.
    Thanks in advance.
    w.regards
    R.Satish

    Looks like you don't have partition license or don't have a complete install of Oracle version 8.0.5. The best way to check is do a sqlplus user/passwd and look for a message that said "Production with the Partitioning and objects options" to appear before the SQL> prompt. Hope this helps....
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by rkumar:
    create table Employee ( empno number(3), name varchar2(10), deptno number(4))
    partition by range(deptno)
    (partition p1 values less than(11),
    partition p2 values less than(21),
    partition p3 values less than(31));
    create table Employee (
    ERROR at line 1:
    ORA-00439: feature not enabled: Partitioning
    Please help me for solving this problem and send me the details I need to partition my table.
    Thanks in advance.
    w.regards
    R.Satish <HR></BLOCKQUOTE>
    null

  • Limit on the number of partitions a table can have

    Hi,
    It's been quite some time I'm thinking of a simple and the best solution to a performance issue in my application. Benefiting out of partitioning the table seems a simplest approach; it involves very minimal changes to my application code and in addition, it keeps the overall application logic 100% intact. However, at times, the number of partitions required can grow to as large as 500 thousand. I know of another application implementing as many as 50 thousand partitions for one of its tables. I'm wondering if Oracle recommends or poses any limit to a number of partitions the table can have. How does that limit, if it exists, vary if each of my table partition holds only a small amount of data; say, not more than 2 thousand records each of 1 KB size. What are the important considerations that one needs to keep in mind while creating the huge number of partitions for a table?
    Any inputs on this would be a great help.
    Thanks,
    Aniruddh
    ps: Consider Oracle releases 10g onwards.
    Edited by: Aniruddh on Dec 30, 2009 9:46 AM
    Edited by: Aniruddh on Dec 30, 2009 9:50 AM

    Aniruddh,
    >
    What are the important considerations that one needs to keep in mind while creating the huge number of partitions for a table?
    >
    I doubt if you are using partitioning for the right causes. Please explain how is your data structured and why you need to create so many partitions..?
    when creating partition, you need to consider..
    a) why you need to partition?
    b) how is your data structured
    c) how your data is indexed.
    d) What kind of queries would you firing on this table to get the data. Will they use the partition key ?
    Thanks,
    Rajesh.
    Please mark this/any other answer as helpful or answered if it is so. If not, provide additional details/feedback.
    Always try to provide create table and insert statements to help the forum members help you better.

  • PL/SQL- Problem in creating a partitioned fact table using select as syntax

    Hi All,
    I am trying to create a clone(mdccma.fact_pax_bkng_t) of existing fact table (mdccma.fact_pax_bkng) using dynamic pl/sql. However, pl/sql anonymous block errors out with following error:
    SQL> Connected.
    SQL> SQL> DECLARE
    ERROR at line 1:
    ORA-00911: invalid character
    ORA-06512: at "SYS.DBMS_SYS_SQL", line 1608
    ORA-06512: at "SYS.DBMS_SQL", line 33
    ORA-06512: at line 50
    Here is pl/sql block:
    -- CREATING FPB_T
    DECLARE
    v_owner VARCHAR2(32) := 'MDCCMA';
    v_table_original VARCHAR2(32) := 'FACT_PAX_BKNG';
    v_table VARCHAR2(32) := 'FACT_PAX_BKNG_T';
    v_tblspc VARCHAR2(32) := v_owner||'_DATA';
    CURSOR c_parts IS SELECT TABLESPACE_NAME, PARTITION_NAME,HIGH_VALUE, ROW_NUMBER() OVER (ORDER BY PARTITION_NAME) AS ROWNUMBER
    FROM USER_TAB_PARTITIONS
    WHERE TABLE_NAME = v_table_original
    ORDER BY PARTITION_NAME;
    v_cmd CLOB := EMPTY_CLOB();
    v_cmd3 varchar2(300) := 'CREATE TABLE ' ||v_owner||'.'||v_table||' TABLESPACE '||v_tblspc
    ||' NOLOGGING PARTITION BY RANGE'||'(' ||'SNAPSHOT_DTM '||')' ||'(';
    v_part VARCHAR2(32);
    v_tblspc_name VARCHAR2(32);
    v_row number;
    v_value LONG;
    v_tmp varchar2(20000);
    v_cur INTEGER;
    v_ret NUMBER;
    v_sql DBMS_SQL.VARCHAR2S;
    v_upperbound NUMBER;
    BEGIN
    v_cmd := v_cmd3;
    OPEN c_parts;
    FETCH c_parts INTO v_tblspc_name, v_part,v_value, v_row;
    WHILE c_parts%FOUND
    LOOP
    IF (v_row = 1) THEN
    v_tmp := ' PARTITION '||v_part||' VALUES LESS THAN ' ||'('|| v_value||')'||' NOLOGGING TABLESPACE '||v_tblspc_name;
    ELSE
    v_tmp := ', PARTITION '||v_part||' VALUES LESS THAN ' ||'('|| v_value||')'||' NOLOGGING TABLESPACE '||v_tblspc_name;
    END IF;
    v_cmd := v_cmd || v_tmp;
    -- DBMS_OUTPUT.PUT_LINE(v_cmd);
    FETCH c_parts INTO v_tblspc_name, v_part,v_value, v_row;
    END LOOP;
    -- DBMS_OUTPUT.PUT_LINE('Length:'||DBMS_LOB.GETLENGTH(v_cmd));
    v_cmd := v_cmd||')'||' AS SELECT ' || '*'||' FROM ' || v_owner||'.'|| v_table_original ||' WHERE '||'1'||'='||'2'||';';
    v_upperbound := CEIL(DBMS_LOB.GETLENGTH(v_cmd)/256);
    FOR i IN 1..v_upperbound
    LOOP
    v_sql(i) := DBMS_LOB.SUBSTR(v_cmd
    ,256 -- amount
    ,((i-1)*256)+1 -- offset
    END LOOP;
    v_cur := DBMS_SQL.OPEN_CURSOR;
    DBMS_SQL.PARSE(v_cur, v_sql, 1, v_upperbound, FALSE, DBMS_SQL.NATIVE);
    v_ret := DBMS_SQL.EXECUTE(v_cur);
    CLOSE c_parts;
    DBMS_OUTPUT.PUT_LINE(v_cmd);
    -- EXECUTE IMMEDIATE v_cmd ;
    END;
    The above pl/sql creates a DDL for partitioned fact table(new) based on an existing fact table and get executes through CLOB.
    Please look into the issue and let me know any changes or modifications/suggestions that are required to fix the issue. Any help is appreciated.
    Thank You,
    Sudheer

    Think this is your problem:
    v_cmd := v_cmd||')'||' AS SELECT ' || '*'||' FROM ' || v_owner||'.'|| v_table_original ||' WHERE '||'1'||'='||'2'||';';Remove the SQL terminator ';' ... dynamic SQL doesn't require it, try this instead:
    v_cmd := v_cmd||')'||' AS SELECT ' || '*'||' FROM ' || v_owner||'.'|| v_table_original ||' WHERE '||'1'||'='||'2';Thanks
    Paul

  • Partitioning of table in oracle 10g - How to Add

    Hello Friends ,
    Hope you are all fine and doing great.
    By the way - I have a quick question on oracle 10g Partitioning of tables...
    I have a table with partition as stated below ..
    CREATE TABLE X_ACC_ASSETS_GPC_AGG
    X_ACC_ASSETS_GPC_AGG_RK NUMBER(10) NOT NULL,
    X_AS_OF_DT DATE NOT NULL,
    ACCOUNT_RK NUMBER(10) NOT NULL,
    X_UNIV_ACCOUNT_ID NUMBER(10),
    ACCOUNT_ID VARCHAR2(10 BYTE),
    X_ASSET_TYPE_CD VARCHAR2(6 BYTE),
    X_AUC_AMT NUMBER(18,5),
    X_FIRM_AMT NUMBER(18,5),
    X_ADJ_SRCE_AMT NUMBER(18,5),
    PROCESSED_DTTM DATE
    )PARTITION BY RANGE (X_AS_OF_DT)
    PARTITION P200712 VALUES LESS THAN (TO_DATE(' 2008-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    NOLOGGING
    NOCOMPRESS
    TABLESPACE KAW_DATA
    PCTFREE 10
    INITRANS 1
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS 2147483645
    BUFFER_POOL DEFAULT
    PARTITION P201112
    NOLOGGING
    NOCOMPRESS
    TABLESPACE KAW_DATA
    PCTFREE 10
    INITRANS 2
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS 2147483645
    BUFFER_POOL DEFAULT
    PARTITION PMAX
    NOLOGGING
    NOCOMPRESS
    TABLESPACE KAW_DATA
    PCTFREE 10
    INITRANS 2
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS 2147483645
    BUFFER_POOL DEFAULT
    )NOPARALLEL;
    My question is :
    1) How to add a partition say P201201 ..
    Since I have already stated PARTITION PMAX can I still add partition?
    2) Can I add partition even though the table has data ?
    ==========================
    I tried to add partition ..say
    ALTER TABLE X_ACC ADD PARTITION P201201 VALUES LESS THAN
    (TO_DATE(' 2012-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
    NOLOGGING
    NOCOMPRESS
    TABLESPACE KAW_DATA
    PCTFREE 10
    INITRANS 1
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS 2147483645
    BUFFER_POOL DEFAULT
    but getting the error ..
    "partition bound must collate higher than that of the last partition"
    Thanks/kumar

    You have partitions
    200712
    200812
    200912
    201012
    201112
    PMAX.
    so your condition for partition p201112 is '201012-01-01' to '201112-01-01' i.e the values between these two dates will be in partition p201112. and then everything else will be in PMAX. So now you are splitting your pmax.
    alter table X_acc split partition pmax at ( to_date('2012-01-01 00:00:00','YYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN') )
    into (partition p201201, partition pmax); The condition you have to change. I just showed as an example. It could be the date range between two dates or it could be greater than a date value. It is upto how you want this new partition.
    how to add partition between two partition
    Edited by: pransuj on Mar 25, 2011 11:13 AM
    Edited by: pransuj on Mar 25, 2011 11:14 AM

  • Sql server partition parent table and reference not partition child table

     
    Hi,
    I have two tables in SQL Server 2008 R2, Parent and Child Table.  
    Parent has date time, and it is partitioned monthly,  there is a Child table which just refer the Parent table using Foreign key relation.   
    is there any problem the non-partitioned child table referring to a partitioned parent table?
    Thanks,
    Areef

    The tables will need to be offline for the operation. "Offline" here, means that you wrap the entire operation in a transaction. Ideally, this transaction would:
    1) Drop the foreign key.
    2) Use ALTER TABLE SWITCH to drop the old data.
    3) Use ALTER PARTITION FUNCTION to drop the old empty partition.
    4) Use ALTER PARTITION FUNCTION to add a new empty partition.
    5) Reapply the foreign keys WITH CHECK.
    All but the last operation are metadata-only operation (provided that you do them right). To perform the last operation, SQL Server must scan the child tbale and verify that all keys are present in the parent table. This can take some time for larger tables.
    During the transaction, SQL Server holds Sch-M locks on the table, which means that are entirely inaccessible, even for queries running with NOLOCK.
    You avoid this the scan by applying the fkey constraint WITH NOCHECK, but this can have impact on query plans, as SQL Server will not consider the constraint as trusted.
    An alternative which should not be entirely dismissed is to use partitioned
    views instead. With partitioned views, the foreign keys are not an issue, because each partition is a pair of tables, with its own local fkey.
    As for the second question: it appears to be completely pointless to partition the parent, but not the child table. Or does the child table only have rows for a smaller set of the rows in the parent?
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Partitioning of tables  in oracle 1og

    I want to do the partitioning of tables due to increasing their size.Can anyone guide me cn I do it? Is it possible to do it?If possible then how can i do it.plz guide mme with al qeuries.
    thanks.

    While it is certainly possible to partition tables (assuming you have the enterprise edition and the partitioning option), that is not something that you would generally want to take a cookbook approach to. Partitioning tables incorrectly is a great way to slow down the system and make it oodles more difficult to support. Partitioning requires a fair amount of architecture and design to get right, and that, in turn, requires that you understand how partitioning works, how your application works, and what you want partitioning to do to change the way your application works.
    Justin

  • Partitioning A table on a data column

    Hi,
    My requirement is to partition a table using a column with DATE datatype.
    Example:
    CREATE TABLE parttab
    STATUS CHAR(1) DEFAULT 'a' NOT NULL,
    UPDATER VARCHAR2(55) NOT NULL,
    UPDTIME DATE DEFAULT SYSDATE NOT NULL
    TABLESPACE part_tbs
    Now i want to RANGE partition the above table on the "UPDTIME" column, so that it will look like:
    Partition Value from Value till
    P1 01-Jan 31-Mar
    P2 01-Apr 30-Jun
    P3 01-Jul 30-Sep
    P4 MAXVALUE
    I tried using the below syntax, but failed with error.
    CREATE TABLE parttab
    STATUS CHAR(1) DEFAULT 'a' NOT NULL,
    UPDATER VARCHAR2(55) NOT NULL,
    UPDTIME DATE DEFAULT SYSDATE NOT NULL
    TABLESPACE part_tbs
    LOGGING
    PARTITION BY RANGE (UPDTIME)
    PARTITION P1 VALUES LESS THAN (to_date('04','MM')) LOGGING COMPRESS TABLESPACE part_tbs_P1,
    PARTITION P2 VALUES LESS THAN (to_date('07','DD-MM')) LOGGING COMPRESS TABLESPACE part_tbs_P2,
    PARTITION P3 VALUES LESS THAN (to_date('10','DD-MM')) LOGGING COMPRESS TABLESPACE part_tbs_P3,
    PARTITION P4 VALUES LESS THAN (MAXVALUE) LOGGING COMPRESS TABLESPACE part_tbs_P4
    COMPRESS
    NOCACHE
    PARALLEL ( DEGREE 2 INSTANCES Default )
    ROWDEPENDENCIES
    NOMONITORING
    ENABLE ROW MOVEMENT;
    Please suggest.
    Thanks in advance for the suggestions.

    what is the error message and your Oracle version? this sample may assist I guess -
    CREATE TABLE range_part (
    prof_history_id NUMBER(10),
    person_id       NUMBER(10) NOT NULL,
    organization_id NUMBER(10) NOT NULL,
    record_date     DATE NOT NULL,
    ph_comments     VARCHAR2(200))
    PARTITION BY RANGE (record_date) (
    PARTITION yr0 VALUES LESS THAN (TO_DATE('01-JAN-2000','DD-MON-YYYY'))
    TABLESPACE part1,
    PARTITION yr1 VALUES LESS THAN (TO_DATE('01-JAN-2001','DD-MON-YYYY'))
    TABLESPACE part2,
    PARTITION yr2 VALUES LESS THAN (TO_DATE('01-JAN-2002','DD-MON-YYYY'))
    TABLESPACE part3,
    PARTITION yr9 VALUES LESS THAN (MAXVALUE) TABLESPACE part4);for more examples you may visit - http://psoug.org/reference/partitions.html

  • I have partitioned my tables, do I need to rebuild the indexes of the table

    Hello,
    I have partition very huge tables, by using rage partition method. After that few queries taking more time than before. Does the old indexes needs to rebuild?
    Thanks

    929941 wrote:
    Hello,
    I have partition very huge tables, by using rage partition method. After that few queries taking more time than before. Does the old indexes needs to rebuild?
    ThanksWhat do you think?
    By the way, how did you partition existing tables? Did you use dbms_redefinition, or did you use CTAS, or some other method?
    I love RAGE partitions. You should always always partition your rage.

  • How to truncate all the tables of my database

    hi guys
    I am using SQL Server 2012 , i need to delete all  the data present in my database .I mean i want to truncate all the tables in my database , so please suggest me the easiest way .

    If the tables are referenced by FK it will be failed.... 
    Basically you can use the below statetemnt
    DECLARE @TruncateStatement nvarchar(4000)
    DECLARE TruncateStatements CURSOR LOCAL FAST_FORWARD
    FOR
    SELECT
        N'TRUNCATE TABLE ' +
        QUOTENAME(TABLE_SCHEMA) +
        N'.' +
        QUOTENAME(TABLE_NAME)
    FROM
        INFORMATION_SCHEMA.TABLES
    WHERE
        TABLE_TYPE = 'BASE TABLE' AND
        OBJECTPROPERTY(OBJECT_ID(QUOTENAME(TABLE_SCHEMA) +
            N'.' +
            QUOTENAME(TABLE_NAME)), 'IsMSShipped') = 0
    OPEN TruncateStatements
    WHILE 1 = 1
    BEGIN
        FETCH NEXT FROM TruncateStatements INTO @TruncateStatement
        IF @@FETCH_STATUS <> 0 BREAK
        RAISERROR (@TruncateStatement, 0, 1) WITH NOWAIT
        EXEC(@TruncateStatement)
    END
    CLOSE TruncateStatements
    DEALLOCATE TruncateStatements
    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

  • Partitioning Fact Table

    Hi
    In our data warehouse we have a Fact table which has grown quite a large in size around 17 million records. We have been pondering on the options to partition this table.
    Unfortunately this fact table does not have any date columns , all columns are surrogate keys of dimensions, even for time dimensions. My idea is to partition by range by manually specifying the surrogate key ranges of time dimension. Is that the way one proced with?
    Other option is to, add a new column to the Fact Table and populate with the corresponding "ddmmyyyy" in number format and use that one to partition the table. If I go with this approach, if in my reports / queries if I use the dimension key to join between the Fact and Dimension, will oracle still identify which partition to look for? Or do I MUST use the partitioned column in the queries for partition pruning to be effective.
    Any thoughts would be useful.
    Regards
    Mahesh

    if in my reports / queries if I use the dimension key to join between the Fact and Dimension, will oracle still identify which partition to look for? No the oracle will not use the Partition Prunning in this case.
    Or do I MUST use the partitioned column in the queries for partition pruning to be effective.yes , you need to use the partitioned column for partition pruning to be effective.
    Cheers
    Nawneet

Maybe you are looking for

  • Download Creative suite apps on 2 computers, got rid of one and need to download on new computer

    help I got a new computer and I got rid of my old one that I had downloaded some of the creative suite on now I need to download it on my new computer and I can't because I have downloaded it on 2 computers, but I no longer have one of them and I uni

  • How do you make a MacBook Pro talk to an Epson printer?

    MacBook Pro OS X 10.6.8 (Thinking about getting  another MacBook) I had an Epson Artisan printer, got an Epson Workforce WF-3640 new in Jan, hardly used because I cannot make it do what I want it to do. Wireless connection is good. With the MacBook P

  • LR 5 my external hard drive no longer appears as a hard drive but as a folder under "Volumes"

    I am running LR 5 on a MacBook pro and my external hard drive no longer appears as a hard drive but as a folder under "Volumes". will this affect my ability to search and store in this external hard drive?  How can I get it back to normal?

  • Microphone buttons do not function.

    So I have the weirdest issue with my headphones. Both earpieces send sound fine, the microphone actually works in a sense that I can have a conversation clearly while on the phone, but the button to start/stop phones, and also the volume control for

  • 2nd gen screen not as bright

    I just got a new 2nd gen iTouch and the screen has a slight yellow/grey cast to it. Spent an hour at the apple store and although their demos are bright like my first gen (whites and blues are true), the new 2nd gen they pulled out of a box for me to