1. 程式人生 > >Oracle rac asm資料庫恢復到單例項資料庫

Oracle rac asm資料庫恢復到單例項資料庫

環境:

資料庫版本:10201

1.源端資料庫:oracle 10g RAC ASM datbase

2.目標資料庫:oracle 10g single datbase

1引數檔案的恢復


1.1.恢復引數檔案
[[email protected] ~]$ rman target /

Recovery Manager: Release 10.2.0.1.0 - Production on Mon Mar 11 00:17:30 2013

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

connected to target database (not started)


RMAN> startup nomount;

startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/oracle/product/10.2/dbs/initoradb.ora'

starting Oracle instance without parameter file for retrival of spfile
Oracle instance started

Total System Global Area     159383552 bytes


Fixed Size                     1218244 bytes
Variable Size                 58722620 bytes
Database Buffers              92274688 bytes
Redo Buffers                   7168000 bytes

RMAN> restore spfile to pfile "/u01/oracle/yd.ora" from "/u01/rmanbak/c-2562551067-20130310-00";

Starting restore at 11-MAR-13
using channel ORA_DISK_1


channel ORA_DISK_1: autobackup found: /u01/rmanbak/c-2562551067-20130310-00
channel ORA_DISK_1: SPFILE restore from autobackup complete
Finished restore at 11-MAR-13

RMAN>

1.2.修改引數檔案
more yd.ora

*.audit_file_dest='/u01/oracle/admin/oradb/adump'
*.background_dump_dest='/u01/oracle/admin/oradb/bdump'
*.compatible='10.2.0.1.0'
*.control_files='/u01/oracle/oradata/oradb/control01.ctl','/u01/oracle/oradata/oradb/control02.ctl','/u01/oracle/o

radata/oradb/control03.ctl'
*.core_dump_dest='/u01/oracle/admin/oradb/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='oradb'
*.job_queue_processes=10
*.open_cursors=300
*.pga_aggregate_target=54371840
*.processes=150
*.remote_login_passwordfile='exclusive'
*.sga_target=185212672
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/u01/oracle/admin/oradb/udump'

1.3.建立相關目錄
[[email protected] admin]$ mkdir -p /u01/oracle/admin/oradb/udump
[[email protected] admin]$ mkdir -p /u01/oracle/admin/oradb/cdump
[[email protected] admin]$ mkdir -p /u01/oracle/admin/oradb/bdump
[[email protected] admin]$ mkdir -p /u01/oracle/admin/oradb/adump
[[email protected] admin]$ mkdir -p /u01/oracle/admin/oradb/pfile
[[email protected] admin]$ mkdir -p /u01/oracle/oradb

1.4.建立spfile檔案
[[email protected] oracle]$ sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.1.0 - Production on Mon Mar 11 00:25:10 2013

Copyright (c) 1982, 2005, Oracle.  All rights reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> create spfile from pfile='/u01/oracle/yd.ora';

File created.

SQL> 
SQL> create pfile from spfile;

File created.

SQL> 

2.恢復控制檔案
2.1.從備份集中恢復controlfile

[[email protected] oracle]$ sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.1.0 - Production on Mon Mar 11 00:26:12 2013

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup nomount;
ORACLE instance started.

Total System Global Area  188743680 bytes
Fixed Size                  1218412 bytes
Variable Size              62916756 bytes
Database Buffers          117440512 bytes
Redo Buffers                7168000 bytes
SQL> 
SQL> 

[email protected] ~]$ rman target /

Recovery Manager: Release 10.2.0.1.0 - Production on Mon Mar 11 00:26:36 2013

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

connected to target database: oradb (not mounted)

RMAN> set dbid=2562551067

executing command: SET DBID

RMAN> 

restore controlfile from '/u01/rmanbak/c-2562551067-20130310-00';

RMAN> restore controlfile from '/u01/rmanbak/c-2562551067-20130310-00';

Starting restore at 11-MAR-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=155 devtype=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
output filename=/u01/oracle/oradata/oradb/control01.ctl
output filename=/u01/oracle/oradata/oradb/control02.ctl
output filename=/u01/oracle/oradata/oradb/control03.ctl
Finished restore at 11-MAR-13

RMAN> alter database mount;

database mounted
released channel: ORA_DISK_1


2.2.註冊rman備份集到控制檔案

catalog start with '/u01/rmanbak';

RMAN> catalog start with '/u01/rmanbak';

searching for all files that match the pattern /u01/rmanbak

List of Files Unknown to the Database
=====================================
File Name: /u01/rmanbak/full_05o46e43_ORADB_20130310
File Name: /u01/rmanbak/arch_03o46e3u_ORADB_20130310
File Name: /u01/rmanbak/arch_08o46e50_ORADB_20130310
File Name: /u01/rmanbak/c-2562551067-20130310-00
File Name: /u01/rmanbak/full_06o46e4i_ORADB_20130310
File Name: /u01/rmanbak/full_04o46e44_ORADB_20130310
File Name: /u01/rmanbak/yd.ora
File Name: /u01/rmanbak/arch_07o46e51_ORADB_20130310
File Name: /u01/rmanbak/arch_02o46e3s_ORADB_20130310
File Name: /u01/rmanbak/arch_01o46e3n_ORADB_20130310
File Name: /u01/rmanbak/rman2.tar
File Name: /u01/rmanbak/rman1.tar

Do you really want to catalog the above files (enter YES or NO)? yes
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /u01/rmanbak/full_05o46e43_ORADB_20130310
File Name: /u01/rmanbak/arch_03o46e3u_ORADB_20130310
File Name: /u01/rmanbak/arch_08o46e50_ORADB_20130310
File Name: /u01/rmanbak/c-2562551067-20130310-00
File Name: /u01/rmanbak/full_06o46e4i_ORADB_20130310
File Name: /u01/rmanbak/full_04o46e44_ORADB_20130310
File Name: /u01/rmanbak/arch_07o46e51_ORADB_20130310
File Name: /u01/rmanbak/arch_02o46e3s_ORADB_20130310
File Name: /u01/rmanbak/arch_01o46e3n_ORADB_20130310

List of Files Which Where Not Cataloged
=======================================
File Name: /u01/rmanbak/yd.ora
  RMAN-07517: Reason: The file header is corrupted
File Name: /u01/rmanbak/rman2.tar
  RMAN-07517: Reason: The file header is corrupted
File Name: /u01/rmanbak/rman1.tar
  RMAN-07517: Reason: The file header is corrupted


ist of Backup Sets
===================

。。。。。



3.檢視控制檔案內容

set line 100   
col NAME for a80
col MEMBER for a80
select file#,status,name from v$datafile
  union all
  select group#,status,member from v$logfile
  union all
  select file#,status,name from v$tempfile;


SQL> set line 100   
SQL> col NAME for a80
SQL> col MEMBER for a80
SQL> select file#,status,name from v$datafile
  2    union all
  3    select group#,status,member from v$logfile
  4    union all
  5    select file#,status,name from v$tempfile;

     FILE# STATUS  NAME
---------- ------- --------------------------------------------------------------------------------
         1 SYSTEM  +ASMDG/oradb/datafile/system.256.809286221
         2 ONLINE  +ASMDG/oradb/datafile/undotbs1.258.809286223
         3 ONLINE  +ASMDG/oradb/datafile/sysaux.257.809286223
         4 ONLINE  +ASMDG/oradb/datafile/users.259.809286223
         5 ONLINE  +ASMDG/oradb/datafile/undotbs2.264.809286357
         6 ONLINE  +ASMDG/oradb/datafile/ts1.268.809708305
         7 ONLINE  +ASMDG/oradb/datafile/yd.269.809708359
         2         +ASMDG/oradb/onlinelog/group_2.262.809286305
         1         +ASMDG/oradb/onlinelog/group_1.261.809286303
         3         +ASMDG/oradb/onlinelog/group_3.265.809286383
         4         +ASMDG/oradb/onlinelog/group_4.266.809286385
         1 ONLINE  +ASMDG/oradb/tempfile/temp.263.809286315

12 rows selected.

4.資料庫恢復

4.1.restore資料檔案和臨時資料檔案

run{
set newname for datafile 1 to '/u01/oracle/oradata/oradb/system01.dbf';
set newname for datafile 2 to '/u01/oracle/oradata/oradb/undotbs1.dbf';
set newname for datafile 3 to '/u01/oracle/oradata/oradb/sysaux01.dbf';
set newname for datafile 4 to '/u01/oracle/oradata/oradb/users01.dbf';
set newname for datafile 5 to '/u01/oracle/oradata/oradb/undotbs02.dbf';
set newname for datafile 6 to '/u01/oracle/oradata/oradb/ts1.dbf';
set newname for datafile 7 to '/u01/oracle/oradata/oradb/yd.dbf';
set newname for tempfile 1 to '/u01/oracle/oradata/oradb/temp01.dbf';
    restore database;
    switch datafile all;
    switch tempfile all;
 }


RMAN> 

RMAN> run{
2> set newname for datafile 1 to '/u01/oracle/oradata/oradb/system01.dbf';
3> set newname for datafile 2 to '/u01/oracle/oradata/oradb/undotbs1.dbf';
4> set newname for datafile 3 to '/u01/oracle/oradata/oradb/sysaux01.dbf';
5> set newname for datafile 4 to '/u01/oracle/oradata/oradb/users01.dbf';
6> set newname for datafile 5 to '/u01/oracle/oradata/oradb/undotbs02.dbf';
7> set newname for datafile 6 to '/u01/oracle/oradata/oradb/ts1.dbf';
8> set newname for datafile 7 to '/u01/oracle/oradata/oradb/yd.dbf';
9> set newname for tempfile 1 to '/u01/oracle/oradata/oradb/temp01.dbf';
10>     restore database;
11>     switch datafile all;
12>     switch tempfile all;
13>  }

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 11-MAR-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=155 devtype=DISK

channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00002 to /u01/oracle/oradata/oradb/undotbs1.dbf
restoring datafile 00003 to /u01/oracle/oradata/oradb/sysaux01.dbf
restoring datafile 00006 to /u01/oracle/oradata/oradb/ts1.dbf
restoring datafile 00007 to /u01/oracle/oradata/oradb/yd.dbf
channel ORA_DISK_1: reading from backup piece /oracle/rmanbak/full_05o46e43_ORADB_20130310
channel ORA_DISK_1: restored backup piece 1
failover to piece handle=/u01/rmanbak/full_05o46e43_ORADB_20130310 tag=TAG20130310T155547
channel ORA_DISK_1: restore complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /u01/oracle/oradata/oradb/system01.dbf
restoring datafile 00004 to /u01/oracle/oradata/oradb/users01.dbf
restoring datafile 00005 to /u01/oracle/oradata/oradb/undotbs02.dbf
channel ORA_DISK_1: reading from backup piece /oracle/rmanbak/full_04o46e44_ORADB_20130310
channel ORA_DISK_1: restored backup piece 1
failover to piece handle=/u01/rmanbak/full_04o46e44_ORADB_20130310 tag=TAG20130310T155547
channel ORA_DISK_1: restore complete, elapsed time: 00:00:35
Finished restore at 11-MAR-13

datafile 1 switched to datafile copy
input datafile copy recid=8 stamp=809742972 filename=/u01/oracle/oradata/oradb/system01.dbf
datafile 2 switched to datafile copy
input datafile copy recid=9 stamp=809742973 filename=/u01/oracle/oradata/oradb/undotbs1.dbf
datafile 3 switched to datafile copy
input datafile copy recid=10 stamp=809742973 filename=/u01/oracle/oradata/oradb/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy recid=11 stamp=809742973 filename=/u01/oracle/oradata/oradb/users01.dbf
datafile 5 switched to datafile copy
input datafile copy recid=12 stamp=809742973 filename=/u01/oracle/oradata/oradb/undotbs02.dbf
datafile 6 switched to datafile copy
input datafile copy recid=13 stamp=809742973 filename=/u01/oracle/oradata/oradb/ts1.dbf
datafile 7 switched to datafile copy
input datafile copy recid=14 stamp=809742973 filename=/u01/oracle/oradata/oradb/yd.dbf

renamed temporary file 1 to /u01/oracle/oradata/oradb/temp01.dbf in control file

RMAN> 



SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
/u01/oracle/oradata/oradb/system01.dbf

相關推薦

Oracle rac asm資料庫恢復例項資料庫

環境: 資料庫版本:10201 1.源端資料庫:oracle 10g RAC ASM datbase 2.目標資料庫:oracle 10g single datbase 1引數檔案的恢復 1.1.恢復引數檔案[[email protected] ~]$

RMAN備份恢復系列1: Oracle 10g rac asm資料庫恢復到10g例項資料庫

RMAN> recover database; Starting recover at 11-MAR-13 using channel ORA_DISK_1 starting media recovery channel ORA_DISK_1: starting archive log restore

Oracle DB 使用DBCA建立例項ASM資料庫用作恢復目錄資料庫

1) 使用 DBCA  啟動建立單例項ASM資料庫,可用作恢復目錄資料庫。  [[email protected] ~]$ dbca 2) 在“Welcome(歡迎)”頁上,單擊“Next (下一步)”。  3) 在“Operations(操作)”頁上,選中“

使用dataguard將例項資料庫轉換為rac資料庫

我們經常將oracle rac資料庫通過dataguard容災到一個單例項資料庫中,當生產庫出現故障後可以將生產庫切換到dg伺服器上。而當生產庫rac修復完成後,我們同樣可以通過dg將資料回切到生產庫中。 此次測試將單例項資料庫通過dg轉換為rac資料庫,這個單例項是剛建立

Oracle 12c R2 例項資料庫建立 和 開機自啟

/etc/oratab是在建立資料庫例項時建立的,需要用root使用者執行root.sh,如果忘記執行在自啟動和關閉時會失敗,錯誤資訊:"/etc/oratab" is not accessible。它記錄主機中有多少個數據庫。在$ORACLE_HOME/bin目錄下的$ORACLE_HOME/bin/dbs

加速Oracle RAC效能 軟體定義儲存的資料庫雲化實踐

編輯手記:軟體定義儲存是行業發展的趨勢,可以保證系統的儲存訪問在精準的水平上更靈活地管理,本文分享軟體定義儲存的資料庫雲化實踐,來自上週四大講堂分享整理。 作者簡介: 劉振宇 雲和恩墨基礎架構軟體研發負責人。 擁有10年以上電信、金融、保險、政府機關以及製造業等多個行業的架構和管理經驗。現在負責雲和

Linux下靜默安裝 oracle參考連結(for例項、for RAC叢集)

1. http://www.dbdream.com.cn/2012/03/03/linux%e7%8e%af%e5%a2%83%e4%b8%8b%e9%9d%99%e9%bb%98%e5%bb%ba%e5%ba%93oracle11gr2/ 2.http://www.dbd

Oracle - 通過dg,完成例項rac的遷移

一、概述 本文將介紹如何給單例項搭建一個rac dg,以及如何對其進行角色轉換,完成從單例項到rac的遷移。預先具備的知識(rac搭建,單例項-單例項dg搭建)   二、實驗環境介紹 主庫(已有資料庫例項prod) prod:192.168.56.102,sid:prod,version:11.2.

ORACLE RAC ASM環境下DATAGUARD搭建步驟

1、準備工作 Host IP          DB_NAME     DB_UNIQUE_NAME    Net Service Name 主庫xxxxxxxxx    wechatqa      wechatqa        wechatqa , wechatqa1,

Oracle RAC+DG實驗】Oracle RAC+ASM+DataGuard配置實驗記錄+常見問題

【Oracle RAC+DG實驗】Oracle RAC+ASM+DataGuard配置實驗記錄+常見問題 1、環境規劃: ---RAC環境介紹(primary database)            rac1       rac2 ____________________

centos部署oracle rac例項11.2.0.3資料庫(使用asm磁碟)

部署oracle rac單例項資料庫,需要安裝grid和datavase兩部分,所以首先建立兩個使用者oracle和grid,因為不能使用root使用者進行安裝,在安裝之前首先需要修改一些系統引數和安裝一些庫。 1.建立使用者和使用者組   首先是官方推薦的使用者和使用者組清單:

oracle 12c RMAN異機恢復還原RAC叢集(ASM)為例項庫(檔案系統)記錄

CONFIGURE CONTROLFILE AUTOBACKUP ON備份集準備 backup database format '/home/databak/whole_%d_%U'; backup spfile format '/home/databak/spfile_%

Oracle歸檔模式下恢復-資料庫完全恢復方法例項1

最初在關閉狀態下進行開啟資料庫恢復的例項: 以pioneer_data表空間為例: ============================製造假損壞======================================= 1、備份表空間: SQL> alter tablespace pionee

Oracle 例項 遷移到 RAC 例項 -- 使用RMAN 異機恢復

Oracle 官網有關單例項遷移到RAC的一個步驟說明: How to Convert 10g Single-Instance database to 10g RAC using Manua

ORACLE 11G RAC ASM磁盤組全部丟失後的恢復

實例 ice mat dns 禁用 buffers bit allocated event 一、環境描述(1)Oracle 11.2.0.3 RAC ON Oracle Linux 6 x86_64,只有一個ASM外部冗余磁盤組——DATA;(2)OCR,VOTEDISK,

重灌系統Oracle資料庫恢復

  1.首先百度了下,重灌系統之後怎麼恢復Oracle資料庫,看到一篇部落格比較好弄,於是參照這篇部落格來點選開啟連結   2.重啟電腦之後,連線不上。查詢幾個重要的路徑 Oracle日誌檔案記錄位置F:\app\chengdu\diag\rdbms\orcl\orcl\

幾種oracle資料庫恢復的練習示例[轉]

幾種oracle資料庫恢復的練習示例     作為一個dba,最重要的工作莫過於保證資料庫中資料的安全,當一個數據庫down掉之後,恢復舊變成了至關重要的事情。能否成功的恢復,並不在於資料庫down掉時採取的恢復策略,要保證資料的萬無一失,一套完整的備份方案是必須的。但作為db

例項GI資料庫徹底清除

1.刪除grid 和 oracle 檔案路徑 2.刪除自動配置的相關檔案 /etc/ora* /tmp/.oracle /var/tmp/.oracle /etc/inittab.crs /etc/init.d/init.ohasd/etc/init.d/ohasd /tmp/CVU_*/tm

oper-O11gR2+ASM+RAC使用duplicate快速複製一個庫到例項

環境: 源庫:O11gR2+ASM+RAC+rhel6.4 目標庫:O11gR2+rhel6.4單例項 步驟 1、配置靜態監聽 源庫:/u01/app/11.2.0/grid_1/network/admin/listener.ora SID_LIST_LISTENER = (SID_LI

檔案系統損壞,oracle資料庫恢復

今天接到一個客戶的服務請求,由於伺服器被強制重啟,資料庫無法啟動ORA-1200報錯 這是一個常見的ORA-1200錯誤,但是檔案大小相差的有離譜實際大小729600個block,但是現在只有149760個block.不像是一般主機重啟導致的資料庫異常.通過再次諮詢客戶實際是什麼情況,客戶那邊如實描述: