oracle資料庫的還原備份

2022-04-14 07:59:10 字數 1391 閱讀 3392

**載自:

oracle資料庫還原備份:

資料匯出:

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%'\"

資料的匯入

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)

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

注意:你要有足夠的許可權,許可權不夠它會提示你。

資料庫時可以連上的。可以用tnsping test 來獲得資料庫test能否連上

附錄一:

給使用者增加匯入資料許可權的操作

第一,啟動sql*puls

第二,以system/manager登陸

第三,create user 使用者名稱 identified by 密碼 (如果已經建立過使用者,這步可以省略)

第四,grant create user,drop user,alter user ,create any view ,drop any

view,exp_full_database,imp_full_database, dba,connect,resource,create session to

使用者名字

第五, 執行-cmd-進入dmp檔案所在的目錄,

imp userid=system/manager full=y file=*.dmp

或者 imp userid=system/manager full=y file=filename.dmp

oracle備份還原資料庫

1 備份資料庫 exp 使用者名稱 密碼 資料庫名 file e oracle date databack 2013 11 03 init dmp。2 還原資料庫 imp 使用者名稱 密碼 資料庫名 file e oracle date databack 2013 11 03 init dmp fu...

Oracle資料庫備份還原

注 以下 如未特別說明,均為sqlplus中執行 sqlplus中連線oracle conn system root 讓備份檔案中包含空表 有些表可能是空表,oracle預設是不會備份空表的 執行以下語句,執行完後得到一些語句集,然後執行這些語句集,如果沒有資料則表示所有表均在備份集中 select...

oracle資料庫的備份還原

create bigfile tablespace 表空間名 create user 使用者名稱 identified by 1234 default tablespace 表空間名 grant dba to 使用者名稱 create directory 存放路徑名 as c users 20160...