node ->rman to RAC (迁移)

*.audit_file_dest='/dba/app/oracle/admin/dominic/adump' *.audit_trail='db' *.cluster_database=true *.compatible='11.2.0.4.0' *.control_files='+DATA_DISK/DOMINIC/controlfile/current.260.825093345','+LOG_DISK/DOMINIC/controlfile/current.256.825093345'    --- DOMINIC 大写 *.db_block_size=8192 *.db_create_file_dest='+DATA_DISK' *.db_domain='' *.db_name='dominic' #*.log_file_name_convert='+DATA_DISK/dominic/logfile','/u01/app/oracle/logfile','+LOG_DISK/dominic/logfile','/u01/app/oracle/oradata/dominic' *.db_recovery_file_dest='+LOG_DISK' *.db_recovery_file_dest_size=4558159872 *.diagnostic_dest='/dba/app/oracle' *.dispatchers='(PROTOCOL=TCP) (SERVICE=dominicXDB)' dominic2.instance_number=2 dominic1.instance_number=1 *.log_archive_format='%t_%s_%r.dbf' *.memory_target=1153433600 *.open_cursors=500 *.processes=300 *.remote_listener='dominic-scan:1521' *.remote_login_passwordfile='exclusive' *.sessions=350 dominic2.thread=2 dominic1.thread=1 dominic2.undo_tablespace='UNDOTBS2' dominic1.undo_tablespace='UNDOTBS1' *.undo_management='AUTO' 一 : 创建參数文件 to ASM [oracle@dominic1 ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0 Production on Sat Jun 21 19:04:49 2014 Copyright (c) 1982, 2013, Oracle. All rights reserved. Connected to an idle instance.
SQL> startup nomount ORA-01078: failure in processing system parameters LRM-00109: could not open parameter file '/dba/app/oracle/product/11.2/dbhome_1/dbs/initdominic1.ora'  --须要追加的路径
SQL> host [oracle@dominic1 ~]$ cd /dba/app/oracle/product/11.2/dbhome_1/dbs/
[oracle@dominic1 dbs]$ ls init.ora [oracle@dominic1 dbs]$ exit exit SQL> create spfile='+data_disk/dominic/parameterfile/initdominic.ora' from pfile='/dba/app/oracle/backup/s_pfile'; File created. SQL> HOST
[oracle@dominic1 ~]$ echo "SPFILE='+data_disk/dominic/parameterfile/initdominic.ora'" > /dba/app/oracle/product/11.2/dbhome_1/dbs/initdominic1.ora [oracle@dominic1 ~]$ cat /dba/app/oracle/product/11.2/dbhome_1/dbs/initdominic1.ora SPFILE='+data_disk/dominic/parameterfile/initdominic.ora' [oracle@dominic1 ~]$ ssh dominic2 [oracle@dominic2 ~]$ echo "SPFILE='+data_disk/dominic/parameterfile/initdominic.ora'" > /dba/app/oracle/product/11.2/dbhome_1/dbs/initdominic2.ora [oracle@dominic2 ~]$ cat /dba/app/oracle/product/11.2/dbhome_1/dbs/initdominic2.ora SPFILE='+data_disk/dominic/parameterfile/initdominic.ora'

ASMCMD> pwd +data_disk/dominic/parameterfile ASMCMD> ls initdominic.ora
二: 创建密码文件:

三: 创建相应的路径: ASM : +DATA_DISK /DOMINI/datafile 、logfile、controlfile、parameterfile。             + LOG_DISK /dominic/logfile, controlfil 等:
+++++++++++++++++++++++++++++++++++++++++++++失败++++++++++++++++++++++ RMAN> run { 2> set newname for datafile 1 to '+DATA_DISK/DOMINIC/datafile/system01.dbf'; 3> set newname for datafile 2 to '+DATA_DISK/DOMINIC/datafile/undotbs01.dbf'; 4> set newname for datafile 3 to '+DATA_DISK/DOMINIC/datafile/users01.dbf'; 5> set newname for datafile 4 to '+DATA_DISK/DOMINIC/datafile/undotbs01.dbf'; 6> set newname for datafile 5 to '+DATA_DISK/DOMINIC/datafile/example01.dbf'; 7> set newname for datafile 6 to '+DATA_DISK/DOMINIC/datafile/dominic_tbs01.dbf'; 8> restore database; 9> switch datafile all; 10> } 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 21-JUN-14 Starting implicit crosscheck backup at 21-JUN-14 allocated channel: ORA_DISK_1 Crosschecked 3 objects Finished implicit crosscheck backup at 21-JUN-14 Starting implicit crosscheck copy at 21-JUN-14 using channel ORA_DISK_1 Finished implicit crosscheck copy at 21-JUN-14 searching for all files in the recovery area cataloging files... cataloging done List of Cataloged Files ======================= File Name: +log_disk/dominic/controlfile/current.257.850853325 File Name: +log_disk/dominic/controlfile/current.256.850853775 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 +DATA_DISK/DOMINIC/datafile/system01.dbf channel ORA_DISK_1: restoring datafile 00002 to +DATA_DISK/DOMINIC/datafile/undotbs01.dbf channel ORA_DISK_1: restoring datafile 00003 to +DATA_DISK/DOMINIC/datafile/users01.dbf channel ORA_DISK_1: restoring datafile 00004 to +DATA_DISK/DOMINIC/datafile/undotbs01.dbf channel ORA_DISK_1: restoring datafile 00005 to +DATA_DISK/DOMINIC/datafile/example01.dbf channel ORA_DISK_1: restoring datafile 00006 to +DATA_DISK/DOMINIC/datafile/dominic_tbs01.dbf channel ORA_DISK_1: reading from backup piece /dba/app/rmanbak/DOMINIC_dbfull_08p9pjgn_20140601.DB channel ORA_DISK_1: ORA-19870: error while restoring backup piece /dba/app/rmanbak/DOMINIC_dbfull_08p9pjgn_20140601.DB ORA-19504: failed to create file "+DATA_DISK/dominic/datafile/undotbs01.dbf" ORA-17502: ksfdcre:4 Failed to create file +DATA_DISK/dominic/datafile/undotbs01.dbf ORA-15005: name "dominic/datafile/undotbs01.dbf" is already used by an existing alias failover to previous backup RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of restore command at 06/21/2014 20:29:11 RMAN-06026: some targets not found - aborting restore RMAN-06023: no backup or copy of datafile 5 found to restore              --上次也抱这错,好好思考一下(node asm -> rman filesys node) RMAN-06023: no backup or copy of datafile 4 found to restore RMAN-06023: no backup or copy of datafile 3 found to restore RMAN-06023: no backup or copy of datafile 2 found to restore   RMAN-06023: no backup or copy of datafile 1 found to restore --ASM 仅仅须要写磁盘组就可以 2、注冊备份集 RMAN> catalog start with '/dba/app/rmanbk/';
最后我改写成这样, set newname for datafile 1 to '+DATA_DISK'; 成功了,不报RMAN-6023错。 并且rman 恢复路径也依照前定义好的。  
====================成功le 案例============================ [oracle@dominic1 rmanbak]$ rman target / Recovery Manager: Release 11.2.0.4.0 - Production on Sat Jun 21 20:42:11 2014 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. connected to target database: DOMINIC (DBID=1978806569, not open) RMAN> run { 2> set newname for datafile 1 to '+DATA_DISK'; 3> set newname for datafile 2 to '+DATA_DISK'; 4> set newname for datafile 3 to '+DATA_DISK'; 5> set newname for datafile 4 to '+DATA_DISK'; 6> set newname for datafile 5 to '+DATA_DISK'; 7> set newname for datafile 6 to '+DATA_DISK'; 8> restore database; 9> switch datafile all; 10> switch tempfile all; 11> } 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 21-JUN-14 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=42 instance=dominic1 device type=DISK 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 +DATA_DISK channel ORA_DISK_1: restoring datafile 00002 to +DATA_DISK channel ORA_DISK_1: restoring datafile 00003 to +DATA_DISK channel ORA_DISK_1: restoring datafile 00004 to +DATA_DISK channel ORA_DISK_1: restoring datafile 00005 to +DATA_DISK channel ORA_DISK_1: restoring datafile 00006 to +DATA_DISK channel ORA_DISK_1: reading from backup piece /dba/app/rmanbak/DOMINIC_dbfull_08p9pjgn_20140601.DB channel ORA_DISK_1: piece handle=/dba/app/rmanbak/DOMINIC_dbfull_08p9pjgn_20140601.DB tag=TAG20140601T232615 channel ORA_DISK_1: restored backup piece 1 channel ORA_DISK_1: restore complete, elapsed time: 00:01:26 Finished restore at 21-JUN-14 datafile 1 switched to datafile copy input datafile copy RECID=10 STAMP=850855528 file name=+DATA_DISK/dominic/datafile/system.263.850855443 datafile 2 switched to datafile copy input datafile copy RECID=11 STAMP=850855529 file name=+DATA_DISK/dominic/datafile/sysaux.262.850855443 datafile 3 switched to datafile copy input datafile copy RECID=12 STAMP=850855529 file name=+DATA_DISK/dominic/datafile/undotbs1.261.850855443 datafile 4 switched to datafile copy input datafile copy RECID=13 STAMP=850855529 file name=+DATA_DISK/dominic/datafile/users.265.850855443 datafile 5 switched to datafile copy input datafile copy RECID=14 STAMP=850855529 file name=+DATA_DISK/dominic/datafile/example.264.850855443 datafile 6 switched to datafile copy input datafile copy RECID=15 STAMP=850855529 file name=+DATA_DISK/dominic/datafile/dominic_tbs.260.850855443 =================================================== ASMCMD> pwd +data_disk/dominic/datafile ASMCMD> ls DOMINIC_TBS.260.850855443 EXAMPLE.264.850855443 SYSAUX.262.850855443 SYSTEM.263.850855443 UNDOTBS1.261.850855443 USERS.265.850855443

select * from v$logfile; GROUP# STATUS TYPE MEMBER IS_ ---------- ------- ------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---   3 ONLINE /dba/app/oracle/oradata/dominic/redo03.log NO   2 ONLINE /dba/app/oracle/oradata/dominic/redo02.log NO   1 ONLINE /dba/app/oracle/oradata/dominic/redo01.log NO   1 ONLINE /dba/app/oracle/redolog/redo01-a.log NO   2 ONLINE /dba/app/oracle/redolog/redo02-a.log NO   3 INVALID ONLINE /dba/app/oracle/redolog/redo03-a.log NO 6 rows selected.

SQL> alter database rename file '/dba/app/oracle/redolog/redo01-a.log' to '+LOG_DISK'; Database altered. SQL> alter database rename file '/dba/app/oracle/redolog/redo02-a.log' to '+LOG_DISK'; Database altered. SQL> alter database rename file '/dba/app/oracle/redolog/redo03-a.log' to '+LOG_DISK'; Database altered. SQL> alter database rename file '/dba/app/oracle/oradata/dominic/redo02.log' to '+DATA_DISK'; Database altered. SQL> alter database rename file '/dba/app/oracle/oradata/dominic/redo03.log' to '+DATA_DISK'; Database altered.

SQL> select * from v$logfile;     GROUP# STATUS TYPE MEMBER IS_ ---------- ------- ------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---   3 ONLINE +DATA_DISK NO   2 ONLINE +DATA_DISK NO   1 ONLINE +DATA_DISK NO   1 ONLINE +LOG_DISK YES   2 ONLINE +LOG_DISK YES   3 INVALID ONLINE +LOG_DISK YES 6 rows selected.

recover 数据库

       在运行restore的节点运行,由于备份文件在该节点上。

RMAN> recover database;

Starting recover at 21-JUN-14

using channel ORA_DISK_1

starting media recovery

unable to find archived log

archived log thread=1 sequence=11

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of recover command at 06/21/2014 21:02:01

RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 11 and starting SCN of 995895


RMAN> recover database until scn 995895;

Starting recover at 21-JUN-14

using channel ORA_DISK_1

starting media recovery

media recovery complete, elapsed time: 00:00:01

Finished recover at 21-JUN-14



RMAN> restore archivelog all;

Starting restore at 21-JUN-14

using channel ORA_DISK_1

channel ORA_DISK_1: starting archived log restore to default destination

channel ORA_DISK_1: restoring archived log

archived log thread=1 sequence=5

channel ORA_DISK_1: restoring archived log

archived log thread=1 sequence=6

channel ORA_DISK_1: restoring archived log

archived log thread=1 sequence=7

channel ORA_DISK_1: restoring archived log

archived log thread=1 sequence=8

channel ORA_DISK_1: restoring archived log

archived log thread=1 sequence=9

channel ORA_DISK_1: restoring archived log

archived log thread=1 sequence=10

channel ORA_DISK_1: reading from backup piece /dba/app/rmanbak/DOMINIC_arch_0ap9pjij_20140601

channel ORA_DISK_1: piece handle=/dba/app/rmanbak/DOMINIC_arch_0ap9pjij_20140601 tag=TAG20140601T232715

channel ORA_DISK_1: restored backup piece 1

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

Finished restore at 21-JUN-14



SQL> startup

ORACLE instance started.

Total System Global Area 1152450560 bytes

Fixed Size 2252584 bytes

Variable Size 855638232 bytes

Database Buffers 285212672 bytes

Redo Buffers 9347072 bytes

Database mounted.

ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

SQL> alter database open resetlogs;

Database altered.




SQL> select name,open_mode from v$database;

NAME OPEN_MODE

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

DOMINIC READ WRITE

SQL> select comp_name, version, status from sys.dba_registry;

COMP_NAME

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

VERSION STATUS

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

OWB

11.2.0.4.0 VALID

Oracle Application Express

3.2.1.00.12 VALID

Oracle Enterprise Manager

11.2.0.4.0 VALID

COMP_NAME

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

VERSION STATUS

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

OLAP Catalog

11.2.0.4.0 VALID

Spatial

11.2.0.4.0 VALID

Oracle Multimedia

11.2.0.4.0 VALID

COMP_NAME

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

VERSION STATUS

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

Oracle XML Database

11.2.0.4.0 VALID

Oracle Text

11.2.0.4.0 VALID

Oracle Expression Filter

11.2.0.4.0 VALID

COMP_NAME

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

VERSION STATUS

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

Oracle Rules Manager

11.2.0.4.0 VALID

Oracle Workspace Manager

11.2.0.4.0 VALID

Oracle Database Catalog Views

11.2.0.4.0 VALID

COMP_NAME

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

VERSION STATUS

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

Oracle Database Packages and Types

11.2.0.4.0 VALID

JServer JAVA Virtual Machine

11.2.0.4.0 VALID

Oracle XDK

11.2.0.4.0 VALID

COMP_NAME

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

VERSION STATUS

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

Oracle Database Java Packages

11.2.0.4.0 VALID

OLAP Analytic Workspace

11.2.0.4.0 VALID

Oracle OLAP API

11.2.0.4.0 VALID

18 rows selected.


SQL> select * from v$option where parameter = 'Real Application Clusters';

PARAMETER

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

VALUE

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

Real Application Clusters

TRUE


SQL> show parameter cluster

NAME TYPE VALUE

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

cluster_database boolean TRUE

cluster_database_instances integer 2

cluster_interconnects string


SQL> show parameter thread;

NAME TYPE VALUE

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

parallel_threads_per_cpu integer 2

thread integer 1


SQL> show parameter instance_number

NAME TYPE VALUE

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

instance_number integer 1


SQL> show parameter cluster_database;

NAME TYPE VALUE

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

cluster_database boolean TRUE

cluster_database_instances integer 2


SQL> show parameter cluster_database_instances

NAME TYPE VALUE

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

cluster_database_instances integer 2


创建节点2的undo 表空间

 

SYS@anqing1(rac1)> show parameter undo_tablespace

 

NAME                   TYPE        VALUE

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

undo_tablespace            string      UNDOTBS1

 

       这个是rac1上节点的信息。我们在之前的在spfile參数指定的rac2节点的undo 空间是UNDOTBS2.

       所以这里我们创建该undo 表空间,并指定相关參数。

 

SYS@dominic(rac1)> create undo tablespace UNDOTBS2 datafile '+DATA/ANQING/datafile/undotbs02.dbf' size 500m;

SQL> create undo tablespace UNDOTBS2 datafile '+DATA_DISK/DOMINIC/datafile/undotbs02.dbf' size 500m;

Tablespace created.

SQL> show parameter undo

NAME TYPE VALUE

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

undo_management string AUTO

undo_retention integer 900

undo_tablespace string UNDOTBS1

SQL> select name from v$datafile;

NAME

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

+DATA_DISK/dominic/datafile/system.263.850855443

+DATA_DISK/dominic/datafile/sysaux.262.850855443

+DATA_DISK/dominic/datafile/undotbs1.261.850855443

+DATA_DISK/dominic/datafile/users.265.850855443

+DATA_DISK/dominic/datafile/example.264.850855443

+DATA_DISK/dominic/datafile/dominic_tbs.260.850855443

+DATA_DISK/dominic/datafile/undotbs02.dbf


ASMCMD> pwd

+data_disk/dominic/datafile

ASMCMD> ls

DOMINIC_TBS.260.850855443

EXAMPLE.264.850855443

SYSAUX.262.850855443

SYSTEM.263.850855443

UNDOTBS1.261.850855443

UNDOTBS2.269.850858531

USERS.265.850855443

undotbs02.dbf



SQL> SELECT NAME FROM V$TABLESPACE;

NAME

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

SYSTEM

SYSAUX

UNDOTBS1

USERS

TEMP

EXAMPLE

DOMINIC_TBS

UNDOTBS2


加入rac2 节点的redo 文件

SQL> alter database add logfile thread 2 group 4 ('+DATA_DISK','+LOG_DISK') SIZE 50M ;

Database altered.

SQL> alter database add logfile thread 2 group 5('+DATA_DISK','+LOG_DISK') SIZE 50M ;

Database altered.

SQL> alter database add logfile thread 2 group 6('+DATA_DISK','+LOG_DISK') SIZE 50M;

Database altered.


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

SQL> alter database add logfile thread 1 group5('+data/myrac/onlinelog/myrac1_redolog_group5_01') size 100m; SQL> alter database add logfile member '+data/myrac/onlinelog/myrac1_redolog_group5_02' to group 5; SQL> alter database add logfile thread 2 group 6('+data/myrac/onlinelog/myrac1_redolog_group6_01')size 100m; SQL> alter database add logfile member '+data/myrac/onlinelog/myrac1_redolog_group6_02' to group 6;

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



SQL> alter database enable thread 2;



SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.   ---- 重新启动节点1和节点2 上的实例。使相关參数生效




=====(一下在节点2 上)

 查看节点二 參数。添加參数 export ORACLE_UNQNAME=dominic

 

[oracle@dominic2 ~]$ cat .bash_profile

# .bash_profile

# Get the aliases and functions

if [ -f ~/.bashrc ]; then

 . ~/.bashrc

fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH

export ORACLE_SID=dominic2

export ORACLE_UNQNAME=dominic

export ORACLE_BASE=/dba/app/oracle

export ORACLE_HOME=$ORACLE_BASE/product/11.2/dbhome_1

export PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin

export LANG=C

export LD_LIBRARY_PATH=$ORACLE_HOME/lib

umask 022


[oracle@dominic2 ~]$ sqlplus / as sysdba   --启动节点2 

SQL*Plus: Release 11.2.0.4.0 Production on Sat Jun 21 21:52:19 2014

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

Connected to an idle instance.

SQL> startup

ORACLE instance started.

Total System Global Area 1152450560 bytes

Fixed Size 2252584 bytes

Variable Size 855638232 bytes

Database Buffers 285212672 bytes

Redo Buffers 9347072 bytes

Database mounted.

Database opened.



SQL> show parameter cluster

NAME TYPE VALUE

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

cluster_database boolean TRUE

cluster_database_instances integer 2

cluster_interconnects string



SQL> select instance_number,instance_name,host_name from gv$instance;   --最后确认是否起来了!

上一篇:jeecg 报ORA-01658:无法为表空间USERS中的段创建INITIAL区


下一篇:sed的用法练习