Oracle 10g R2 資料庫的複製---物理拷貝複製

來源:互聯網
上載者:User

在日常的工作中DBA經常會遇到資料的轉移,最典型的就是要將線上系統啟動並執行資料庫匯入到測試環境中,以進行相關的升級測試和壓力測試等。

下面介紹兩種方式複製資料庫。 

一、直接的物理拷貝複製

此種方式比較簡單,只要將必要的資料檔案,redo,控制檔案,參數檔案,監聽檔案等拷貝到目標伺服器相同的位置即可,下面介紹具體步驟:

首先,已經存在一台運行完好的資料庫,可以是生產庫或者練習使用的,我這裡是一個練習使用的10Gr2的庫:

主機名稱:dg1.andylhz.com  IP地址:192.168.1.254 來源資料庫  執行個體名:LHZ

目標資料庫只安裝資料庫軟體不建庫:

主機名稱:dg2.andylhz.com  IP地址:192.168.1.253 目標資料庫

先停止來源資料庫和監聽使用shutdown 和 lsnrctl stop 命令

然後找到來源資料庫的資料檔案和REDO檔案,控制檔案,系統參數檔案、密碼檔案和網路監聽設定檔等。

 

資料庫檔案、REDO檔案、控制檔案:

[Oracle@dg1 ~]$ cd /u01/app/oracle/oradata/lhz/

[oracle@dg1 lhz]$ ll

total 1071516

-rw-r-----  1 oracle oinstall   7061504 Jan 16 08:13 control01.ctl

-rw-r-----  1 oracle oinstall   7061504 Jan 16 08:13 control02.ctl

-rw-r-----  1 oracle oinstall   7061504 Jan 16 08:13 control03.ctl

-rw-r-----  1 oracle oinstall 104865792 Jan 16 07:39 example01.dbf

-rw-r-----  1 oracle oinstall  52429312 Jan 16 07:39 redo01.log

-rw-r-----  1 oracle oinstall  52429312 Jan 16 07:39 redo02.log

-rw-r-----  1 oracle oinstall  52429312 Jan 16 08:09 redo03.log

-rw-r-----  1 oracle oinstall 251666432 Jan 16 07:55 sysaux01.dbf

-rw-r-----  1 oracle oinstall 503324672 Jan 16 08:09 system01.dbf

-rw-r-----  1 oracle oinstall  22028288 Aug 28 11:03 temp01.dbf

-rw-r-----  1 oracle oinstall  31465472 Jan 16 08:09 undotbs01.dbf

-rw-r-----  1 oracle oinstall   5251072 Jan 16 07:39 users01.dbf

 

系統參數檔案、密碼檔案:

[oracle@dg1 dbs]$ cd /u01/app/oracle/10g/dbs/

total 44

-rw-r-----  1 oracle oinstall  1544 Aug 28 11:00 hc_lhz.dat

-rw-r-----  1 oracle oinstall 12920 May  3  2001 initdw.ora

-rw-r-----  1 oracle oinstall  8385 Sep 11  1998 init.ora

-rw-r-----  1 oracle oinstall    24 Aug 28 11:00 lkLHZ

-rw-r-----  1 oracle oinstall  1536 Aug 28 11:29 orapwlhz

-rw-r-----  1 oracle oinstall  2560 Jan 16 07:39 spfilelhz.ora

網路監聽設定檔:

[oracle@dg1 admin]$ cd /u01/app/oracle/10g/network/admin/

[oracle@dg1 admin]$ ll

total 20

-rw-r-----  1 oracle oinstall  479 Jan 16 07:53 listener.ora

drwxr-x---  2 oracle oinstall 4096 Aug 28 10:56 samples

-rw-r-----  1 oracle oinstall  172 Dec 26  2003 shrept.lst

-rw-r-----  1 oracle oinstall  175 Aug 28 11:15 sqlnet.ora

-rw-r-----  1 oracle oinstall  599 Jan 16 07:36 tnsnames.ora

  • 1
  • 2
  • 下一頁

聯繫我們

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