Oracle RAC Daily Management Command ____oracle

Source: Internet
Author: User
Tags taf oracle database
First, view RAC Environment

RAC Architecture, 2 node information

Node 1

Sql> Show Parameter instance

NAME TYPE VALUE

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

Active_instance_count integer

Cluster_database_instances Integer 2

Instance_groups string

instance_name string RACDB1

Instance_number Integer 1

Instance_type string RDBMS

Open_links_per_instance Integer 4

Parallel_instance_group string

Parallel_server_instances Integer 2

Node 2

Sql> Show Parameter instance,

NAME TYPE VALUE

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

Active_instance_count integer

Cluster_database_instances Integer 2

Instance_groups string

instance_name string RACDB2

Instance_number Integer 2

Instance_type string RDBMS

Open_links_per_instance Integer 4

Parallel_instance_group string

Parallel_server_instances Integer 2

Database version

Sql> select * from V$version;

BANNER

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

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0-prod

Pl/sql Release 10.2.0.1.0-production

CORE 10.2.0.1.0 Production

TNS for Linux:version 10.2.0.1.0-production

Nlsrtl Version 10.2.0.1.0-production

Operating System Information

Node 1

[Oracle@rac1 ~]$ Uname-a

Linux Rac1 2.6.18-53.el5 #1 SMP Wed Oct 16:34:02 EDT 2007 i686 i686 i386 Gnu/linux

Node 2

[Oracle@rac2 ~]$ Uname-a

Linux rac2 2.6.18-53.el5 #1 SMP Wed Oct 16:34:02 EDT 2007 i686 i686 i386 Gnu/linux

[Oracle@leonarding1 admin]$ Uname-a

Linux leonarding1.oracle.com 2.6.32-200.13.1.el5uek #1 SMP Wed 21:02:33 EDT x86_64 x86_64 x86_64 gnu/linux

RAC All resource Information

[Oracle@rac2 ~]$ Crs_stat-t

Name Type Target State Host

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

Ora ..... B1.inst Application Online Online Rac1

Ora ..... B2.inst Application Online Online RAC2

Ora ..... DB1.SRV Application Online Online RAC2

Ora ..... TAF.cs Application Online Online RAC2

Ora. Racdb.db Application Online Online RAC2

Ora ..... Sm1.asm Application Online Online Rac1

Ora ..... C1.lsnr Application Online Online Rac1

ORA.RAC1.GSD Application Online Online Rac1

Ora.rac1.ons Application Online Online Rac1

ORA.RAC1.VIP Application Online Online Rac1

Ora ..... Sm2.asm Application Online Online RAC2

Ora ..... C2.lsnr Application Online Online RAC2

ORA.RAC2.GSD Application Online Online RAC2

Ora.rac2.ons Application Online Online RAC2

ORA.RAC2.VIP Application Online Online RAC2

two starting and shutting down the CRS master process

(1) Simply talk about the content of the daily management of RAC

1. Nodes Management: node day-to-day management

2. Network management: For example, NIC configuration VIP virtual IP external network Internal network

3. Cluster Management: CRS Cluster resource management OCR Oracle Cluster Registry SRV service management Votedisk voting disk

4. Application Management: Databases, instances, listeners, virtual IP, various resources registered to RAC

(2) RAC cluster daemon

[Oracle@rac1 init.d]$ pwd

/etc/init.d

[Oracle@rac1 init.d]$ ll | grep init*

init.crsd:# Init.crsd-control script for the CRS daemon.

init.crsd:# is invoked from Init.crs or from Inittab.

init.crsd:# No Manual invocation of INIT.CRSD is supported.

init.crsd:# or on a automatic startup, this file is exist. INIT.CRSD Run would

init.cssd:# directory. It should is invoked from Init.crs.

init.evmd:# is invoked from Init.crs.

[Oracle@rac1 init.d]$ ls init*

Init.crs INIT.CRSD INIT.CSSD INIT.EVMD

These are the RAC Cluster daemons, which are stored in a Linux boot-initiated script directory and can be started with the operating system.

./init.crs start starts the cluster process

./init.crs stop stopping the cluster process

./init.crs enable starts with the operating system

./init.crs disable does not start with the operating system

Note: The Init.crs script is a boot script for the INIT.CRSD init.cssd INIT.EVMD script

CRS Main Process

(1) CRSD
Responsible for managing HA high reliability operations
Manage CRS resources, such as LINSTENER,VIP,ONS,GSN, etc.
Managed by root user, boot
(2) OCSSD
Manage the relationships of each node, and use it for communication between nodes
Run administration by Oracle users
(3) Oprocd
Cluster process Management-process monitor for the cluster. Cluster monitoring process
Run only in the state of the cluster software without using vendor
(4) EVMD
Event detection process, run by Oracle User management
(5) Main log location
$ORA _crs_home/log/Node host name (Rac1 RAC2)/RACG node log
$ORA _crs_home/log/Node host name (Rac1 RAC2)/CRSD cluster software log
$ORA _crs_home/crs/init
$ORA log of communication between _crs_home/css/log nodes
$ORA _crs_home/css/init
$ORA _crs_home/evm/log Event Monitoring log
$ORA _crs_home/evm/init
$ORA _crs_home/srvm/log

Demonstrate

[Oracle@rac1 init.d]$ Su–root must perform a RAC cluster script with root user

Password:

[Root@rac1 ~]# CD/ETC/INIT.D

[Root@rac1 init.d]#./init.crs Disable

Automatic startup disabled for system boot.

[Root@rac1 init.d]#./init.crs Enable

Automatic startup enabled for system boot.

[Root@rac1 init.d]#./init.crs Stop the CRS main process

Shutting down Oracle Cluster Ready Services (CRS):

Stopping resources.

Successfully stopped CRS resources contains CRSD

Stopping CSSD.

Shutting down CSS daemon. Contains CSSD

Shutdown request successfully issued.

Shutdown has begun. The daemons should exit soon.

[Root@rac1 init.d]#./init.crs start the CRS master process

The startup will is queued to init within seconds. Start up in 90 seconds.

[Root@rac1 init.d]# Crs_stat-t

Name Type Target State Host

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

Ora ..... B1.inst Application Online Online Rac1

Ora ..... B2.inst Application Online Online RAC2

Ora ..... DB1.SRV Application Online Online RAC2

Ora ..... TAF.cs Application Online Online RAC2

Ora. Racdb.db Application Online Online RAC2

Ora ..... Sm1.asm Application Online Online Rac1

Ora ..... C1.lsnr Application Online Online Rac1

ORA.RAC1.GSD Application Online Online Rac1

Ora.rac1.ons Application Online Online Rac1

ORA.RAC1.VIP Application Online Online Rac1

Ora ..... Sm2.asm Application Online Online RAC2

Ora ..... C2.lsnr Application Online Online RAC2

ORA.RAC2.GSD Application Online Online RAC2

Ora.rac2.ons Application Online Online RAC2

ORA.RAC2.VIP Application Online Online RAC2

Wait for a while not necessarily 90 seconds, CRS cluster resources are all started

(3) RAC cluster command set directory

$ORACLE _home/crs_1/bin

All cluster commands are placed in this directory

(4) node layer command

[Oracle@rac1 init.d]$ Olsnodes-n

Rac1 1

RAC2 2

[Oracle@rac1 init.d]$ Olsnodes-n-P

Rac1 1 Rac1-priv

RAC2 2 Rac2-priv

[Oracle@rac1 init.d]$ olsnodes-n-p-i

Rac1 1 Rac1-priv RAC1-VIP

RAC2 2 Rac2-priv RAC2-VIP

This command is used to display information about the cluster nodes

Parameter explanation: N Print node number

P Print Private Network Name

I print virtual IP

(2) Network layer command

[Oracle@rac1 init.d]$ oifcfgoracle NIC Configuration Tool

Name:

Oifcfg-oracle Interface Configuration Tool.

Usage:oifcfg iflist [-P [-N]]

Oifcfg setif {-node <nodename> |-global} {<if_name>/<subnet>:<if_type>}

Oifcfg getif [-node <nodename> |-global] [-if <if_name>[/<subnet>] [-type <if_type>]]

Oifcfg delif [-node <nodename> |-global] [<IF_NAME>[/<SUBNET>]]

oifcfg [-help]

<nodename>-Name of the host, as known to a communications network

<if_name>-Name by which the interface was configured in the system

<subnet>-subnet address of the interface

<if_type>-type of the interface {cluster_interconnect | public | storage}

[Oracle@rac1 init.d]$ oifcfg iflist View network segment corresponding to network card, Oracle network adapter Configuration Tool

Eth0 192.168.1.0

Eth1 192.168.2.0

Eth2 192.168.61.0

$ oifcfg getif is not configured before what content is not

$ oifcfg Setif-global Eth0/192.168.1.0:publicoracle Network Adapter Configuration Tool specify public network card

$ oifcfg Setif-global Eth1/192.168.2.0:cluster_interconnectoracle Network adapter Configuration tool Specify private network

[Oracle@rac1 init.d]$ oifcfg getif Get configuration results

The eth0 192.168.1.0 Global Publiceth0 is a global public network adapter

Eth1 192.168.2.0 Global Cluster_interconnecteth1 is a globally private network card

three view OCR disk information and print out the contents of the OCR disk

OCR: Known as the Oracle Cluster registry, there are at least 2 OCR disks mirrored in the general RAC Cluster, and all resource information in the cluster is registered in OCR (database instance listener VIP OCR disk Voting disk Service Node application network card, etc.)

We can use the Ocrcheck command to check OCR disk status

Node 1

racdb1@rac1/home/oracle$ Ocrcheck

Status of Oracle Cluster Registry is as follows:

Version:2

Total spaces (Kbytes): 104344 Overall space

Used Space (Kbytes): 4324 usage

Available Space (Kbytes): 100020 Left

id:1752469369

Device/file Name:/DEV/RAW/RAW1 disk Path

Device/file Integrity Check Succeeded

Device/file Not Configured

Cluster Registry Integrity Check succeeded

Node 2

racdb2@rac2/home/oracle$ Ocrcheck

Status of Oracle Cluster Registry is as follows:

Version:2

Total Space (Kbytes): 104344

Used Space (Kbytes): 4324

Available Space (Kbytes): 100020

id:1752469369

Device/file Name:/DEV/RAW/RAW1

Device/file Integrity Check Succeeded

Device/file Not Configured

Cluster Registry Integrity Check succeeded

Use the Ocrdump command to view OCR content, but this command cannot be used for OCR backup recovery only for reading

racdb1@rac1/home/oracle$ Ocrdump-stdout | More

[SYSTEM.evm.acceptor]

UNDEF:

Security: {user_permission:procr_all_access, Group_permission:procr_read, Other_permission:procr_read, USER_NAME: Root, Group_name:root}

[SYSTEM.EVM.ACCEPTOR.RAC1]

Oratext: (address= (PROTOCOL=IPC) (KEY=ARAC1_CRS_EVM))

Security: {user_permission:procr_all_access, Group_permission:procr_read, Other_permission:procr_read, USER_NAME: Root, Group_name:root}

[SYSTEM.EVM.ACCEPTOR.RAC2]

Oratext: (address= (PROTOCOL=IPC) (KEY=ARAC2_CRS_EVM))

Security: {user_permission:procr_all_access, Group_permission:procr_read, Other_permission:procr_read, USER_NAME: Root, Group_name:root}

Use the Ocrconfig command to configure the maintenance of OCR disks, such as exporting backup ocrdump files and then importing to restore OCR

[Oracle@rac1 init.d]$ Su-root

Password:

[Root@rac1 ~]# Cd/home/oracle

[Root@rac1 oracle]# LL

Total 4

Drwxr-xr-x 3 Oracle Oinstall 4096 June 5 2013 Desktop

[Root@rac1 oracle]# ocrconfig-export ocr_bk.dmp Export OCR disk content, once there is a problem can import recovery

[Root@rac1 oracle]# LL

Total 104

Drwxr-xr-x 3 Oracle Oinstall 4096 June 5 2013 Desktop

-rw-r--r--1 root root 97517 June 4 17:57 Ocr_bk.dmp

[Root@rac1 oracle]# strings ocr_bk.dmp can use this command to view the contents of the dump file

[Root@rac1 oracle]# ocrconfig-import ocr_bk.dmp Import dump file Recovery OCR

[Root@rac1 oracle]# ocrconfig–replace ocrmirror/dev/raw/raw2 Create a new OCR disk image

Four, view voting disk information

Voting disk This file is mainly used to record node member State, in the presence of brain crack, the decision that partion gain control, the other partion must be removed from the cluster. Voting disk uses a "Most available algorithm", if there are multiple voting disk, you must be more than half of the votedisk at the same time to survive, Clusterware normal use. For example, CONFIGURED 4 Votedisk, bad a votedisk, the cluster can work properly, if 2 broken, can not meet more than half of the cluster will immediately go down, all nodes immediately restart, so if you add votedisk, try not only to add one, but should add 2, The total number is guaranteed to be odd.

(1) Voting disk check, must be singular <

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.