RAC异机恢复

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了RAC异机恢复相关的知识,希望对你有一定的参考价值。

  

RAC异机恢复PDCL到PFCL:

PNCL:RAC+ASM ,product env   db name:PNCL   instance:PDCL1 PDCL2

PFCL:RAC+ASM ,performance env   db name:PFCL1  instance:PFCL11 PFCL12

 

=============

  1. start backup at pncl side:

/rman_bkup1/PDCL/rmandumps/deff

 

Recovery Manager: Release 11.2.0.4.0 - Production on Fri Dec 23 05:39:34 2016

 

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

 

connected to target database: PNCL (DBID=3875018320)

 

RMAN> run

2> {

3>  allocate channel disk1 device type disk format ‘/rman_bkup1/PDCL/rmandumps/deff/PFCL_DB_FULL_%d_%u_%s_%p.dbf‘;

 allocate channel disk2 device type disk format ‘/rman_bkup1/PDCL/rmandumps/deff/PFCL_DB_FULL_%d_%u_%s_%p.dbf‘;

 allocate channel disk3 device type disk format ‘/rman_bkup1/PDCL/rmandumps/deff/PFCL_DB_FULL_%d_%u_%s_%p.dbf‘;

 allocate channel disk4 device type disk format ‘/rman_bkup1/PDCL/rmandumps/deff/PFCL_DB_FULL_%d_%u_%s_%p.dbf‘;

 allocate channel disk5 device type disk format ‘/rman_bkup1/PDCL/rmandumps/deff/PFCL_DB_FULL_%d_%u_%s_%p.dbf‘;

 allocate channel disk6 device type disk format ‘/rman_bkup1/PDCL/rmandumps/deff/PFCL_DB_FULL_%d_%u_%s_%p.dbf‘;

 allocate channel disk7 device type disk format ‘/rman_bkup1/PDCL/rmandumps/deff/PFCL_DB_FULL_%d_%u_%s_%p.dbf‘;

 allocate channel disk8 device type disk format ‘/rman_bkup1/PDCL/rmandumps/deff/PFCL_DB_FULL_%d_%u_%s_%p.dbf‘;

 backup incremental level 0 tag DBFull_12_23 as compressed backupset database  ;

 sql ‘alter system switch all logfile‘;

 backup tag ArchFull_12_23 as compressed backupset archivelog from time ‘SYSDATE-1‘ format ‘/rman_bkup1/PDCL/rmandumps/deff/%d_c1_INCR_0_s%s_p%p_seq%e‘;

4> 5> 6> 7> 8> 9> 10> 11> 12> 13> 14> }

 

------

After backup finished(DB BACKUP+SPFILE BACKUP+ARC LOG BACKUP), scp these file to PFCL destination directory.

channel disk5: finished piece 1 at 23-DEC-16

piece handle=/rman_bkup1/PDCL/rmandumps/deff/PFCL_DB_FULL_PNCL_rkro5q0v_125812_1.dbf tag=DBFULL_12_23 comment=NONE

channel disk5: backup set complete, elapsed time: 00:38:26

Finished backup at 23-DEC-16

 

piece handle=/rman_bkup1/PDCL/rmandumps/control-files/controlfile_PNCL_c-3875018320-20161223-04.ctl comment=NONE

Finished Control File and SPFILE Autobackup at 23-DEC-16

 

channel disk1: finished piece 1 at 23-DEC-16

piece handle=/rman_bkup1/PDCL/rmandumps/deff/PNCL_c1_INCR_0_s125836_p1_seq42596 tag=ARCHFULL_12_23 comment=NONE

channel disk1: backup set complete, elapsed time: 00:03:30

Finished backup at 23-DEC-16

 

 

   2.restore in PFCL:

/u01/home/oracle/deff

total 87856788

-rw-r-----. 1 oracle oinstall 14566948864 Dec 23 06:32 PFCL_DB_FULL_PNCL_rgro5q0v_125808_1.dbf

-rw-r-----. 1 oracle oinstall  8302133248 Dec 23 06:34 PFCL_DB_FULL_PNCL_rhro5q0v_125809_1.dbf

-rw-r-----. 1 oracle oinstall  9807085568 Dec 23 06:36 PFCL_DB_FULL_PNCL_riro5q0v_125810_1.dbf

-rw-r-----. 1 oracle oinstall  7528685568 Dec 23 06:38 PFCL_DB_FULL_PNCL_rjro5q0v_125811_1.dbf

-rw-r-----. 1 oracle oinstall 23005274112 Dec 23 06:43 PFCL_DB_FULL_PNCL_rkro5q0v_125812_1.dbf

-rw-r-----. 1 oracle oinstall  2592604160 Dec 23 06:43 PFCL_DB_FULL_PNCL_rlro5q0v_125813_1.dbf

-rw-r-----. 1 oracle oinstall  4899266560 Dec 23 06:44 PFCL_DB_FULL_PNCL_rmro5q0v_125814_1.dbf

-rw-r-----. 1 oracle oinstall  1138730496 Dec 23 06:44 PNCL_c1_INCR_0_s125826_p1_seq42533

-rw-r-----. 1 oracle oinstall  2091913216 Dec 23 06:45 PNCL_c1_INCR_0_s125827_p1_seq42537

-rw-r-----. 1 oracle oinstall  2363798528 Dec 23 06:45 PNCL_c1_INCR_0_s125828_p1_seq32831

-rw-r-----. 1 oracle oinstall  2200173568 Dec 23 06:46 PNCL_c1_INCR_0_s125829_p1_seq42555

-rw-r-----. 1 oracle oinstall   679460864 Dec 23 06:46 PNCL_c1_INCR_0_s125830_p1_seq32848

-rw-r-----. 1 oracle oinstall    54853632 Dec 23 06:46 controlfile_PNCL_c-3875018320-20161223-05.ctl

-rw-r-----. 1 oracle oinstall  2156604416 Dec 23 06:47 PNCL_c1_INCR_0_s125831_p1_seq32853

-rw-r-----. 1 oracle oinstall  1303107584 Dec 23 06:47 PNCL_c1_INCR_0_s125832_p1_seq32862

-rw-r-----. 1 oracle oinstall  2257122304 Dec 23 06:47 PNCL_c1_INCR_0_s125833_p1_seq32866

-rw-r-----. 1 oracle oinstall  2510075904 Dec 23 06:48 PNCL_c1_INCR_0_s125835_p1_seq42592

-rw-r-----. 1 oracle oinstall  2390411264 Dec 23 06:48 PNCL_c1_INCR_0_s125836_p1_seq42596

-rw-r-----. 1 oracle oinstall   117005824 Dec 23 06:48 PNCL_c1_INCR_0_s125837_p1_seq42598

Create pfile from PFCL1(PFCL1  is db name,PFCL11 and PFCL12 are two nodes instance name)

Sqlplus:create pfile=’/u01/home/oracle/deff/pfile_1223.txt’ from spfile;

Then we can shutdown database:srvctl status database -d PFCL1

Srvctl stop database -d PFCL1

When PFCL1 db is shutdown,we can begin restore/recover :

cd /u01/home/oracle/deff

vi pfile_1223.txt

modify these parameter to:

*.cluster_database=false   

*.db_name=‘PNCL‘

#*.db_recovery_file_dest=‘+LOGS‘ 注掉这两个参数

#*.db_recovery_file_dest_size=241591910400

Start only PFCL11 nomount: startup nomount pfile=’/u01/home/oracle/deff/pfile_1223.txt’

 

在开始下面做之前,可以在asm里面把PFCL1相关的数据文件,临时文件全清了

 

[email protected]:PFCL11:/u01/home/oracle/deff $ rman target /

 

connected to target database: PNCL (not mounted)

 

RMAN> restore controlfile from ‘/u01/home/oracle/deff/controlfile_PNCL_c-3875018320-20161223-05.ctl‘;

 

Starting restore at 23-DEC-16

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=2017 instance=PFCL11 device type=DISK

 

channel ORA_DISK_1: restoring control file

channel ORA_DISK_1: restore complete, elapsed time: 00:00:02

output file name=+LOGS/pncl/controlfile/current.824.931330093

Finished restore at 23-DEC-16

 

RMAN> sql ‘alter database mount‘;

 

sql statement: alter database mount

released channel: ORA_DISK_1

 

RMAN> catalog start with ‘/u01/home/oracle/deff/‘;

 

searching for all files that match the pattern /u01/home/oracle/deff/

 

List of Files Unknown to the Database

=====================================

File Name: /u01/home/oracle/deff/PNCL_c1_INCR_0_s125827_p1_seq42537

File Name: /u01/home/oracle/deff/PFCL_DB_FULL_PNCL_rgro5q0v_125808_1.dbf

File Name: /u01/home/oracle/deff/PNCL_c1_INCR_0_s125831_p1_seq32853

File Name: /u01/home/oracle/deff/PNCL_c1_INCR_0_s125835_p1_seq42592

File Name: /u01/home/oracle/deff/PFCL_DB_FULL_PNCL_rkro5q0v_125812_1.dbf

File Name: /u01/home/oracle/deff/PFCL_DB_FULL_PNCL_riro5q0v_125810_1.dbf

File Name: /u01/home/oracle/deff/PNCL_c1_INCR_0_s125830_p1_seq32848

File Name: /u01/home/oracle/deff/PNCL_c1_INCR_0_s125837_p1_seq42598

File Name: /u01/home/oracle/deff/PNCL_c1_INCR_0_s125829_p1_seq42555

File Name: /u01/home/oracle/deff/pfile_1223.ora

File Name: /u01/home/oracle/deff/PFCL_DB_FULL_PNCL_rlro5q0v_125813_1.dbf

File Name: /u01/home/oracle/deff/PNCL_c1_INCR_0_s125833_p1_seq32866

File Name: /u01/home/oracle/deff/PNCL_c1_INCR_0_s125836_p1_seq42596

File Name: /u01/home/oracle/deff/PFCL_DB_FULL_PNCL_rmro5q0v_125814_1.dbf

File Name: /u01/home/oracle/deff/controlfile_PNCL_c-3875018320-20161223-05.ctl

File Name: /u01/home/oracle/deff/PNCL_c1_INCR_0_s125826_p1_seq42533

File Name: /u01/home/oracle/deff/PFCL_DB_FULL_PNCL_rhro5q0v_125809_1.dbf

File Name: /u01/home/oracle/deff/PNCL_c1_INCR_0_s125828_p1_seq32831

File Name: /u01/home/oracle/deff/PFCL_DB_FULL_PNCL_rjro5q0v_125811_1.dbf

File Name: /u01/home/oracle/deff/PNCL_c1_INCR_0_s125832_p1_seq32862

 

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/home/oracle/deff/PNCL_c1_INCR_0_s125827_p1_seq42537

File Name: /u01/home/oracle/deff/PFCL_DB_FULL_PNCL_rgro5q0v_125808_1.dbf

File Name: /u01/home/oracle/deff/PNCL_c1_INCR_0_s125831_p1_seq32853

File Name: /u01/home/oracle/deff/PNCL_c1_INCR_0_s125835_p1_seq42592

File Name: /u01/home/oracle/deff/PFCL_DB_FULL_PNCL_rkro5q0v_125812_1.dbf

File Name: /u01/home/oracle/deff/PFCL_DB_FULL_PNCL_riro5q0v_125810_1.dbf

File Name: /u01/home/oracle/deff/PNCL_c1_INCR_0_s125830_p1_seq32848

File Name: /u01/home/oracle/deff/PNCL_c1_INCR_0_s125837_p1_seq42598

File Name: /u01/home/oracle/deff/PNCL_c1_INCR_0_s125829_p1_seq42555

File Name: /u01/home/oracle/deff/PFCL_DB_FULL_PNCL_rlro5q0v_125813_1.dbf

File Name: /u01/home/oracle/deff/PNCL_c1_INCR_0_s125833_p1_seq32866

File Name: /u01/home/oracle/deff/PNCL_c1_INCR_0_s125836_p1_seq42596

File Name: /u01/home/oracle/deff/PFCL_DB_FULL_PNCL_rmro5q0v_125814_1.dbf

File Name: /u01/home/oracle/deff/controlfile_PNCL_c-3875018320-20161223-05.ctl

File Name: /u01/home/oracle/deff/PNCL_c1_INCR_0_s125826_p1_seq42533

File Name: /u01/home/oracle/deff/PFCL_DB_FULL_PNCL_rhro5q0v_125809_1.dbf

File Name: /u01/home/oracle/deff/PNCL_c1_INCR_0_s125828_p1_seq32831

File Name: /u01/home/oracle/deff/PFCL_DB_FULL_PNCL_rjro5q0v_125811_1.dbf

File Name: /u01/home/oracle/deff/PNCL_c1_INCR_0_s125832_p1_seq32862

 

List of Files Which Where Not Cataloged

=======================================

File Name: /u01/home/oracle/deff/pfile_1223.ora

  RMAN-07517: Reason: The file header is corrupted

 

RMAN> restore database preview summary;

 

Starting restore at 23-DEC-16

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=2017 instance=PFCL11 device type=DISK

allocated channel: ORA_DISK_2

channel ORA_DISK_2: SID=2113 instance=PFCL11 device type=DISK

allocated channel: ORA_DISK_3

channel ORA_DISK_3: SID=2161 instance=PFCL11 device type=DISK

allocated channel: ORA_DISK_4

channel ORA_DISK_4: SID=2209 instance=PFCL11 device type=DISK

 

List of Backups

===============

Key     TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag

------- -- -- - ----------- --------------- ------- ------- ---------- ---

92812   B  0  A DISK        23-DEC-16       1       2       YES        DBFULL_12_23

92818   B  0  A DISK        23-DEC-16       1       2       YES        DBFULL_12_23

92817   B  0  A DISK        23-DEC-16       1       2       YES        DBFULL_12_23

92814   B  0  A DISK        23-DEC-16       1       2       YES        DBFULL_12_23

92815   B  0  A DISK        23-DEC-16       1       2       YES        DBFULL_12_23

92816   B  0  A DISK        23-DEC-16       1       2       YES        DBFULL_12_23

92813   B  0  A DISK        23-DEC-16       1       2       YES        DBFULL_12_23

using channel ORA_DISK_1

using channel ORA_DISK_2

using channel ORA_DISK_3

using channel ORA_DISK_4

 

List of Backups

===============

Key     TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag

------- -- -- - ----------- --------------- ------- ------- ---------- ---

92829   B  A  A DISK        23-DEC-16       1       2       YES        ARCHFULL_12_23

92830   B  A  A DISK        23-DEC-16       1       2       YES        ARCHFULL_12_23

92823   B  A  A DISK        23-DEC-16       1       2       YES        ARCHFULL_12_23

Media recovery start SCN is 14202310815615

Recovery must be done beyond SCN 14202315480073 to clear datafile fuzziness

Finished restore at 23-DEC-16

run{

allocate channel c0 type disk ;

allocate channel c1 type disk ;

allocate channel c2 type disk ;

allocate channel c3 type disk ;

SET NEWNAME FOR DATAFILE 1 TO ‘+DATA/PFCL1/DATAFILE/system.285.dbf‘;

SET NEWNAME FOR DATAFILE 2 TO ‘+DATA/PFCL1/DATAFILE/sysaux.276.dbf‘;

SET NEWNAME FOR DATAFILE 3 TO ‘+DATA/PFCL1/DATAFILE/undotbs1.296.dbf‘;

SET NEWNAME FOR DATAFILE 4 TO ‘+DATA/PFCL1/DATAFILE/users.286.dbf‘;

SET NEWNAME FOR DATAFILE 5 TO ‘+DATA/PFCL1/DATAFILE/nike_schema_admin_data.284.dbf‘;

SET NEWNAME FOR DATAFILE 6 TO ‘+DATA/PFCL1/DATAFILE/emerch_content_data.287.dbf‘;

SET NEWNAME FOR DATAFILE 7 TO ‘+DATA/PFCL1/DATAFILE/emerch_content_index.260.dbf‘;

SET NEWNAME FOR DATAFILE 8 TO ‘+DATA/PFCL1/DATAFILE/caps_product_depot_data.293.dbf‘;

SET NEWNAME FOR DATAFILE 9 TO ‘+DATA/PFCL1/DATAFILE/caps_product_depot_index.261.dbf‘;

SET NEWNAME FOR DATAFILE 10 TO ‘+DATA/PFCL1/DATAFILE/pcat_ecs_data.289.dbf‘;

SET NEWNAME FOR DATAFILE 11 TO ‘+DATA/PFCL1/DATAFILE/pcat_base_data.290.dbf‘;

SET NEWNAME FOR DATAFILE 16 TO ‘+DATA/PFCL1/DATAFILE/pcat_ecs_index.264.dbf‘;

SET NEWNAME FOR DATAFILE 17 TO ‘+DATA/PFCL1/DATAFILE/pcat_base_index.262.dbf‘;

SET NEWNAME FOR DATAFILE 26 TO ‘+DATA/PFCL1/DATAFILE/emerch_ppub_gbl_data.277.dbf‘;

SET NEWNAME FOR DATAFILE 27 TO ‘+DATA/PFCL1/DATAFILE/emerch_ppub_gbl_index.267.dbf‘;

SET NEWNAME FOR DATAFILE 28 TO ‘+DATA/PFCL1/DATAFILE/undotbs1.294.dbf‘;

SET NEWNAME FOR DATAFILE 31 TO ‘+DATA/PFCL1/DATAFILE/product_depot_data.283.dbf‘;

SET NEWNAME FOR DATAFILE 32 TO ‘+DATA/PFCL1/DATAFILE/product_depot_index.258.dbf‘;

SET NEWNAME FOR DATAFILE 34 TO ‘+DATA/PFCL1/DATAFILE/emerch_pauthor_data.273.dbf‘;

SET NEWNAME FOR DATAFILE 35 TO ‘+DATA/PFCL1/DATAFILE/emerch_pauthor_index.257.dbf‘;

SET NEWNAME FOR DATAFILE 36 TO ‘+DATA/PFCL1/DATAFILE/emerch_staging_data.291.dbf‘;

SET NEWNAME FOR DATAFILE 37 TO ‘+DATA/PFCL1/DATAFILE/emerch_staging_index.265.dbf‘;

SET NEWNAME FOR DATAFILE 38 TO ‘+DATA/PFCL1/DATAFILE/product_depot_data.300.dbf‘;

SET NEWNAME FOR DATAFILE 39 TO ‘+DATA/PFCL1/DATAFILE/ggadmin_data.281.dbf‘;

SET NEWNAME FOR DATAFILE 40 TO ‘+DATA/PFCL1/DATAFILE/emerch_fba_data.278.dbf‘;

SET NEWNAME FOR DATAFILE 41 TO ‘+DATA/PFCL1/DATAFILE/emerch_service_data.272.dbf‘;

SET NEWNAME FOR DATAFILE 42 TO ‘+DATA/PFCL1/DATAFILE/emerch_service_index.263.dbf‘;

SET NEWNAME FOR DATAFILE 43 TO ‘+DATA/PFCL1/DATAFILE/undotbs2.299.dbf‘;

restore database from tag=’ DBFull_12_23’;

switch datafile all;

release channel c0;

release channel c1;

release channel c2;

release channel c3;

}

Note:

  1. there is no need to set newname for tempfile,because tempfile is no needed when doing backup/restore operation
  2. set newname for datafile command can be generated from following sql,(run it at PNCL side)

SELECT ‘SET NEWNAME FOR DATAFILE ‘||FILE#||‘ TO ‘‘‘||‘+DATA/PFCL1/DATAFILE‘||

SUBSTR(NAME,

INSTR(NAME, ‘/‘, -1, 1),

INSTR(NAME, ‘.‘,1,2) - INSTR(NAME, ‘/‘,-1,1)) ||‘.dbf‘‘;‘

FROM V$DATAFILE;

     3. when use rman to do restore,if we also use set name to modify datafile path,then when restored,the datafile path info in controlfile are not modified,so we need sync control file info ,so we need use   switch datafile all

       使用rman进行恢复时,如果使用了set name修改文件路径,那么恢复后,控制文件里面的信息是没有修改该的,如果要同步控制文件的信息那么就需要使用
      switch datafile all
      all这个可以写文件号的,all表示所有使用set name的都一起保存

   4. db_file_name_convert这个参数适用在主备库上时候,在异机恢复时候不起作用(自己也还没试过起不起作用,具体的还是得去官方doc查看下)  参考:http://www.linuxidc.com/Linux/2013-08/88500.htm

 

After restore:

RMAN> recover database until scn 14202315480073;

 

After recover:

Alter database open resetlogs;

ERROR at line 1:

ORA-19751: could not create the change tracking file

ORA-19750: change tracking file: ‘+DATA/pfus1/changetracking/ctf.277.893883407‘

ORA-17502: ksfdcre:4 Failed to create file

+DATA/pfus1/changetracking/ctf.277.893883407

ORA-15046: ASM file name ‘+DATA/pfus1/changetracking/ctf.277.893883407‘ is not

in single-file creation form

ORA-17503: ksfdopn:2 Failed to open file

+DATA/pfus1/changetracking/ctf.277.893883407

ORA-15012: ASM file ‘+DATA/pfus1/changetracking/ctf.277.893883407‘ does not

exist

SQL> ALTER DATABASE DISABLE BLOCK CHANGE TRACKING;(enable it after rac working good)

Database altered.

SQL> shutdown immediate;

vi /u01/home/oracle/deff/pfile_1223.txt

control_file这个参数确保是restore之后的control file的位置

*.cluster_database=false   

*.db_name=‘PNCL‘

*.db_recovery_file_dest=‘+LOGS‘ 不在注掉这两个参数

*.db_recovery_file_dest_size=241591910400

然后就可以startup pfile=’’

把数据库打开之后,之后就是得把PNCL改成PFCL1这个数据库名,用nid来改

nid要求数据库在mount状态

[email protected]:PFCL11:/u01/home/oracle/deff $ nid target=/ setname=yes dbname=PFCL1

 

DBNEWID: Release 11.2.0.4.0 - Production on Fri Dec 23 09:35:51 2016

 

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

 

Connected to database PNCL (DBID=3875018320)

 

Connected to server version 11.2.0

 

Control Files in database:

    +LOGS/pncl/controlfile/current.824.931330093

 

Change database name of database PNCL to PFCL1? (Y/[N]) => Y

 

Proceeding with operation

Changing database name from PNCL to PFCL1

    Control File +LOGS/pncl/controlfile/current.824.931330093 - modified

    Datafile +DATA/pfcl1/datafile/system.285.db - wrote new name

    Datafile +DATA/pfcl1/datafile/sysaux.276.db - wrote new name

    Datafile +DATA/pfcl1/datafile/undotbs1.296.db - wrote new name

    Datafile +DATA/pfcl1/datafile/users.286.db - wrote new name

    Datafile +DATA/pfcl1/datafile/nike_schema_admin_data.284.db - wrote new name

    Datafile +DATA/pfcl1/datafile/emerch_content_data.287.db - wrote new name

    Datafile +DATA/pfcl1/datafile/emerch_content_index.260.db - wrote new name

    Datafile +DATA/pfcl1/datafile/caps_product_depot_data.293.db - wrote new name

    Datafile +DATA/pfcl1/datafile/caps_product_depot_index.261.db - wrote new name

    Datafile +DATA/pfcl1/datafile/pcat_ecs_data.289.db - wrote new name

    Datafile +DATA/pfcl1/datafile/pcat_base_data.290.db - wrote new name

    Datafile +DATA/pfcl1/datafile/pcat_ecs_index.264.db - wrote new name

    Datafile +DATA/pfcl1/datafile/pcat_base_index.262.db - wrote new name

    Datafile +DATA/pfcl1/datafile/emerch_ppub_gbl_data.277.db - wrote new name

    Datafile +DATA/pfcl1/datafile/emerch_ppub_gbl_index.267.db - wrote new name

    Datafile +DATA/pfcl1/datafile/undotbs1.294.db - wrote new name

    Datafile +DATA/pfcl1/datafile/product_depot_data.283.db - wrote new name

    Datafile +DATA/pfcl1/datafile/product_depot_index.258.db - wrote new name

    Datafile +DATA/pfcl1/datafile/emerch_pauthor_data.273.db - wrote new name

    Datafile +DATA/pfcl1/datafile/emerch_pauthor_index.257.db - wrote new name

    Datafile +DATA/pfcl1/datafile/emerch_staging_data.291.db - wrote new name

    Datafile +DATA/pfcl1/datafile/emerch_staging_index.265.db - wrote new name

    Datafile +DATA/pfcl1/datafile/product_depot_data.300.db - wrote new name

    Datafile +DATA/pfcl1/datafile/ggadmin_data.281.db - wrote new name

    Datafile +DATA/pfcl1/datafile/emerch_fba_data.278.db - wrote new name

    Datafile +DATA/pfcl1/datafile/emerch_service_data.272.db - wrote new name

    Datafile +DATA/pfcl1/datafile/emerch_service_index.263.db - wrote new name

    Datafile +DATA/pfcl1/datafile/undotbs2.299.db - wrote new name

    Datafile +DATA/pfcl1/datafile/temp2.db - wrote new name

    Control File +LOGS/pncl/controlfile/current.824.931330093 - wrote new name

    Instance shut down

 

Database name changed to PFCL1.

Modify parameter file and generate a new password file before restarting.

Succesfully changed database name.

DBNEWID - Completed succesfully.

 

=============================================================================================================

在做完nid之后,无非就是再修改下pfile,起两个节点,建spfile,中间遇到的小问题就暂时略过了,直接来说下遇到的一个spfile与srvctl的问题:

目标就是spfile放到ASM上+data里的一个目录下,然后能用srvctl顺利启起来,因为自己每次都是改init file指向新的ASM下的SPFILE,每次用srvctl重启就不行,后来看了文章搞清楚了srvctl下的config还没改!

参考这篇文章,写得很清楚~~

在RAC环境下修改spfile:

1. 需要修改$ORACLE_HOME/dbs下的相关文件init file,指向新文件spfile

2. 需要用srvctl修改config信息,指向新文件spfile

 

浅析RAC下SPFILE文件修改之整理三篇文章   http://blog.csdn.net/huangyanlong/article/details/33767269?utm_source=tuicool&utm_medium=referral

参考这篇文章看下自己现在的环境:

PFCL11:

SQL> show parameter pfile

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

spfile                               string      /u01/app/oracle/product/11.2.0

                                                 .4/db_1/dbs/spfilePFCL11.ora

PFCL12:

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

spfile                               string      /u01/app/oracle/product/11.2.0

                                                 .4/db_1/dbs/spfilePFCL12.ora

[email protected]:PFCL12:/u01/home/oracle $ srvctl config database -d pfcl1 -a

Database unique name: PFCL1

Database name:

Oracle home: /u01/app/oracle/product/11.2.0.4/db_1

Oracle user: oracle

Spfile: +DATA/PFCL1/spfilePFCL1.ora

srvctl modify database-d PFCL1 -p ‘new spfile destination‘

 

========================================================================================================

其他命令供参考:

Check the redo log group:

SQL> set line 1000

SQL> select * from v$log;

    GROUP#    THREAD#  SEQUENCE#      BYTES  BLOCKSIZE    MEMBERS ARC STATUS           FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME

---------- ---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- --------- ------------ ---------

        15          1          1 2147483648        512          2 YES INACTIVE            1.3989E+13 02-AUG-16   1.3989E+13 02-AUG-16

        16          1          2 2147483648        512          2 YES INACTIVE            1.3989E+13 02-AUG-16   1.3989E+13 02-AUG-16

        17          1          3 2147483648        512          2 YES INACTIVE            1.3989E+13 02-AUG-16   1.3989E+13 02-AUG-16

        18          1          4 2147483648        512          2 NO  CURRENT             1.3989E+13 02-AUG-16   2.8147E+14

        19          2          1 2147483648        512          2 YES INACTIVE            1.3989E+13 02-AUG-16   1.3989E+13 02-AUG-16

        20          2          0 2147483648        512          2 YES UNUSED                       0                      0

        21          2          0 2147483648        512          2 YES UNUSED                       0                      0

        22          2          0 2147483648        512          2 YES UNUSED                       0                      0

8 rows selected.

Configure the redo log group:

sqlplus / as sysdba

alter database disable thread 2;

alter database drop logfile group 19;

alter database drop logfile group 20;

alter database drop logfile group 21;

alter database drop logfile group 22;

select * from v$log;

alter system switch logfile ;

alter database add logfile thread 2 group 19 (‘+REDOA‘,‘+REDOB‘) size 2048M;

alter database add logfile thread 2 group 20 (‘+REDOA‘,‘+REDOB‘) size 2048M;

alter database add logfile thread 2 group 21 (‘+REDOA‘,‘+REDOB‘) size 2048M;

alter database add logfile thread 2 group 22 (‘+REDOA‘,‘+REDOB‘) size 2048M;

alter database enable public thread 2;

select * from v$log;

 

以上是关于RAC异机恢复的主要内容,如果未能解决你的问题,请参考以下文章

RAC/single 异机完全恢复(RMAN)

Oracle12c RAC RMAN异机恢复

Oracle 单实例 迁移到 RAC 实例 -- 使用RMAN 异机恢复

RMAN - 备份异机恢复

Cassandra管理之异机恢复

rman恢复方案和oracle异机恢复