Oracle遠(yuǎn)程備份恢復(fù)數(shù)據(jù)_編程愛好者.doc_第1頁
Oracle遠(yuǎn)程備份恢復(fù)數(shù)據(jù)_編程愛好者.doc_第2頁
Oracle遠(yuǎn)程備份恢復(fù)數(shù)據(jù)_編程愛好者.doc_第3頁
Oracle遠(yuǎn)程備份恢復(fù)數(shù)據(jù)_編程愛好者.doc_第4頁
Oracle遠(yuǎn)程備份恢復(fù)數(shù)據(jù)_編程愛好者.doc_第5頁
已閱讀5頁,還剩3頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

Oracle 遠(yuǎn)程數(shù)據(jù)備份 編程愛好者 版本信息 版 本 號發(fā) 布 人日 期版本摘要 V1 0Wenlong2011 3 14創(chuàng)建 Copyright 2010 Wenlong All Rights Reserved 目 錄 1 備份數(shù)據(jù)庫 1 2 恢復(fù)數(shù)據(jù)庫 1 3 備份單表 1 3 1 簡單備份 1 3 2 查詢備份 1 4 恢復(fù)單表 2 4 1 恢復(fù)表結(jié)構(gòu) 2 4 2 恢復(fù)表數(shù)據(jù) 2 5 關(guān)于表空間的問題 2 1 備份數(shù)據(jù)庫備份數(shù)據(jù)庫 對整個(gè)數(shù)據(jù)庫進(jìn)行備份 參數(shù)設(shè)置為默認(rèn)值 exp g3datatest g3datatest 10 12 1 21 file d g3datatest dmp direct y 2 恢復(fù)數(shù)據(jù)庫恢復(fù)數(shù)據(jù)庫 對整個(gè)數(shù)據(jù)庫進(jìn)行恢復(fù) 參數(shù)設(shè)置為默認(rèn)值 imp g3datatest g3datatest 10 12 1 21 file c Backup drug dmp full y 3 備份單表備份單表 3 1 簡單備份簡單備份 只對數(shù)據(jù)庫中的某一表進(jìn)行備份 exp g3datatest g3datatest 10 12 1 21 file c Backup drug dmp tables TABLE TEST 3 2 查詢備份查詢備份 單表備份可以帶查詢條件 exp programmer programmer localhost file d user test dmp tables TABLE TEST query where ID 1001 4 恢復(fù)單表恢復(fù)單表 4 1 恢復(fù)表結(jié)構(gòu)恢復(fù)表結(jié)構(gòu) 對備份的表進(jìn)行表結(jié)構(gòu)恢復(fù) imp g3datatest g3datatest 10 12 1 21 file c Backup drug dmp tables TABLE TEST rows n 4 2 恢復(fù)表數(shù)據(jù)恢復(fù)表數(shù)據(jù) 對備份的表進(jìn)行數(shù)據(jù)恢復(fù) imp g3datatest g3datatest 10 12 1 21 file c Backup drug dmp tables TABLE TEST ignore y 5 關(guān)于表空間的問題關(guān)于表空間的問題 在備份和恢復(fù)數(shù)據(jù)庫的時(shí)候 如果是在同一個(gè)用戶下進(jìn)行操作 即把某一個(gè)用戶的數(shù) 據(jù)庫進(jìn)行還原 就不會出現(xiàn)表空間的問題 如果實(shí)在不同用戶下進(jìn)行操作 即把某一個(gè) 用戶的數(shù)據(jù)庫備份后恢復(fù)到另外一個(gè)用戶 此時(shí)就會出現(xiàn)表空間的問題 具體的表空間 問題描述如下 假設(shè)現(xiàn)在有兩個(gè) Oracle 用戶 user1 和 user2 用戶信息如下表 用戶名表空間臨時(shí)表空間角色系統(tǒng)權(quán)限 USER1USER1USER1 TEMPCONNECT DBA RESOURCE ADMINISTER RESOURCE MANAGER CREATE ANY TABLE UNLIMITED TABLESPACE USER2USER2USER2 TEMP同上同上 用戶 USER1 的表 USER TEST 信息如下 Create table create table USER TEST ID NUMBER 12 not null NAME VARCHAR2 50 tablespace USER1 pctfree 10 initrans 1 maxtrans 255 storage initial 64 minextents 1 maxextents unlimited Create Recreate primary unique and foreign key constraints alter table USER TEST add primary key ID using index tablespace USER1 pctfree 10 initrans 2 maxtrans 255 storage initial 64K minextents 1 maxextents unlimited 在 USER TEST 表中隨便插入幾條記錄的數(shù)據(jù) 然后通過 Oracle 數(shù)據(jù)庫的備份命令 exp 對表進(jìn)行備份 備份完成以后再通過恢復(fù)命令 imp 將用戶 USER1 的表 USER TEST 恢復(fù)到用戶 USER2 包括表結(jié)構(gòu)和數(shù)據(jù) 在所有操作完成之后 通過查看用戶 USER2 的 USER TEST 表的表結(jié)構(gòu) 我們會發(fā)現(xiàn) 用戶 USER2 的表 USER TEST 的表空間還是用戶 USER1 的表空間 USER1 而不是用戶 USER2 的默認(rèn)表空間 USER2 雖然表是從用戶 USER1 備份恢復(fù)到 USER2 了 但是表空間卻沒有轉(zhuǎn)換 這樣恢復(fù)的 表和以前的表空間在物理上還是有牽連 不是我們期待的結(jié)果 對于此問題 解決的思路就是撤回目標(biāo)用戶的任意表空間權(quán)限 使導(dǎo)入表的表空間為 目標(biāo)用戶默認(rèn)的表空間 測試表的腳本如下 create table user test id number 12 name varchar2 50 primary key id insert into user test id name values 1001 Jack insert into user test id name values 1002 Mary 解決表空間問題的詳細(xì)步驟如下 D exp programmer programmer localhost file d user test dmp tables user test Export Release 10 2 0 1 0 Production on 星期一 3 月 14 10 50 26 2011 Copyright c 1982 2005 Oracle All rights reserved 連接到 Oracle Database 10g Enterprise Edition Release 10 2 0 1 0 Production With the Partitioning OLAP and Data Mining options 已導(dǎo)出 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集 即將導(dǎo)出指定的表通過常規(guī)路徑 正在導(dǎo)出表 USER TEST 導(dǎo)出了 2 行 成功終止導(dǎo)出 沒有出現(xiàn)警告 D sqlplus nolog SQL Plus Release 10 2 0 1 0 Production on 星期一 3 月 14 10 50 52 2011 Copyright c 1982 2005 Oracle All rights reserved SQL conn as sysdba 已連接 SQL create user ORACLETEST identified by oracletest default tablespace ORACLETE ST temporary tablespace ORACLETEST TEMP 用戶已創(chuàng)建 SQL grant dba connect resource to ORACLETEST 授權(quán)成功 SQL revoke unlimited tablespace from ORACLETEST 撤銷成功 SQL alter user ORACLETEST quota 0 on USERS 用戶已更改 SQL alter user ORACLETEST quota unlimited on ORACLETEST 用戶已更改 SQL exit 從 Oracle Database 10g Enterprise Edition Release 10 2 0 1 0 Production With the Partitioning OLAP and Data Mining options 斷開 D imp programmer programmer localhost file d user test dmp fromuser programme r touser oracletest grants n Import Release 10 2 0 1 0 Production on 星期一 3 月 14 11 00 01 2011 Copyright c 1982 2005 Oracle All rights reserved 連接到 Oracle Database 10g Enterprise Edition Release 10 2 0 1 0 Production With the Partitioning OLAP and Data Mining options 經(jīng)由常規(guī)路徑由 EXPORT V10 02 01 創(chuàng)建的導(dǎo)出文件 已經(jīng)完成 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集中的導(dǎo)入 正在將 PROGRAMMER 的對象導(dǎo)入到 ORACLETEST 正在導(dǎo)入表 USER TEST 導(dǎo)入了 2 行 成功終止導(dǎo)入 沒有出現(xiàn)警告 D sqlplus oracletest oracletest SQL Plus Release 10 2 0 1 0 Production on 星期一 3 月 14 11 02 21 2011 Copyright c 1982 2005 Oracle All rights reserved 連接到 Oracle Database 10g Enterprise Edition Release 10 2 0 1 0 Producti

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論