Oracle資料庫密碼重設、匯入匯出庫命令樣本應用_oracle

來源:互聯網
上載者:User

重設辦法如下:開啟CMD命令提示字元,然後輸入下面命令進行重設:

輸入sqlplus /nolog,斷行符號

SQL> conn /as sysdba

已串連;

SQL>alter user system identified by "123456"; ---(123456就是重設的密碼了)

SQL>alter user sys identified by "123456";

下面介紹的是匯入匯出的執行個體,嚮導入匯出看執行個體基本上就可以完成,因為匯入匯出很簡單。

資料匯出:

1 將資料庫TEST完全匯出,使用者名稱system 密碼manager 匯出到D:\daochu.dmp中
exp system/manager@TEST file=d:\daochu.dmp full=y
2 將資料庫中system使用者與sys使用者的表匯出
exp system/manager@TEST file=d:\daochu.dmp owner=(system,sys)
3 將資料庫中的表table1 、table2匯出
exp system/manager@TEST file=d:\daochu.dmp tables=(table1,table2)
4 將資料庫中的表table1中的欄位filed1以"00"打頭的資料匯出
exp system/manager@TEST file=d:\daochu.dmp tables=(table1) query=\" where filed1 like '00%'\"

上面是常用的匯出,對於壓縮我不太在意,用winzip把dmp檔案可以很好的壓縮。
不過在上面命令後面 加上 compress=y 就可以了

資料的匯入

1 將D:\daochu.dmp 中的資料匯入 TEST資料庫中。
imp system/manager@TEST file=d:\daochu.dmp
上面可能有點問題,因為有的表已經存在,然後它就報錯,對該表就不進行匯入。
在後面加上 ignore=y 就可以了。
2 將d:\daochu.dmp中的表table1 匯入
imp system/manager@TEST file=d:\daochu.dmp tables=(table1)

基本上上面的匯入匯出夠用了。不少情況我是將表徹底刪除,然後匯入。

資料匯出:

exp hkb/hkb@boss_14 full=y file=c:\orabackup\hkbfull.dmp log=c:\orabackup\hkbfull.log;

匯出注意事項:匯出的是目前使用者的的資料,目前使用者如果有DBA的許可權,則匯出所有資料!

同名使用者之間的資料匯入:
imp hkb/hkb@xe file=c:\orabackup\hkbfull.dmp log=c:\orabackup\hkbimp.log full=y

不同名之間的資料匯入:
imp system/test@xe fromuser=hkb touser=hkb_new file=c:\orabackup\hkbfull.dmp

log=c:\orabackup\hkbimp.log;

聯繫我們

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