アットウィキロゴ

Oracle_バックアップ

▼インポート
1.データの追加のみ
 TABLE_EXISTS_ACTION:APPEND(DATA_ONLYのデフォルトのため指定不要)
 CONTENT:DATA_ONLY
 例)impdp scott/tiger dumpfile=expdp.dmp directory=datapump_dir tables=emp content=data_only

2.テーブルの削除、テーブルの作成、データのロードを行う
 TABLE_EXISTS_ACTION:REPLACE
 CONTENT:ALL(デフォルトのため指定不要)
 例)impdp scott/tiger dumpfile=expdp.dmp directory=datapump_dir tables=emp table_exists_action=replace

3.既存のデータを削除し、データのロードを行う
 TABLE_EXISTS_ACTION:TRUNCATE
 CONTENT:DATA_ONLY
 例)impdp scott/tiger dumpfile=expdp.dmp directory=datapump_dir tables=emp table_exists_action=truncate content=data_only

4.既存のテーブルを削除し、データをロードせずテーブルの作成を行う
 TABLE_EXISTS_ACTION:REPLACE
 CONTENT:METADATA_ONLY
 例)impdp scott/tiger dumpfile=expdp.dmp directory=datapump_dir tables=emp table_exists_action=replace content=metadata_only

▼エクスポート
EXP_FULL_DATABASEロールが必要(SYSTEMユーザを使えばOK)
1.普通にエクスポート用のフォルダを作成する
2.sqlplusで接続し、作成したフォルダをOracleで使えるようにする
SQL>create directory dpump_dir as 'd:\oradump';
3.expdpでデータベースを
全データベース・モードでデータをエクスポートする
expdp system/manager full=y dumpfile=fulldb.dmp directory=dpump_dir logfile=full_expdp.log
指定スキーマのみエクスポートする
expdp system/manager schemas=scott dumpfile=fulldb.dmp directory=dpump_dir logfile=full_expdp.log
指定テーブルのみエクスポートする
expdp system/manager dumpfile=fulldb.dmp directory=dpump_dir logfile=full_expdp.log tables=scott.emp

タグ:

+ タグ編集
  • タグ:
最終更新:2012年04月05日 10:36
ツールボックス

下から選んでください:

新しいページを作成する
ヘルプ / FAQ もご覧ください。