「Oracle 12c」Oracleのバックアップでエクスポート・インポートを使う方法

環境

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
Windows Server 2012 R2
Oracle 12.2.0.1.0
Windows Server 2012 R2 Oracle 12.2.0.1.0
Windows Server 2012 R2
Oracle 12.2.0.1.0

構文
CREATE OR REPLACE DIRECTORY ディレクトリ AS ディレクトリパス;

操作例

1.ディレクトリオブジェクトBACK_DIRを作成

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
SQL> CREATE OR REPLACE DIRECTORY BACK_DIR AS 'D:\dump';
SQL> CREATE OR REPLACE DIRECTORY BACK_DIR AS 'D:\dump';
SQL> CREATE OR REPLACE DIRECTORY BACK_DIR AS 'D:\dump';

2.権限を付与

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
方法1
SQL> GRANT READ ON DIRECTORY BACK_DIR TO CFT;
SQL> GRANT WRITE ON DIRECTORY BACK_DIR TO CFT;
方法2
SQL> GRANT READ, WRITE ON DIRECTORY BACK_DIR TO CFT;
方法1 SQL> GRANT READ ON DIRECTORY BACK_DIR TO CFT; SQL> GRANT WRITE ON DIRECTORY BACK_DIR TO CFT; 方法2 SQL> GRANT READ, WRITE ON DIRECTORY BACK_DIR TO CFT;
方法1
SQL> GRANT READ ON DIRECTORY BACK_DIR TO CFT;
SQL> GRANT WRITE ON DIRECTORY BACK_DIR TO CFT;

方法2
SQL> GRANT READ, WRITE ON DIRECTORY BACK_DIR TO CFT;

3.Oracleのバックアップでエクスポート

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
>EXPDP CFT/CFTPWD@USERDB DIRECTORY=BACK_DIR DUMPFILE=CFT_BAK.DMP LOGFILE=CFT_BAK.LOG
>EXPDP CFT/CFTPWD@USERDB DIRECTORY=BACK_DIR DUMPFILE=CFT_BAK.DMP LOGFILE=CFT_BAK.LOG
>EXPDP CFT/CFTPWD@USERDB DIRECTORY=BACK_DIR DUMPFILE=CFT_BAK.DMP LOGFILE=CFT_BAK.LOG

4.Oracleのバックアップでインポート

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
>IMPDP CFT/CFTPWD@USERDB DIRECTORY=BACK_DIR DUMPFILE=CFT_BAK.DMP LOGFILE=CFT_BAK.LOG
>IMPDP CFT/CFTPWD@USERDB DIRECTORY=BACK_DIR DUMPFILE=CFT_BAK.DMP LOGFILE=CFT_BAK.LOG
>IMPDP CFT/CFTPWD@USERDB DIRECTORY=BACK_DIR DUMPFILE=CFT_BAK.DMP LOGFILE=CFT_BAK.LOG

 

Oracle 12c

Posted by arkgame