デモ作成などでスキーマとか環境をいろいろ作り直したりするので、その時によく使うコマンドの備忘録を貯めていきます。
Oracle12cR1
expdp directory=TEST_DIR dumpfile=pdb1_mluser.dmp schemas=mluser
Export: Release 12.1.0.2.0 - Production on Wed May 11 12:29:35 2016
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
Username: sys@pdb1 as sysdba
Password:
Connected to: Oracle Database 12c EE High Perf Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Advanced Analytics
and Real Application Testing options
Starting "SYS"."SYS_EXPORT_SCHEMA_01": sys/********@pdb1 AS SYSDBA directory=TEST_DIR dumpfile=pdb1_mluser.dmp schemas=mluser
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 65 MB
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
. . exported "MLUSER"."DM$PIASSOC_AP_1_2" 0 KB 0 rows
Master table "SYS"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYS.SYS_EXPORT_SCHEMA_01 is:
/home/oracle/work/pdb1_mluser.dmp
Job "SYS"."SYS_EXPORT_SCHEMA_01" successfully completed at Wed May 11 12:33:05 2016 elapsed 0 00:03:07
Usernameのところで、接続情報を入力する以外はすべて同じ。
旧来と同じだけどダンプファイルを吐き出すdirectory objectは事前に作成する必要あり。
Oracle12cR1
create directory TEST_DIR as '/home/oracle/work';
select * from dba_directories;
importする場合には、directory objectをpdb内に作る必要あり。