expdp 会删除 Oracle 中的数据吗?
Does expdp remove data in Oracle?
我打算在 Hadoop 集群上执行升级,但我想先备份 Ambari Metastore 架构,以防出现任何问题。
Oracle 用于存储数据,因此我考虑使用 expdp
快速备份当前状态的模式。但是,我在几个不同的文档中看到它提到这用于 "unload" 数据。这是否意味着数据将在转储过程中从数据库中删除?我想保留所有内容并快速备份,类似于 Postgres 命令 pg_dump
.
别担心,您的数据会保留在原处。
这是一个简单的示例:我正在导出 Scott 的 DEPT table。您会看到数据在执行 EXPDP 之前和之后的 table 中。
SQL> select * from dept;
DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
SQL> $expdp scott/tiger@xe tables=dept directory=ext_dir
Export: Release 11.2.0.2.0 - Production on Pon O×u 5 21:21:24 2018
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
Starting "SCOTT"."SYS_EXPORT_TABLE_01": scott/********@xe tables=dept directory=ext_dir
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
Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
. . exported "SCOTT"."DEPT" 5.929 KB 4 rows
Master table "SCOTT"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SCOTT.SYS_EXPORT_TABLE_01 is:
C:\TEMP\EXPDAT.DMP
Job "SCOTT"."SYS_EXPORT_TABLE_01" successfully completed at 21:21:34
SQL> select * from dept;
DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
SQL>
我打算在 Hadoop 集群上执行升级,但我想先备份 Ambari Metastore 架构,以防出现任何问题。
Oracle 用于存储数据,因此我考虑使用 expdp
快速备份当前状态的模式。但是,我在几个不同的文档中看到它提到这用于 "unload" 数据。这是否意味着数据将在转储过程中从数据库中删除?我想保留所有内容并快速备份,类似于 Postgres 命令 pg_dump
.
别担心,您的数据会保留在原处。
这是一个简单的示例:我正在导出 Scott 的 DEPT table。您会看到数据在执行 EXPDP 之前和之后的 table 中。
SQL> select * from dept;
DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
SQL> $expdp scott/tiger@xe tables=dept directory=ext_dir
Export: Release 11.2.0.2.0 - Production on Pon O×u 5 21:21:24 2018
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
Starting "SCOTT"."SYS_EXPORT_TABLE_01": scott/********@xe tables=dept directory=ext_dir
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
Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
. . exported "SCOTT"."DEPT" 5.929 KB 4 rows
Master table "SCOTT"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SCOTT.SYS_EXPORT_TABLE_01 is:
C:\TEMP\EXPDAT.DMP
Job "SCOTT"."SYS_EXPORT_TABLE_01" successfully completed at 21:21:34
SQL> select * from dept;
DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
SQL>