基於flashback_scn的expdp匯出
在使用10g後的Oracle data pump匯出資料時,我們可以使用flashback_scn引數指定匯出的時間點,這時oracle會使用flashback query查詢匯出scn時的資料,flashback query使用undo,無需開啟flashback database功能。也就是說,只要undo資訊不被覆蓋,即使資料庫被重啟,仍然可以進行基於flashback_scn的匯出動作。
來做一個簡單的實驗:
oracle@ibmvs_a@/oracle $ sqlplus test/test
SQL*Plus: Release 10.2.0.3.0 - Production on Mon Jun 27 21:34:55 2011
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> select current_scn from v$database;
CURRENT_SCN
-----------
11850458 (記為1號時間點)
SQL> create table t (num number);
Table created.
SQL> insert into t values(1);
1 row created.
SQL> commit;
Commit complete.
SQL> select current_scn from v$database;
CURRENT_SCN
-----------
11850483 (記為2號時間點)
SQL> insert into t values(1);
1 row created.
SQL> commit;
Commit complete.
SQL> select current_scn from v$database;
CURRENT_SCN
-----------
11850489
SQL> conn / as sysdba
Connected.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 1124073472 bytes
Fixed Size 2078688 bytes
Variable Size 591398944 bytes
Database Buffers 524288000 bytes
Redo Buffers 6307840 bytes
Database mounted.
Database opened.
SQL> select current_scn from v$database;
CURRENT_SCN
-----------
11850721 (記為3號時間點)
SQL> conn test/test
Connected.
SQL> insert into t values(1);
1 row created.
SQL> commit;
Commit complete.
SQL> select current_scn from v$database;
CURRENT_SCN
-----------
11850893 (記為4號時間點)
好,現在開始做expdp匯出。
oracle@ibmvs_a@/other/dumpdir $ export ORACLE_SID=HT
oracle@ibmvs_a@/other/dumpdir $ expdp test/test directory=dumpdir dumpfile=t.dmp tables=t flashback_scn=11850458 (1號時間點)
Export: Release 10.2.0.3.0 - 64bit Production on Monday, 27 June, 2011 21:39:02
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
Starting "TEST"."SYS_EXPORT_TABLE_01": test/******** directory=dumpdir dumpfile=t.dmp tables=t flashback_scn=11850458
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 64 KB
Processing object type TABLE_EXPORT/TABLE/TABLE
ORA-31693: Table data object "TEST"."T" failed to load/unload and is being skipped due to error:
ORA-02354: error in exporting/importing data
ORA-01466: unable to read data - table definition has changed
Master table "TEST"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for TEST.SYS_EXPORT_TABLE_01 is:
/other/dumpdir/t.dmp
Job "TEST"."SYS_EXPORT_TABLE_01" completed with 1 error(s) at 21:39:38
oracle@ibmvs_a@/other/dumpdir $ expdp test/test directory=dumpdir dumpfile=t.dmp tables=t flashback_scn=11850483 (2號時間點)
Export: Release 10.2.0.3.0 - 64bit Production on Monday, 27 June, 2011 21:40:19
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
Starting "TEST"."SYS_EXPORT_TABLE_01": test/******** directory=dumpdir dumpfile=t.dmp tables=t flashback_scn=11850483
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 64 KB
Processing object type TABLE_EXPORT/TABLE/TABLE
. . exported "TEST"."T" 4.906 KB 1 rows
Master table "TEST"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for TEST.SYS_EXPORT_TABLE_01 is:
/other/dumpdir/t.dmp
Job "TEST"."SYS_EXPORT_TABLE_01" successfully completed at 21:40:30
oracle@ibmvs_a@/other/dumpdir $ expdp test/test directory=dumpdir dumpfile=t.dmp tables=t flashback_scn=11850721 (3號時間點)
Export: Release 10.2.0.3.0 - 64bit Production on Monday, 27 June, 2011 21:41:09
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
Starting "TEST"."SYS_EXPORT_TABLE_01": test/******** directory=dumpdir dumpfile=t.dmp tables=t flashback_scn=11850721
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 64 KB
Processing object type TABLE_EXPORT/TABLE/TABLE
. . exported "TEST"."T" 4.914 KB 2 rows
Master table "TEST"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for TEST.SYS_EXPORT_TABLE_01 is:
/other/dumpdir/t.dmp
Job "TEST"."SYS_EXPORT_TABLE_01" successfully completed at 21:41:23
oracle@ibmvs_a@/other/dumpdir $ expdp test/test directory=dumpdir dumpfile=t.dmp tables=t flashback_scn=11850893 (4號時間點)
Export: Release 10.2.0.3.0 - 64bit Production on Monday, 27 June, 2011 21:41:47
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
Starting "TEST"."SYS_EXPORT_TABLE_01": test/******** directory=dumpdir dumpfile=t.dmp tables=t flashback_scn=11850893
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 64 KB
Processing object type TABLE_EXPORT/TABLE/TABLE
. . exported "TEST"."T" 4.921 KB 3 rows
Master table "TEST"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for TEST.SYS_EXPORT_TABLE_01 is:
/other/dumpdir/t.dmp
Job "TEST"."SYS_EXPORT_TABLE_01" successfully completed at 21:42:01
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/21374452/viewspace-2152029/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- expdp 匯出時指定節點
- Oracle資料泵匯出匯入(expdp/impdp)Oracle
- expdp匯出報錯ORA-39127
- [oracle] expdp 匯出分割槽表的分割槽Oracle
- Oracle 12c expdp和impdp匯出匯入表Oracle
- Oracle expdp資料泵遠端匯出Oracle
- 如何確定一個dmp檔案是exp匯出的還是expdp匯出的?
- oracle按照表條件expdp匯出資料Oracle
- 基於 PhpSpreadsheet 簡單 Excel 匯入匯出PHPExcel
- 基於EPPlus和NPOI實現的Excel匯入匯出Excel
- oracle 11g expdp匯出報ORA-24001Oracle
- abp框架Excel匯出——基於vue框架ExcelVue
- Oracle使用資料泵expdp,impdp進行資料匯出匯入Oracle
- exp和expdp的filesize引數的使用--匯出多個檔案
- 【資料泵】EXPDP匯出表結構(真實案例)
- Oracle 11g 透過expdp按日期匯出表Oracle
- 【ASK_ORACLE】一眼判斷出Oracle的dmp檔案是用expdp匯出還是exp匯出Oracle
- 基於NPOI封裝匯出Excel方法封裝Excel
- 分享:一個基於NPOI的excel匯入匯出元件(強型別)Excel元件型別
- expdp在匯出時對資料大小進行評估
- expdp匯出報ORA-31693、ORA-02354、ORA-01466
- oracle10g expdp資料泵的bug,按schema匯出,匯入impdp時無jobOracle
- 基於DotNetCoreNPOI封裝特性通用匯出excelNetCore封裝Excel
- 基於.Net開發的資料庫匯入匯出的開源專案資料庫
- 使用Exp和Expdp匯出資料的效能對比與最佳化
- [重慶思莊每日技術分享]-expdp按日期匯出表
- 關於java中Excel的匯入匯出JavaExcel
- 基於Vue + axios + WebApi + NPOI匯出Excel檔案VueiOSWebAPIExcel
- java實現Excel定製匯出(基於POI的工具類)JavaExcel
- EXPDP匯出報ORA-31693 ORA-29913 ORA-01861錯誤
- 資料搬運元件:基於Sqoop管理資料匯入和匯出元件OOP
- 終止expdp正在執行中的匯出任務
- Oracle 12.1.0.2 expdp匯出分割槽表資料遇到BUG慢的原因和解決方法Oracle
- Python 基於 xlsxwriter 實現百萬資料匯出 excelPythonExcel
- 資料泵expdp匯出遇到ORA-01555和ORA-22924問題的分析和處理
- 基於 PHP 反射的許可權匯入PHP反射
- 關於EasyExcel的資料匯入和單sheet和多sheet匯出Excel
- [重慶思莊每日技術分享]-expdp導資料時評估匯出檔案大小