關於oracleDatabase Backup還原-impdp,expdp

來源:互聯網
上載者:User

標籤:

初始化:

-- 建立資料表空間CREATE TABLESPACE 資料表空間名 DATAFILE ‘檔案名稱.dat‘ SIZE 100M AUTOEXTEND ON NEXT  10M MAXSIZE UNLIMITED;-- 建立使用者(oauser)--connect internalCREATE USER oauser IDENTIFIED BY oauser;ALTER USER oauser DEFAULT   TABLESPACE tablespace_name;ALTER USER oauser DEFAULT  ROLE ALL;GRANT DBA TO oauser;GRANT CONNECT TO oauser;GRANT RESOURCE TO oauser;GRANT create table to oauser;GRANT create trigger to oauser;grant exp_full_database to oauser;grant imp_full_database to oauser;--刪除使用者及資料表空間--步驟一:  刪除userdrop user ×× cascade--說明: 刪除了user,只是刪除了該user下的schema objects,是不會刪除相應的tablespace的。--步驟二: 刪除tablespaceDROP TABLESPACE 資料表空間名 INCLUDING CONTENTS AND DATAFILES;

oracle 匯入匯出(impdp,expdp):

//oracle 11g 下建立 匯入匯出目錄,需要串連到資料庫create or replace directory expdp_dir as ‘e:\backup‘;//給使用者賦權,需要使用另一個使用者賦權grant read,write on directory expdp_dir to oauser1;
//備份當前資料庫
expdp 使用者名稱/密碼 DIRECTORY=expdp_dir DUMPFILE=備份檔案名.dmp logfile=備份日誌名.log;
例子:
expdp oauser1/123456 DIRECTORY=expdp_dir DUMPFILE=2015-12-11.dmp logfile=2015-12-11.log

//將DMP備份檔案複製到 expdp_dir 下//將制定備份資料匯入impdp 使用者名稱/密碼[@監聽] dumpfile=備份檔案名 directory=expdp_dir remap_schema=匯出時的使用者名稱:匯入時的使用者 logfile=記錄檔名;

例子:
impdp oauser1/123456 dumpfile=2015-12-11.dmp directory=expdp_dir remap_schema=oauser:oauser1

 

PS:expdp,impdp這兩個命令是伺服器端的命令,直接在cmd裡以管理員的身份運行即可;

關於oracleDatabase Backup還原-impdp,expdp

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.