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;   --最后确认是否起来了!

INSTANCE_NUMBER INSTANCE_NAME HOST_NAME

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

       1 dominic1 dominic1.com

       2 dominic2 dominic2.com



到现在已经是集群了,不过还有一些收尾的工作要做。



执行catclust.sql脚本来创建相关视图

SQL> @$ORACLE_HOME/rdbms/admin/catclust.sql



重建Temp 表空间


在恢复的时候,会自动创建TEMP 表空间。和一个前辈聊到过这个问题,他说这个temp 文件好像没有起到作用。 尤其是数据量大的时候,他建议重建添加temp 数据文件。 这个还是小心为好,反正重建一些也不费什么事。但是万一出问题,就是大麻烦。


SQL> select name from v$tempfile;

NAME

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

/dba/app/oracle/oradata/dominic/temp01.dbf     --两个节点一样


SQL> alter tablespace temp add tempfile '+DATA_DISK' size 400m;

Tablespace altered.

SQL> select name from v$tempfile;

NAME

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

/dba/app/oracle/oradata/dominic/temp01.dbf

+DATA_DISK/dominic/tempfile/temp.273.850859907



SQL> alter database tempfile '/dba/app/oracle/oradata/dominic/temp01.dbf' offline;

Database altered.


SQL> alter database tempfile '/dba/app/oracle/oradata/dominic/temp01.dbf' drop including datafiles;

Database altered.

 ---现在两个节点查看,都是一样的,


SQL> select name from v$tempfile;

NAME

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

+DATA_DISK/dominic/tempfile/temp.273.850859907



添加集群的监听:

之前需要确认: 


[grid@dominic2 ~]$ crs_stat -t

Name Type Target State Host

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

ora....DISK.dg ora....up.type ONLINE ONLINE dominic1

ora....ER.lsnr ora....er.type ONLINE ONLINE dominic1

ora....N1.lsnr ora....er.type ONLINE ONLINE dominic1

ora....DISK.dg ora....up.type ONLINE ONLINE dominic1

ora....DATA.dg ora....up.type ONLINE ONLINE dominic1

ora.asm ora.asm.type ONLINE ONLINE dominic1

ora.cvu ora.cvu.type ONLINE ONLINE dominic1

ora....SM1.asm application ONLINE ONLINE dominic1

ora....C1.lsnr application ONLINE ONLINE dominic1

ora....ic1.gsd application OFFLINE OFFLINE

ora....ic1.ons application ONLINE ONLINE dominic1

ora....ic1.vip ora....t1.type ONLINE ONLINE dominic1

ora....SM2.asm application ONLINE ONLINE dominic2

ora....C2.lsnr application ONLINE ONLINE dominic2

ora....ic2.gsd application OFFLINE OFFLINE

ora....ic2.ons application ONLINE ONLINE dominic2

ora....ic2.vip ora....t1.type ONLINE ONLINE dominic2

ora.gsd ora.gsd.type OFFLINE OFFLINE

ora....network ora....rk.type ONLINE ONLINE dominic1

ora.oc4j ora.oc4j.type ONLINE ONLINE dominic1

ora.ons ora.ons.type ONLINE ONLINE dominic1

ora....ry.acfs ora....fs.type ONLINE ONLINE dominic1

ora.scan1.vip ora....ip.type ONLINE ONLINE dominic1


[grid@dominic1 ~]$ crs_stat -t

Name Type Target State Host

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

ora....DISK.dg ora....up.type ONLINE ONLINE dominic1

ora....ER.lsnr ora....er.type ONLINE ONLINE dominic1

ora....N1.lsnr ora....er.type ONLINE ONLINE dominic1

ora....DISK.dg ora....up.type ONLINE ONLINE dominic1

ora....DATA.dg ora....up.type ONLINE ONLINE dominic1

ora.asm ora.asm.type ONLINE ONLINE dominic1

ora.cvu ora.cvu.type ONLINE ONLINE dominic1

ora....SM1.asm application ONLINE ONLINE dominic1

ora....C1.lsnr application ONLINE ONLINE dominic1

ora....ic1.gsd application OFFLINE OFFLINE

ora....ic1.ons application ONLINE ONLINE dominic1

ora....ic1.vip ora....t1.type ONLINE ONLINE dominic1

ora....SM2.asm application ONLINE ONLINE dominic2

ora....C2.lsnr application ONLINE ONLINE dominic2

ora....ic2.gsd application OFFLINE OFFLINE

ora....ic2.ons application ONLINE ONLINE dominic2

ora....ic2.vip ora....t1.type ONLINE ONLINE dominic2

ora.gsd ora.gsd.type OFFLINE OFFLINE

ora....network ora....rk.type ONLINE ONLINE dominic1

ora.oc4j ora.oc4j.type ONLINE ONLINE dominic1

ora.ons ora.ons.type ONLINE ONLINE dominic1

ora....ry.acfs ora....fs.type ONLINE ONLINE dominic1

ora.scan1.vip ora....ip.type ONLINE ONLINE dominic1  


将其他信息注册到CRS里



[grid@dominic1 ~]$ srvctl add database -d dominic -o $ORACLE_HOME

[grid@dominic1 ~]$ srvctl add instance -d dominic -i dominic1 -n dominic1 (-n 为hostname, oracle,grid 用户都可以)

[grid@dominic1 ~]$ srvctl add instance -d dominic -i dominic2 -n dominic2



修改instance 和 asm 之间的依赖关系:

srvctl modify instance -d <db_unique_name> -i <SID1> -s <+ASM1>


[oracle@dominic1 ~]$ srvctl modify instance -d dominic -i dominic1 -s +ASM1

Warning:-s option has been deprecated and will be ignored.

[oracle@dominic1 ~]$ srvctl modify instance -d dominic -i dominic2 -s +ASM2

Warning:-s option has been deprecated and will be ignored.


 -----在这里算是可以完成了:


查询验证一下:

[grid@dominic1 ~]$ crs_stat -t

Name Type Target State Host

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

ora....DISK.dg ora....up.type ONLINE ONLINE dominic1

ora....ER.lsnr ora....er.type ONLINE ONLINE dominic1

ora....N1.lsnr ora....er.type ONLINE ONLINE dominic1

ora....DISK.dg ora....up.type ONLINE ONLINE dominic1

ora....DATA.dg ora....up.type ONLINE ONLINE dominic1

ora.asm ora.asm.type ONLINE ONLINE dominic1

ora.cvu ora.cvu.type ONLINE ONLINE dominic1

ora.dominic.db ora....se.type OFFLINE OFFLINE

ora....SM1.asm application ONLINE ONLINE dominic1

ora....C1.lsnr application ONLINE ONLINE dominic1

ora....ic1.gsd application OFFLINE OFFLINE

ora....ic1.ons application ONLINE ONLINE dominic1

ora....ic1.vip ora....t1.type ONLINE ONLINE dominic1

ora....SM2.asm application ONLINE ONLINE dominic2

ora....C2.lsnr application ONLINE ONLINE dominic2

ora....ic2.gsd application OFFLINE OFFLINE

ora....ic2.ons application ONLINE ONLINE dominic2

ora....ic2.vip ora....t1.type ONLINE ONLINE dominic2

ora.gsd ora.gsd.type OFFLINE OFFLINE

ora....network ora....rk.type ONLINE ONLINE dominic1

ora.oc4j ora.oc4j.type ONLINE ONLINE dominic1

ora.ons ora.ons.type ONLINE ONLINE dominic1

ora....ry.acfs ora....fs.type ONLINE ONLINE dominic1

ora.scan1.vip ora....ip.type ONLINE ONLINE dominic1 


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

[grid@dominic1 ~]$ crsctl status resource -t

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

NAME TARGET STATE SERVER STATE_DETAILS

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

Local Resources

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

ora.DATA_DISK.dg

               ONLINE ONLINE dominic1

               ONLINE ONLINE dominic2

ora.LISTENER.lsnr

               ONLINE ONLINE dominic1

               ONLINE ONLINE dominic2

ora.LOG_DISK.dg

               ONLINE ONLINE dominic1

               ONLINE ONLINE dominic2

ora.OCR_DATA.dg

               ONLINE ONLINE dominic1

               ONLINE ONLINE dominic2

ora.asm

               ONLINE ONLINE dominic1 Started

               ONLINE ONLINE dominic2 Started

ora.gsd

               OFFLINE OFFLINE dominic1

               OFFLINE OFFLINE dominic2

ora.net1.network

               ONLINE ONLINE dominic1

               ONLINE ONLINE dominic2

ora.ons

               ONLINE ONLINE dominic1

               ONLINE ONLINE dominic2

ora.registry.acfs

               ONLINE ONLINE dominic1

               ONLINE ONLINE dominic2

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

Cluster Resources

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

ora.LISTENER_SCAN1.lsnr

      1 ONLINE ONLINE dominic1

ora.cvu

      1 ONLINE ONLINE dominic1

ora.dominic.db

      1 OFFLINE OFFLINE

      2 OFFLINE OFFLINE

ora.dominic1.vip

      1 ONLINE ONLINE dominic1

ora.dominic2.vip

      1 ONLINE ONLINE dominic2

ora.oc4j

      1 ONLINE ONLINE dominic1

ora.scan1.vip

      1 ONLINE ONLINE dominic1  



这里并没有启动,因为我们的服务是刚添加上来的,还没有同步。 我们启动一下就ok了


[grid@dominic1 ~]$ srvctl start database -d dominic




=========================(以上都在节点一操作)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值