在Oracle 11gR2上使用RMAN實現整庫遷移

來源:互聯網
上載者:User

在Oracle 11gR2上使用RMAN實現整庫遷移

背景:

資料庫

IP

SID

連接埠

資料庫版本

Target DB

192.168.1.133

orcl

1521

11.2.0.1.0

Auxiliary DB

192.168.1.133(可以是同一機器,也可以是不同機器)

V112

1522

11.2.0.1.0

1. 在Auxiliary 建立pfile 參數檔案
 
[oracle@localhost dbs]$ pwd
/u01/oracle11gR2/product/11.2.0/db_1/dbs
[oracle@localhost dbs]$ more initv112.ora
*.DB_NAME=v112
*.control_files='/u01/oracle11gR2/oradata/v112/control01.ctl','/u01/oracle11gR2/flash_recovery_area
/v112/control02.ctl'
*.db_block_size=8192
*.compatible='11.2.0.1'
_compression_compatibility="11.2.0"   註:這個隱含參數可以繞過11.2.0.1的bug
*.db_recovery_file_dest_size=4294967296
*.db_recovery_file_dest='/u01/oracle11gR2/flash_recovery_area'
*.audit_file_dest='/u01/oracle11gR2/admin/v112/adump'
    
2. 在Auxiliary庫上建立口令檔案
[oracle@localhost dbs]$ pwd
/u01/oracle11gR2/product/11.2.0/db_1/dbs
[oracle@localhost dbs]$ orap
orapipe  orapki   orapwd   orapwdO 
[oracle@localhost dbs]$ orapwd file=orapwv112 password=Your password   
3. 在Auxiliary庫建立相關的目錄結構
[oracle@localhost dbs]$ mkdir /u01/oracle11gR2/admin/v112/
[oracle@localhost dbs]$ mkdir /u01/oracle11gR2/oradata/v112/ 
註:在duplicate過程中,如果目錄不存在,則會報錯“ORA-27040: file create error, unable to create file”
 
4. 啟動Auxiliary 到nomout 狀態
 
SQL> conn / as sysdba;
Connected to an idle instance.
SQL> startup nomount pfile=‘/u01/oracle11gR2/product/11.2.0/db_1/dbs/initv112.ora’
ORACLE instance started.
Total System Global Area  146472960 bytes
Fixed Size                  1335080 bytes
Variable Size              92274904 bytes
Database Buffers           50331648 bytes
Redo Buffers                2531328 bytes
    
5. 在Target 和Auxiliary 都配置Oracle Net(Listener.ora and tnsnames.ora)[可選] 
 
[oracle@localhost admin]$ more tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/oracle11gR2/product/11.2.0/db_1/network/admin/tnsna
mes.ora
# Generated by Oracle configuration tools.
v112 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.133)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = v112)
    )
  )
LISTENER_v112 =
  (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.133)(PORT = 1521))
ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.133)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SID_NAME = orcl
    )
  )
LISTENER_ORCL =
  (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.133)(PORT = 1521))
 
[oracle@localhost admin]$ more listener.ora
# listener.ora Network Configuration File: /u01/oracle11gR2/product/11.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.133)(PORT = 1521))
    )
  )
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = v112)
      (ORACLE_HOME = /u01/oracle11gR2/product/11.2.0/db_1)
      (SID_NAME = v112)
    )
  )
 
LISTENER2 =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.133)(PORT = 1522))
    )
  )
 
SID_LIST_LISTENER2 =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = orcl)
      (ORACLE_HOME = /u01/oracle11gR2/product/11.2.0/db_1)
      (SID_NAME = orcl)
    )
  )
 
ADR_BASE_LISTENER1 = /u01/oracle11gR2

  • 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.