doc-exports/docs/dws/tool/dws_mt_0108.html
Lu, Huayi 346ac31da9 DWS TG 8.1.3.200 VERSION
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Reviewed-by: Jiang, Beibei <beibei.jiang@t-systems.com>
Co-authored-by: Lu, Huayi <luhuayi@huawei.com>
Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
2023-08-28 09:20:17 +00:00

1384 lines
97 KiB
HTML

<a name="EN-US_TOPIC_0000001188362498"></a><a name="EN-US_TOPIC_0000001188362498"></a>
<h1 class="topictitle1">Tables</h1>
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_section19727195217814"><h4 class="sectiontitle">CREATE TABLE</h4><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p1126223516389">The Oracle <strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b1262183573817">CREATE TABLE</strong> statement is used to create new tables. The target database supports Oracle CREATE TABLE without any migration.</p>
</div>
<div class="section" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_section4448162910"><h4 class="sectiontitle">ALTER TABLE</h4><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p38366371891">The Oracle ALTER TABLE statement is used to add, rename, modify, or drop/delete columns in a table. The target database supports Oracle ALTER TABLE without any migration.</p>
</div>
<div class="section" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_section17217186395"><h4 class="sectiontitle">PRIMARY KEY</h4><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p11108944155011">The Oracle ALTER TABLE statement is used to add table names when the primary key appears in a different file other than the CREATE table statement.</p>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p218116135396"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b085224743914">Input - PRIMARY KEY</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen132252814020">CREATE TABLE CTP_ARM_CONFIG
( HOSTNAME VARCHAR2(50),
OPNAME VARCHAR2(50),
PARAMTYPE VARCHAR2(2),
PARAMVALUE NUMBER(*,0),
MODIFYDATE DATE
) SEGMENT CREATION DEFERRED
PCTFREE 10 PCTUSED 0 INITRANS 1 MAXTRANS 255
NOCOMPRESS LOGGING
STORAGE( PCTINCREASE 0
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE SPMS_DATA ;
ALTER TABLE CTP_ARM_CONFIG ADD CONSTRAINT PKCTP_ARM_CONFIG PRIMARY KEY (HOSTNAME, OPNAME)
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE( PCTINCREASE 0
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE SPMS_DATA ENABLE;</pre>
</div>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p2494165415404"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b389311304120">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen117735136416">CREATE
TABLE
CTP_ARM_CONFIG (
HOSTNAME VARCHAR2 (50)
,OPNAME VARCHAR2 (50)
,PARAMTYPE VARCHAR2 (2)
,PARAMVALUE NUMBER (
38
,0
)
,MODIFYDATE DATE
,CONSTRAINT PKCTP_ARM_CONFIG PRIMARY KEY (
HOSTNAME
,OPNAME
)
) /*SEGMENT CREATION DEFERRED*/
/*PCTFREE 10*/
/*PCTUSED 0*/
/*INITRANS 1*/
/*MAXTRANS 255*/
/*NOCOMPRESS*/
/*LOGGING*/
/*STORAGE( BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)*/
/*TABLESPACE SPMS_DATA */
;</pre>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p2708124103515"></p>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p8060118"><strong id="EN-US_TOPIC_0000001188362498__b35011548274">Unique</strong></p>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p44351213164215">The <strong id="EN-US_TOPIC_0000001188362498__b9522551102614">ALTER TABLE</strong> query contains UNIQUE Constraint. If it is directly executed in GaussDB, the following error shows: "Cannot create index whose evaluation cannot be enforced to remote nodes".</p>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p19306426134418">Implementation is similar to PRIMARY KEY. If PRIMARY KEY/UNIQUE is already present, there is no need to migrate and leave it as it is.</p>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p838811513314"><strong id="EN-US_TOPIC_0000001188362498__b14435236182610">Input</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen1734332314335">CREATE
TABLE
GCC_PLAN.T1033 (
ROLLOUT_PLAN_LINE_ID NUMBER NOT NULL
,UDF_FIELD_VALUE_ID NUMBER NOT NULL
) ;
ALTER TABLE
GCC_PLAN.T1033 ADD CONSTRAINT UDF_FIELD_VALUE_ID_PK UNIQUE (UDF_FIELD_VALUE_ID) ;</pre>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p867565183319"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b581445519333">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen174813217343">CREATE TABLE
GCC_PLAN.T1033
(
ROLLOUT_PLAN_LINE_ID NUMBER NOT NULL
,UDF_FIELD_VALUE_ID NUMBER NOT NULL
,CONSTRAINT UDF_FIELD_VALUE_ID_PK UNIQUE (UDF_FIELD_VALUE_ID)
) ;</pre>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p181515106452"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b592116304473">NULL Constraint</strong></p>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p521318105459">NULL constraint during local variable declaration is not supported in packages -that is L_CONTRACT_DISTRIBUTE_STATUS SAD_DISTRIBUTION_HEADERS_T.STATUS%TYPE NULL ;</p>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p142982911482"><strong id="EN-US_TOPIC_0000001188362498__b15557101212289">Input</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen147971927124810">CREATE OR REPLACE FUNCTION CONTRACT_DISTRIBUTE_STATUS_S2(PI_CONTRACT_NUMBER IN VARCHAR2)
RETURN VARCHAR2 IS
L_CONTRACT_DISTRIBUTE_STATUS BAS_SUBTYPE_PKG.STATUS NULL;
BEGIN
FOR CUR_CONTRACT IN (SELECT HT.CONTRACT_STATUS
FROM SAD_CONTRACTS_V HT
WHERE HT.HTH = PI_CONTRACT_NUMBER)
LOOP
IF CUR_CONTRACT.CONTRACT_STATUS = 0 THEN
L_CONTRACT_DISTRIBUTE_STATUS := 'Cancel';
ELSE
L_CONTRACT_DISTRIBUTE_STATUS := BAS_SUBTYPE_PKG.G_HEADER_WAITING_SPLIT_STATUS;
END IF;
END LOOP;
RETURN L_CONTRACT_DISTRIBUTE_STATUS;
END CONTRACT_DISTRIBUTE_STATUS_S2;
/</pre>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p19237171013458"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b491714664918">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen1267315295514">CREATE OR REPLACE FUNCTION CONTRACT_DISTRIBUTE_STATUS_S2
( PI_CONTRACT_NUMBER IN VARCHAR2 )
RETURN VARCHAR2
PACKAGE
IS
L_CONTRACT_DISTRIBUTE_STATUS BAS_SUBTYPE_PKG.STATUS /*NULL*/;
BEGIN
FOR CUR_CONTRACT IN ( SELECT HT.CONTRACT_STATUS
FROM SAD_CONTRACTS_V HT
WHERE HT.HTH = PI_CONTRACT_NUMBER )
LOOP
IF CUR_CONTRACT.CONTRACT_STATUS = 0 THEN
L_CONTRACT_DISTRIBUTE_STATUS := 'Cancel' ;
ELSE
L_CONTRACT_DISTRIBUTE_STATUS := BAS_SUBTYPE_PKG.G_HEADER_WAITING_SPLIT_STATUS ;
END IF ;
END LOOP ;
RETURN L_CONTRACT_DISTRIBUTE_STATUS ;
END ;
/</pre>
<div class="section" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_section17486184112232"><h4 class="sectiontitle">NO INDEX CREATED</h4><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p7598144415387">If the <strong id="EN-US_TOPIC_0000001188362498__b18314103519398">INDEX</strong> or <strong id="EN-US_TOPIC_0000001188362498__b2024983863913">STORAGE</strong> parameter is used in <strong id="EN-US_TOPIC_0000001188362498__b96421719114011">ALTER TABLE</strong>, delete the parameter. Add constraints to <strong id="EN-US_TOPIC_0000001188362498__b3132182312401">CREATE TABLE</strong>.</p>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p457134172319"><strong id="EN-US_TOPIC_0000001188362498__b1634948036">Input - PRIMARY KEY</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen9571241152320">CREATE TABLE CTP_ARM_CONFIG
( HOSTNAME VARCHAR2(50),
OPNAME VARCHAR2(50),
PARAMTYPE VARCHAR2(2),
PARAMVALUE NUMBER(*,0),
MODIFYDATE DATE
) SEGMENT CREATION DEFERRED
PCTFREE 10 PCTUSED 0 INITRANS 1 MAXTRANS 255
NOCOMPRESS LOGGING
STORAGE( PCTINCREASE 0
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE SPMS_DATA ;
ALTER TABLE CTP_ARM_CONFIG ADD CONSTRAINT PKCTP_ARM_CONFIG PRIMARY KEY
(HOSTNAME, OPNAME)
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE( PCTINCREASE 0
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE SPMS_DATA ENABLE;</pre>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p9572141102310"><strong id="EN-US_TOPIC_0000001188362498__b632986368">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen1572124132313">CREATE TABLE
CTP_ARM_CONFIG (
HOSTNAME VARCHAR2 (50)
,OPNAME VARCHAR2 (50)
,PARAMTYPE VARCHAR2 (2)
,PARAMVALUE NUMBER (
38
,0
)
,MODIFYDATE DATE
,CONSTRAINT PKCTP_ARM_CONFIG PRIMARY KEY (
HOSTNAME
,OPNAME
)
) /*SEGMENT CREATION DEFERRED*/
/*PCTFREE 10*/
/*PCTUSED 0*/
/*INITRANS 1*/
/*MAXTRANS 255*/
/*NOCOMPRESS*/
/*LOGGING*/
/*STORAGE( BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE
DEFAULT)*/
/*TABLESPACE SPMS_DATA */
;</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_section10458183733810"><h4 class="sectiontitle">PARTITIONS</h4><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p37527192711">Maintenance of large tables and indexes can become very time and resource consuming. At the same time, data access performance can reduce drastically for these objects. Partitioning of tables and indexes can benefit the performance and maintenance in several ways.</p>
</div>
<div class="fignone" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_fig18300111011183"><span class="figcap"><b>Figure 1 </b>Partitioning and sub-partitioning of tables</span><br><span><img id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_image1430011108189" src="figure/en-us_image_0000001234200695.png"></span></div>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p1710510719272"></p>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p156775711379">DSC supports migration of range partition.</p>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p3203625201010">The tool does not support the following partitions/subpartitions and these are commented in the migrated scripts:</p>
<ul id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_ul1311420111319"><li id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_li11499563136">List partition</li><li id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_li18114180181311">Hash partition</li><li id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_li1945821019144">Range subpartition</li><li id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_li17659716101414">List subpartition</li><li id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_li37362257147">Hash subpartition</li></ul>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p1127719345543">The unsupported partitions/subpartitions may be supported in the future. Configuration parameters have been provided to enable/disable commenting of the unsupported statements. For details, see <a href="dws_mt_0027.html#EN-US_TOPIC_0000001188202590__en-us_topic_0218440495_table15565195515413">Configuration Parameters for Oracle Features</a>.</p>
<ul id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_ul1823915719275"><li id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_li1124616716274"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_b13265127152713"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_b114331636378">PARTITION BY HASH</strong></strong><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p1227314710272">Hash partitioning is a partitioning technique where a hash algorithm is used to distribute rows evenly across the different partitions (sub-tables). This is typically used where ranges are not appropriate, for example employee ID, product ID, and so on. DSC does not support PARTITION and SUBPARTITION by HASH and will comment these statements.</p>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p1528137152717"><strong id="EN-US_TOPIC_0000001188362498__b186401815123418">Input - HASH PARTITION</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen529610792715">CREATE TABLE dept (deptno NUMBER, deptname VARCHAR(32)) PARTITION BY HASH(deptno) PARTITIONS 16;</pre>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p15311774274"><strong id="EN-US_TOPIC_0000001188362498__b79071329183410">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen13328187122713">CREATE TABLE dept ( deptno NUMBER ,deptname VARCHAR( 32 ) ) /* PARTITION BY HASH(deptno) PARTITIONS 16 */ ;</pre>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p750565110115"><strong id="EN-US_TOPIC_0000001188362498__b935943653419">Input - HASH PARTITION without partition names</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen35106512119">CREATE TABLE dept (deptno NUMBER, deptname VARCHAR(32))
PARTITION BY HASH(deptno) PARTITIONS 16;</pre>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p1151555111116"><strong id="EN-US_TOPIC_0000001188362498__b4201733183411">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen1751913515110">CREATE TABLE dept (deptno NUMBER, deptname VARCHAR(32))
/* PARTITION BY HASH(deptno) PARTITIONS 16 */;</pre>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p98669136169"><strong id="EN-US_TOPIC_0000001188362498__b16357194317340">Input - HASH SUBPARTITION</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen586911331617">CREATE TABLE sales
( prod_id NUMBER(6)
, cust_id NUMBER
, time_id DATE
, channel_id CHAR(1)
, promo_id NUMBER(6)
, quantity_sold NUMBER(3)
, amount_sold NUMBER(10,2)
)
PARTITION BY RANGE (time_id) SUBPARTITION BY HASH (cust_id)
SUBPARTITIONS 8STORE IN (ts1, ts2, ts3, ts4)
( PARTITION sales_q1_2006 VALUES LESS THAN (TO_DATE('01-APR-2006','dd-MON-yyyy'))
, PARTITION sales_q2_2006 VALUES LESS THAN (TO_DATE('01-JUL-2006','dd-MON-yyyy'))
, PARTITION sales_q3_2006 VALUES LESS THAN (TO_DATE('01-OCT-2006','dd-MON-yyyy'))
, PARTITION sales_q4_2006 VALUES LESS THAN (TO_DATE('01-JAN-2007','dd-MON-yyyy'))
);</pre>
<div class="p" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p14130141120196"><strong id="EN-US_TOPIC_0000001188362498__b384134912344">Output</strong><pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen988081318164">CREATE TABLE sales
( prod_id NUMBER(6)
, cust_id NUMBER
, time_id DATE
, channel_id CHAR(1)
, promo_id NUMBER(6)
, quantity_sold NUMBER(3)
, amount_sold NUMBER(10,2)
)
PARTITION BY RANGE (time_id) /*SUBPARTITION BY HASH (cust_id)
SUBPARTITIONS 8 STORE IN (ts1, ts2, ts3, ts4) */
( PARTITION sales_q1_2006 VALUES LESS THAN (TO_DATE('01-APR-2006','dd-MON-yyyy'))
, PARTITION sales_q2_2006 VALUES LESS THAN (TO_DATE('01-JUL-2006','dd-MON-yyyy'))
, PARTITION sales_q3_2006 VALUES LESS THAN (TO_DATE('01-OCT-2006','dd-MON-yyyy'))
, PARTITION sales_q4_2006 VALUES LESS THAN (TO_DATE('01-JAN-2007','dd-MON-yyyy'))
);</pre>
</div>
</li></ul>
<ul id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_ul173444712710"><li id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_li6634203420457"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_b55911894153">PARTITION BY LIST</strong><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p15123175010538">List partitioning is a partitioning technique where you specify a list of discrete values for the partitioning key in the description for each partition. DSC does not support PARTITION and SUBPARTITION by LIST and will comment these statements.</p>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p69059065315"><strong id="EN-US_TOPIC_0000001188362498__b108721143143513">Input - LIST PARTITION</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen2090640115317">CREATE TABLE sales_by_region (item# INTEGER, qty INTEGER, store_name VARCHAR(30), state_code VARCHAR(2), sale_date DATE) STORAGE(INITIAL 10K NEXT 20K) TABLESPACE tbs5 PARTITION BY LIST (state_code) ( PARTITION region_east VALUES ('MA','NY','CT','NH','ME','MD','VA','PA','NJ') STORAGE (INITIAL 8M) TABLESPACE tbs8, PARTITION region_west VALUES ('CA','AZ','NM','OR','WA','UT','NV','CO') NOLOGGING, PARTITION region_south VALUES ('TX','KY','TN','LA','MS','AR','AL','GA'), PARTITION region_central VALUES ('OH','ND','SD','MO','IL','MI','IA'), PARTITION region_null VALUES (NULL), PARTITION region_unknown VALUES (DEFAULT) );</pre>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p209071404531"><strong id="EN-US_TOPIC_0000001188362498__b112115063613">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen14908140175316">CREATE UNLOGGED TABLE sales_by_region ( item# INTEGER ,qty INTEGER ,store_name VARCHAR( 30 ) ,state_code VARCHAR( 2 ) ,sale_date DATE ) TABLESPACE tbs5 /* PARTITION BY LIST(state_code)(PARTITION region_east VALUES('MA','NY','CT','NH','ME','MD','VA','PA','NJ') TABLESPACE tbs8, PARTITION region_west VALUES('CA','AZ','NM','OR','WA','UT','NV','CO') , PARTITION region_south VALUES('TX','KY','TN','LA','MS','AR','AL','GA'), PARTITION region_central VALUES('OH','ND','SD','MO','IL','MI','IA'), PARTITION region_null VALUES(NULL), PARTITION region_unknown VALUES(DEFAULT) ) */ ;</pre>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p952633655018"><strong id="EN-US_TOPIC_0000001188362498__b18951611103610">Input - LIST PARTITION</strong><strong id="EN-US_TOPIC_0000001188362498__b11951191143610"> </strong>(With Storage Parameters)</p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen85301736145019">CREATE TABLE store_master
( Store_id NUMBER
, Store_address VARCHAR2 (40)
, City VARCHAR2 (30)
, State VARCHAR2 (2)
, zip VARCHAR2 (10)
, manager_id NUMBER
)
/*TABLESPACE users*/
STORAGE ( INITIAL 100 k NEXT 100 k
PCTINCREASE 0 )
PARTITION BY LIST (city)
( PARTITION south_florida
VALUES ( 'MIA', 'ORL' )
/*TABLESPACE users*/
STORAGE ( INITIAL 100 k NEXT 100
k PCTINCREASE 0 )
, PARTITION north_florida
VALUES ( 'JAC', 'TAM', 'PEN' )
/*TABLESPACE users*/
STORAGE ( INITIAL 100 k NEXT 100
k PCTINCREASE 0 )
, PARTITION south_georga VALUES
( 'BRU', 'WAY', 'VAL' )
/*TABLESPACE users*/
STORAGE ( INITIAL 100 k NEXT 100
k PCTINCREASE 0 )
, PARTITION north_georgia
VALUES ( 'ATL', 'SAV', NULL )
);</pre>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p13533183616506"><strong id="EN-US_TOPIC_0000001188362498__b83360291361">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen1853812369503">CREATE TABLE store_master
( Store_id NUMBER
, Store_address VARCHAR2 (40)
, City VARCHAR2 (30)
, State VARCHAR2 (2)
, zip VARCHAR2 (10)
, manager_id NUMBER
)
/*TABLESPACE users*/
STORAGE ( INITIAL 100 k NEXT 100 k );</pre>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p45917569512"><strong id="EN-US_TOPIC_0000001188362498__b762883823613">Input - LIST PARTITIONED</strong><strong id="EN-US_TOPIC_0000001188362498__b8628133883615"> TABLE from another TABLE</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen1161119564514">CREATE TABLE tab1_list
PARTITION BY LIST (col1)
( partition part1 VALUES ( 1 )
, partition part2 VALUES ( 2,
3, 4 )
, partition part3 VALUES
(DEFAULT)
)
AS
SELECT *
FROM tab1;</pre>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p1961810561255"><strong id="EN-US_TOPIC_0000001188362498__b16260144433610">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen362312560516">CREATE TABLE tab1_list
AS
( SELECT *
FROM tab1 );</pre>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p10910120195316"><strong id="EN-US_TOPIC_0000001188362498__b1572515263619">Input - LIST PARTITION</strong><strong id="EN-US_TOPIC_0000001188362498__b1472575210361"> with SUBPARTITIONS</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen1791260195317">CREATE TABLE big_t_list PARTITION BY LIST(n10) (partition part1 VALUES (1) ,partition part2 VALUES (2,3,4) ,partition part3 VALUES (DEFAULT)) AS SELECT * FROM big_t;</pre>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p149133013531"><strong id="EN-US_TOPIC_0000001188362498__b9281175017368">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen2091420115314">CREATE TABLE big_t_list /* PARTITION BY LIST(n10)(partition part1 VALUES(1) ,partition part2 VALUES(2,3,4) ,partition part3 VALUES(DEFAULT)) */ AS ( SELECT * FROM big_t ) ;</pre>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p1433616211939"><strong id="EN-US_TOPIC_0000001188362498__b04397293713">Input - LIST PARTITION</strong><strong id="EN-US_TOPIC_0000001188362498__b1743917283718"> with SUBPARTITION TEMPLATE</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen1916571312489">CREATE TABLE q1_sales_by_region
( deptno NUMBER
, deptname varchar2 (20)
, quarterly_sales NUMBER
(10,2)
, state varchar2 (2)
)
PARTITION BY LIST (state)
SUBPARTITION BY RANGE
(quarterly_sales)
SUBPARTITION TEMPLATE
( SUBPARTITION original VALUES
LESS THAN (1001)
, SUBPARTITION acquired VALUES
LESS THAN (8001)
, SUBPARTITION recent VALUES
LESS THAN (MAXVALUE)
)
( PARTITION q1_northwest VALUES
( 'OR', 'WA' )
, PARTITION q1_southwest VALUES
( 'AZ', 'UT', 'NM' )
, PARTITION q1_northeast VALUES
( 'NY', 'VM', 'NJ' )
, PARTITION q1_southcentral VALUES
( 'OK', 'TX' )
);</pre>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p87471832931"><strong id="EN-US_TOPIC_0000001188362498__b164511111153716">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen1713212521123">CREATE TABLE q1_sales_by_region
( deptno NUMBER
, deptname varchar2 (20)
, quarterly_sales NUMBER (10,2)
, state varchar2 (2)
);</pre>
</li><li id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_li6439388356"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_b18482040173611">PARTITION BY RANGE</strong><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p204371285352">Range partitioning is a partitioning technique where ranges of data is stored separately in different sub-tables. Range partitioning is useful when you have distinct ranges of data you want to store together, for example the date field. DSC supports PARTITION by RANGE. It does not support SUBPARTITION by RANGE and will comment these statements.</p>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p152671144124817"><strong id="EN-US_TOPIC_0000001188362498__b3250121113811">Input - RANGE PARTITION</strong> (With STORAGE Parameters)</p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen13268644114810">CREATE
TABLE
CCM_TA550002_H (
STRU_ID VARCHAR2 (10)
,ORGAN1_NO VARCHAR2 (10)
,ORGAN2_NO VARCHAR2 (10)
) partition BY range (ORGAN2_NO) (
partition CCM_TA550002_01
VALUES LESS than ('00100') /* TABLESPACE users */
/*pctfree 10*/
/*initrans 1*/
/*storage(initial 256 K NEXT 256 K minextents 1 maxextents unlimited )*/
,partition CCM_TA550002_02
VALUES LESS than ('00200') /* TABLESPACE users */
/*pctfree 10*/
/*initrans 1*/
/* storage ( initial 256 K NEXT
256K minextents 1
maxextents unlimited
pctincrease 0 )*/</pre>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p729084484817"><strong id="EN-US_TOPIC_0000001188362498__b1631629173810">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen12914164917586">CREATE TABLE CCM_TA550002_H
( STRU_ID VARCHAR2 (10)
, ORGAN1_NO VARCHAR2 (10)
, ORGAN2_NO VARCHAR2 (10)
)
partition BY range (ORGAN2_NO)
( partition CCM_TA550002_01 VALUES LESS
than ('00100')
/*TABLESPACE users*/
, partition CCM_TA550002_02 VALUES LESS
than ('00200')
/*TABLESPACE users*/
);</pre>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p113061044164814"><strong id="EN-US_TOPIC_0000001188362498__b108066179388">Input - RANGE PARTITION</strong><strong id="EN-US_TOPIC_0000001188362498__b98063177389"> with SUBPARTITIONS</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen18941702429">CREATE TABLE composite_rng_list (
cust_id NUMBER(10),
cust_name VARCHAR2(25),
cust_state VARCHAR2(2),
time_id DATE)
PARTITION BY RANGE(time_id)
SUBPARTITION BY LIST (cust_state)
SUBPARTITION TEMPLATE(
SUBPARTITION west VALUES ('OR', 'WA') TABLESPACE part1,
SUBPARTITION east VALUES ('NY', 'CT') TABLESPACE part2,
SUBPARTITION cent VALUES ('OK', 'TX') TABLESPACE part3) (
PARTITION per1 VALUES LESS THAN (TO_DATE('01/01/2000','DD/MM/YYYY')),
PARTITION per2 VALUES LESS THAN (TO_DATE('01/01/2005','DD/MM/YYYY')),
PARTITION per3 VALUES LESS THAN (TO_DATE('01/01/2010','DD/MM/YYYY')),
PARTITION future VALUES LESS THAN(MAXVALUE));</pre>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p15320144434820"><strong id="EN-US_TOPIC_0000001188362498__b12489426103819">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen01244084218">CREATE TABLE composite_rng_list (
cust_id NUMBER(10),
cust_name VARCHAR2(25),
cust_state VARCHAR2(2),
time_id DATE)
PARTITION BY RANGE(time_id)
/*SUBPARTITION BY LIST (cust_state)
SUBPARTITION TEMPLATE(
SUBPARTITION west VALUES ('OR', 'WA') TABLESPACE part1,
SUBPARTITION east VALUES ('NY', 'CT') TABLESPACE part2,
SUBPARTITION cent VALUES ('OK', 'TX') TABLESPACE part3)*/ (
PARTITION per1 VALUES LESS THAN (TO_DATE('01/01/2000','DD/MM/YYYY')),
PARTITION per2 VALUES LESS THAN (TO_DATE('01/01/2005','DD/MM/YYYY')),
PARTITION per3 VALUES LESS THAN (TO_DATE('01/01/2010','DD/MM/YYYY')),
PARTITION future VALUES LESS THAN(MAXVALUE));</pre>
<div class="p" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p3331134484812"><strong id="EN-US_TOPIC_0000001188362498__b644210017393">Input - RANGE PARTITION</strong><strong id="EN-US_TOPIC_0000001188362498__b244212012399"> with SUBPARTITION TEMPLATE</strong><pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen1674431112465">CREATE TABLE composite_rng_rng (
cust_id NUMBER(10),
cust_name VARCHAR2(25),
cust_state VARCHAR2(2),
time_id DATE)
PARTITION BY RANGE(time_id)
SUBPARTITION BY RANGE (cust_id)
SUBPARTITION TEMPLATE(
SUBPARTITION original VALUES LESS THAN (1001) TABLESPACE part1,
SUBPARTITION acquired VALUES LESS THAN (8001) TABLESPACE part2,
SUBPARTITION recent VALUES LESS THAN (MAXVALUE) TABLESPACE part3) (
PARTITION per1 VALUES LESS THAN (TO_DATE('01/01/2000','DD/MM/YYYY')),
PARTITION per2 VALUES LESS THAN (TO_DATE('01/01/2005','DD/MM/YYYY')),
PARTITION per3 VALUES LESS THAN (TO_DATE('01/01/2010','DD/MM/YYYY')),
PARTITION future VALUES LESS THAN (MAXVALUE));</pre>
</div>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p291924975811"><strong id="EN-US_TOPIC_0000001188362498__b87882912392">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen19759811174613">CREATE TABLE composite_rng_rng (
cust_id NUMBER(10),
cust_name VARCHAR2(25),
cust_state VARCHAR2(2),
time_id DATE)
PARTITION BY RANGE(time_id)
/*SUBPARTITION BY RANGE (cust_id)
SUBPARTITION TEMPLATE(
SUBPARTITION original VALUES LESS THAN (1001) TABLESPACE part1,
SUBPARTITION acquired VALUES LESS THAN (8001) TABLESPACE part2,
SUBPARTITION recent VALUES LESS THAN (MAXVALUE) TABLESPACE part3)*/ (
PARTITION per1 VALUES LESS THAN (TO_DATE('01/01/2000','DD/MM/YYYY')),
PARTITION per2 VALUES LESS THAN (TO_DATE('01/01/2005','DD/MM/YYYY')),
PARTITION per3 VALUES LESS THAN (TO_DATE('01/01/2010','DD/MM/YYYY')),
PARTITION future VALUES LESS THAN (MAXVALUE));</pre>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p1897211481603"><strong id="EN-US_TOPIC_0000001188362498__b1158291853919">PRIMARY KEY/UNIQUE Constraint for Partitioned Table</strong></p>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p94371632165118">If the CREATE TABLE statement contains range/hash/list partitioning, the following error is reported:</p>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p122485611314">Invalid PRIMARY KEY/UNIQUE constraint for partitioned table</p>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p02491862032">Note: Columns of the PRIMARY KEY/UNIQUE constraint must contain PARTITION KEY.</p>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p8249196136">Scripts : wo_integrate_log_t.sql, wo_change_log_t.sql</p>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p1324996939"><strong id="EN-US_TOPIC_0000001188362498__b1211617145422">Input:</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen1580104192619">create table SD_WO.WO_INTEGRATE_LOG_T
(
LOG_ID NUMBER not null,
PROJECT_NUMBER VARCHAR2(40),
MESSAGE_ID VARCHAR2(100),
BUSINESS_ID VARCHAR2(100),
BUSINESS_TYPE VARCHAR2(100),
INTEGRATE_CONTENT CLOB,
OPERATION_RESULT VARCHAR2(100),
FAILED_MSG VARCHAR2(4000),
HOST_NAME VARCHAR2(100) not null,
CREATED_BY NUMBER not null,
CREATION_DATE DATE not null,
LAST_UPDATED_BY NUMBER not null,
LAST_UPDATE_DATE DATE not null,
SOURCE_CODE VARCHAR2(100),
TENANT_ID NUMBER
)
partition by range (CREATION_DATE)
(
partition P2018 values less than (TO_DATE(' 2018-10-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace SDWO_DATA,
partition SYS_P53873 values less than (TO_DATE(' 2018-11-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace SDWO_DATA,
partition SYS_P104273 values less than (TO_DATE(' 2018-12-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace SDWO_DATA,
partition SYS_P105533 values less than (TO_DATE(' 2019-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace SDWO_DATA,
partition SYS_P108153 values less than (TO_DATE(' 2019-02-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace SDWO_DATA,
partition SYS_P127173 values less than (TO_DATE(' 2019-03-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace SDWO_DATA,
partition SYS_P130313 values less than (TO_DATE(' 2019-04-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace SDWO_DATA
);
alter table SD_WO.WO_INTEGRATE_LOG_T
add constraint WO_INTEGRATE_LOG_PK primary key (LOG_ID);
create index SD_WO.WO_INTEGRATE_LOG_N1 on SD_WO.WO_INTEGRATE_LOG_T (BUSINESS_ID);
create index SD_WO.WO_INTEGRATE_LOG_N2 on SD_WO.WO_INTEGRATE_LOG_T (CREATION_DATE, BUSINESS_TYPE);
create index SD_WO.WO_INTEGRATE_LOG_N3 on SD_WO.WO_INTEGRATE_LOG_T (PROJECT_NUMBER, BUSINESS_TYPE);</pre>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p72509614312"><strong id="EN-US_TOPIC_0000001188362498__b11654250114216">Output:</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen1449995411268">CREATE
TABLE
SD_WO.WO_INTEGRATE_LOG_T (
LOG_ID NUMBER NOT NULL
,PROJECT_NUMBER VARCHAR2 (40)
,MESSAGE_ID VARCHAR2 (100)
,BUSINESS_ID VARCHAR2 (100)
,BUSINESS_TYPE VARCHAR2 (100)
,INTEGRATE_CONTENT CLOB
,OPERATION_RESULT VARCHAR2 (100)
,FAILED_MSG VARCHAR2 (4000)
,HOST_NAME VARCHAR2 (100) NOT NULL
,CREATED_BY NUMBER NOT NULL
,CREATION_DATE DATE NOT NULL
,LAST_UPDATED_BY NUMBER NOT NULL
,LAST_UPDATE_DATE DATE NOT NULL
,SOURCE_CODE VARCHAR2 (100)
,TENANT_ID NUMBER
,CONSTRAINT WO_INTEGRATE_LOG_PK PRIMARY KEY (LOG_ID)
) partition BY range (CREATION_DATE) (
partition P2018
VALUES LESS than (
TO_DATE( ' 2018-10-01 00:00:00' ,'SYYYY-MM-DD HH24:MI:SS'/*, 'NLS_CALENDAR=GREGORIAN'*/ )
) /* tablespace SDWO_DATA */
,partition SYS_P53873
VALUES LESS than (
TO_DATE( ' 2018-11-01 00:00:00' ,'SYYYY-MM-DD HH24:MI:SS'/*, 'NLS_CALENDAR=GREGORIAN'*/ )
) /* tablespace SDWO_DATA */
,partition SYS_P104273
VALUES LESS than (
TO_DATE( ' 2018-12-01 00:00:00' ,'SYYYY-MM-DD HH24:MI:SS'/*, 'NLS_CALENDAR=GREGORIAN'*/ )
) /* tablespace SDWO_DATA */
,partition SYS_P105533
VALUES LESS than (
TO_DATE( ' 2019-01-01 00:00:00' ,'SYYYY-MM-DD HH24:MI:SS'/*, 'NLS_CALENDAR=GREGORIAN'*/ )
) /* tablespace SDWO_DATA */
,partition SYS_P108153
VALUES LESS than (
TO_DATE( ' 2019-02-01 00:00:00' ,'SYYYY-MM-DD HH24:MI:SS'/*, 'NLS_CALENDAR=GREGORIAN'*/ )
) /* tablespace SDWO_DATA */
,partition SYS_P127173
VALUES LESS than (
TO_DATE( ' 2019-03-01 00:00:00' ,'SYYYY-MM-DD HH24:MI:SS'/*, 'NLS_CALENDAR=GREGORIAN'*/ )
) /* tablespace SDWO_DATA */
,partition SYS_P130313
VALUES LESS than (
TO_DATE( ' 2019-04-01 00:00:00' ,'SYYYY-MM-DD HH24:MI:SS'/*, 'NLS_CALENDAR=GREGORIAN'*/ )
) /* tablespace SDWO_DATA */
) ;
CREATE
index WO_INTEGRATE_LOG_N1
ON SD_WO.WO_INTEGRATE_LOG_T (BUSINESS_ID) LOCAL ;
CREATE
index WO_INTEGRATE_LOG_N2
ON SD_WO.WO_INTEGRATE_LOG_T (
CREATION_DATE
,BUSINESS_TYPE
) LOCAL ;
CREATE
index WO_INTEGRATE_LOG_N3
ON SD_WO.WO_INTEGRATE_LOG_T (
PROJECT_NUMBER
,BUSINESS_TYPE
) LOCAL ;</pre>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p54661481337"><strong id="EN-US_TOPIC_0000001188362498__b1226713710437">Input</strong>:</p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen11421244315">create table SD_WO.WO_INTEGRATE_LOG_T
(
LOG_ID NUMBER not null,
PROJECT_NUMBER VARCHAR2(40),
MESSAGE_ID VARCHAR2(100),
BUSINESS_ID VARCHAR2(100),
BUSINESS_TYPE VARCHAR2(100),
INTEGRATE_CONTENT CLOB,
OPERATION_RESULT VARCHAR2(100),
FAILED_MSG VARCHAR2(4000),
HOST_NAME VARCHAR2(100) not null,
CREATED_BY NUMBER not null,
CREATION_DATE DATE not null,
LAST_UPDATED_BY NUMBER not null,
LAST_UPDATE_DATE DATE not null,
SOURCE_CODE VARCHAR2(100),
TENANT_ID NUMBER
)
partition by range (CREATION_DATE)
(
partition P2018 values less than (TO_DATE(' 2018-10-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace SDWO_DATA,
partition SYS_P53873 values less than (TO_DATE(' 2018-11-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace SDWO_DATA,
partition SYS_P104273 values less than (TO_DATE(' 2018-12-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace SDWO_DATA,
partition SYS_P105533 values less than (TO_DATE(' 2019-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace SDWO_DATA,
partition SYS_P108153 values less than (TO_DATE(' 2019-02-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace SDWO_DATA,
partition SYS_P127173 values less than (TO_DATE(' 2019-03-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace SDWO_DATA,
partition SYS_P130313 values less than (TO_DATE(' 2019-04-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace SDWO_DATA
);
alter table SD_WO.WO_INTEGRATE_LOG_T
add constraint WO_INTEGRATE_LOG_PK primary key (LOG_ID);
create index SD_WO.WO_INTEGRATE_LOG_N1 on SD_WO.WO_INTEGRATE_LOG_T (BUSINESS_ID);
create index SD_WO.WO_INTEGRATE_LOG_N2 on SD_WO.WO_INTEGRATE_LOG_T (CREATION_DATE, BUSINESS_TYPE);
create index SD_WO.WO_INTEGRATE_LOG_N3 on SD_WO.WO_INTEGRATE_LOG_T (PROJECT_NUMBER, BUSINESS_TYPE);</pre>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p19647787312"><strong id="EN-US_TOPIC_0000001188362498__b8325721184314">Output</strong>:</p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen14789111015715">create table SD_WO.WO_INTEGRATE_LOG_T
(
LOG_ID NUMBER not null,
PROJECT_NUMBER VARCHAR2(40),
MESSAGE_ID VARCHAR2(100),
BUSINESS_ID VARCHAR2(100),
BUSINESS_TYPE VARCHAR2(100),
INTEGRATE_CONTENT CLOB,
OPERATION_RESULT VARCHAR2(100),
FAILED_MSG VARCHAR2(4000),
HOST_NAME VARCHAR2(100) not null,
CREATED_BY NUMBER not null,
CREATION_DATE DATE not null,
LAST_UPDATED_BY NUMBER not null,
LAST_UPDATE_DATE DATE not null,
SOURCE_CODE VARCHAR2(100),
TENANT_ID NUMBER
)
partition by range (CREATION_DATE)
(
partition P2018 values less than (TO_DATE(' 2018-10-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace SDWO_DATA,
partition SYS_P53873 values less than (TO_DATE(' 2018-11-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace SDWO_DATA,
partition SYS_P104273 values less than (TO_DATE(' 2018-12-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace SDWO_DATA,
partition SYS_P105533 values less than (TO_DATE(' 2019-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace SDWO_DATA,
partition SYS_P108153 values less than (TO_DATE(' 2019-02-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace SDWO_DATA,
partition SYS_P127173 values less than (TO_DATE(' 2019-03-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace SDWO_DATA,
partition SYS_P130313 values less than (TO_DATE(' 2019-04-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
tablespace SDWO_DATA
);
alter table SD_WO.WO_INTEGRATE_LOG_T
add constraint WO_INTEGRATE_LOG_PK primary key (LOG_ID);
create index SD_WO.WO_INTEGRATE_LOG_N1 on SD_WO.WO_INTEGRATE_LOG_T (BUSINESS_ID);
create index SD_WO.WO_INTEGRATE_LOG_N2 on SD_WO.WO_INTEGRATE_LOG_T (CREATION_DATE, BUSINESS_TYPE);
create index SD_WO.WO_INTEGRATE_LOG_N3 on SD_WO.WO_INTEGRATE_LOG_T (PROJECT_NUMBER, BUSINESS_TYPE);</pre>
</li></ul>
<div class="section" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_section173915454816"><h4 class="sectiontitle">Data Type</h4><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p1528506124816">Remove the BYTE keyword from the data type.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_table1841517311486" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_row1416031144817"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.30.3.1.3.1.1"><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p960411314283"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b886012514911">Oracle Syntax</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.30.3.1.3.1.2"><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p3604103112814"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b81851635102616">Syntax After Migration</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_row1416193144817"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.30.3.1.3.1.1 "><pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen17783654134912">CREATE TABLE TBL_ORACLE
(
ID Number,
Name VARCHAR2(100 BYTE),
ADDRESS VARCHAR2(200 BYTE)
);</pre>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.30.3.1.3.1.2 "><pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen243394914910">CREATE TABLE TBL_ORACLE
(
ID NUMBER
,Name VARCHAR2 (100)
,ADDRESS VARCHAR2 (200)
) ; </pre>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_section1351822895116"><h4 class="sectiontitle">Partition (Comment Partition)</h4><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p11334133005112">In configuration parameter for oracle "#Unique or primary key constraint for partitioned table" to comment_partition.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_table1596425410517" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_row1096512546519"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.31.3.1.3.1.1"><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p1327383452812"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b7965115445110">Oracle Syntax</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.31.3.1.3.1.2"><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p1273134182811"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b177221818193115">Syntax After Migration</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_row496585445115"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.31.3.1.3.1.1 "><pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen1896515413510">CREATE TABLE TBL_ORACLE
(
ID Number,
Name VARCHAR2(100 BYTE),
ADDRESS VARCHAR2(200 BYTE)
)
TABLESPACE space1
PCTUSED 40
PCTFREE 0
INITRANS 1
MAXTRANS 255
NOLOGGING
PARTITION BY RANGE (ID)
(
PARTITION PART_2010 VALUES LESS THAN (10)
NOLOGGING,
PARTITION PART_2011 VALUES LESS THAN (20)
NOLOGGING ,
PARTITION PART_2012 VALUES LESS THAN (MAXVALUE)
NOLOGGING
)
ENABLE ROW MOVEMENT;
ALTER TABLE TBL_ORACLE ADD CONSTRAINT SAMPLE_PK PRIMARY KEY (ID);</pre>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.31.3.1.3.1.2 "><pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen896625416518">CREATE UNLOGGED TABLE TBL_ORACLE
(
ID NUMBER
,Name VARCHAR2 (100)
,ADDRESS VARCHAR2 (200)
,CONSTRAINT SAMPLE_PK PRIMARY KEY (ID)
)
TABLESPACE space1
/*PCTUSED 40*/
PCTFREE 0
INITRANS 1
MAXTRANS 255
/* PARTITION BY RANGE(ID)(PARTITION PART_2010 VALUES LESS THAN(10) ,
PARTITION PART_2011 VALUES LESS THAN(20) , PARTITION PART_2012 VALUES LESS THAN(MAXVALUE) )
ENABLE ROW MOVEMENT */
; </pre>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_section1744434555314"><h4 class="sectiontitle">Partition (Comment Constraint)</h4><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p1611014478536">In configuration parameter for oracle "#Unique or primary key constraint for partitioned table" to comment_unique.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_table171312148546" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_row91318141544"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.32.3.1.3.1.1"><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p2035112428340"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b61324148549">Oracle Syntax</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.32.3.1.3.1.2"><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p23511742153415"><strong id="EN-US_TOPIC_0000001188362498__b1092144122">Syntax After Migration</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_row413241420543"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.32.3.1.3.1.1 "><pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen17132714185417">CREATE TABLE TBL_ORACLE
(
ID Number,
Name VARCHAR2(100 BYTE),
ADDRESS VARCHAR2(200 BYTE)
)
TABLESPACE space1
PCTUSED 40
PCTFREE 0
INITRANS 1
MAXTRANS 255
NOLOGGING
PARTITION BY RANGE (ID)
(
PARTITION PART_2010 VALUES LESS THAN (10)
NOLOGGING,
PARTITION PART_2011 VALUES LESS THAN (20)
NOLOGGING ,
PARTITION PART_2012 VALUES LESS THAN (MAXVALUE)
NOLOGGING
)
ENABLE ROW MOVEMENT;
ALTER TABLE TBL_ORACLE ADD CONSTRAINT SAMPLE_PK PRIMARY KEY (ID);
</pre>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.32.3.1.3.1.2 "><pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen813415141546">CREATE UNLOGGED TABLE TBL_ORACLE
(
ID NUMBER
,Name VARCHAR2 (100)
,ADDRESS VARCHAR2 (200)
/*,CONSTRAINT SAMPLE_PK PRIMARY KEY (ID)*/
)
TABLESPACE space1
/*PCTUSED 40*/
PCTFREE 0
INITRANS 1
MAXTRANS 255
PARTITION BY RANGE (ID)
(
PARTITION PART_2010 VALUES LESS THAN (10)
,PARTITION PART_2011 VALUES LESS THAN (20)
,PARTITION PART_2012 VALUES LESS THAN (MAXVALUE)
) ENABLE ROW MOVEMENT ; </pre>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_section8752174253514"><h4 class="sectiontitle">Partition (I)</h4><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_p1951355617318">Comment ALTER TABLE TRUNCATE PARTITION for non-partitioned tables.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_table96731165323" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_row17673116113217"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.33.3.1.3.1.1"><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_p1790931019337"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b1767341612329">Oracle Syntax</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.33.3.1.3.1.2"><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_p290915109330"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b1823092313313">Syntax After Migration</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_row967461613212"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.33.3.1.3.1.1 "><pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_screen1020191343318">CREATE TABLE product_range
(
product_id VARCHAR2(20),
Product_Name VARCHAR2(50),
Year_Manufacture DATE
)
partition by range (Year_Manufacture)
(
partition Year_Manufacture values less than (TO_DATE(' 2007-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS'))
pctfree 10
initrans 1
);
CREATE TABLE product_list
(
product_id VARCHAR2(20),
Product_Name VARCHAR2(50),
Year_Manufacture vARCHAR2(10)
)
partition by list (Year_Manufacture)
(
partition P_2020 VALUES (2020)
pctfree 10
initrans 1
);
CREATE OR REPLACE PROCEDURE Range_test
IS
V_ID VARCHAR2(10);
BEGIN
EXECUTE IMMEDIATE 'ALTER TABLE product TRUNCATE PARTITION PART'||V_ID;
NULL;
END;
/
CREATE OR REPLACE PROCEDURE List_test
IS
V_ID VARCHAR2(10);
BEGIN
EXECUTE IMMEDIATE 'ALTER TABLE product TRUNCATE PARTITION PART'||V_ID;
NULL;
END;
/</pre>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_p124843814320"></p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.33.3.1.3.1.2 "><pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_screen1835800193312">CREATE TABLE product_range
(
product_id VARCHAR2(20),
Product_Name VARCHAR2(50),
Year_Manufacture DATE
)
partition by range (Year_Manufacture)
(
partition Year_Manufacture values less than (TO_DATE(' 2007-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS'))
pctfree 10
initrans 1
);
CREATE TABLE product_list
(
product_id VARCHAR2(20),
Product_Name VARCHAR2(50),
Year_Manufacture vARCHAR2(10)
)
/*partition by list (Year_Manufacture)
(
partition P_2020 VALUES (2020)
pctfree 10
initrans 1
)*/;
CREATE OR REPLACE PROCEDURE Range_test
IS
V_ID VARCHAR2(10);
BEGIN
EXECUTE IMMEDIATE 'ALTER TABLE product TRUNCATE PARTITION PART'||V_ID;
NULL;
END;
/
CREATE OR REPLACE PROCEDURE List_test
IS
V_ID VARCHAR2(10);
BEGIN
/*EXECUTE IMMEDIATE 'ALTER TABLE product TRUNCATE PARTITION PART'||V_ID;*/
NULL;
END;
/</pre>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_p19934195017324"></p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_section1946672833617"><h4 class="sectiontitle">Partition (II)</h4><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_p151335579355">Delete data for ALTER TABLE TRUNCATE PARTITION for non-partitioned tables.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_table2833101811361" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_row10834191816361"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.34.3.1.3.1.1"><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_p14585131593310"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b8834201810364">Oracle Syntax</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.34.3.1.3.1.2"><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_p658541543312"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b3791825153120">Syntax After Migration</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_row5834201811364"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.34.3.1.3.1.1 "><pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_screen15732153913710">CREATE TABLE product_list
(
product_id VARCHAR2(20),
Product_Name VARCHAR2(50),
Year_Manufacture vARCHAR2(10)
)
partition by list (Year_Manufacture)
( partition PART_2015 VALUES (2011,2012,2013,2014,2015) pctfree 10 initrans 1 ,
partition PART_2016 VALUES (2016) pctfree 10 initrans 1 ,
partition PART_2017 VALUES (2017) pctfree 10 initrans 1 ,
partition PART_2018 VALUES (2018) pctfree 10 initrans 1 ,
partition PART_2019 VALUES (2019) pctfree 10 initrans 1 ,
partition PART_2020 VALUES (2020) pctfree 10 initrans 1 ,
PARTITION PART_unknown VALUES (DEFAULT) );
CREATE OR REPLACE PROCEDURE List_test
IS
V_ID VARCHAR2(10);
BEGIN
EXECUTE IMMEDIATE 'ALTER TABLE product_list TRUNCATE PARTITION PART_2020;
NULL;
END;
/
CREATE OR REPLACE PROCEDURE List_test
IS
V_ID VARCHAR2(10);
BEGIN
EXECUTE IMMEDIATE 'ALTER TABLE product_list TRUNCATE PARTITION PART_' || V_ID;
NULL;
END;
/</pre>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.34.3.1.3.1.2 "><pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_screen541410304374">CREATE TABLE product_list
(
product_id VARCHAR2(20),
Product_Name VARCHAR2(50),
Year_Manufacture vARCHAR2(10)
)
/*partition by list (Year_Manufacture)
( partition PART_2015 VALUES (2011,2012,2013,2014,2015) pctfree 10 initrans 1 ,
partition PART_2016 VALUES (2016) pctfree 10 initrans 1 ,
partition PART_2017 VALUES (2017) pctfree 10 initrans 1 ,
partition PART_2018 VALUES (2018) pctfree 10 initrans 1 ,
partition PART_2019 VALUES (2019) pctfree 10 initrans 1 ,
partition PART_2020 VALUES (2020) pctfree 10 initrans 1 ,
PARTITION PART_unknown VALUES (DEFAULT) )*/;
CREATE OR REPLACE PROCEDURE List_test
IS
V_ID VARCHAR2(10);
BEGIN
EXECUTE IMMEDIATE 'ALTER TABLE product_list TRUNCATE PARTITION PART_' || V_ID;
NULL;
END;
/
CREATE OR REPLACE PROCEDURE List_test
IS
V_ID VARCHAR2(10);
BEGIN
/* EXECUTE IMMEDIATE 'ALTER TABLE product_list TRUNCATE PARTITION PART_' || V_ID; */
IF 'PART_' || V_ID = 'PART_2015' THEN
DELETE FROM product_list WHERE Year_Manufacture IN (2011,2012,2013,2014,2015);
ELSIF 'PART_' || V_ID = 'PART_2016' THEN
DELETE FROM product_list WHERE Year_Manufacture IN (2016);
ELSIF 'PART_' || V_ID = 'PART_2017' THEN
DELETE FROM product_list WHERE Year_Manufacture IN (2017);
ELSIF 'PART_' || V_ID = 'PART_2018' THEN
DELETE FROM product_list WHERE Year_Manufacture IN (2018);
ELSIF 'PART_' || V_ID = 'PART_2019' THEN
DELETE FROM product_list WHERE Year_Manufacture IN (2019);
ELSIF 'PART_' || V_ID = 'PART_2020' THEN
DELETE FROM product_list WHERE Year_Manufacture IN (2020);
ELSE
DELETE FROM product_list WHERE Year_Manufacture NOT IN (2011,2012,2013,2014,2015,2016,2017,2018,2019,2020);
END IF;
NULL;
END;
/</pre>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_p16478131717371"></p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_section13786820145015"><h4 class="sectiontitle">SEGMENT CREATION</h4><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p14646102219504">SEGMENT CREATION { IMMEDIATE | DEFERRED } is not supported in Gauss, hence it is commented in the migrated output. This is based on the following configuration item:<strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b1685917381268"> commentStorageParameter=true</strong>.</p>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p12258459125211"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b1726095985212">Input - TABLE with </strong><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b13239161405320">SEGMENT CREATION</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen2424181211529">CREATE TABLE T1
( MESSAGE_CODE VARCHAR2(50),
MAIL_TITLE VARCHAR2(1000),
MAIL_BODY VARCHAR2(1000),
MAIL_ADDRESS VARCHAR2(1000),
MAIL_ADDRESS_CC VARCHAR2(1000)
) SEGMENT CREATION DEFERRED
PCTFREE 10 PCTUSED 0 INITRANS 1 MAXTRANS 255
NOCOMPRESS LOGGING
STORAGE( INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE Test ;</pre>
</div>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p165482655218"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b6708123317532">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen25360525414">CREATE TABLE T1
( MESSAGE_CODE VARCHAR2(50),
MAIL_TITLE VARCHAR2(1000),
MAIL_BODY VARCHAR2(1000),
MAIL_ADDRESS VARCHAR2(1000),
MAIL_ADDRESS_CC VARCHAR2(1000)
) /*SEGMENT CREATION DEFERRED */
/*PCTFREE 10*/
/* PCTUSED 0 */
/*INITRANS 1 */
/*MAXTRANS 255 */
/* NOCOMPRESS LOGGING*/
/* STORAGE( INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)*/
/* TABLESPACE Test */;</pre>
<div class="section" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_section18215101155520"><h4 class="sectiontitle">STORAGE</h4><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p20997153162619">Storage parameters including <strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b3267172693719">BUFFER_POOL</strong> and <strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b582842953711">MAXEXTENTS</strong> are not supported in Gauss. Storage parameters are commented when it appears in tables or indexes based on the value of the config parameter <strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b12736185113814">commment_storage_parameter</strong>.</p>
</div>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p125731121175611"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b9573172115619">Input - TABLE with </strong><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b257312211567">STORAGE</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen1149412299569">CREATE UNIQUE INDEX PK_BASE_APPR_STEP_DEF ON BASE_APPR_STEP_DEF (FLOW_ID, NODE_ID, STEP_ID)
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE SPMS_DATA ;
CREATE TABLE UFP_MAIL
( MAIL_ID NUMBER(*,0),
MAIL_TITLE VARCHAR2(1000),
MAIL_BODY VARCHAR2(4000),
STATUS VARCHAR2(50),
CREATE_TIME DATE,
SEND_TIME DATE,
MAIL_ADDRESS CLOB,
MAIL_CC CLOB,
BASE_ID VARCHAR2(20),
BASE_STATUS VARCHAR2(50),
BASE_VERIFY VARCHAR2(20),
BASE_LINK VARCHAR2(4000),
MAIL_TYPE VARCHAR2(20),
BLIND_COPY_TO CLOB,
FILE_NAME VARCHAR2(4000),
FULL_FILEPATH VARCHAR2(4000)
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 0 INITRANS 1 MAXTRANS 255
NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE SPMS_DATA
LOB (MAIL_ADDRESS) STORE AS BASICFILE (
TABLESPACE SPMS_DATA ENABLE STORAGE IN ROW CHUNK 8192 RETENTION
NOCACHE LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT))
LOB (MAIL_CC) STORE AS BASICFILE (
TABLESPACE SPMS_DATA ENABLE STORAGE IN ROW CHUNK 8192 RETENTION
NOCACHE LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT))
LOB (BLIND_COPY_TO) STORE AS BASICFILE (
TABLESPACE SPMS_DATA ENABLE STORAGE IN ROW CHUNK 8192 RETENTION
NOCACHE LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) ;</pre>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p754613795816"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b20864154355817">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen674575416585"> CREATE
UNIQUE INDEX PK_BASE_APPR_STEP_DEF
ON BASE_APPR_STEP_DEF (
FLOW_ID
,NODE_ID
,STEP_ID
) /*PCTFREE 10*/
/*INITRANS 2*/
/*MAXTRANS 255*/
/*COMPUTE STATISTICS*/
/*STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)*/
/*TABLESPACE SPMS_DATA */
;</pre>
<div class="note" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_note543513461818"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p154785341017">If <strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b1644253918260">commment_storage_parameter</strong> is set TRUE, then storage parameters are commented.</p>
</div></div>
<div class="section" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_section1050692062913"><h4 class="sectiontitle">STORE</h4><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p9725125452815">The STORE keyword for LOB columns is not supported in Gauss, and it is commented in the migrated output.</p>
</div>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p12569344102914"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b0572104462913">Input - TABLE with </strong><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b6575844122914">STORE</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen14763213103013">CREATE TABLE CTP_PROC_LOG
( PORC_NAME VARCHAR2(100),
LOG_TIME VARCHAR2(100),
LOG_INFO CLOB
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 0 INITRANS 1 MAXTRANS 255
NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE SPMS_DATA
LOB (LOG_INFO) STORE AS BASICFILE (
TABLESPACE SPMS_DATA ENABLE STORAGE IN ROW CHUNK 8192 RETENTION
NOCACHE LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) ;</pre>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p164965111296"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b17259205323015">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen1704638318"> CREATE
TABLE
CTP_PROC_LOG (
PORC_NAME VARCHAR2 (100)
,LOG_TIME VARCHAR2 (100)
,LOG_INFO CLOB
) /*SEGMENT CREATION IMMEDIATE*/
/*PCTFREE 10*/
/*PCTUSED 0*/
/*INITRANS 1*/
/*MAXTRANS 255*/
/*NOCOMPRESS*/
/*LOGGING*/
/*STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)*/
/*TABLESPACE SPMS_DATA */
/*LOB (LOG_INFO) STORE AS BASICFILE ( TABLESPACE SPMS_DATA ENABLE STORAGE IN ROW CHUNK 8192 RETENTION NOCACHE LOGGING STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT))*/
;</pre>
<div class="section" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_section282183034310"><h4 class="sectiontitle">PCTINCREASE</h4><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p1853104022820">The storage parameter <strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b35290501142029">PCTINCREASE</strong> is not supported for all the tables. In addition, all storage parameters (like pctfree, minextents, maxextents) are not allowed for partitioned tables.</p>
</div>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p1599114232911"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b1233095317521">Input - TABLE with PCTINCREASE</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen814134313298">CREATE TABLE tab1 (
col1 &lt; datatype &gt;
, col2 &lt; datatype &gt;
, ...
, colN &lt; datatype &gt; )
TABLESPACE testts
PCTFREE 10 INITRANS 1 MAXTRANS
255
/* STORAGE (
INITIAL 5 M NEXT 5 M MINEXTENTS 1 MAXEXTENTS UNLIMITED PCTINCREASE 0 );*/
</pre>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p210944372913"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b1258603145311">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen11124943182910">CREATE TABLE tab1 (
col1 &lt; datatype &gt;
, col2 &lt; datatype &gt;
, ...
, colN &lt; datatype &gt; )
TABLESPACE testts
PCTFREE 10 INITRANS 1 MAXTRANS 255
/* STORAGE (
INITIAL 5 M NEXT 5 M MINEXTENTS 1 MAXEXTENTS
UNLIMITED );*/
</pre>
<div class="section" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_section942516219372"><h4 class="sectiontitle">FOREIGN KEY</h4><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p97874573362">A foreign key is a way to enforce referential integrity within an Oracle database. A foreign key means that values in one table must also appear in another table. The referenced table is called the parent table while the table with the foreign key is called the child table. The foreign key in the child table will generally reference a primary key in the parent table. A foreign key can be defined in either a CREATE TABLE statement or an ALTER TABLE statement.</p>
</div>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p17794557143612">A foreign key constraint<strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b179040262423"> </strong>must be established with the REFERENCE clause. An inline constraint clause appears as part of the column definition clause or the object properties clause. An out-of-line constraint appears as part of a relational properties clause or the object properties clause.</p>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p1665542611214">If the configuration parameter <a href="dws_mt_0027.html#EN-US_TOPIC_0000001188202590__en-us_topic_0218440495_li19969157459">foreignKeyHandler</a> is set to <strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b183952114315">true</strong> (default value), then the tool will migrate these statements into commented statements.</p>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p6803757203610">DSC supports inline and out-of-line foreign key constraints as shown in the following examples.</p>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p13812857183619"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b2995283538">Input - Foreign Key with inline constraint in CREATE TABLE</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen14530182724219">CREATE TABLE orders (
order_no INT NOT NULL PRIMARY KEY,
order_date DATE NOT NULL,
cust_id INT
[CONSTRAINT fk_orders_cust]
REFERENCES customers(cust_id)
[ON DELETE SET NULL]
[INITIALLY DEFERRED]
[ENABLE NOVALIDATE]
);</pre>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p89248571367"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b2402514145317">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen994214570361">CREATE TABLE orders (
order_no INT NOT NULL PRIMARY KEY,
order_date DATE NOT NULL,
cust_id INT
/*
[CONSTRAINT fk_orders_cust]
REFERENCES customers(cust_id)
[ON DELETE SET NULL]
[INITIALLY DEFERRED]
[ENABLE NOVALIDATE] */
);</pre>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p1651205817363"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b746712191532">Input - Foreign Key with out-of-line constraint in CREATE TABLE</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen187715815368">CREATE TABLE customers (
cust_id INT NOT NULL,
cust_name VARCHAR(64) NOT NULL,
cust_addr VARCHAR(256),
cust_contact_no VARCHAR(16),
PRIMARY KEY (cust_id)
);
CREATE TABLE orders (
order_no INT NOT NULL,
order_date DATE NOT NULL,
cust_id INT NOT NULL,
PRIMARY KEY (order_no),
CONSTRAINT fk_orders_cust
FOREIGN KEY (cust_id)
REFERENCES customers(cust_id)
ON DELETE CASCADE
);</pre>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p2024275813362"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b5985321135319">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen1526585813363">CREATE TABLE customers (
cust_id INT NOT NULL,
cust_name VARCHAR(64) NOT NULL,
cust_addr VARCHAR(256),
cust_contact_no VARCHAR(16),
PRIMARY KEY (cust_id)
);
CREATE TABLE orders (
order_no INT NOT NULL,
order_date DATE NOT NULL,
cust_id INT NOT NULL,
PRIMARY KEY (order_no) /*,
CONSTRAINT fk_orders_cust
FOREIGN KEY (cust_id)
REFERENCES customers(cust_id)
ON DELETE CASCADE */
);</pre>
<div class="section" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_section44101836173614"><h4 class="sectiontitle">LONG Data Type</h4><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p10474919143419">Columns defined as LONG can store variable-length character data containing up to two gigabytes of information. The tool supports LONG data types in TABLE structure and PL/SQL.</p>
</div>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p648214196347"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b176951726115315">Input - LONG data type in table structure</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen14508131914348">CREATE TABLE project ( proj_cd INT
, proj_name VARCHAR2(32)
, dept_no INT
, proj_det LONG );</pre>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p1754316192345"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b0531183213532">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen255915197340">CREATE TABLE project ( proj_cd INT
, proj_name VARCHAR2(32)
, dept_no INT
, proj_det TEXT );</pre>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p1260091973419"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b1411103785312">Input - LONG data type in PL/SQL</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen17615161912349">CREATE OR REPLACE FUNCTION fn_proj_det
( i_proj_cd INT )
RETURN LONG
IS
v_proj_det LONG;
BEGIN
SELECT proj_det
INTO v_proj_det
FROM project
WHERE proj_cd = i_proj_cd;
RETURN v_proj_det;
END;
/</pre>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p1275616192347"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b196091391536">Output</strong></p>
<pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen9688177181520">CREATE OR REPLACE FUNCTION fn_proj_det
( i_proj_cd INT )
RETURN TEXT
IS
v_proj_det TEXT;
BEGIN
SELECT proj_det
INTO v_proj_det
FROM project
WHERE proj_cd = i_proj_cd;
RETURN v_proj_det;
END;
/</pre>
<div class="section" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_section198992038102715"><h4 class="sectiontitle">TYPE</h4><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p145561209281">MDSYS.MBRCOORDLIST should be replaced with CLOB.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_table201740222819" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_row1817413292819"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.75.3.1.3.1.1"><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p16390192954112"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b1917411220282">Oracle Syntax</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.75.3.1.3.1.2"><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p239062915415"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b1071862673119">Syntax After Migration</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_row41755222812"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.75.3.1.3.1.1 "><pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen141753219281">create table product_part
(
partid VARCHAR2(24),
mbrcoords MDSYS.MBRCOORDLIST
);</pre>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.75.3.1.3.1.2 "><pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen4175122202820">CREATE TABLE product_part
(
partid VARCHAR2(24),
mbrcoords CLOB
);</pre>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p185966184295">MDSYS.SDO_GEOMETRY should be replaced with CLOB.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_table1399033472919" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_row599043412299"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.77.1.3.1.1"><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p19511141161514"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b499043422915">Oracle Syntax</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.77.1.3.1.2"><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p39511441181514"><strong id="EN-US_TOPIC_0000001188362498__b653619699">Syntax After Migration</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_row199118347297"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.77.1.3.1.1 "><pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen18469256182912">create table product_part
(
partid VARCHAR2(24),
shape MDSYS.SDO_GEOMETRY
);</pre>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.77.1.3.1.2 "><pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen165793083016">CREATE TABLE product_part
(
partid VARCHAR2(24),
shape CLOB
);</pre>
</td>
</tr>
</tbody>
</table>
</div>
<p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p43171248177">GEOMETRY should be replaced with CLOB.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_table4359114623012" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_row53601746163014"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.79.1.3.1.1"><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p12974420159"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b153601946153013">Oracle Syntax</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.79.1.3.1.2"><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p14291444121516"><strong id="EN-US_TOPIC_0000001188362498__b300860634">Syntax After Migration</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_row936074683013"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.79.1.3.1.1 "><pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen63601446103017">create table product_part
(
partid VARCHAR2(24),
shape GEOMETRY
);</pre>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.79.1.3.1.2 "><pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen9361546143020">CREATE TABLE product_part
(
partid VARCHAR2(24),
shape CLOB
);</pre>
</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_section1854014413313"><h4 class="sectiontitle">Columns</h4><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p978103192911">xmax, xmin, left, right and maxvalue are Gauss keywords and should be concatenated with double quotes in upper case.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_table1031485953120" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_row9315155973119"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.80.3.1.3.1.1"><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p1251674611151"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b93151959173117">Oracle Syntax</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.80.3.1.3.1.2"><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p10516946151513"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b61381332163114">Syntax After Migration</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_row7316135919311"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.80.3.1.3.1.1 "><pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen1948431853212">create table product
(
xmax VARCHAR2(20),
xmin VARCHAR2(50),
left VARCHAR2(50),
right VARCHAR2(50),
maxvalue VARCHAR2(50)
);</pre>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.80.3.1.3.1.2 "><pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen18196330183217">CREATE TABLE product1
(
"XMAX" VARCHAR2(20),
"XMIN" VARCHAR2(50),
"LEFT" VARCHAR2(50),
"RIGHT" VARCHAR2(50),
"MAXVALUE" VARCHAR2(50)
);</pre>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_section875293493313"><h4 class="sectiontitle">Interval Partition</h4><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p1650217361339">Partition should be commented for interval partition.</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_table584475133312" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_row1845125118331"><th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.81.3.1.3.1.1"><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p64767492154"><strong id="EN-US_TOPIC_0000001188362498__en-us_topic_0237712470_b484515110336">Oracle Syntax</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.81.3.1.3.1.2"><p id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_p8476349131518"><strong id="EN-US_TOPIC_0000001188362498__b844393982">Syntax After Migration</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_row1184555163312"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.81.3.1.3.1.1 "><pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen11685341340">create table product
(
product_id VARCHAR2(20),
product_name VARCHAR2(50),
manufacture_month DATE
)
partition by range (manufacture_month) interval (NUMTODSINTERVAL (1, 'MONTH'))
(
partition T_PARTITION_2018_11_LESS values less than (TO_DATE(' 2018-11-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS')));</pre>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.81.3.1.3.1.2 "><pre class="screen" id="EN-US_TOPIC_0000001188362498__en-us_topic_0238518376_en-us_topic_0238226698_en-us_topic_0221101039_en-us_topic_0202727455_screen1281231093414">CREATE TABLE product
(
product_id VARCHAR2(20),
product_name VARCHAR2(50),
manufacture_month DATE
)
/*partition by range (manufacture_month) interval (NUMTODSINTERVAL (1, 'MONTH'))
(
partition T_PARTITION_2018_11_LESS values less than (TO_DATE(' 2018-11-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS')))*/;</pre>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_mt_0106.html">Schema Objects</a></div>
</div>
</div>