realapplicationcluster,多个oracle实例,对应于一个存储,大家都说优点,我就来说缺点,更有价值,我又不是做广告的。\x0d\(1)性能可能差,如果不拆分应用,容易使得interconnect的网络流量加大,使得性能下降;\x0d\(2)一个实例修改数据库的表时,上的是块锁,不是行锁;\x0d\(3)事物不能无缝切换;\x0d\(4)价格贵的要死
两个节点,第一个节点能正常启动,但第二个节点报错。
无论是在集群还是在实例,都无法启动数据库实例。
[grid@m2 ~]$ srvctl start instance -d mdb -i mdb2
PRCR-1013 : 无法启动资源 oramdbdb
PRCR-1064 : 无法在节点 m2 上启动资源 oramdbdb
ORA-00203:
ORA-00202: : ''+DATA/mdb/controlfile/current268821031437''
CRS-2674: 未能启动 'oramdbdb' (在 'm2' 上)
[grid@m2 ~]$ pwd
/home/grid
[grid@m2 ~]$ ll
总计 4
drwxrwxr-x 3 grid oinstall 4096 07-15 15:35 oradiag_grid
[grid@m2 ~]$ pwd
/home/grid
[grid@m2 ~]$ srvctl status asm -n m1
ASM 正在 m1 上运行
[grid@m2 ~]$ srvctl status asm -n m2
ASM 正在 m2 上运行
ORA-03113: end-of-file on communication channel
使用相同的pfile启动。
SQL> startup pfile='/opt/app/oracle/product/1120/dbs/initmdb1ora';
ORACLE instance started
Total System Global Area 1607008256 bytes
Fixed Size 1336820 bytes
Variable Size 469764620 bytes
Database Buffers 1124073472 bytes
Redo Buffers 11833344 bytes
ORA-00203: using the wrong control files
ORA-00202: control file: '+DATA/mdb/controlfile/current268821031437'
NODE M2:
SQL> show parameter control
NAME TYPE
------------------------------------ ---------------------------------
VALUE
------------------------------
control_file_record_keep_time integer
7
control_files string
+DATA/mdb/controlfile/current
268821031437, +RECOVERY/mdb/c
ontrolfile/current2698210314
39
control_management_pack_access string
DIAGNOSTIC+TUNING
SQL>
NODE M1:
SQL> show parameter control
NAME TYPE
------------------------------------ ---------------------------------
VALUE
------------------------------
control_file_record_keep_time integer
7
control_files string
+DATA/mdb/controlfile/current
268821031437, +RECOVERY/mdb/c
ontrolfile/current2698210314
39
control_management_pack_access string
DIAGNOSTIC+TUNING
SQL>
怀疑是虚拟机中的磁盘设置问题,修改虚拟机文件
把 scsi0:1type="disk"
修改为:
scsi0:1shared="TRUE"
其它两项不变
scsi0:1virtualDev = "lsilogic"
scsi0:1SharedBus="Virtual"
所有共享磁盘修改后为:
scsi0:1virtualDev = "lsilogic"
scsi0:1sharedBus = "VIRTUAL"
scsi0:1shared="TRUE"
disklocking="FALSE"
========================================================
修改后,再启动实例,还是无法启动,报控制文件出错:
Connected to an idle instance
SQL> startup;
ORACLE instance started
Total System Global Area 1607008256 bytes
Fixed Size 1336820 bytes
Variable Size 520096268 bytes
Database Buffers 1073741824 bytes
Redo Buffers 11833344 bytes
ORA-00214: control file '+RECOVERY/mdb/controlfile/current269821031439'
version 1199 inconsistent with file
'+DATA/mdb/controlfile/current283821115539' version 522
SQL> show parameter spfile;
NAME TYPE
------------------------------------ ---------------------------------
VALUE
------------------------------
spfile string
+DATA/mdb/spfilemdbora
SQL> select instance_name from v$instance;
INSTANCE_NAME
------------------------------------------------
mdb1
SQL> show parameter spfile;
NAME TYPE
------------------------------------ ---------------------------------
VALUE
------------------------------
spfile string
+DATA/mdb/spfilemdbora
SQL> select instance_name from v$instance;
INSTANCE_NAME
------------------------------------------------
mdb1
SQL> create pfile from spfile;
File created
SQL> shutdown abort;
ORACLE instance shut down
SQL> exit
[oracle@m1 dbs]$ vi initmdb1ora
[oracle@m1 dbs]$ sqlplus / as sysdba
SQLPlus: Release 112010 Production on Thu Jul 18 15:24:51 2013
Copyright (c) 1982, 2009, Oracle All rights reserved
Connected to an idle instance
SQL> startup pfile='/opt/app/oracle/product/1120/dbs/initmdb1ora';
ORACLE instance started
Total System Global Area 1607008256 bytes
Fixed Size 1336820 bytes
Variable Size 520096268 bytes
Database Buffers 1073741824 bytes
Redo Buffers 11833344 bytes
Database mounted
Database opened
SQL>
[oracle@m1 dbs]$ rman target /
Recovery Manager: Release 112010 - Production on Thu Jul 18 15:29:09 2013
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 1607008256 bytes
Fixed Size 1336820 bytes
Variable Size 520096268 bytes
Database Buffers 1073741824 bytes
Redo Buffers 11833344 bytes
RMAN> restore controlfile to '+DATA' from '+RECOVERY/mdb/controlfile/current269821031439';
Starting restore at 2013-07-18 15:30:28
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=143 instance=mdb1 device type=DISK
channel ORA_DISK_1: copied control file copy
Finished restore at 2013-07-18 15:30:36
RMAN> restore controlfile to '+DATA' from '+RECOVERY/mdb/controlfile/current269821031439';
Starting restore at 2013-07-18 15:38:57
using channel ORA_DISK_1
channel ORA_DISK_1: copied control file copy
Finished restore at 2013-07-18 15:39:05
RMAN> exit
恢复控制文件的同时,可以在其它窗口看到增加的控制文件名称:
ASMCMD> ls
Current256820944177
Current268821031437
current282821115029
ASMCMD> ls
Current256820944177
Current268821031437
current282821115029
current283821115539
ASMCMD>
后面两个文件是这次恢复的。
修改pfile,添加进去:
control_files='+DATA/mdb/controlfile/current282821115029','+DATA/mdb/controlfile/current283821115539','+RECOVERY/mdb/controlfile/current269821031439'
再次使用pfile启动数据库后,建立spfile 文件。
SQL> startup pfile='/opt/app/oracle/product/1120/dbs/initmdb1ora';
ORACLE instance started
Total System Global Area 1607008256 bytes
Fixed Size 1336820 bytes
Variable Size 520096268 bytes
Database Buffers 1073741824 bytes
Redo Buffers 11833344 bytes
Database mounted
Database opened
SQL>
create spfile='+DATA/mdb/spfilemdbora' from pfile='/opt/app/oracle/product/1120/dbs/initmdb1ora';
修改pfile文件指定到新生成的共享磁盘中的spfile
[oracle@m1 dbs]$ cat initmdb1ora
SPFILE='+DATA/mdb/spfilemdbora'
[oracle@m1 dbs]$ sqlplus / as sysdba
SQLPlus: Release 112010 Production on Thu Jul 18 15:53:56 2013
Copyright (c) 1982, 2009, Oracle All rights reserved
Connected to an idle instance
SQL> startup;
ORACLE instance started
Total System Global Area 1607008256 bytes
Fixed Size 1336820 bytes
Variable Size 520096268 bytes
Database Buffers 1073741824 bytes
Redo Buffers 11833344 bytes
Database mounted
Database opened
SQL>
完成后,再另一个节点启动数据库实例:
[oracle@m2 dbs]$ sqlplus / as sysdba
SQLPlus: Release 112010 Production on Thu Jul 18 15:58:55 2013
Copyright (c) 1982, 2009, Oracle All rights reserved
Connected to an idle instance
SQL> startup;
ORACLE instance started
Total System Global Area 1607008256 bytes
Fixed Size 1336820 bytes
Variable Size 469764620 bytes
Database Buffers 1124073472 bytes
Redo Buffers 11833344 bytes
Database mounted
Database opened
SQL> create table tst_tbs(id number(10),prod_name varchar2(50));
Table created
SQL> insert into tst_tbs values(1,'test name');
1 row created
SQL> commit;
Commit complete
在另一个实例中可以看到刚才插入的数据。
SQL> select id,prod_name from tst_tbs;
ID
----------
PROD_NAME
--------------------------------------------------------------------------------
1
test name
SQL> select instance_name from v$instance;
INSTANCE_NAME
------------------------------------------------
mdb1
SQL>
在RAC中,看到数据库没启动起来,再次使用RAC的命令启动一下数据库,完成。
[grid@m1 ~]$ crs_stat -t
Name Type Target State Host
停机维护前,数据都expdp/impdp备用机
1 先停RAC数据库,然后关数据库服务器,最后关存储
2 先开存储,在开数据库服务器,开启数据库
一:关rac
1 Ensure that you are logged in as the oracle Linux/ UNIX user
su - oracle
$ emctl status dbconsole
2 Stop/ shut (stop) down all applications using the Oracle database
export ORACLE_UNQNAME=mxloan (export ORACLE_UNQNAME=GlobalUniqueName (database SID and not instance SID))
$ emctl stop dbconsole
3 Shut down (stop) all Oracle RAC instances on all nodes
$ORACLE_HOME/bin/srvctl stop database -d mxloan (-d 数据库名 this command is stoping all the instances)
4 Shut down (stop) all Oracle ASM instances on all nodes (If you are not using the ASM you must skip this step)
$ORACLE_HOME/bin/srvctl stop asm -n mxloan1 (-n 节点名)
$ORACLE_HOME/bin/srvctl stop asm -n mxloan2
5 Stop (shut down) the Oracle cluster stack
su - root
cd $CRS_HOME/bin
# /crsctl stop crs (must be run on each node)
/srvctl stop nodeapps -n node_name --> in 112 stops only ONS and eONS because of some dependencies
开机:
1
su - root
2
su - root
cd $CRS_HOME/bin
# /crsctl start crs (must be run on each node)
3
su - oracle
$ORACLE_HOME/bin/srvctl start asm -n mxloan1
$ORACLE_HOME/bin/srvctl start asm -n mxloan2
4
$ srvctl start database -d mxloan (srvctl from ORACLE_HOME) (this command is starting all the instances)
5
$ emctl start dbconsole
-------------------------------------------------
其他启停版本
总结
停止RAC: 先停库(实例),然后ASM ,最后apps
emctl stop dbconsole
srvctl stop instance -d rac -i rac1
srvctl stop instance -d rac -i rac2
srvctl stop asm -n rac1
srvctl stop asm -n rac2
srvctl stop nodeapps -n rac1
srvctl stop nodeapps -n rac2
启动RAC:
和上面的步骤正好相反即
srvctl start nodeapps -n rac1
srvctl start nodeapps -n rac2
srvctl start asm -n rac1
srvctl start asm -n rac2
srvctl start instance -d rac -i rac2
srvctl start instance -d rac -i rac1
emctl start dbconsole
milipp启停版本(10g)
$crs_stat stop/start z 启停资源
$/crs_stop -all --停止集群所有资源 或单个资源
$/crs_start -all --开启集群所有资源 或单个资源
本节点关闭crs服务 需要root用户身份
#/app/oracle/product/10021/crs/bin/crsctl stop crs
#/etc/initd/initcrs stop/start 启停资源
============================================
重启后服务
服务端
service tgtd start
service iscsid start
service iscsi start
tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL
iscsiadm -m discovery -t sendtargets -p 1921680253 -l
客户端
service iscsi start
iscsiadm -m discovery -t sendtargets -p 1921680253 -l
stu253 & stu15 :
fdisk -l
partprobe
start_udev
ll /dev/raw/
raw -qa
服务端重启ntp服务:
service ntpd status
重启 iscsi 和多路径服务
askmaclean
10204以后vip不会自动relocate back回原节点, 原因是ORACLE开发人员发现在实际使用中会遇到这样的情况: relocate back回原节点 需要停止VIP并在原始节点再次启动该VIP,但是如果原始节点上的公共网络仍不可用,则这个relocate的尝试将再次失败而failover到第二节点。 在此期间VIP将不可用,所以从10204和111开始,默认的实例检查将不会自动relocate vip到原始节点。
详细见下面的Note介绍:
Applies to:Oracle Server – Enterprise Edition – Version 10204 to 11107 [Release 102 to 111]Information in this document applies to any platformSymptoms
Starting from 10204 and 111, VIP does not fail-over back to the original node even after the public network problem is resolved This behavior is the default behavior in 10204 and 111 and is different from that of 10203Cause
This is actually the default default behavior in 10204 and 111
解决办法:
rac1:
SQL> show parameter local_listener
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string (DESCRIPTION=(ADDRESS_LIST=(AD
DRESS=(PROTOCOL=TCP)(HOST=rac1
-vip)(PORT=1521))))
SQL> alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=1921682111)(PORT=1521))))' scope=both sid='orcl1';
SQL> alter system register;
rac2:
SQL> show parameter local_listener
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string (DESCRIPTION=(ADDRESS_LIST=(AD
DRESS=(PROTOCOL=TCP)(HOST=rac2
-vip)(PORT=1521))))
SQL> alter system set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=1921682112)(PORT=1521))))' scope=both sid='orcl2';
SQL> alter system register;
随后使用windows客户端连接成功:
C:\Users\WJW>sqlplus system/qweasd@1921682200:1521/orcl
SQLPlus: Release 112010 Production on Thu May 17 13:14:39 2012
Copyright (c) 1982, 2010, Oracle All rights reserved
Connected to:
Oracle Database 11g Enterprise Edition Release 112010 - Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
以上就是关于oracle数据库RAC是什么全部的内容,包括:oracle数据库RAC是什么、Oracle 12c RAC,其中一个节点数据库实例起不来,怎么办、oracle10双机rac停机等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)