Oracle中的Imp和Expt用法

來源:互聯網
上載者:User

1.imp 使用者名稱/密碼@資料庫名稱(SID) file="dmp檔案的路徑"  fromuser=使用者名稱(從哪個使用者匯出)  touser=匯入到哪個使用者  例:

imp public_hmis/public_hmis@rldm file=d:\hmis.dmp log=d:\hmis.log fromuer=public_hmis touser=public_hmis ignore = y
imp jtv_conn/jtv_conn@rldm file=d:\hmis.dmp log=d:\hmis.log fromuser=jtv_conn touser=jtv_conn ignore = y
imp rldm/rldm@rldm file=d:\hmis.dmp log=d:\rldm.log fromuser=rldm touser=rldm ignore = y

2.授權grant select on v_$session to rldm grant 許可權(select,create,delete,update) on 表名、視圖名 to 使用者
在本地機器上往另一機器導資料
一、先在本地的tnsnames.ora檔案中建立一個服務名指向目標機器 如下例:
orcl=(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST =192.168.1.66)(PORT = 1521))
)
(CONNECT_DATA =
(SID = orcl)
(SERVER = orcl)
)
) 往IP為192.168.1.66的機器,執行個體名為orcl匯入資料
imp rldm/rldm@orcl file=d:\rldm.dmp log=d:\rldm.log fromuser=rldm touser=rldm ignore=y
192.168.1.66 中Oralce的使用者名稱為rldm,密碼為rldm, log=d:\rldm.log 是把記錄檔儲存在d盤,從rldm使用者中匯入到rldm使用者

3.匯出資料庫

exp 使用者名稱/密碼@SID(匯出庫的SID)


exp test(目標資料庫使用者名稱)/123456(密碼)@orcl(指向目標伺服器IP地址) file=d:\0704.dmp(匯出檔案儲存在本機上的路徑) log=d:\0704.log (螢幕日誌) owner=test (所有者使用者名稱列表)

exp test/123456@orcl file=d:\0704.dmp log=d:\0704.log owner=test

Oracle匯出全庫

exp sys as sysdba/admin@orcl file=f:\test.dmp log=f:\test.log full=y (rows=n compress=y direct=y這三項可不寫)

聯繫我們

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