1. 程式人生 > >ASM+RAC==>>單例項+檔案系統遷移步驟

ASM+RAC==>>單例項+檔案系統遷移步驟

1修改pfile檔案(去掉叢集專用,因原伺服器有重名資料庫,取別名'test')
2轉儲控制檔案,資料庫至mount
3註冊備份集目錄
4restore、recover database
5修改redo日誌路徑
6開啟資料庫

7善後(刪除多餘undo和redo、新建temp表空間)

1:修改pfile檔案(去掉叢集專用,因原伺服器有重名資料庫,取別名'test')

#fyl1.__db_cache_size=109051904
#fyl2.__db_cache_size=113246208
#fyl1.__java_pool_size=4194304
#fyl2.__java_pool_size=4194304
#fyl1.__large_pool_size=4194304
#fyl2.__large_pool_size=4194304
#fyl1.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
#fyl2.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
#fyl1.__pga_aggregate_target=209715200
#fyl2.__pga_aggregate_target=209715200
#fyl1.__sga_target=314572800
#fyl2.__sga_target=314572800
#fyl1.__shared_io_pool_size=0
#fyl2.__shared_io_pool_size=0
#fyl1.__shared_pool_size=188743680
#fyl2.__shared_pool_size=184549376
#fyl1.__streams_pool_size=0
#fyl2.__streams_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/fyl/adump'
*.audit_trail='db'
#*.cluster_database=true
*.compatible='11.2.0.0.0'
*.control_files='/u01/app/oracle/oradata/test/control01.ctl'
*.db_block_size=8192
#*.db_create_file_dest='+DATE1'
*.db_domain=''
*.db_name='fyl'
db_unique_name='test'
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=fylXDB)'
#fyl2.instance_number=2
#fyl1.instance_number=1
#*.local_listener=''
#rac1.local_listener='rac'
#rac2.local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=rac2)(PORT=1522))))'
*.log_archive_dest_1='location=/u02/arch'
#*.log_archive_dest_2='location=+DATE1'
*.log_archive_format='fyl%t_%s_%r.log'
*.memory_target=524288000
*.nls_language='SIMPLIFIED CHINESE'
*.nls_territory='CHINA'
*.open_cursors=300
2轉儲控制檔案,資料庫至mount
[[email protected] dbs]$ export ORACLE_SID=test
[[email protected] dbs]$ rman target /
Recovery Manager: Release 11.2.0.1.0 - Production on Tue Oct 28 19:23:05 2014
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
connected to target database (not started)

RMAN> startup nomount;
Oracle instance started

Total System Global Area     523108352 bytes
Fixed Size                     1337632 bytes
Variable Size                314574560 bytes
Database Buffers             201326592 bytes
Redo Buffers                   5869568 bytes

RMAN> restore controlfile from '/oracle/rman_fyl/rman_rac/fyl1_1_6.ctl';

Starting restore at 28-OCT-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=19 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
output file name=/u01/app/oracle/oradata/test/control01.ctl
Finished restore at 28-OCT-14

RMAN> startup mount;

database is already started
database mounted
released channel: ORA_DISK_1
3 註冊備份集目錄
RMAN> catalog start with '/oracle/rman_fyl/rman_rac';

searching for all files that match the pattern /oracle/rman_fyl/rman_rac
List of Files Unknown to the Database
=====================================
File Name: /oracle/rman_fyl/rman_rac/fyl1_1_5_05pl78qj.arc
File Name: /oracle/rman_fyl/rman_rac/fyl1_1_3_03pl78mf.dbf
File Name: /oracle/rman_fyl/rman_rac/fyl1_1_6.ctl
File Name: /oracle/rman_fyl/rman_rac/fyl1_1_4_04pl78pk.dbf
File Name: /oracle/rman_fyl/rman_rac/inittext.ora

Do you really want to catalog the above files (enter YES or NO)? y
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /oracle/rman_fyl/rman_rac/fyl1_1_5_05pl78qj.arc
File Name: /oracle/rman_fyl/rman_rac/fyl1_1_3_03pl78mf.dbf
File Name: /oracle/rman_fyl/rman_rac/fyl1_1_6.ctl
File Name: /oracle/rman_fyl/rman_rac/fyl1_1_4_04pl78pk.dbf
List of Files Which Where Not Cataloged
=======================================
File Name: /oracle/rman_fyl/rman_rac/inittext.ora
  RMAN-07517: Reason: The file header is corrupted
4restore、recover database
RMAN> report schema;

RMAN-06139: WARNING: control file is not current for REPORT SCHEMA
Report of database schema for database with db_unique_name TEST
List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    0        SYSTEM               ***     +DATE1/fyl/datafile/system.259.858119563
2    0        SYSAUX               ***     +DATE1/fyl/datafile/sysaux.260.858119595
3    0        UNDOTBS1             ***     +DATE1/fyl/datafile/undotbs1.261.858119615
4    0        UNDOTBS2             ***     +DATE1/fyl/datafile/undotbs2.263.858119637
5    0        USERS                ***     +DATE1/fyl/datafile/users.264.858119641
List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    0        TEMP                 32767       +DATE1/fyl/tempfile/temp.262.858119621

RMAN> run {
2> set newname for datafile '+DATE1/fyl/datafile/system.259.858119563' to '/u01/app/oracle/oradata/test/system.dbf';
3> set newname for datafile '+DATE1/fyl/datafile/sysaux.260.858119595' to '/u01/app/oracle/oradata/test/sysaux.dbf';
4> set newname for datafile '+DATE1/fyl/datafile/undotbs1.261.858119615' to '/u01/app/oracle/oradata/test/undotbs1.dbf';
5> set newname for datafile '+DATE1/fyl/datafile/undotbs2.263.858119637' to '/u01/app/oracle/oradata/test/undotbs2.dbf';
6> set newname for datafile '+DATE1/fyl/datafile/users.264.858119641' to '/u01/app/oracle/oradata/test/users.dbf';
7> restore database;
8> switch datafile all;
9> recover database;
10> }

executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 28-OCT-14
using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /u01/app/oracle/oradata/test/system.dbf
channel ORA_DISK_1: restoring datafile 00002 to /u01/app/oracle/oradata/test/sysaux.dbf
channel ORA_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/test/undotbs1.dbf
channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/test/undotbs2.dbf
channel ORA_DISK_1: restoring datafile 00005 to /u01/app/oracle/oradata/test/users.dbf
channel ORA_DISK_1: reading from backup piece /u02/rman/20141016_0/fyl1_1_3_03pl78mf.dbf
channel ORA_DISK_1: errors found reading piece handle=/u02/rman/20141016_0/fyl1_1_3_03pl78mf.dbf
channel ORA_DISK_1: failover to piece handle=/oracle/rman_fyl/rman_rac/fyl1_1_3_03pl78mf.dbf tag=TAG20141016T154623
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:01:35
Finished restore at 28-OCT-14

datafile 1 switched to datafile copy
input datafile copy RECID=6 STAMP=862169998 file name=/u01/app/oracle/oradata/test/system.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=7 STAMP=862169998 file name=/u01/app/oracle/oradata/test/sysaux.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=8 STAMP=862169998 file name=/u01/app/oracle/oradata/test/undotbs1.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=9 STAMP=862169998 file name=/u01/app/oracle/oradata/test/undotbs2.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=10 STAMP=862169998 file name=/u01/app/oracle/oradata/test/users.dbf

Starting recover at 28-OCT-14
using channel ORA_DISK_1
starting media recovery

channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=2 sequence=15
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=53
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=54
channel ORA_DISK_1: restoring archived log
archived log thread=2 sequence=16
channel ORA_DISK_1: reading from backup piece /u02/rman/20141016_0/fyl1_1_5_05pl78qj.arc
channel ORA_DISK_1: errors found reading piece handle=/u02/rman/20141016_0/fyl1_1_5_05pl78qj.arc
channel ORA_DISK_1: failover to piece handle=/oracle/rman_fyl/rman_rac/fyl1_1_5_05pl78qj.arc tag=TAG20141016T154834
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:04
archived log file name=/u01/app/oracle/product/11.2.0/db_1/dbs/archfyl1_53_858119547.log thread=1 sequence=53
archived log file name=/u01/app/oracle/product/11.2.0/db_1/dbs/archfyl2_15_858119547.log thread=2 sequence=15
archived log file name=/u01/app/oracle/product/11.2.0/db_1/dbs/archfyl1_54_858119547.log thread=1 sequence=54
archived log file name=/u01/app/oracle/product/11.2.0/db_1/dbs/archfyl2_16_858119547.log thread=2 sequence=16
unable to find archived log
archived log thread=1 sequence=55
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 10/28/2014 19:40:06
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 55 and starting SCN of 932155
5修改redo日誌路徑
[email protected] test>select * from v$logfile;
    GROUP# STATUS          TYPE            MEMBER                                         IS_RECOVE
---------- --------------- --------------- ---------------------------------------------- ---------
         1                 ONLINE          +DATE1/fyl/onlinelog/group_1.257.858119555     NO
         2                 ONLINE          +DATE1/fyl/onlinelog/group_2.258.858119559     NO
         3                 ONLINE          +DATE1/fyl/onlinelog/group_3.265.858121703     NO
         4                 ONLINE          +DATE1/fyl/onlinelog/group_4.266.858121705     NO
         
[email protected] test>alter database rename file '+DATE1/fyl/onlinelog/group_1.257.858119555' to '/u01/app/oracle/oradata/test/redo01.log';  
alter database rename file '+DATE1/fyl/onlinelog/group_2.258.858119559' to '/u01/app/oracle/oradata/test/redo02.log';
alter database rename file '+DATE1/fyl/onlinelog/group_3.265.858121703' to '/u01/app/oracle/oradata/test/redo03.log';
alter database rename file '+DATE1/fyl/onlinelog/group_4.266.858121705' to '/u01/app/oracle/oradata/test/redo04.log';
Database altered.

[email protected] test>select * from v$logfile;
    GROUP# STATUS       TYPE              MEMBER                                         IS_RECOVE
---------- ------------ ----------------- ---------------------------------------------- ---------
         1              ONLINE            /u01/app/oracle/oradata/test/redo01.log        NO
         2              ONLINE            /u01/app/oracle/oradata/test/redo02.log        NO
         3              ONLINE            /u01/app/oracle/oradata/test/redo03.log        NO
         4              ONLINE            /u01/app/oracle/oradata/test/redo04.log        NO
6開啟資料庫
[email protected] test>alter database open resetlogs;
Database altered.

7善後(刪除多餘undo和redo、新建temp表空間)

[email protected] test>select GROUP# ,THREAD#,SEQUENCE#, MEMBERS,STATUS from v$log;
    GROUP#    THREAD#  SEQUENCE#    MEMBERS STATUS
---------- ---------- ---------- ---------- ------------------------------------------------
         1          1          1          1 CURRENT
         2          1          0          1 UNUSED
         3          2          1          1 ACTIVE
         4          2          0          1 UNUSED
[email protected] test>select thread#,status,enabled from v$thread;
   THREAD# STATUS             ENABLED
---------- ------------------ ------------------------
         1 OPEN               PUBLIC
         2 CLOSED             PUBLIC
         
[email protected] test>alter database disable thread 2;
Database altered.

[email protected] test>alter database drop logfile group 3;
Database altered.

[email protected] test>alter database drop logfile group 4;
Database altered.

[email protected] test>select GROUP# ,THREAD#,SEQUENCE#, MEMBERS,STATUS from v$log;
    GROUP#    THREAD#  SEQUENCE#    MEMBERS STATUS
---------- ---------- ---------- ---------- ------------------------------------------------
         1          1          1          1 CURRENT
         2          1          0          1 UNUSED
         
[email protected] test>drop tablespace undotbs2 including contents and datafiles;
Tablespace dropped.

[email protected] test>select * from dba_temp_files;
select * from dba_temp_files
              *
ERROR at line 1:
ORA-01157: cannot identify/lock data file 201 - see DBWR trace file
ORA-01110: data file 201: '+DATE1/fyl/tempfile/temp.262.858119621'

[email protected] test>create temporary tablespace temp1 tempfile '/u01/app/oracle/oradata/test/temp1.dbf' size 10M;
Tablespace created.
[email protected] test>alter database default temporary tablespace temp1;
Database altered.
[email protected] test>drop tablespace temp including contents and datafiles;
Tablespace dropped.

[email protected] test>select FILE_NAME,FILE_ID ,TABLESPACE_NAME,STATUS,AUTOEXTENSIBLE from dba_temp_files;

FILE_NAME                                             FILE_ID TABLESPACE STATUS                AUTOEXTEN
-------------------------------------------------- ---------- ---------- --------------------- ---------
/u01/app/oracle/oradata/test/temp1.dbf                      2 TEMP1      ONLINE                NO





相關推薦

ASM+RAC==>>例項+檔案系統遷移步驟

1修改pfile檔案(去掉叢集專用,因原伺服器有重名資料庫,取別名'test') 2轉儲控制檔案,資料庫至mount 3註冊備份集目錄 4restore、recover database 5修改redo日誌路徑 6開啟資料庫7善後(刪除多餘undo和redo、新建temp表

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

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

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

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

oracle例項通過dataguard 遷移RAC

One instance primary to RAC standbyDataGuard Configuration: Primary standby Clusterware Oracle Database 11g Enterprise Edition

oracle表空間檔案系統遷移ASM

1.配置測試環境建立資料表空間create tablespace test logging datafile '/home/oracle/test.dbf' size 10m autoextend on next 10m maxsize 2048m extent management local;建立使用者並

同機同版本資料庫從檔案系統遷移ASM實驗

1. 實驗環境說明 作業系統的版本是Oracle Linux 5核心是2.6.18-164.el5 [[email protected] ~]# uname -a Linux book 2.6.18-164.el5 #1 SMP Thu Sep 3 02:16:4

oracle資料庫檔案系統遷移ASM

檢視ASM磁碟組 SQL> select name,state from v$asm_diskgroup; 登陸RMAN執行映象全備到ASM磁碟組 $rman target /RMAN> backup as copy database format '+da

正式生產庫,配置雙節點的RAC + 例項的 DATAGUARD

正式生產庫,配置DATAGUARD RAC+單例項DATAGUARD  配置 RAC 兩節點: 192.1.0.101    rac1     192.1.0.102    rac2 儲存:ASM DB_UNIQUE_NAME= racdb 例項:racdb1; racdb

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 rac asm資料庫恢復到例項資料庫

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

使用RMAN遷移檔案系統資料庫到ASM

--================================== -- 使用RMAN遷移檔案系統數據庫到ASM --================================== 在

oracle 異機恢復 從asm檔案系統成功例項

1.1   確實 源資料庫與目標庫版本一致  語句:select * from v$version; 源庫: 1.2   確認源資料庫名與目標庫資料庫名一致  查詢資料庫名語句:select name fromv$database; 如果不一致通過恢復spfile檔

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

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

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 - 通過dg,完成例項rac遷移

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

oper-O11gR2+ASM+RAC使用duplicate快速復制一個庫到實例

bho 靜態監聽 backup arch 步驟 bpm tables asm class 環境: 源庫:O11gR2+ASM+RAC+rhel6.4 目標庫:O11gR2+rhel6.4單實例 步驟 1、配置靜態監聽 源庫:/u01/app/11.2.0/grid_1/ne

大量資料遷移到物件儲存服務過程中使用聯合檔案系統遷移方案

記一次遷移3T靜態資料到儲存服務的實踐過程,跟大家分享一下。 剛畢業,水平有限,重在記錄和分享。^ _ ^ 1.任務概述 幾個T的靜態資料遷移,主要是小圖,從本地檔案系統遷移到新物件儲存服務中。 遷移過程時間跨度大,可能要幾天甚至一週才能完成,在這過程

《精通Windows API-函式、介面、程式設計例項》——第4章檔案系統

第4章檔案系統 4.2 磁碟和驅動器管理 檔案系統的基本概念: 包括磁碟分割槽,卷,目錄,檔案物件,檔案控制代碼,檔案對映 1.磁碟分割槽: 物理磁碟,邏輯磁碟 2.卷: 也稱邏輯驅動器,是NTFS,FAT32等檔案系統組織結構的最高層. 卷是

redis叢集配置加例項資料遷移到叢集

http://vip.mtu9335.cn/http://vip.xrr9518.cn/http://vip.nyc9430.cn/http://vip.jaf1308.cn/http://vip.qsv0141.cn/http://vip.tub1546.cn/http://vip.ife7579.cn/h

cordova檔案系統建立資料夾與讀寫檔案例項

一、cordova 檔案系統 1. 安裝外掛 cordova 需要安裝外掛才能對對手機檔案系統進行操作 cordova plagin add cordova-plugin-file 2. 需要了解的外掛api 1 . cordova.file.externalRootD