Create table as with partitions

Hi,
Is there a way to create table1 same as table2 with the exact partition and subpartition names? I need to exchange the partitions between the tables. Move the data from table1 to table2 and drop the subpartition from table1.Any help is appreciated.
Thanks
SC

Hi,
Thanks for reply. I tried dbms_metadata.get_ddl and it worked but lists all the partitions and subpartitions. table2 is partitioned by date and serviceid. Is there a way to generate the ddl for specific partitions of table2 and not all the partitions and subpartitions?
Thank You
SC

Similar Messages

  • How to create table view with reference table

    Hi experts,
    How to create table view with reference table in SE11, plz gve me stp by stp procedure.
    pints grnded for hlp.

    Hi
    Go to Tcode se11 choose view and enter the name and create a popup opens up choose database view option
    enter the description
    On the left hand side choose the table name.
    Click on view fields tab and choose your table fields.Here you can choose which fields you want in your view.
    Save and then activate.
    Hope this helps.
    Regards,
    Harish

  • Table creation with partition

    following is the table creation script with partition
    CREATE TABLE customer_entity_temp (
    BRANCH_ID NUMBER (4),
    ACTIVE_FROM_YEAR VARCHAR2 (4),
    ACTIVE_FROM_MONTH VARCHAR2 (3),
    partition by range (ACTIVE_FROM_YEAR,ACTIVE_FROM_MONTH)
    (partition yr7_1999 values less than ('1999',TO_DATE('Jul','Mon')),
    partition yr12_1999 values less than ('1999',TO_DATE('Dec','Mon')),
    it gives an error
    ORA-14036: partition bound value too large for column
    but if I increase the size of the ACTIVE_FROM_MONTH column to 9 , the script works and creates the table. Why is it so ?
    Also, by creating a table in this way and populating the table data in their respective partitions, all rows with month less than "JULY" will go in yr7_1999 partition and all rows with month value between "JUL" and "DEC" will go in the second partition yr12_1999 , where will the data with month value equal to "DEC" go?
    Plz help me in solving this problem
    thanks n regards
    Moloy

    Hi,
    You declared ACTIVE_FROM_MONTH VARCHAR2 (3) and you try to check it against a date in your partitionning clause:TO_DATE('Jul','Mon')so you should first check your data model and what you are trying to achieve exactly.
    With such a partition decl, you will not be able to insert dates from december 1998 included and onward. The values are stricly less than (<) not less or equal(<=) hence such lines can't be inserted. I'd advise you to check the MAXVALUE value jocker and the ENABLE ROW MOVEMENT partitionning clause.
    Regards,
    Yoann.

  • How To Create Table View With Same Column name But Different Table?

    Hi All,
    I have the problem to create a tableview with same column name but in different table.
    The Table that i have:-
    Table - PAC051MPROFORMA
    Column - mrn,visitid
    Table - PAC051TPROFORMA
    Column - mrn,visitid
    Table - PAC052MTRANSBILL
    Column - mrn,visitid
    Then i want to create a table view to view that table. This is my SQL
    CREATE VIEW pacviewproforma (mrn,visitid,mrn,visitid,mrn,visitid)
    As Select PAC051MPROFORMA.mrn,PAC051MPROFORMA.visitid,PAC051TPROFORMA.mrn,PAC051TPROFORMA.visitid,PAC052MTRANSBILL.mrn,PAC052MTRANSBILL.visitid
    where
    *(a.PAC051MPROFORMA.mrn=PAC051TPROFORMA.mrn)*
    and
    *(a.PAC051TPROFORMA.mrn=PAC052TRANSBILL.mrn)*
    That SQL Return this error = ORA-00957: duplicate column name
    Then I modify that SQL to
    CREATE VIEW pacviewproforma (mrn,visitid)
    As Select PAC051MPROFORMA.mrn,PAC051MPROFORMA.visitid,PAC051TPROFORMA.mrn,PAC051TPROFORMA.visitid,PAC052MTRANSBILL.mrn,PAC052MTRANSBILL.visitid
    where
    *(a.PAC051MPROFORMA.mrn=PAC051TPROFORMA.mrn)*
    and
    *(a.PAC051TPROFORMA.mrn=PAC052TRANSBILL.mrn)*
    This time this error return = ORA-01730: invalid number of column names specified
    What should i do?
    Thanks...

    Hi,
    SQL> CREATE VIEW pacviewproforma (mrn,visitid,mrn,visitid,mrn,visitid)
      2  As Select
      3  PAC051MPROFORMA.mrn,
      4  PAC051MPROFORMA.visitid,
      5  PAC051TPROFORMA.mrn,
      6  PAC051TPROFORMA.visitid,
      7  PAC052MTRANSBILL.mrn,
      8  PAC052MTRANSBILL.visitid
      9  from PAC051MPROFORMA,PAC051TPROFORMA,PAC052MTRANSBILL
    10  where
    11  (PAC051MPROFORMA.mrn=PAC051TPROFORMA.mrn)
    12  and
    13  (PAC051TPROFORMA.mrn=PAC052MTRANSBILL.mrn);
    CREATE VIEW pacviewproforma (mrn,visitid,mrn,visitid,mrn,visitid)
    ERROR at line 1:
    ORA-00957: duplicate column namePlease give different names to each column.
    Something like this..
    SQL> CREATE OR REPLACE VIEW pacviewproforma (MPROFORMA_mrn,MPROFORMA_visitid,TPROFORMA_mrn,TPROFORMA
    _visitid,MTRANSBILL_mrn,MTRANSBILL_visitid)
      2  As Select
      3  PAC051MPROFORMA.mrn,
      4  PAC051MPROFORMA.visitid,
      5  PAC051TPROFORMA.mrn,
      6  PAC051TPROFORMA.visitid,
      7  PAC052MTRANSBILL.mrn,
      8  PAC052MTRANSBILL.visitid
      9  from PAC051MPROFORMA,PAC051TPROFORMA,PAC052MTRANSBILL
    10  where
    11  (PAC051MPROFORMA.mrn=PAC051TPROFORMA.mrn)
    12  and
    13  (PAC051TPROFORMA.mrn=PAC052MTRANSBILL.mrn);
    View created.
    SQL> DESC  pacviewproforma;
    Name                                      Null?    Type
    MPROFORMA_MRN                                      NUMBER
    MPROFORMA_VISITID                                  NUMBER
    TPROFORMA_MRN                                      NUMBER
    TPROFORMA_VISITID                                  NUMBER
    MTRANSBILL_MRN                                     NUMBER
    MTRANSBILL_VISITID                                 NUMBER
    ORA-01730: invalid number of column names specifiedThe list of column nmae you specified during the CREATE VIEW should match with the SELECT list of the view.
    Twinkle

  • Create table as with append hint

    All,
    This is part of my oracle plsql procedure.
    EXECUTE IMMEDIATE 'create table inventory_stg
    TABLESPACE users
    PARALLEL 6
    AS
    SELECT DISTINCT /*+ parallel(stg,6) */
    orders.order_sid,
    ORDERS.order_doc,
    stg.ref_doc_num quote_num
    FROM stg,
    ORDERS,
    QUOTE
    WHERE
    stg.DOC_doc=ORDERS.order_doc AND
    stg.ref_doc_num=QUOTE.quote_num AND
    QUOTE.s_no = ORDERS.s_no';
    This query is running for ever.
    If i create a table and insert with append hint, it will complete in 10 min.
    I know, the append hint will bypass redolog and insert above HWM.
    But my above code also a direct load and why it is taking this much time?
    My db is running in archive log mode. But i don't want to log the info in redo.
    Regards
    Govind

    I don't think so. /*+ APPEND */ is probably what you are thinking of. But even if it isn't direct load, inserting into a tablespace that isn't totally fragged might not be too slow for you. I'm just suggesting a test since you weren't getting any direct answers.
    I actually haven't done any testing on parallel with execute immediate either. I don't know if EI imposesl certain limitations on that or not.
    Anyone?
    Update: Actually, you are correct. Append is the default mode for a parallel insert. So that would make me start looking at side affects of the Execute Immediate.
    Message was edited by:
    Gaff

  • Need to create Table Maintenance with more than 400 characters

    I need to create table maintenance in which one filed have more than 400 characters. CHAR type support between 1-255 & STRING type not supported by Table Maintenance. Is there any alternative type or solution for that?

    Hi,
    If  you assign TMG to the table, it will throw error as unable to display the field on screen. why because it can able to display upto 255 char length only.
    For this requirement you have 2 solutions :
    1) Create multiple fields and your Z table, split the data and store them as required.
    2) Create a TEXT ID and store it as a long text using FM CREATE_TEXT.
    or
    This type of text should be treated as Long Text.
    And the steps are:
    1. Create Text Object Using SE75.
    2. Create Text ID Using SE75.
    3. Now you have to Save the text with FM SAVE_TEXT.
    For example:
    The Most simple solution for it can be that Divide the field REMARKS of size 1000 in multiples of 200 characters like REMARK1, REMARK2....REMARKn.
    Now you can create two FMs :
    zset_data: To Store 1000 char long data in Table
    Here you will divide the data of Variable (type char1024) in multiples of 200 and will store in REMARK1, REMARK2.....
    zget_data: To Get 1000 char long data back from Table
    Here you will concatenate REMARK1, REMARK2..... and will store in Variable of Type char1024.
    This is the best solution if Table is not going to be maintained by Table Maintenance Generator.
    regards,
    ravi

  • Create table dynamically with concatanated sysdate

    Hello,
    i am trying to create a table dynamically using a sysdate concatanated i am getting an error. could anyone point me where i am doing wrong in scripts.
    here is the script.
    decalre
    x varchar2(200)
    begin
    x:='CREATE table test_'||sysdate (pname varchar2(10), pnum number(9))''';
    execute immediate x;
    end;
    appreciate any help.

    EdStevens wrote:
    Rodriguez wrote:
    Yes, of course .
    But unfortunately it is not good practice in real production systems :)Of course, the OP's entire approach, his entire design, is profoundly flawed, so why stop here?About using "interesting" identifier names in Oracle...
    An interesting problem in doing basic o-o development in PL/SQL is that all classes (object types) need to have properties. So if you want a pure abstract class with static methods, you cannot create that without defining at minimum, a single property.
    Work-around? Define a property that most PL/SQL developers will be unable to call and use even if they tend to abuse o-o classes. Define the property as a single space. E.g.
    create or replace type TSomeAbstractClass is object(
      " " smallint,
      static method function Foo1 ...
    ) not final not instantiable;:-)

  • How to create table maintence  with function group

    plz send me replay.
    urgent.

    Hi,
    Refer this:
    1.
    Create Maintenance Dialog 
    To generate the maintenance dialog for a table or view:
    Choose Development ® Other tools ® Gen.tab. maint. dialog. You go to the maintenance transaction initial screen.
    Enter the name of the table or view.
    Choose Generated objects.
    Choose Create/Change.
    Confirm the maintenance module creation prompt.
    Enter the generation data:
    – Maintenance module function group
    You can put maintenance modules for several tables or views in a function group.
    – Authorization group
    – Maintenance type (one/two-level)
    – Maintenance screen numbers
    – Recording routine (standard/individual or none)
    Choose Create. All components required are generated.
    When a maintenance dialog is generated, an entry with an object list is created in the maintenance object description table. All tables involved are in this object list.
    http://help.sap.com/saphelp_nw04/helpdata/en/a7/513477407a11d1893b0000e8323c4f/frameset.htm
    2. https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8129f164-0a01-0010-2a8e-8765287250fc
    3. Important : u must activate Function group before generating table maintainance.
    Jogdand M B

  • Create Table/View with Validity Date Control?

    Hi,
    does anyone know the easiest way for me to create a custom view that uses validity dates to control records by time periods, similar to time constraint 1 infotypes in HR?
    For instance, if I define a table to store entries like so
    Client (Key): 100
    PSubArea (Key): C001
    Grouping (Key): 01
    End Date (Key): 99991231
    Begin Date: 18000101
    and I want to ensure that there can only be one record active on any given date, how can I prevent someone from creating a record from 20061107 - 20071107 that overlaps the existing record?
    Is there a setting I missed?
    Add conditions to generated view coding? Is there a good example?
    Thanks

    K, so I found these
    <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/91/ca9fb3a9d111d1a5690000e82deaaa/content.htm">SAP Help - Time-Dependent Table/View</a>
    <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/c1/df5c3c3b067331e10000000a114084/content.htm">Generate Time-Dependence</a>
    I'll give it a whirl now.

  • Creating table view with text descriptions

    Hello everyone,
    I need to create a table view to a table ZMATERIAL (example) that needs to enter MATNR and MAKTX. But when i insert the material number and press enter, the view should automatically search the text description MAKTX of that material on it's respective table.
    How can i do this ?
                 Thank you,
                     Nuno

    Hello Nuno
    Most likely my variant works only for a single material number. In this case you have to use table maintenance events:
    <a href="http://help.sap.com/saphelp_47x200/helpdata/en/91/ca9f0ea9d111d1a5690000e82deaaa/content.htm">Extended Table Maintenance Events</a>
    Probably you have to use two or three events:
    <b>- Event AA: Instead of the Standard Data Read Routine</b> (Here you read to material texts for both possible materials per record)
    <b>- Event 05: When Creating a New Entry</b>
    <b>- Event 08: After Correcting the Contents of a Selected Field</b> (when the user changes the second material number)
    Regards
      Uwe

  • Problem while creating Table control with wizard

    Hi All,
    I am using the table control wizard.
    Following is the declared data :
    TYPES: BEGIN OF test_str,
            name TYPE string,
            city TYPE string,
          END OF test_str.
    DATA: lt_str TYPE STANDARD TABLE OF test_str,
          ls_str TYPE test_str.
    I activated the program after declaring this..
    then I created a screen.
    while generating the table control , i give the internal table name as lt_str and work area as  ls_str(both of these are also coming in F4 help) , i am getting the following error :
    the table work area  ls_str does not exist or is not a structure.
    Please help.
    Regards
    Panneer

    HI Selvam
    In the wizard please choose the radio button internal program table. I hope you might have choosen the dictonary table.
    And activate the program before generating the wizard.
    Please try this and let me know if any issues.
    Thanks
    Praveen
    Edited by: Praveen Kumar on Feb 4, 2010 4:34 AM

  • Problem creating table with foreign key in SQL Workshop

    Application Express version 2.2.1.00.04
    Get error message "Number of referencing columns/data types must match referenced columns"
    Master table SLS_SUPPLIERS has primary key SLS_ID NUMBER(8,0) and when creating table SLS_PRODUCTS with FK SLS_SLP_ID NUMBER(8,0) using the create table wizard I get the above error.
    The name of the FK is SLP_SLS_FK, key column is SLP_SLS_ID, referenced table is SLS_SUPPLIERS and referenced column is SLS_ID.
    Any help is much appreciated.
    James Edey
    I should add that if I create the table without the foreign key constraint and then create the constraint separately in SQL Workshop then it creates OK. It only fails in the create table wizard dialog.
    Message was edited by:
    edeyje
    Obviously no-one interested in this - just thought it may be a bug in v2.2 that the development team would find useful.
    James
    Message was edited by:
    edeyje

    I replied to the other thread on this too -
    there is a bug on that page when you click Next. If you define more than one fk but then navigate using the links on the process chart on the left (Constraints, Confirm, etc), the page works fine. We do have a bug on this now and I just added the notes I will need to get this fixed in 3.1 (I have already assigned it to me - must have some rogue validation that fires on next).
    Sorry it took so long for this to get noticed - I am glad I checked the forum this morning -
    -- Sharon

  • Select count into versus create table as in functions/procedures

    I am working on a dynamic PL/SQL script that will count the number of records in a remote database
    based on certain criteria and then if the number is "acceptable" will create a table in the connecting
    database with those records.
    My where clauses are supposed to be the same but I am presented with the problem, when I run the
    first code ... select in to rowcount I get 122000 records, when I later do the create table as
    with the same whereclause code, I get 77 records. So now I am attempting to validate that the two
    where clauses are the same ... you'd think it would be obvious, but it's not.
    My first operation does a select count(*) into rowcount with the where clause behind it.
    The second operations creates a "sql command literal' that gets executed and returns the less value.
    I build it like testscript := 'create table '||tablename ||'as select * from '||remotetablename||'@'||linkname;
    testwhere := ' xxxxxxx'
    then I do an execute immediate teststring ||' ' testwhere; which works but gives me 77 rows in the table.
    Since I believe my where clause might be different, how can I run the first operation ... select count into rowcount
    as a normal SQL statement in the script...
    When I attempt to just run it I get -- PLS-00428: an into clause expected in this select statement......
    I will provide the source code in my next posting. Working to get it moved to this system.. Once you see it you'll understand
    why I don't think, it's the same, but I need a way to run them exactly as they are written to understand the different results.
    so How can I make the select count (*) into rowcount from .... work just like a normal select

    Here is first part of the procedure --- I get returned value of 122000 records ....
    SELECT COUNT (*)
                   INTO ROWCOUNT
                   FROM A_K_A_D_TBL@FCA08_INGRES
                   WHERE (( "a_" = '1' OR "a_" = '6' ) AND
                             ( "d_t" <> '3' OR "k_c_s" = 'Y' ) AND
                             "d_d" < DATECUTOFFDATE AND
                        "k_c_d" < DATECUTOFFDATE )OR
    (( "a_" = 4 OR "a_" = 7 ) AND
                             ( "d_t" <> '3' OR
    "k_c_s" = 'Y' OR
    "r_t" = '0' OR
                        "r_t" = '2' OR
                   "r_t" = '3' ) AND
                        "d_d" < DATECUTOFFDATE AND
                        "k_c_d" < DATECUTOFFDATE AND
                        "r_d" < DATECUTOFFDATE AND
                        "s_d" < DATECUTOFFDATE);
    then I attempt to duplicate it for string literals.... when this runs ... I get only 77 records. So that makes me think that my strings are not
    done properly.
    So I want to try to run the first sql itself ... but then I get the errors about needing select into ..... etc..
                   TESTWHERE := q'[WHERE (( "a_" = '1' OR "a_" = '6' ) AND ( "d_t" <> '3' OR "k_c_s" = 'Y' )]'||
              q'[ AND "d_d" < DATE ']'||TO_CHAR(DATECUTOFFDATE,'YYYY-MM-DD')||q'[']'||
                             q'[ AND "k_c_d" < DATE ']'||TO_CHAR(DATECUTOFFDATE,'YYYY-MM-DD')||q'[')]'||
                             q'[ OR (( "a_" = 4 OR "a_" = 7 )]'||
                             q'[ AND ( "d_t" <> '3' OR "k_c_s" = 'Y' OR "r_t" = '0' OR "r_t" = '2' OR "r_t" = '3' )]'||
                             q'[ AND "d_d" < DATE ']'||TO_CHAR(DATECUTOFFDATE,'YYYY-MM-DD')||q'[']'||
                             q'[ AND "k_c_d" < DATE ']'||TO_CHAR(DATECUTOFFDATE,'YYYY-MM-DD')||q'[']'||
                             q'[ AND "r_d" < DATE ']'||TO_CHAR(DATECUTOFFDATE,'YYYY-MM-DD')||q'[']'||
                             q'[ AND "s_d" < DATE ']'||TO_CHAR(DATECUTOFFDATE,'YYYY-MM-DD')||q'[')]';
                        TESTSTRING := 'CREATE TABLE '||UCASEXTABLENAMETEMP||' AS SELECT * FROM '||UCASEXTABLENAME||'@'||XLINKNAME;
                        DBMS_OUTPUT.PUT_LINE(TESTSTRING);
                        DBMS_OUTPUT.PUT_LINE(TESTWHERE);
                        EXECUTE IMMEDIATE TESTSTRING||' '||TESTWHERE;

  • How to create table records..

    hi,
    i have table having 6 fields,
    first two are key fields.. i need to create table records with repeating
    1st field , how can i create plz tell me , because its not accepting in se11, is their any altenative  .
    thanks and regards,
    kalyan

    Can you be more clear on what your requirement is ?
    Lets put it in an example :
    CASE 1 : Possible
    Key1 Key2 Field1 Field2 Field3 Field4
    1       1      XXX     xxx     xxxx  xxx
    1       2      XXX     xxx     xxxx  xxx
    OR
    CASE 2 : Impossible with 2 keys, you will need one more key.
    Key1 Key2 Field1 Field2 Field3 Field4
    1       1      XXX     xxx     xxxx  xxx
    1       1      XXX     xxx     xxxx  xxx
    regards,
    Advait

  • I want to write condition while creating table/maintaining table using SM30

    Hello all,
    I am creating table Z_CUST with only 2 fields Client, Customer number using SE11 transcation then maintain using SM30 transcation.
    User should only be allowed to enter customer number that is in account group(KNA1-KTOKD) ‘Z011’. This  validation should be performed during data entry.

    Hi,
    Crete the table maintenance generator for your Ztable.
    below is the brief procedure to create table maintenance.
    Table maintenance generator is basically used to do table operations like (insert, delete, modify...).
    if you create table maintenance for your table it will build a module pool program, by using you do the above operations.
    below is the procedure to create table maintenance generator.
    1) Create one function group.
    2) after activating your Ztable, choose 'Utilities'----> 'Table maintenance genrator'.
    3) then give the authorization group and function group created abobe in the next screen.
    4) Then choose the "create" button in your application tool bar, which will creates the module pool program.
    5) then create one Tcode by chosing "Transaction with parameters( parameter transaction)".
    6) in transaction field give "SM30", select the check box "Skip initial screen".
    7) in the below of that screen you can find the "Default values" frame.
    8) there under the "name of screen field" select the "View name' and 'update".
    9) in value column against to "view name" give you table name, and against to "Update" put 'X' in capital letters.
    save it then you can straight away use this newly created Tcode to maintain your table.
    Note:- 1) make the modification while saving the data into your table using this newly generated program to carry out your validation (even though it looks like standard program; no need to enter the access key).
    2) if you do any changes to your table and press the activate button automatically the table maintenace generator will be goes off, you need to create this again.
    Reward if useful.
    Thanks,
    Sreeram.

Maybe you are looking for

  • File Content Conversion pr

    Hi Guys, I have a problem with a file-to-file scenario. It brings up the following error when trying to read the file i.e from the receiver:- Conversion of file content to XML failed at position 0: java.lang.Exception: ERROR consistency check in reco

  • What is the proper and best way to destroy a java.util.List or Array for GC

    Hi, If I have a java.util.List of objects lets say: List<File> files = new ArrayList();The List contains 1000 file objects. When my class finishes, is it enough to do files = null;to make GC able to release it from memory? Cause it seems like I can't

  • Good tutorials for a kid to work through

    My son who is almost 12 is interested in learning flex.  I've started him on some very basic stuff but I'm still learning myself and could probably end up teach some bad habits.   So,  I was wondering, If any of you could suggest some good tutorials

  • Insert a  BSP Application in  Web Application designer template (WAD)

    Hello to all I like to place a BSP Application in my Web Application designer template (WAD). Have someone a good idea how to display a BSP in a web item. We use BW 7.0 . Thanks a lot for any good idea. Christian Edited by: Christian Baumann on Nov 1

  • Help required in CoreSelectOneChoicecomponent of ADF

    HI. I am using the CoreSelectOneChoice component. In my application i am loading the data in combo box by bean. Now it is setting the 0 index value as default selection in the combo. In this case if i use the getValue() on this combo then i will get