本文主要是介绍Oracle高可用部分书面作业 - 第三课 RAC-日常管理,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1.演示启动和关闭crs主进程。
启动crs主进程:
[root@rac3 ~]# /etc/init.d/init.crs start
Startup will be queued to init within 90 seconds.
[root@rac3 ~]#
[root@rac3 ~]# /opt/ora10g/product/10.2.0/crs_1/bin/crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy
[root@rac3 ~]#
关闭crs主进程:
[root@rac3 ~]# /etc/init.d/init.crs stop
Shutting down Oracle Cluster Ready Services (CRS):
Stopping resources.
Successfully stopped CRS resources
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
Shutdown has begun. The daemons should exit soon.
[root@rac3 ~]#
2.查看OCR磁盘的信息,并打印出OCR磁盘的内容。
[oracle@rac3 dbs]$ ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 104344
Used space (kbytes) : 3820
Available space (kbytes) : 100524
ID : 1742158402
Device/File Name : /dev/raw/raw1
Device/File integrity check succeeded
Device/File not configured
Cluster registry integrity check succeeded
[oracle@rac3 dbs]$
[oracle@rac3 dbs]$ ocrdump -stdout | head
07/07/2013 15:52:06
ocrdump -stdout
[SYSTEM]
UNDEF :
SECURITY : {USER_PERMISSION : PROCR_ALL_ACCESS, GROUP_PERMISSION : PROCR_READ, OTHER_PERMISSION : PROCR_READ, USER_NAME : root, GROUP_NAME : root}
[SYSTEM.css]
UNDEF :
SECURITY : {USER_PERMISSION : PROCR_ALL_ACCESS, GROUP_PERMISSION : PROCR_READ, OTHER_PERMISSION : PROCR_READ, USER_NAME : root, GROUP_NAME : root}
[oracle@rac3 dbs]$
3.查看voting disk磁盘信息。
[oracle@rac3 dbs]$ crsctl query css votedisk
0. 0 /dev/raw/raw2
located 1 votedisk(s).
[oracle@rac3 dbs]$
4.用srvctl分别启动ASM,数据库实例和数据库。
启动ASM:
[oracle@rac3 dbs]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....SM1.asm application OFFLINE OFFLINE
ora....C3.lsnr application ONLINE ONLINE rac3
ora.rac3.gsd application ONLINE ONLINE rac3
ora.rac3.ons application ONLINE ONLINE rac3
ora.rac3.vip application ONLINE ONLINE rac3
ora....SM2.asm application OFFLINE OFFLINE
ora....C4.lsnr application ONLINE ONLINE rac4
ora.rac4.gsd application ONLINE ONLINE rac4
ora.rac4.ons application ONLINE ONLINE rac4
ora.rac4.vip application ONLINE ONLINE rac4
ora.racdb.db application OFFLINE OFFLINE
ora....b1.inst application OFFLINE OFFLINE
ora....b2.inst application OFFLINE OFFLINE
[oracle@rac3 dbs]$ srvctl start asm -n rac3
[oracle@rac3 dbs]$ srvctl start asm -n rac4
[oracle@rac3 dbs]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....SM1.asm application ONLINE ONLINE rac3
ora....C3.lsnr application ONLINE ONLINE rac3
ora.rac3.gsd application ONLINE ONLINE rac3
ora.rac3.ons application ONLINE ONLINE rac3
ora.rac3.vip application ONLINE ONLINE rac3
ora....SM2.asm application ONLINE ONLINE rac4
ora....C4.lsnr application ONLINE ONLINE rac4
ora.rac4.gsd application ONLINE ONLINE rac4
ora.rac4.ons application ONLINE ONLINE rac4
ora.rac4.vip application ONLINE ONLINE rac4
ora.racdb.db application OFFLINE OFFLINE
ora....b1.inst application OFFLINE OFFLINE
ora....b2.inst application OFFLINE OFFLINE
[oracle@rac3 dbs]$
启动数据库实例:
[oracle@rac3 dbs]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....SM1.asm application ONLINE ONLINE rac3
ora....C3.lsnr application ONLINE ONLINE rac3
ora.rac3.gsd application ONLINE ONLINE rac3
ora.rac3.ons application ONLINE ONLINE rac3
ora.rac3.vip application ONLINE ONLINE rac3
ora....SM2.asm application ONLINE ONLINE rac4
ora....C4.lsnr application ONLINE ONLINE rac4
ora.rac4.gsd application ONLINE ONLINE rac4
ora.rac4.ons application ONLINE ONLINE rac4
ora.rac4.vip application ONLINE ONLINE rac4
ora.racdb.db application OFFLINE OFFLINE
ora....b1.inst application OFFLINE OFFLINE
ora....b2.inst application OFFLINE OFFLINE
[oracle@rac3 dbs]$ srvctl start instance -d racdb -i racdb1
[oracle@rac3 dbs]$ srvctl start instance -d racdb -i racdb2
[oracle@rac3 dbs]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....SM1.asm application ONLINE ONLINE rac3
ora....C3.lsnr application ONLINE ONLINE rac3
ora.rac3.gsd application ONLINE ONLINE rac3
ora.rac3.ons application ONLINE ONLINE rac3
ora.rac3.vip application ONLINE ONLINE rac3
ora....SM2.asm application ONLINE ONLINE rac4
ora....C4.lsnr application ONLINE ONLINE rac4
ora.rac4.gsd application ONLINE ONLINE rac4
ora.rac4.ons application ONLINE ONLINE rac4
ora.rac4.vip application ONLINE ONLINE rac4
ora.racdb.db application ONLINE ONLINE rac4
ora....b1.inst application ONLINE ONLINE rac3
ora....b2.inst application ONLINE ONLINE rac4
[oracle@rac3 dbs]$
启动数据库:
[oracle@rac3 dbs]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....SM1.asm application ONLINE ONLINE rac3
ora....C3.lsnr application ONLINE ONLINE rac3
ora.rac3.gsd application ONLINE ONLINE rac3
ora.rac3.ons application ONLINE ONLINE rac3
ora.rac3.vip application ONLINE ONLINE rac3
ora....SM2.asm application ONLINE ONLINE rac4
ora....C4.lsnr application ONLINE ONLINE rac4
ora.rac4.gsd application ONLINE ONLINE rac4
ora.rac4.ons application ONLINE ONLINE rac4
ora.rac4.vip application ONLINE ONLINE rac4
ora.racdb.db application OFFLINE OFFLINE
ora....b1.inst application OFFLINE OFFLINE
ora....b2.inst application OFFLINE OFFLINE
[oracle@rac3 dbs]$ srvctl start database -d racdb
[oracle@rac3 dbs]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....SM1.asm application ONLINE ONLINE rac3
ora....C3.lsnr application ONLINE ONLINE rac3
ora.rac3.gsd application ONLINE ONLINE rac3
ora.rac3.ons application ONLINE ONLINE rac3
ora.rac3.vip application ONLINE ONLINE rac3
ora....SM2.asm application ONLINE ONLINE rac4
ora....C4.lsnr application ONLINE ONLINE rac4
ora.rac4.gsd application ONLINE ONLINE rac4
ora.rac4.ons application ONLINE ONLINE rac4
ora.rac4.vip application ONLINE ONLINE rac4
ora.racdb.db application ONLINE ONLINE rac3
ora....b1.inst application ONLINE ONLINE rac3
ora....b2.inst application ONLINE ONLINE rac4
[oracle@rac3 dbs]$
停止过程:
实例与数据库
[oracle@rac3 dbs]$ srvctl stop database -d racdb
[oracle@rac3 dbs]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....SM1.asm application ONLINE ONLINE rac3
ora....C3.lsnr application ONLINE ONLINE rac3
ora.rac3.gsd application ONLINE ONLINE rac3
ora.rac3.ons application ONLINE ONLINE rac3
ora.rac3.vip application ONLINE ONLINE rac3
ora....SM2.asm application ONLINE ONLINE rac4
ora....C4.lsnr application ONLINE ONLINE rac4
ora.rac4.gsd application ONLINE ONLINE rac4
ora.rac4.ons application ONLINE ONLINE rac4
ora.rac4.vip application ONLINE ONLINE rac4
ora.racdb.db application OFFLINE OFFLINE
ora....b1.inst application OFFLINE OFFLINE
ora....b2.inst application OFFLINE OFFLINE
[oracle@rac3 dbs]$
asm
[oracle@rac3 dbs]$ srvctl stop asm -n rac3
[oracle@rac3 dbs]$ srvctl stop asm -n rac4
[oracle@rac3 dbs]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....SM1.asm application OFFLINE OFFLINE
ora....C3.lsnr application ONLINE ONLINE rac3
ora.rac3.gsd application ONLINE ONLINE rac3
ora.rac3.ons application ONLINE ONLINE rac3
ora.rac3.vip application ONLINE ONLINE rac3
ora....SM2.asm application OFFLINE OFFLINE
ora....C4.lsnr application ONLINE ONLINE rac4
ora.rac4.gsd application ONLINE ONLINE rac4
ora.rac4.ons application ONLINE ONLINE rac4
ora.rac4.vip application ONLINE ONLINE rac4
ora.racdb.db application OFFLINE OFFLINE
ora....b1.inst application OFFLINE OFFLINE
ora....b2.inst application OFFLINE OFFLINE
[oracle@rac3 dbs]$
5.分别查看RAC的参数文件,REDO日志,UNDO表空间,TEMP表空间的信息,说明一下在RAC环境下每个实例是否拥有专属自己的上述对象。
参数文件:
SQL> show parameter pfile
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string +DATE/racdb/spfileracdb.ora
SQL>
[oracle@rac3 dbs]$ cat initracdb1.ora
SPFILE='+DATE/racdb/spfileracdb.ora'
[oracle@rac3 dbs]$
REDO日志:
SQL> select INST_ID,GROUP#,THREAD#,SEQUENCE# from gv$log ;
INST_ID GROUP# THREAD# SEQUENCE#
---------- ---------- ---------- ----------
1 1 1 27
1 2 1 26
1 3 2 3
1 4 2 4
2 1 1 27
2 2 1 26
2 3 2 3
2 4 2 4
8 rows selected.
SQL> select inst_id, group#, member from gv$logfile;
INST_ID GROUP# MEMBER
------- ---------- --------------------------------------------------
1 1 +DATE/racdb/onlinelog/group_1.269.799790615
1 2 +DATE/racdb/onlinelog/group_2.270.799790615
1 3 +DATE/racdb/onlinelog/group_3.264.799791933
1 4 +DATE/racdb/onlinelog/group_4.263.799791933
2 1 +DATE/racdb/onlinelog/group_1.269.799790615
2 2 +DATE/racdb/onlinelog/group_2.270.799790615
2 3 +DATE/racdb/onlinelog/group_3.264.799791933
2 4 +DATE/racdb/onlinelog/group_4.263.799791933
8 rows selected.
SQL>
UNDO表空间:
SQL> select inst_id,name,value from gv$parameter where name like '%undo_tab%';
INST_ID NAME VALUE
------- -------------------- --------------------
1 undo_tablespace UNDOTBS1
2 undo_tablespace UNDOTBS2
SQL>
TEMP表空间:
SQL> select file_name,tablespace_name from dba_temp_files ;
FILE_NAME TABLESPACE
-------------------------------------------------- ----------
+DATE/racdb/tempfile/temp.274.799790627 TEMP
SQL>
综上可见,RAC环境下每个实例独有undo表空间和redo日志,共享参数文件和temp表空间。
这篇关于Oracle高可用部分书面作业 - 第三课 RAC-日常管理的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!