Wednesday, May 16, 2007

EXP/IMP to modify storage properties

EXP/IMP to modify storage properties
====================================


1. Current storage properties of t1

gen@GENQB> select table_name, initial_extent, next_extent from
user_tables where table_name='T1';

TABLE_NAME INITIAL_EXTENT NEXT_EXTENT
------------------------------ -------------- -----------
T1 131072 4194304

2. Exp

tx2ddfsdb1> /oracle/admin/GENQB/create [GENQB] exp system/xxx
file=t1.dmp tables=GEN.T1


3. Drop the table

4. Re-create table t1 with modified storage properties

CREATE TABLE GEN.T1
(
OWNER VARCHAR2(30) NOT NULL,
OBJECT_NAME VARCHAR2(30) NOT NULL,
SUBOBJECT_NAME VARCHAR2(30) NULL,
OBJECT_ID NUMBER NOT NULL,
DATA_OBJECT_ID NUMBER NULL,
OBJECT_TYPE VARCHAR2(18) NULL,
CREATED DATE NOT NULL,
LAST_DDL_TIME DATE NOT NULL,
TIMESTAMP VARCHAR2(19) NULL,
STATUS VARCHAR2(7) NULL,
TEMPORARY VARCHAR2(1) NULL,
GENERATED VARCHAR2(1) NULL,
SECONDARY VARCHAR2(1) NULL
)
TABLESPACE GEN_DATA
LOGGING
PCTFREE 10
PCTUSED 40
INITRANS 1
MAXTRANS 255
STORAGE(INITIAL 1M
NEXT 2M
MINEXTENTS 1
MAXEXTENTS UNLIMITED
PCTINCREASE 0
FREELISTS 1
FREELIST GROUPS 1
BUFFER_POOL DEFAULT)
NOPARALLEL
NOCACHE
/

gen@GENQB> select table_name, initial_extent, next_extent from
user_tables where table_name='T1';

TABLE_NAME INITIAL_EXTENT NEXT_EXTENT
------------------------------ -------------- -----------
T1 1048576 2097152

5. Imp data:

imp system/xxx file=t1.dmp tables=T1 fromuser=GEN touser=GEN ignore=y


gen@GENQB> select table_name, initial_extent, next_extent from
user_tables where table_name='T1';

TABLE_NAME INITIAL_EXTENT NEXT_EXTENT
------------------------------ -------------- -----------
T1 1048576 2097152

No comments: