expdp参数
compression 压缩
parallel 并行
cluster 集群
schemas 用户对象
tables 表
tablespaces 表空间
full=y 整库
1.创建数据库用户
create user test identified by test;
2.授予用户权限
grant connect,resource to test;
3.创建expdp导出目录
create directory expdpdir as '/home/oracle/expdp';
4.验证导出目录是否存在
select * from dba_directories;
5.为创建的目录赋权限
grant read,write on directory expdpdir to test;
6.直接导出用户方式(以SYSDBA用户直接导出)
expdp \' / as sysdba\' directory=testdir dumpfile=testpdb_%U.dump schemas=test logfile=expdp.log compression=all;
7.12C以上版本直接导出PDB用户方式
expdp test/test@ttpdb directory=testdir dumpfile=testpdb_%U.dump schemas=test logfile=expdp.log compression=all;
7.结果
Export: Release 12.2.0.1.0 - Production on Sun Dec 19 11:08:05 2021
Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
Starting "TEST"."SYS_EXPORT_SCHEMA_01": test/********@ttpdb directory=testdir dumpfile=testpdb_%U.dump schemas=test logfile=expdp.log compression=all
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/COMMENT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Master table "TEST"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for TEST.SYS_EXPORT_SCHEMA_01 is:
/home/oracle/expdp/testpdb_01.dump
Job "TEST"."SYS_EXPORT_SCHEMA_01" successfully completed at Sun Dec 19 11:08:52 2021 elapsed 0 00:00:45