Create clustered table from heap table

Hi
I have a table with more than 15 million rows. I want to create a clustured table from this heap table and as you know, I can't use CTAS for clustered table
I created a clustered table and started insert data to it (Using append hint and parallel 16). Now, waiting 10 hours there's no result. What's the best way?
Thanks

a. you can use ctas:
SQL> select * from v$version;
BANNER
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
PL/SQL Release 9.2.0.1.0 - Production
CORE    9.2.0.1.0       Production
TNS for 32-bit Windows: Version 9.2.0.1.0 - Production
NLSRTL Version 9.2.0.1.0 - Production
SQL>  create cluster clu(m_num number);
Cluster created.
SQL> create index clu_ind on cluster clu;
Index created.
SQL>  create table clu_tab
  2   (m_num)
  3   cluster clu(m_num)
  4   as select rownum from dual connect by level <=10;
Table created.please post:
1. the whole cluster creation script
2. your oracle version
Amiel Davis

Similar Messages

  • Need To Create a table in Sql Server and do some culculation into the table from Oracle and Sql

    Hello All,
    I'm moving a data from Oracle to Sql Server with ETL (80 tables with data) and i want to track the number of records that i moving on the daily basis , so i need to create a table in SQL Server, wilth 4 columns , Table name, OracleRowsCount, SqlRowCount,
    and Diff(OracleRowsCount - SqlRowCount) that will tell me the each table how many rows i have in Oracle, how many rows i have in SQL after ETL load, and different between them, something like that:
    Table Name  OracleRowsCount   SqlRowCount  Diff
    Customer                150                 150            
    0
    Sales                      2000                1998          
    2
    Devisions                 5                       5             
    0
    (I can add alot of SQL Tasks and variables per each table but it not seems logicly to do that, i tryid to find a way to deal with that in vb but i didn't find)
    What the simplest way to do it ?
    Thank you
    Best Regards
    Daniel

    Hi Daniel,
    According to your description, what you want is an indicator to show whether all the rows are inserted to the destination table. To achieve your goal, you can add a Row Count Transformation following the OLE DB Destination, and redirect bad rows to the Row
    Count Transformation. This way, we can get the count of the bad rows without redirecting these rows. Since the row count value is stored in a variable, we can create another string type variable to retrieve the row count value from the variable used by the
    Row Count Transformation, and then use a Send Mail Task to send the row count value in an email message body. You can also insert the row count value to the SQL Server table through Execute SQL Task. Then, you can check whether bad rows were generated in the
    package by querying this table.  
    Regards,
    Mike Yin
    TechNet Community Support

  • Create a table in SQL Server, Export tables from Microsoft Excel to Microsoft SQL Server, Populate the created table

    Hello team,
    I have a project that I need to do, what is the best approach for each step?
    1- I have to create a table in Microsoft SQL Server.
    2- I have to import data/ tables from Microsoft Excel or Access to Microsoft SQL Server. Should I use Microsoft Visual Studio to move data from Excel or Access?
    3-I should populate the created table with the data from the exported data.
    4-How should I add the second and third imported table to the first table? Should I use union query?
    After I learn these, I will bring up the code to make sure what I do is right.
    Thanks for all,
    Guity
    GGGGGNNNNN

    Hello Naomi,
    I have imported all the tables into SQL Server,
    I created a table:
    CREATE
    TABLE dbo.Orders
    Now I want to populate this table with the values from imported tables, will this code take care of this task?
    INSERT INTO dbo.Orders(OrderId, OrderDate)
    SELECT OrderId, OrderDate
    FROM Sales.Orders
    UNION
    SELECT OrderId, OrderDate
    FROM Sales.Orders1
    Union
    SELECT OrderId, OrderDate
    FROM Sales.Orders2
    If not, what is the code?
    Please advise me.
    GGGGGNNNNN
    GGGGGNNNNN

  • How create temporary table from list of values

    Can you anybody advise me how can I create temporary table from list of values? I have list of values and need create temporary table for next use with command JOIN etc.
    Thank you for help

    NO, you can not create temporary table in oracle on the fly ( Like #Tabels in SQl Server or Sybase ) , you will have to use the GTT i.e Global Temporary Tables
    check the following link GTT :
    to flush the tables after commit
    CREATE GLOBAL TEMPORARY TABLE my_temp_table (
      column1  NUMBER,
      column2  NUMBER
    ) ON COMMIT DELETE ROWS;In contrast, the ON COMMIT PRESERVE ROWS clause indicates that rows should be preserved until the end of the session.
    so to keep rows in Table after commit
    CREATE GLOBAL TEMPORARY TABLE my_temp_table (
      column1  NUMBER,
      column2  NUMBER
    ) ON COMMIT PRESERVE ROWS;

  • HOW CAN I CREATE A VIEW FROM SAME TABLE WHERE I NEED COLUMNS DETAILS FROM DIFFERENT ROWS IN THE SAME TABLE

    i have a table1 on the top, but i want to create a view from table 1 as  view mentioned beneath the table 2. Could any of you please help me.
    table1
    ID
    office
    employee
    activity
    1
    246
    -9999
    698
    2
    ##-99
    21480
    698
    3
    104
    -9999
    7025
    4
    ##-99
    88908
    7025
    5
    108
    -9999
    2415
    6
    ##-99
    17135
    2415
    7
    246
    -9999
    698
    8
    ##-99
    21480
    698
    9
    104
    -9999
    7025
    10
    ##-99
    88908
    7025
    11
    108
    -9999
    2415
    12
    ##-99
    17135
    2415
    view
    ID
    office
    ID1
    employee
    activity
    1
    246
    2
    21480
    698
    3
    104
    4
    88908
    7025
    5
    108
    6
    17135
    2415
    7
    246
    8
    21480
    698
    9
    104
    10
    88908
    7025
    11
    108
    12
    17135
    2415

    declare @forumsTable table (ID int, officeID int, employeeID INT, activityID int)
    insert into @forumsTable (ID, officeID, employeeID, activityID)
    values
    (1 ,246, -9999, 698 ),
    (2 ,-99, 21480, 698 ),
    (3 ,104, -9999, 7025),
    (4 ,-99, 88908, 7025),
    (5 ,108, -9999, 2415),
    (6 ,-99, 17135, 2415),
    (7 ,246, -9999, 698 ),
    (8 ,-99, 21480, 698 ),
    (9 ,104, -9999, 7025),
    (10 ,-99, 88908, 7025),
    (11 ,108, -9999, 2415),
    (12 ,-99, 17135, 2415)
    select f1.ID, f1.officeID, f2.ID as ID1, f1.employeeID, f1.activityID
    from @forumsTable f1
    inner join @forumsTable f2
    on f1.activityID = f2.activityID
    and f1.officeID > 0
    and f2.employeeID > 0
    and f1.id - f2.id = -1
    You really need to improve the relationship here.
    Perhaps you could make office and activity an exclusive pair.

  • Creating a table/view or temporary table from within a stored procedure

    Hi Gurus,
    Can someone tell me if it is possible to create a table (or view) from within a stored procedure.
    PROBLEM:
    In fact I need to create a report at back end (without using oracle developer forms or reports). This report requires creating several tables to hold temporary report data. If I create a sql*plus script for this, i works fine, because it can run DDL and other sql or pl/sql statements sequencialy. But this sql*plus script cannot be called from application. So, application needs an stored procedure to do this task and then application call that procedure. But within stored procedure, i am unable to create table (or run any ddl statement). Can somebody help me in this?
    Thanks in Advance.

    Denis,
    The problem with Nicholas' suggestion isrelated to the fact that now you have two components
    (a table and a stored procedure)
    I don't see any problem to have "two
    components" here. After all, what about all others
    tabes ? This is only one more, but I don't understand
    why want manage less objects, that implies more code,
    more maintenance, and more difficulties to debug.
    Needless to say about performance...
    Nicolas.The same reasons apply if you were forced to declare all PL/SQL variables publicly (outside the stored proc.) rather than privately (from inside the stored proc). Naming conflicts for one. If the name that you want to use for the GTT already exists, you need to find a new name. With the SQL Server type local/private declarations, you wouldn't have that problem.
    I can see how performance would be the same or better using GTTs. If the number of records involved is low, this is likely negligable.

  • How to Create a Table of Contents From an Imported PDF File?

    I have imported a 150 page PDF file into inDesign 5. I want to create a Table of Contents for my document, but there are no paragraph or heading styles in the document. If I built the document in inDesign, I would have labeled each chapter "Heading 1" and then instructed inDesign to collect up all the Heading 1s and make a TOC automatically.
    But I didn't create this PDF, it has no formatting at all. Its just been placed in the inDesign document space.
    Anyone have any tips of how I can pick out all the Chapter headings.....they are in a distinctive format (14 point bold) from the rest of the document text.
    Anyone?

    InDesign cannot read *anything* out of a PDF file.
    Open in Acrobat, copy heading, paste in InDesign. Repeat until done.

  • How to create a table control from a program internal table

    Hi all,
    I try to create a table control that matches following requirements :
    - the source table is an internal table from program (not a dictionary table)
    - I need to specify my own column header titles
    - the fields need to be editable
    - some of the columns fields must be displayed as checkboxes, other one as texts
    When I try using "Table Control WIth Wizard", the generated TabControl has the expected columns titles but the fields are not displayed as checkboxes. Moreoever, when I look at "Dictionnary, program Fields list", the table fields choosed using wizard are locked (a padlock is displayed in front of the line) So, I can not check "checkbox display"
    When I try using simple Table Control -I mean without ALV-, I can use the "checkbox display" for wanted fields but I don't know how to specify the resquired columns headers titles
    So, could you please help me ? How to do both : maage columsn header titles and display some of the columns as checkboxes ?
    thanks for help
    Regards
    morgan

    Hi Morgan,
    Create an Interanal Table in Top Include and activate it first. Then go the Screen Layout and Drag and Drop a Table control.
    Enter a name like TC. now press F6 (Dictionary/Program Fields Window). Enter the Interanal Table and Press
    Get From  Program Push button. Select the required Columns and transfer them. Double click on the Table Control Area only (any corner of the TC) now you get attribute window POP UP. now select the check box for with column Header or remove the available column header and place your own Text Field and  give meaningful Text for them. With in the Table control you can Drag and Drop a Check Box which will occupy all the rows. Make sure you include one more column in the TOP include type C with length one.
    Hope this is very Clear to YOU.
    Cheers
    Ram

  • How to create a table from an existing table with new column

    Hi !
    Please help me.
    I want to create a table from an existing table with data and add two new column to the new table.
    What will be the syntax?

    craete table new_table as select a.*, 'somevalue' new_col1, 'somevalue'
    new_col2 from old_table a;Also there is a pitfall - newly created table will accept column type and precision from the select statement, so further you can be needed to modify columns
    if you want to have VARCHAR2 instead of CHAR for example:
    SQL> create table new_dept as select dept.*, 'New data' new_col from dept;
    Table created.
    SQL> desc new_dept
    Name                                      Null?    Type
    DEPTNO                                             NUMBER(2)
    DNAME                                              VARCHAR2(14)
    LOC                                                VARCHAR2(13)
    NEW_COL                                            CHAR(8)
    SQL> alter table new_dept modify (new_col varchar2(8));
    Table altered.
    SQL> desc new_dept
    Name                                      Null?    Type
    DEPTNO                                             NUMBER(2)
    DNAME                                              VARCHAR2(14)
    LOC                                                VARCHAR2(13)
    NEW_COL                                            VARCHAR2(8)Rgds.
    Didn't see michael's post - it reflects the fix for this problem using CAST.
    Message was edited by:
    dnikiforov

  • How to create a table with 3 inputs one of which is received from a sensor and the other 2 are constants

    i want to create a table that has 2 angles (beta and theta) that could assume values from 0 to 180º and gamma that is given from a sensor to the table at every moment... all angles depend of each other and i want a table that demonstrates that. so i can pull a data to use it in a equation. can someone help with this mess?

    alufe wrote:
    I have to make an array for each angle and connects them?
    That's one way. You end up with multiple 2-D arrays. You also could make a 3-D array to iterate through all your beta/theta arrays, calculating a gamma for each pair, if you understand arrays of multiple dimensions. You seem to indicate a major shortfalling in your math skills here, so I'll repeat, work with your teacher until you can understand the math, and then work on the programming.
    You have to know what you want to do before you can do it. In this case, you have to know what that array represents, and how (I'm talking math now) you are going to determine/represent the one set of numbers you need to work with for each experiment before you set something up in software.
    Cameron
    To err is human, but to really foul it up requires a computer.
    The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
    Profanity is the one language all programmers know best.
    An expert is someone who has made all the possible mistakes.
    To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):
    LabVIEW Unit 1 - Getting Started
    Learn to Use LabVIEW with MyDAQ

  • Stored Proc to create .csv file from table

    Hi all,
    I have a table with 4 columns and 10 rows. Now I need a stored proc to create a .csv file from the table data. Here the scripts to create a table and insert the row's.
    Create table emp(emp_id number(10), emp_name varchar2(20), department varchar2(20), salary number(10));
    Insert into emp values ('1','AAAAA','SALES','10000');
    Insert into emp values ('2','BBBBB','MARKETING','8000');
    Insert into emp values ('3','CCCCC','SALES','12000');
    Insert into emp values ('4','DDDDD','FINANCE','10000');
    Insert into emp values ('5','EEEEE','SALES','11000');
    Insert into emp values ('6','FFFFF','MANAGER','90000');
    Insert into emp values ('7','GGGGG','SALES','12000');
    Insert into emp values ('8','HHHHH','FINANCE','14000');
    Insert into emp values ('9','IIIII','SALES','20000');
    Insert into emp values ('10','JJJJJ','FINANCE','21000');
    commit;
    Now I need a stored proc to create a .csv file in my local location. Please let me know If you need any other details....

    Some pointers:
    http://www.oracle-base.com/articles/9i/GeneratingCSVFiles.php
    http://tkyte.blogspot.com/2009/10/httpasktomoraclecomtkyteflat.html
    also, doing a search on this forum or http://asktom.oracle.com will give you many clues.
    .csv file in my local location.What is your 'local location'?
    A client machine? The database server machine?
    What database version are you using?
    (the result of: select * from v$version; )

  • Please Help. Trying to create XML file from 2 tables.

    Step1: Target XML format
    Created an XML
    <DEPART>
    <DEPARTMENT_ID>10</DEPARTMENT_ID>
    <DEPARTMENT_NAME>Administration</DEPARTMENT_NAME>
    <MANAGER_ID>200</MANAGER_ID>
    <LOCATION_ID>1700</LOCATION_ID>
    <EMP><EMPLOYEE_ID>100</EMPLOYEE_ID>
    <FIRST_NAME>Steven</FIRST_NAME>
    <LAST_NAME>King</LAST_NAME>
    <SALARY>24000</SALARY>
    </EMP>
    </DEPART>Step 2. Created a target data server from the above mentioned xml. Specified the logical and physical schema.
    Step3.Logged into Designer and reverse engineered from the the schema created in step2.
    step 4. Following Hierarchy is created
    DEPART
    --> EMP
    Step 5. Reverse engineered 2 tables from oraclexe (HR ) Schema
    Employees
    Departments
    Step 6. Created an interface and made DEPART from step 4 as target
    and Departments from step 5 as source.
    Step 7. Staging area is different to the target.
    step 8. modified the IKM SQL Control Append to write to a file
    create xmlfile #filename from schema DEPART
    Step 9. Changed the DEPART PK Column in the TARGET to 0
    Step 10. File is created.
    Problem:
    1. When i view the file it has all the departments but the employees are also displayed eventhough i haven't done the mapping.
    2. All the employees are listed under every department.
    Please help as i have tried everything. I know i am missing something somewhere.
    Thanks a lot for reading it.
    Alvinder
    Edited by: alvinder on Jun 30, 2010 5:29 PM

    Hi Alvindar,
    Thanks u posted good issue,
    Can u clarify this about how your issue got ressolved. I am also trying with same XML as you have pasted here. I have following doubts.
    While setting up XML data server the ro option i have deleted as defalut value is false which allows both read/write & its look like this
    jdbc:snps:xml?f=../demo/XML/EMPDEPT.xml&s=SCH_EMPDEPT.
    I have mapped and written create XML commands in commit section of IKM which looks like this :CREATE XMLFILE #ExportXMLFileLoc FROM SCHEMA SCH_FLDEPT
    created the interface and executed,it went through fine,4 rows data transformed into target xml data store,file is generated in the given path .
    But in the generated file is same as which have EMPDEPT.xml with data change,but in the target xml data store depart i am able to view newly inserted records.
    i want generate an output xml for each of the target of the XML data store, how we can do that please explain me.
    this is my xml
    <?xml version="1.0" encoding="UTF-8"?>
    <REQUEST>
    <DEPART>
    <DEPARTMENT_ID>10</DEPARTMENT_ID>
    <DEPARTMENT_NAME>Admin</DEPARTMENT_NAME>
    <MANAGER_ID>200</MANAGER_ID>
    <LOCATION_ID>1700</LOCATION_ID>
    </DEPART>
    </REQUEST>
    tried only with DEPART table.
    Waiting for ur repply,
    Thanks,
    MNK

  • Uploading data from excel file to a dynamically created internal table

    Hi,
    I have a requirement where i have to upload data from an excel file into a database table. I would be able to determine the structure of the table only at runtime based on the user input.. so i have created an internal table dynamically.
    Could you please tell me if its possible to upload data from an excel file to the dynamically created internal table using any function modules?
    I thought of doing this by declaring a generic internal table of one field and then uploading the *.csv file into it and then splitting it based on "," and then assigning it to the field symbol referencing the internal table.. but my file length exceeds 132 characters and i'm only able to get data of lenght 132 char's in my internal table ( generic one).
    Could anyone please show me a way around this.
    Thanks in advance,
    Harsha

    Sure, check this out.
    report zrich_0002.
    type-pools: slis.
    field-symbols: <dyn_table> type standard table,
                   <dyn_wa>,
                   <dyn_field>.
    data: it_fldcat type lvc_t_fcat,
          wa_it_fldcat type lvc_s_fcat.
    type-pools : abap.
    data: new_table type ref to data,
          new_line  type ref to data.
    data: iflat type table of string.
    data: xflat type string.
      data: irec type table of string with header line.
      data: tabix type sy-tabix.
    data: file type string.
    selection-screen begin of block b1 with frame title text .
    parameters: p_file type  rlgrap-filename default 'c:Test.csv'.
    parameters: p_flds type i.
    selection-screen end of block b1.
    start-of-selection.
    * Add X number of fields to the dynamic itab cataelog
      do p_flds times.
        clear wa_it_fldcat.
        wa_it_fldcat-fieldname = sy-index.
        wa_it_fldcat-datatype = 'C'.
        wa_it_fldcat-inttype = 'C'.
        wa_it_fldcat-intlen = 10.
        append wa_it_fldcat to it_fldcat .
      enddo.
    * Create dynamic internal table and assign to FS
      call method cl_alv_table_create=>create_dynamic_table
                   exporting
                      it_fieldcatalog = it_fldcat
                   importing
                      ep_table        = new_table.
      assign new_table->* to <dyn_table>.
    * Create dynamic work area and assign to FS
      create data new_line like line of <dyn_table>.
      assign new_line->* to <dyn_wa>.
      file = p_file.
      call method cl_gui_frontend_services=>gui_upload
        exporting
          filename                = file
        changing
          data_tab                = iflat
        exceptions
          file_open_error         = 1
          file_read_error         = 2
          no_batch                = 3
          gui_refuse_filetransfer = 4
          invalid_type            = 5
          no_authority            = 6
          unknown_error           = 7
          bad_data_format         = 8
          header_not_allowed      = 9
          separator_not_allowed   = 10
          header_too_long         = 11
          unknown_dp_error        = 12
          access_denied           = 13
          dp_out_of_memory        = 14
          disk_full               = 15
          dp_timeout              = 16
          others                  = 17.
      loop at iflat into xflat.
        clear irec. refresh irec.
        split xflat at ',' into table irec.
        loop at irec.
          tabix = sy-tabix.
          assign component tabix of structure <dyn_wa> to <dyn_field>.
          <dyn_field> = irec.
        endloop.
        append <dyn_wa> to <dyn_table>.
      endloop.
    * Write out data from table.
      loop at <dyn_table> into <dyn_wa>.
        do.
          assign component  sy-index  of structure <dyn_wa> to <dyn_field>.
          if sy-subrc <> 0.
            exit.
          endif.
          if sy-index = 1.
            write:/ <dyn_field>.
          else.
            write: <dyn_field>.
          endif.
        enddo.
      endloop.
    Regards,
    Rich Heilman

  • How do create a table of contents page from a series of bookmarks?

    I am compiling bundles of documents for printing, starting from single PDFs. I combine them using Acrobat Pro X for Mac which gives me a single PDF, with a series of bookmarks for each document. I then insert page numbers.
    What I need is a way of creating a table of contents for printing (as opposed to a "digial T.O.C" - ie the bookmarks list). Ideally, I would need a script that would copy the list of bookmarks and the page numbers for each and dump them to a new page in the PDF bundle (or a text file).
    That way I can print the PDF with a Table of Contents at the front.
    There was an entry on the Acobrat for Legal Professionals blog a while back (http://blogs.adobe.com/acrolaw/2009/12/list_bookmarks_with_a_free_scrip/) - as far as I can tell that hint only works for Acrobat 9.
    Any help gratefully received

    Rick Borstein created an Action in Acrobat X Pro., that allows you to create a Bookmark Report. You might see if that does the trick.

  • How to delete a field from a Dynamically created internal table

    Hi friends,
    I have got a requirement in which, I will be entering the table name and Excel file from seletion-screen.
    based on the Table I have entered in the selection-screen I need to create a dynamic internal table so that I can fill that Execel data into that internal table and later i using BDC i can I can fill the database table using SM30 transaction.
    here. my problem is that, When I am creating internal table dynamically, MANDT filed is also getting created in the internal table.
    please, help in deleteing the filed MANDT from the internal able.
    following is the code which creates the dynamic internal table.
    CREATE DATA dy_table TYPE TABLE OF (p_tabname).
    assign dy_table->* to <dyn_table>.
    please provide, if any sample code is available.
    Regards,
    Xavier.P

    Hi,
    You can use this logic,
    While creating the Dynamic filed catalog try to avoid MANDT field.
    Ex:
    *Dynamic creation of a structure
      CREATE DATA LP_STRUCT TYPE (V_TABLE).
      ASSIGN LP_STRUCT->* TO <FS>.
    *Fields Structure
      OF_SDESCR ?= CL_ABAP_TYPEDESCR=>DESCRIBE_BY_DATA( <FS> ).
    LOOP AT OF_SDESCR->COMPONENTS ASSIGNING <COMPONENTS>.
    *Field MANDT not displayed
        IF SY-TABIX = 1 AND <COMPONENTS>-NAME = 'MANDT'.
          CONTINUE. " Next loop
        ENDIF.
    *Build Fieldcatalog
        LS_LVC_CAT-FIELDNAME = <COMPONENTS>-NAME.
        LS_LVC_CAT-REF_TABLE = V_TABLE.
        APPEND LS_LVC_CAT TO LT_LVC_CAT.
        CLEAR LS_LVC_CAT.
      ENDLOOP.

Maybe you are looking for

  • Aperture slideshows to mobileme gallery

    I have tried endlessly to export a good quality aperture slideshow to my mobileme gallery but it seems this can only be done as an album of pictures or as a movie through imovie. Does anyone know another procedure whereby I can upload them as I origi

  • How to connect to BO from Excel 2007

    Hi everyone, as I am new to BO I need help how to establish connection to a BO Universe from Excel 2007 - what components I need to install to be able to make the connection, and steps for creating the connection Thanks in advance, Maria

  • Accomodating Different Fiscal Year Variants in Fixed Assets.

    Hello All, Our client wants to maintain two separate and distinct fiscal year calendars for Fixed Assets: 1. One for Financial statements (Oct - Sep) and the other for 2 .Tax reporting and compliance purposes. (Jan - Dec) How would you accommodate th

  • Grammar Check is Overzealous About Gender

    I am a writer by profession and dumped Word for Pages at the beginning of this year.  I'm a happy user, but certain grammar suggestions are just annoying.  Marking the word 'husband' or 'wife' as being too gender specific, in a context where it's nec

  • HT4059 I pre-order a book and now that it is available to download, I can't download it?

    I pre-Oder a book and now that it is available for download, I can't download to my phone.