[oracle] expdp 匯出分割槽表的分割槽

匠人xin發表於2021-01-28

1.檢視分割槽表分割槽欄位


select * from dba_part_key_columns where name='LOAN_UN_APP_INFO_CLOB' and owner ='OLS';
 
 OWNER             NAME                OBJECT_TYPE      COLUMN_NAME
-------------------- ------------------------------ -------------------- 
OLS             LOAN_UN_APP_INFO_CLOB        TABLE         OLS_DATA_DATE


2.檢視分割槽資訊

select PARTITION_NAME,HIGH_VALUE from dba_tab_partitions where TABLE_OWNER = 'OLS' and TABLE_NAME = 'LOAN_UN_APP_INFO_CLOB' ;

PARTITION_NAME                                                             HIGH_VALUE
-------------------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------
P1_LUAICLOB_01                                                             TO_DATE(' 2020-09-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')
SYS_P14044                                                             TO_DATE(' 2021-01-08 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')
SYS_P14082                                                             TO_DATE(' 2021-01-09 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')
SYS_P14119                                                             TO_DATE(' 2021-01-10 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')
省略

3.匯出分割槽


可以採用query方式,也可以匯出具體分割槽,本次採用匯出具體分割槽

select TABLE_OWNER||'.'||TABLE_NAME||':'||PARTITION_NAME from dba_tab_partitions where TABLE_OWNER = 'OLS' and TABLE_NAME = 'LOAN_UN_APP_INFO_CLOB';
OLS.LOAN_UN_APP_INFO_CLOB:P1_LUAICLOB_01

OLS.LOAN_UN_APP_INFO_CLOB:SYS_P14044
OLS.LOAN_UN_APP_INFO_CLOB:SYS_P14082
OLS.LOAN_UN_APP_INFO_CLOB:SYS_P14119

省略


nohup expdp \" / as sysdba \" dumpfile=ols_LOAN_UN_APP_INFO_CLOB_BAK20210108.dmp directory=yearend logfile=ols_LOAN_UN_APP_INFO_CLOB_BAK20210108.log  logtime=all cluster=no COMPRESSION=all tables=OLS.LOAN_UN_APP_INFO_CLOB:SYS_P14044 exclude=statistics,index  &
nohup expdp \" / as sysdba \" dumpfile=ols_LOAN_UN_APP_INFO_CLOB_BAK20210109.dmp directory=yearend logfile=ols_LOAN_UN_APP_INFO_CLOB_BAK20210109.log  logtime=all cluster=no COMPRESSION=all tables=OLS.LOAN_UN_APP_INFO_CLOB:SYS_P14082 exclude=statistics,index  &
省略


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/69993564/viewspace-2754059/,如需轉載,請註明出處,否則將追究法律責任。

相關文章