oracle資料庫匯入匯出

來源:互聯網
上載者:User

標籤:ar   sp   for   檔案   資料   on   art   log   ad   

>exp -help

>imp -help

資料字典表:dba_data_files:資料檔案表

查看資料檔案名及其所屬資料表空間名:

設定每行顯示長度:set linesize 300;

設定每頁顯示列數:set pagesize 30;

設定資料檔案名顯示長度:col file_name for a50;

設定資料表空間名顯示長度:col tablespace_name for a15;

select file_name,tablespace_name from dba_data_files;

建立資料表空間文法:

create tablespace 資料表空間名

datafile ‘資料檔案地址\資料檔案名.dbf‘

size 10M autoextend on maxsize 10g;

em:create tablespace bangkins

datafile ‘d:\dddd\ddddd.dbf‘

size 10M autoextend on maxsize 10g;

建立使用者:create user bankuser

identidied by tiger

default tablespace bankins;

授權使用者:grant cennect,resource to bankuser;

查看目前使用者下的表:select table_name from user_tables;

exp匯出資料:>exp 使用者名稱/密碼@伺服器名 file=匯出地址 log=匯出記錄檔地址

imp匯入資料:>imp 使用者名稱/密碼@伺服器名 fromuser=匯出資料庫使用者名稱 touser=匯入資料庫使用者名稱 file=匯入Database Backup log=匯出記錄備份

>exp bankuser/[email protected] file=‘d:\ddddd\dddd.dmp‘ log=‘d:\ddddd\eeeee.dmp‘

>imp bankuser/[email protected] fromuser=bankuser touser=bankuser file=‘d:\ddddd\ddddd.dmp‘ file=‘d:\ddddd\eeeee.dmp‘

資料泵:

>expdp -help

>impdp- help

linux下oracle資料庫下建立匯出資料的目錄:SQL>create or replare directory expdp_dir

as ‘/home/oracle/expdp_dir‘;

把建立目錄的讀寫權限賦予給使用者(wcw):

grant read,write on directory expdp_dir to wcw;

linux下建立檔案夾:$mkdir expdp_dir;

linux下刪除剛建立的目錄:$rm -rf expdp_dir;

$chmod 777 expdp_dir

$expdp 使用者名稱/密碼 directory=匯出目錄名 dumpfile=*******.dmp logfile=*******.log

em:$expdp wcw/tiger directory=bank_ins dumpfile=bankeins.dmp logfile=bankins.log

$impdp 使用者名稱/密碼@資料庫執行個體名 directory=匯入資料目錄 dumpfile=******.dmp logfile=****.log

在windows系統下建立匯入目錄:

create or replare directory=impdp_dir as ‘d:\ddddddd‘;

授權匯入目錄給wcw使用者:

grant read,write on dicretory impdp_dir to wcw;

em:$impdp wcw/[email protected] directory=impdo_dir dumplile=bankins.dmp logfile=bankins.log

註:更改ftp參數:#setsebool ftpd_disable_trans 1

重啟ftp服務:#service vsftpd restart;

oracle資料庫匯入匯出

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.