探索 Oracle 10g RAC 数据库环境
2014-07-27 15:37
369 查看
RAC安装参考点击打开链接
rac1上执行
rac1-> sqlplus sys/test1234@devdb1 as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Sun Jul 20 17:04:01 2014
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> show parameter service
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
service_names string CRM, devdb
rac2上执行
rac2-> sqlplus sys/test1234@devdb2 as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Sun Jul 20 17:04:59 2014
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> show parameter service;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
service_names string devdb
在rac1上用CRM服务连接:
rac1-> sqlplus sys/test1234@crm as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Sun Jul 20 17:08:15 2014
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> select instance_number instance#,instance_name,host_name,status from v$instance;
INSTANCE# INSTANCE_NAME
---------- ----------------
HOST_NAME STATUS
---------------------------------------------------------------- ------------
1 devdb1
rac1 OPEN
SQL> select failover_type,failover_method,failed_over from v$session where username='SYS';
FAILOVER_TYPE FAILOVER_M FAI
------------- ---------- ---
SELECT BASIC NO
NONE NONE NO
NONE NONE NO
NONE NONE NO
NONE NONE NO
NONE NONE NO
6 rows selected.
新打开一个putty,从其他会话中关闭该实例。在CRM所在的实例上以 sys 用户身份连接,并关闭该实例。
rac1-> export ORACLE_SID=devdb1
rac1-> sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Sun Jul 20 17:19:20 2014
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> select instance_number instance#,instance_name,host_name,status from v$instance;
INSTANCE# INSTANCE_NAME
---------- ----------------
HOST_NAME STATUS
---------------------------------------------------------------- ------------
1 devdb1
rac1 OPEN
SQL> shutdown abort;
ORACLE instance shut down.
验证会话已经完成故障切换:从先前打开的CRM 会话执行以下查询,以验证该会话已经故障切换到其他实例。
SQL> select instance_number instance#,instance_name,host_name,status from v$instance;
INSTANCE# INSTANCE_NAME
---------- ----------------
HOST_NAME STATUS
---------------------------------------------------------------- ------------
2 devdb2
rac2 OPEN
SQL> select failover_type,failover_method,failed_over from v$session where username='SYS';
FAILOVER_TYPE FAILOVER_M FAI
------------- ---------- ---
NONE NONE NO
SELECT BASIC YES
NONE NONE NO
NONE NONE NO
NONE NONE NO
NONE NONE NO
6 rows selected.
将 CRM 服务重新定位到首选实例。恢复 devdb1 之后,CRM 服务不会自动重新定位到首选实例。您必须手动将服务重新定位到 devdb1。
rac1-> export ORACLE_SID=devdb1
rac1-> sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Sun Jul 20 17:24:54 2014
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to an idle instance.
SQL> startup;
ORACLE instance started.
Total System Global Area 272629760 bytes
Fixed Size 1266996 bytes
Variable Size 96471756 bytes
Database Buffers 171966464 bytes
Redo Buffers 2924544 bytes
Database mounted.
Database opened.
SQL> show parameter service;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
service_names string devdb
在rac2上执行
rac2-> export ORACLE_SID=devdb2
rac2-> sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Sun Jul 20 17:31:50 2014
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> show parameter service;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
service_names string CRM, devdb
SQL>
在rac1上手工切换
rac1-> srvctl relocate service -d devdb -s crm -i devdb2 -t devdb1
rac1-> sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Sun Jul 20 17:35:28 2014
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> show parameter service;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
service_names string CRM
SQL> alter system set service_names='CRM,devdb' scope=both
sid='devdb1';
System altered.
SQL> show parameter service;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
service_names string CRM,devdb
(刚开始为啥只有CRM,没有devdb,还有待于研究。所以我在这里是手工修改了service_names参数)
在rac2上执行:
rac2-> sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Sun Jul 20 17:39:03 2014
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> show parameter service;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
service_names string devdb
rac1上执行
rac1-> sqlplus sys/test1234@devdb1 as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Sun Jul 20 17:04:01 2014
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> show parameter service
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
service_names string CRM, devdb
rac2上执行
rac2-> sqlplus sys/test1234@devdb2 as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Sun Jul 20 17:04:59 2014
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> show parameter service;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
service_names string devdb
在rac1上用CRM服务连接:
rac1-> sqlplus sys/test1234@crm as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Sun Jul 20 17:08:15 2014
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> select instance_number instance#,instance_name,host_name,status from v$instance;
INSTANCE# INSTANCE_NAME
---------- ----------------
HOST_NAME STATUS
---------------------------------------------------------------- ------------
1 devdb1
rac1 OPEN
SQL> select failover_type,failover_method,failed_over from v$session where username='SYS';
FAILOVER_TYPE FAILOVER_M FAI
------------- ---------- ---
SELECT BASIC NO
NONE NONE NO
NONE NONE NO
NONE NONE NO
NONE NONE NO
NONE NONE NO
6 rows selected.
新打开一个putty,从其他会话中关闭该实例。在CRM所在的实例上以 sys 用户身份连接,并关闭该实例。
rac1-> export ORACLE_SID=devdb1
rac1-> sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Sun Jul 20 17:19:20 2014
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> select instance_number instance#,instance_name,host_name,status from v$instance;
INSTANCE# INSTANCE_NAME
---------- ----------------
HOST_NAME STATUS
---------------------------------------------------------------- ------------
1 devdb1
rac1 OPEN
SQL> shutdown abort;
ORACLE instance shut down.
验证会话已经完成故障切换:从先前打开的CRM 会话执行以下查询,以验证该会话已经故障切换到其他实例。
SQL> select instance_number instance#,instance_name,host_name,status from v$instance;
INSTANCE# INSTANCE_NAME
---------- ----------------
HOST_NAME STATUS
---------------------------------------------------------------- ------------
2 devdb2
rac2 OPEN
SQL> select failover_type,failover_method,failed_over from v$session where username='SYS';
FAILOVER_TYPE FAILOVER_M FAI
------------- ---------- ---
NONE NONE NO
SELECT BASIC YES
NONE NONE NO
NONE NONE NO
NONE NONE NO
NONE NONE NO
6 rows selected.
将 CRM 服务重新定位到首选实例。恢复 devdb1 之后,CRM 服务不会自动重新定位到首选实例。您必须手动将服务重新定位到 devdb1。
rac1-> export ORACLE_SID=devdb1
rac1-> sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Sun Jul 20 17:24:54 2014
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to an idle instance.
SQL> startup;
ORACLE instance started.
Total System Global Area 272629760 bytes
Fixed Size 1266996 bytes
Variable Size 96471756 bytes
Database Buffers 171966464 bytes
Redo Buffers 2924544 bytes
Database mounted.
Database opened.
SQL> show parameter service;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
service_names string devdb
在rac2上执行
rac2-> export ORACLE_SID=devdb2
rac2-> sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Sun Jul 20 17:31:50 2014
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> show parameter service;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
service_names string CRM, devdb
SQL>
在rac1上手工切换
rac1-> srvctl relocate service -d devdb -s crm -i devdb2 -t devdb1
rac1-> sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Sun Jul 20 17:35:28 2014
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> show parameter service;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
service_names string CRM
SQL> alter system set service_names='CRM,devdb' scope=both
sid='devdb1';
System altered.
SQL> show parameter service;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
service_names string CRM,devdb
(刚开始为啥只有CRM,没有devdb,还有待于研究。所以我在这里是手工修改了service_names参数)
在rac2上执行:
rac2-> sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Sun Jul 20 17:39:03 2014
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> show parameter service;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
service_names string devdb
相关文章推荐
- Oracle 10g RAC 在HP-UX v3+MC ServiceGuard环境的安装【转】
- 在vmware下安装redhat linux 5.4 环境与oracle 10g 数据库
- step by step 清理安装失败的oracle 10g RAC环境
- oracle 10g 11g rac 虚拟环境切换
- RMAN备份恢复系列1: Oracle 10g rac asm数据库恢复到10g单实例数据库
- Linux环境下手工创建Oracle 10g数据库
- Oracle 10g数据库迁移的经验 Windows环境
- 在vmware下安装redhat linux 5.4 环境与oracle 10g 数据库
- oracle技术之利用STANDBY将单实例数据库升级为RAC环境(二)
- Oracle 10g RAC 升级(CPU Update)之--升级数据库
- 图文详解安装NetBackup 6.5备份恢复Oracle 10g rac 数据库(修订)
- 在windows中搭建虚拟ASM环境创建Oracle 10G数据库
- Oracle 10g RAC 在HP-UX v3+MC ServiceGuard环境的安装【转】
- RedHat 5.6_x86_64 + ASM + RAW+ Oracle 10g RAC (七) 添加节点—初始化环境
- 解决字符串插入不能大于2000.(用的数据库环境为Oracle 9i; 10g不能大于4000)
- 图文详解安装NetBackup 6.5备份恢复Oracle 10g rac 数据库(修订)
- VMWARE上suse linux 10环境: Oracle 10g cluster+asm+rac安装流程
- 构建Oracle高可用环境HA rac:企业级高可用数据库架构、实战与经验总结
- RedHat EL5 安装Oracle 10g RAC之--系统环境配置(1)
- RedHat 5.6_x86_64 + ASM + RAW+ Oracle 10g RAC (九) 添加节点—安装数据库软件