create table as select or parallel table / * + parllel() * /.

Dear Experts,


I have two huge table almost 300 GB each.
create table as 
select * from table t1 ,t2
where t1.row_id=t2.row_id
How to run this query in parllelism. Withou Parlell, it takes too much time.

as it should be
create table parallel 15 as 
select * from t1,t2;
or in another way

and if it was it y 3 table to join to

My * wrote:
Dear Experts,

I have two huge table almost 300 GB each.

create table as
select * from table t1 ,t2
where t1.row_id=t2.row_id

How to run this query in parllelism. Withou Parlell, it takes too much time.

as it should be

create table parallel 15 as
select * from t1,t2;

or in another way

and if it was it y 3 table to join to

What happens if the slowdown occurs on SELECT it & not create?

Tags: Database

Similar Questions

  • Create table with overlapping parallel dates in individual columns

    I try to combine data from two different tables into a single table.

    The data in table 1 contains locations of patients in a hospital where each record represents a single location. Patients can be transferred several times between the different beds resulting from multiple records for a single visit.

    The data in table 2 contains the operative activity of the patient to the Hospital where each record represents either the GOLD of the suspension of the recovery room. A patient may have multiple operations in a single visit.

    I would like to join/merge/mashup data in a single table that contains the data parallel to each other. In other words, dates of the appliance on one side of the table and the activity of GOLD on the other. The difficulty is that the two sets of overlapping of dates of arrival and departure. I wish that the final table to divide the originals in new records when the overlaps do not coincide.

    Example:

    Original in both events (one per table)

    > Unit event has - from 14:00 to 18:00

    > OR event B - from 16:00 to 17:00

    Results in 3 documents (in the final)

    > Event 1 - unit from 14:00 to 16:00, null dates GOLD

    > Event 2 - unit from 16:00 to 17:00 OR 16:00 to 17:00

    > Event 3 - unit from 17:00 to 18:00, null dates GOLD

    Of course overlap can be more complex than the example above and adding code to indicate the 'ghosts' transfers to as well.

    In the code below, the first visit of the GOLD occurs during the first mention of the unit.

    Jason

    Oracle 10g

    [code]

    create the table delme_Unit_dates

    (id varchar2 (20))

    , unit_rcd_id varchar2 (20)

    , Unit_desc varchar2 (20)

    Unit_in_code char (1)

    Date of Unit_in_dttm

    Date of Unit_out_dttm

    Unit_out_code char(1));

    create the table delme_or_dates

    (id varchar2 (20))

    , OR_rcd_id varchar2 (20)

    , OR_desc varchar2 (20)

    OR_in_code char (1)

    Date of OR_in_dttm

    Date of OR_out_dttm

    OR_out_code char(1));

    create the table delme_all_dates

    (id varchar2 (20))

    , Unit_OR_id varchar2 (40)

    , Unit_rcd_id varchar2 (20)

    , Unit_desc varchar2 (20)

    Unit_in_code char (1)

    Date of Unit_in_dttm

    Date of Unit_out_dttm

    Unit_out_code char (1)

    , OR_rcd_id varchar2 (20)

    , OR_Desc varchar2 (20)

    OR_in_code char (1)

    Date of OR_in_dttm

    Date of OR_out_dttm

    OR_out_code char (1));

    insert into delme_unit_dates values ('123456', 'U1111', 'Unit A', 'A', to_date('2013-04-29 5:02:00 PM', 'yyyy-mm-dd hh:mi:ss am'), to_date('2013-05-09 1:06:00 PM', 'yyyy-mm-dd hh:mi:ss am'), 'B');

    insert into delme_unit_dates values ('123456', 'U1112', 'Unit A', 'B', to_date('2013-05-09 1:06:00 PM', 'yyyy-mm-dd hh:mi:ss am'), to_date('2013-05-09 4:53:00 PM', 'yyyy-mm-dd hh:mi:ss am'), 'B');

    insert into delme_unit_dates values ('123456', 'U1113', 'Unit A', 'B', to_date('2013-05-09 4:53:00 PM', 'yyyy-mm-dd hh:mi:ss am'), to_date('2013-05-10 10:52:00 PM', 'yyyy-mm-dd hh:mi:ss am'), 't');

    insert into delme_unit_dates values ('123456', 'U1114', ' unity, 't', to_date('2013-05-10 10:52:00 PM', 'yyyy-mm-dd hh:mi:ss am'), to_date('2013-05-11 11:30:00 AM', 'yyyy-mm-dd hh:mi:ss am'), 'B' ");

    insert into delme_unit_dates values ('123456', 'U1115', ' unity, ' B', to_date('2013-05-11 11:30:00 AM', 'yyyy-mm-dd hh:mi:ss am'), to_date('2013-05-12 4:00:00 PM', 'yyyy-mm-dd hh:mi:ss am'), 'B');

    insert into delme_unit_dates values ('123456', 'U1116', ' unity, ' B ', to_date('2013-05-12 4:00:00 PM', 'yyyy-mm-dd hh:mi:ss am'), to_date('2013-05-16 2:14:00 PM', 'yyyy-mm-dd hh:mi:ss am'),' t ');

    insert into delme_unit_dates values ('123456', 'U1117', 'Unit Z', ', to_date('2013-05-16 2:14:00 PM', 'yyyy-mm-dd hh:mi:ss am'), to_date('2013-05-17 2:26:00 PM', 'yyyy-mm-dd hh:mi:ss am'), 'B');

    insert into delme_unit_dates values ('123456 ', 'U1118', 'Unit Z', 'B', to_date('2013-05-17 2:26:00 PM', 'yyyy-mm-dd hh:mi:ss am'), to_date('2013-05-20 11:30:00 AM', 'yyyy-mm-dd hh:mi:ss am'),');

    insert into delme_or_dates values ('123456', 'OR2221', 'or 1', 'O', to_date('2013-05-09 7:35:00 AM', 'yyyy-mm-dd hh:mi:ss am'), to_date('2013-05-09 10:56:00 AM', 'yyyy-mm-dd hh:mi:ss am'), 'R');

    insert into delme_or_dates values ('123456', 'OR2222', ' 5', 'R', to_date('2013-05-09 10:56:00 AM', 'yyyy-mm-dd hh:mi:ss am'), to_date('2013-05-09 3:20:00 PM', 'yyyy-mm-dd hh:mi:ss am'), 'U');

    insert into delme_or_dates values ('123456', 'OR3331', 'or 2', 'O', to_date('2013-05-16 7:59:00 PM', 'yyyy-mm-dd hh:mi:ss am'), to_date('2013-05-16 10:43:00 PM', 'yyyy-mm-dd hh:mi:ss am'), 'R');

    insert into delme_or_dates values ('123456', 'OR3332', ' 8', 'R', to_date('2013-05-16 10:43:00 PM', 'yyyy-mm-dd hh:mi:ss am'), to_date('2013-05-17 11:20:00 PM', 'yyyy-mm-dd hh:mi:ss am'), 'U');

    commit;

    -Is far from what we

    Select

    U.*

    , o.*

    Of

    delme_Unit_dates U

    delme_OR_dates O

    where

    U.ID = o.id

    and U.UNIT_IN_DTTM < = O.OR_IN_DTTM

    and U.UNIT_OUT_DTTM > = O.OR_IN_DTTM

    order of U.UNIT_IN_DTTM, O.OR_IN_DTTM

    ;

    [/ code]

    Post edited by: Jason_S (changed a single date ' 2013 - 05 - 16 15:20 ' to ' 2013 - 05 - 09 15:20 ')

    Hi, Jason.

    Jason_S wrote:

    I edited one of the dates in the original post.

    Also although the inpatient unit and OR events are contiguous for a given patient (no overlap and without gaps - after that data are cleaned).

    ...

    The sample data you posted a of gaps in the data of the GOLD.  It is correct that the solution below works or not there are gaps in the two tables.

    WITH got_dttm AS

    (

    SELECT unit_in_dttm AS DTMC

    OF delme_unit_dates

    UNION

    SELECT unit_out_dttm AS DTMC

    OF delme_unit_dates

    UNION

    SELECT or_in_dttm AS DTMC

    OF delme_or_dates

    UNION

    SELECT or_out_dttm AS DTMC

    OF delme_or_dates

    )

    all_periods AS

    (

    SELECT DTMC AS in_dttm

    , (DTMC) ahead OF (ORDER BY DTMC) AS out_dttm

    OF got_dttm

    )

    SELECT NVL (u.id, o.id) as id

    u.unit_rcd_id

    u.unit_desc

    u.unit_in_code

    p.in_dttm

    p.out_dttm

    o.or_rcd_id

    o.or_desc

    Of all_periods p

    LEFT OUTER JOIN delme_unit_dates u WE u.unit_in_dttm<=>

    AND u.unit_out_dttm > = p.out_dttm

    LEFT OUTER JOIN delme_or_dates o WE o.or_in_dttm<=>

    AND o.or_out_dttm > = p.out_dttm

    WHERE p.out_dttm IS NOT NULL

    ORDER BY p.in_dttm

    ;

    You can use the query above to CREATE or a CREATE TABLE... AS command.

    If you have as much data as you say, a table or materialized view would be maybe faster to use.

    You will notice that I do understand not all columns; I would like to know if you have a problem, including them.

    I don't know what id role plays in this problem.  It is difficult to say when all rows have the same value.

  • Create table as select execution Issues

    I have a table that is 190 million lines (TableA). The database is on the storage of very old and slow. I'll try the following: create table TableB in the select * from TableA where field1 < 10000 [this should translate into about 36 million lines for the new table]

    The problem is: I started this work at 20:00 and 02:00 is still not create the table. My thoughts are that it accumulates the lines into a temporary table, initially based on the where clause and then it goes to create the table. fix? That being said, the customer has a problem with the execution of this request during the opening hours, BUT it does start in writing during the outage window (20:00-02:00) and, in fact, I never get to this point. In fact, the early stages making the ETG is not this CPU intensive, I should be able to start the ETG before 20:00 without too much grumbling and I hope that the part of writing occurs during the window [i.e.: start the ETG at 14:00]. Is there a way to determine how long a DEC will take before you actually create the table?

    Anyone know if I'm wrong about the way that Oracle treats this type of DEC?

    Thank you

    To speed up the DEC options

    (1) NOLOGGING
    (2) PARALLEL

    http://download.Oracle.com/docs/CD/E11882_01/server.112/e25523/parallel003.htm#BEIFIDIE

    How useful PARALLEL might be depends on your environment (in particular, the number of processors).

    Werner

  • How to get data in the procedure after CREATE TABLE table1 AS SELECT * from table2

    Hello

    can any body tell me how to get the data in the new table created in the procedure. because it gives following error.

    • Error (47,21): PL/SQL: ORA-00942: table or view does not exist

    tableName: = "BCKUP_" | TO_CHAR (sysdate, 'ddmmrrrr');

    tableDDL: = 'CREATE TABLE' | tableName. "AS SELECT * FROM Table1 where to_char(MSG_IN_TIME,''dd-mon-rrrr'') < sysdate - ' | daysNumber;

    EXECUTE IMMEDIATE backUpDDL;

    COMMIT;

    DELETE FROM Table1;

    How to select the data in the newly created table. as...

    Select * from ". tableName;

    Do not choose anything to get the number...

    Just after backupDDL EXECUTE IMMEDIATE, simply refers to SQL % ROWCOUNT - who will be the number of lines.

    Oh and DDL engages automatically, your commitment is redundant.

  • Create Table As select from a PLSQL Package

    Hello

    I'm trying to use an Assignment statement in a stored procedure using Execute Immediate.

    I first create the script in a variable:

    v_sql: = 'CREATE TABLE ' | v_archive_partition_name |
    "TABLESPACE TBS_ARCHIVE |
    "STORAGE (INITIAL 20 M) |
    "AS COMPRESS |
    ' SELECT *' |. '
    'FROM ' | v_table_name |
    «PARTITION (' |)» v_archive_partition_name | ' ) ' ||
    "ORDER BY". v_sort_order | '';

    Then I run:

    EXECUTE IMMEDIATE v_sql;

    When I run the present, I get an error of incorrect permissions, but if I run the SQL that is created manually by using the same user it creates the table correctly.

    Can someone tell me what grants should I apply for my procedure create this table correctly?

    Can someone tell me what grants should I apply for my procedure create this table correctly?

    acquired through ROLE privileges do not apply in the PL/SQL procedure named.
    GRANT must be explicitly made

    IMO, application should NOT do the DOF between application version releases.

  • Create Table As Select Select

    Table_2
    ----------------------

    CREATE TABLE TABLE_2
    (
    'ID' VARCHAR2 (10),
    VARCHAR2 (10) "OFF."
    "SEQ" NUMBER (10)
    );

    Inserts
    ---------------------
    INSERT IN TABLE_2 (ID, EXCL, SEQ) VALUES ('123456', ", 1);
    INSERT IN TABLE_2 (ID, EXCL, SEQ) VALUES ('123456', 'EX', 2);
    INSERT IN TABLE_2 (ID, EXCL, SEQ) VALUES ('123456', ", 3);
    INSERT IN TABLE_2 (ID, EXCL, SEQ) VALUES ('321654' ", 4);
    INSERT IN TABLE_2 (ID, EXCL, SEQ) VALUES ('123798', 'EX', 5);
    INSERT IN TABLE_2 (ID, EXCL, SEQ) VALUES ('123785' ", 6);
    INSERT IN TABLE_2 (ID, EXCL, SEQ) VALUES ('654787', ", 7);
    INSERT IN TABLE_2 (ID, EXCL, SEQ) VALUES ('654787', ", 8);
    INSERT IN TABLE_2 (ID, EXCL, SEQ) VALUES ('654787', ", 9);
    INSERT IN TABLE_2 (ID, EXCL, SEQ) VALUES ('985217', 'EX', 10);
    INSERT IN TABLE_2 (ID, EXCL, SEQ) VALUES ('985217', ", 11);
    INSERT IN TABLE_2 (ID, EXCL, SEQ) VALUES ('937158' ", 12);
    INSERT IN TABLE_2 (ID, EXCL, SEQ) VALUES ('937158' ", 13);

    Select *.
    ------------------------
    EXCL SEQ ID
    1 123456
    123456 EX 2
    3 123456
    321654 4
    123798 EX 5
    123785 6
    654787 7
    654787 8
    654787 9
    985217 EX 10
    985217 11
    937158 12
    937158 13






    I need to create a table based on for all records that are not null - EXC, but I need to bring through all the records that have the same ID as the EXC not null field.

    Desired output: -.
    ------------------

    EXCL SEQ ID
    1 123456
    123456 EX 2
    3 123456
    123798 EX 5
    985217 EX 10
    985217 11

    The ideas people?

    Hello

    Here's one way:

    CREATE     TABLE     table_x
    AS
    SELECT     *
    FROM     table_2
    WHERE     id     IN (
                     SELECT  id
                     FROM    table_2
                     WHERE   excl     IS NOT NULL
                 )
    ;
    

    Furthermore, whenever you post the text formatted (for example, the results of the query) on this site, type the 6 characters:

    \

    (small letters only, inside curly brackets) before and after each section of formatted text, to preserve spacing.
    You'll get better answers quicker if people can read:
    

    EXCL SEQ ID
    1 123456
    123456 EX 2
    3 123456
    123798 EX 5
    985217 EX 10
    985217 11

    (for example) rather than
    
    

    Deeds_2001 wrote:
    ...
    ID EXCL SEQ
    123456 1
    123456 EX 2
    123456 3
    123798 EX 5
    985217 EX 10
    985217 11

    		   
  • create table as select the number of lines

    Hi s/n,.

    IM using create table select this option to copy the table of which 400 million rows.is there anyway to watch how many lines it is actually processing (copied) as we do by using a query in import.

    You can see if there is something in v$ session_longops.

    You can also monitor the space consumed as dba_segments or dba_extents.

  • Cannot SELECT newly created tables

    Hi all

    Summer faced with granting permissions to the newly created tables.

    I designed a database in Toad DataModeller and generated the script data out of it.

    After you run the script, I can see the tables in schema browser Toad but cannot run a query on those.

    If I run for example - "* select * users *; I get an error "ORA00942 - Table or view does not exist.

    But if I create a new table in Toad itself (table Assistant creation of usage, I can do SELECT without any problem.

    There is no difference in the table creation script generated by the Toad and toad Datamodeller.

    I tried to connect as SYSDBA and ran ' * GRANT ALL ON USERS TO TEST. " (The TEST is normal user).

    I got all kinds of permissions for the TEST user account... But still it's not working. :(

    I put the table creation script and the creation of the user script... If that helps.

    Please suggest.

    Please share the script. With the assumption that you are connected to the same pattern on the same instance of two different tools, my guess is the name table (and possibly the names of the columns) are in quotes and have been spelled in cases - this is why you are not able to query these tables.

  • Problem with create table as select (DEC)

    Hello

    We try to data cleaning of huge tables. And a customer of guise is reanme main table to the backup table. Then create a master table in select * backup table with some test.

    Now the problem with create table select, is that it creates the table without indexes and constraints. Is it possible to use the ETG (create the select table) with the same structure that he was the (all index, constriaints).

    Or any other solution to solve this problem?

    Thanks in advance

    Sweety wrote:
    Hello

    We try to data cleaning of huge tables. And a customer of guise is reanme main table to the backup table. Then create a master table in select * backup table with some test.

    Now the problem with create table select, is that it creates the table without indexes and constraints. Is it possible to use the ETG (create the select table) with the same structure that he was the (all index, constriaints).

    Or any other solution to solve this problem?

    Thanks in advance

    No, this is not possible. You need to get the manuscript of dependent object and create it manually.

  • Create table from a credit count Select

    Hello Folks, all the ideas here, I need to create a table using the below "Select" as a criterion.

    I have the following table and its duplicate records, identified by double Unique_seq has. I want to create a table of these somewhere else where, then delete them from schema.tablename.

    Schmea.TableName
    -------------------------
    Field1
    Field2
    field3
    Field4
    Unique_Seq


    SELECT Unique_Seq, COUNT (Unique_Seq)
    Starting FROM Schema.Tablename
    Unique_Seq GROUP
    SEEN (COUNT (Unique_Seq) > 1

    I want to create the table using all fields from schema.tablename

    Thank you

    What is then?

    New table to contain the duplicate data, pushing ad_id null if exist for the same unique_seq

    CREATE Table tester_c_dup as SELECT ad_id,cd_id,unique_seq,z_master_key
     FROM (select a.*,row_number() over (partition by unique_seq order by unique_seq,ad_id) rn from tester_c A) temp
    where temp.rn != 1
    /
    
    select * from tester_c_dup;
    
    AD_ID                                    CD_ID                               UNIQUE_SEQ Z_MASTER_KEY
    ---------------------------------------- ----------------------------------- ---------- -------------------------
                                             KL1923836                                65478 BG7892534KL1923836
                                             OP0021889/10                            529832 NNCC0049136225-JAN-10
                                             OP0022096/10                            539481 NNCC0060037812-JAN-10
    
    Elapsed: 00:00:00.01
    

    eliminating duplicates in the source table and also focus on null ad_id while eliminating duplicates.

    delete from tester_c A
    where a.rowid in
    (select rowid from (select a.rowid,row_number() over (partition by unique_seq order by unique_seq,ad_id) rn from tester_c A) temp
    where temp.rn != 1)
    /
    
    select * from tester_c;
    
    AD_ID                                    CD_ID                               UNIQUE_SEQ Z_MASTER_KEY
    ---------------------------------------- ----------------------------------- ---------- --------------------------------------
    OP0021889/10                             OP0021889/10                            529832 NNCC00491362OP0021889/1025-JAN-10
    OP0022096/10                             OP0022096/10                            539481 NNCC00600378OP0022096/1012-JAN-10
    LI0192                                   IK735241                                 53925 PP54TH34120988
                                             KL1923836                                65478 BG7892534KL1923836
    PQ8712346                                BN27345236                               64877 7234723642
    
    Elapsed: 00:00:00.00
    
  • Create table in the select statement.

    Hello Oracle gurus,

    I am creating a table using select * in the other table.

    The procedure I am following is as follows: -.

    I have a temporary table whose signature is on delete rows commit.

    I insert records into this table.

    When I select * from temporary_table, perm_table, I get a few lines.

    so I try to create a result_table the use of this

    CREATE TABLE result_table
    AS SELECT * FROM temporary_table, perm_table;

    I see the created array, but the number of records in 0. Please can someone explain where the validation is performed while the sequence in this query occurs.

    Thank you

    Published by: user10696492 on November 10, 2009 08:47

    Hello

    When you perform DDL like CREATE TABLE implicit validation takes place just before and just after the statement.

    Concerning
    Peter

  • Specify the type of data when using the "CREATE TABLE AS SELECT"?

    In the table creation code I'm trying to create a DATE column called DOB below. However, the resulting DOB column in the condamnes2 table is a Varchar2. How can I specify that I want to be a DATE field DOB? (I know that I can create the structure first and then fill it but this isn't what I want.)

    create the table condamnes2
    SELECT Person_ID,
    decode (year of BIRTH, null, null, to_date (nvl(BIRTHMONTH,1) |)) » /'|| NVL(Birthday,1) | » /'|| NVL (BIRTHYEAR, 1500), ' MM/DD/YYYY')) DOB
    Among the people

    Thank you

    Use the CAST function in your decoding:

    SQL> create table Persons2 as
      2  SELECT Person_ID,
      3         decode(BIRTHYEAR
      4               ,null, cast(null as date)
      5               ,to_date(nvl(BIRTHMONTH,1)||'/'||nvl(birthday,1)||'/'||nvl(BIRTHYEAR,1500),'MM/DD/YYYY')) DOB
      6  from   persons
      7  ;
    
    Table created.
    
    SQL> desc persons2
     Name                                      Null?    Type
     ----------------------------------------- -------- ----------------------------
     PERSON_ID                                          NUMBER
     DOB                                                DATE
    
  • Create table in Select...

    Hi all

    I need to run the statement below create a PL SQL, but his return from a mistake. Can someone help on the same.

    sqlstmt: = ' create table f0006_new in select * from f0006 where mcrp02 in ('PAV","OTH")';
    run immediately sqlstmt;

    Error: ORA-00904: "OTH" is not a valid identifier

    Thank you
    Amit.

    Instead of using the quotes to quote your list, use two single quotes:

    this
    (''PAV'',''OTH'')
    not this
    ("PAV","OTH")
    
  • Create table statement will hang the State... in ODI... in the BI database

    Our development team is trying to create an external tabe in the database of another schema. ODI is to create the inside connection bridge. I don't know how. But whenever they get from this request, he'll hang on State. When in the same code works fine in a different database.

    Users whereby they are connceting to the source in the fire database this query have the same privileges.
    For a database, it works fine that the table is created in the target database and in the correct schema but for another, it doesn't work and hung... (not giving any results)

    Databases are used to the BI work and having almost the same configurations.
    I checked the view target database v$ session. It gives me < enq: PS - contention > event
    and three rows are back with < PX Deq: table Q narrow > event for others following two lines...

    is - can anyone shed some light on this? What should I do now. like killing the session blocking is not solve problems


    Here is an example of the executed query:

    CREATE TABLE SCHEMA_NAME. C$ _0ODS_JDE_F0004
    (C1_DTSY, C2_DTUCD1, C3_DTRT, C4_DTJOBN, C5_DTUPMJ_DT, C6_DTMRTY, C7_DTDL01, C8_DTPID,
    C9_DTMRCT, C10_DTLN2, C11_DTCNUM, C12_DTUSEQ, C13_DTUSER, C14_DTCDL, JRN_SUBSCRIBER, JRN_FLAG, JRN_DATE)
    EXTERNAL ORGANIZATION
    (TYPE oracle_datapump
    THE DEFAULT DIRECTORY DIR_SCHEMA_NAME
    LOCATION ("X58030417C$ _0ODS_JDE_F0004_1.EXP", ' X58030417C$ _0ODS_JDE_F0004_2.EXP ')
    )
    2 PARALLEL AS
    SELECT
    NVL (TRIM (F0004. (DTSY), ' ') C1_DTSY, NVL (TRIM (F0004. (DTUCD1), ' ') C2_DTUCD1, F0004. DTRT C3_DTRT,
    TRIM (F0004. C4_DTJOBN DTJOBN), J2DT (DTUPMJ, DTUPMT) C5_DTUPMJ_DT, NVL (TRIM (F0004. (DTMRTY), ' ') C6_DTMRTY;
    TRIM (F0004. DTDL01) C7_DTDL01, TRIM (F0004. DTPID) C8_DTPID, F0004. DTMRCT C9_DTMRCT, F0004. DTLN2 C10_DTLN2,
    F0004. DTCNUM C11_DTCNUM, F0004. DTUSEQ/10 C12_DTUSEQ, TRIM (F0004. C13_DTUSER DTUSER),
    F0004. DTCDL C14_DTCDL, ' ' AS JRN_SUBSCRIBER, 'I' AS JRN_FLAG, SYSDATE AS JRN_DATE
    OF SCHEMA_NAME. F0004 F0004 WHERE (1 = 1)

    -Best regards,.
    Saha

    scratched...

    -saha

  • syntax error in create table

    Could someone help me please as to what's wrong in the creation under the structure of the table:

    create table test (select * from schema.tablename where 1 = 2)
    TABLESPACE PCR_ARCHIVE_DATA_04
    PCTUSED 0
    PCTFREE 10
    INITRANS 1
    MAXTRANS 255
    STORAGE)
    64K INITIALS
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    DEFAULT USER_TABLES
    )
    NOLOGGING
    COMPRESS
    NOCACHE
    PARALLEL (INSTANCES OF 6 1 DEGREE)
    MONITORING;

    SELECT AS comes after the physical attributes, such as

    create table test TABLESPACE PCR_ARCHIVE_DATA_04
    PCTUSED 0
    PCTFREE 10
    INITRANS 1
    MAXTRANS 255
    STORAGE (
    INITIAL 64K
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    )
    NOLOGGING
    COMPRESS
    NOCACHE
    PARALLEL ( DEGREE 6 INSTANCES 1 )
    MONITORING
    as (select * from schema.tablename where 1=2)
    

    Best regards

    Maxim

Maybe you are looking for