Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the basic maintenance commands for Oracle RAC

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Today, I will talk to you about the basic maintenance commands of Oracle RAC, which may not be well understood by many people. in order to make you understand better, the editor has summarized the following contents for you. I hope you can get something according to this article.

Oracle RAC daily basic maintenance command

Status of all instances and services

$srvctl status database-d orcl

Instance orcl1 is running on node linux1

Instance orcl2 is running on node linux2

Status of a single instance

$srvctl status instance-d orcl-I orcl2

Instance orcl2 is running on node linux2

Status of the global naming service in the database

$srvctl status service-d orcl-s orcltest

Service orcltest is running on instance (s) orcl2, orcl1

The status of the node application on a specific node

$srvctl status nodeapps-n linux1

VIP is running on node: linux1

GSD is running on node: linux1

Listener is running on node: linux1

ONS daemon is running on node: linux1

Status of ASM instance

$srvctl status asm-n linux1

ASM instance + ASM1 is running on node linux1.

List all configured databases

$srvctl config database

Orcl

Displays the configuration of the RAC database

$srvctl config database-d orcl

Linux1 orcl1 / u01/app/oracle/product/10.2.0/db_1

Linux2 orcl2 / u01/app/oracle/product/10.2.0/db_1

Displays all services for the specified cluster database

$srvctl config service-d orcl

Orcltest PREF: orcl2 orcl1 AVAIL:

Displays the configuration of the node application-(VIP, GSD, ONS, listener)

$srvctl config nodeapps-n linux1-a-g-s-l

VIP exists.: / linux1-vip/192.168.1.200/255.255.255.0/eth0:eth2

GSD exists.

ONS daemon exists.

Listener exists.

Displays the configuration of the ASM instance

$srvctl config asm-n linux1

+ ASM1 / u01/app/oracle/product/10.2.0/db_1

All running instances in the cluster

SELECT

Inst_id

, instance_number inst_no

, instance_name inst_name

, parallel

, status

, database_status db_status

, active_state state

, host_name host

FROM gv$instance

ORDER BY inst_id

INST_ID INST_NO INST_NAME PAR STATUS DB_STATUS STATE HOST

-

1 1 orcl1 YES OPEN ACTIVE NORMAL rac1

2 2 orcl2 YES OPEN ACTIVE NORMAL rac2

All data files located in the disk group

Select name from v$datafile

Union

Select member from v$logfile

Union

Select name from v$controlfile

Union

Select name from v$tempfile

NAME

+ FLASH_RECOVERY_AREA/orcl/controlfile/current.258.570913191

+ FLASH_RECOVERY_AREA/orcl/onlinelog/group_1.257.570913201

+ FLASH_RECOVERY_AREA/orcl/onlinelog/group_2.256.570913211

+ FLASH_RECOVERY_AREA/orcl/onlinelog/group_3.259.570918285

+ FLASH_RECOVERY_AREA/orcl/onlinelog/group_4.260.570918295

+ ORCL_DATA1/orcl/controlfile/current.259.570913189

+ ORCL_DATA1/orcl/datafile/example.257.570913311

+ ORCL_DATA1/orcl/datafile/indx.270.570920045

+ ORCL_DATA1/orcl/datafile/sysaux.260.570913287

+ ORCL_DATA1/orcl/datafile/system.262.570913215

+ ORCL_DATA1/orcl/datafile/undotbs1.261.570913263

+ ORCL_DATA1/orcl/datafile/undotbs1.271.570920865

+ ORCL_DATA1/orcl/datafile/undotbs2.265.570913331

+ ORCL_DATA1/orcl/datafile/undotbs2.272.570921065

+ ORCL_DATA1/orcl/datafile/users.264.570913355

+ ORCL_DATA1/orcl/datafile/users.269.570919829

+ ORCL_DATA1/orcl/onlinelog/group_1.256.570913195

+ ORCL_DATA1/orcl/onlinelog/group_2.263.570913205

+ ORCL_DATA1/orcl/onlinelog/group_3.266.570918279

+ ORCL_DATA1/orcl/onlinelog/group_4.267.570918289

+ ORCL_DATA1/orcl/tempfile/temp.258.570913303

21 rows selected.

All ASM disks belonging to the "ORCL_DATA1" disk group

SELECT path

FROM v$asm_disk

WHERE group_number IN (select group_number

From v$asm_diskgroup

Where name = 'ORCL_DATA1')

PATH

-

ORCL:VOL1

ORCL:VOL2

Start / stop RAC cluster

Make sure you are logged in as the oracle UNIX user. We will run all commands from the rac1 node:

# su-oracle

$hostname

Rac1

Stop the Oracle RAC 10g environment

The first step is to stop the Oracle instance. When this instance (and related services) is shut down, shut down the ASM instance. Finally, close the node applications (virtual IP, GSD, TNS listeners, and ONS).

$export ORACLE_SID=orcl1

$emctl stop dbconsole

$srvctl stop instance-d orcl-I orcl1

$srvctl stop asm-n rac1

$srvctl stop nodeapps-n rac1

Start the Oracle RAC 10g environment

The first step is to start the node application (virtual IP, GSD, TNS listener, and ONS). When the node application is started successfully, start the ASM instance. Finally, start the Oracle instance (and related services) and the Enterprise Manager database console.

$export ORACLE_SID=orcl1

$srvctl start nodeapps-n rac1

$srvctl start asm-n rac1

$srvctl start instance-d orcl-I orcl1

$emctl start dbconsole

Start / stop all instances using SRVCTL

Start / stop all instances and their enabled services. I just thought it was interesting to add this step as a way to shut down all instances!

$srvctl start database-d orcl

$srvctl stop database-d orcl

Start and stop monitoring

Hostb$lsnrctl start listener_hostb

Hostb$lsnrctl stop listener_hostb backup votning diskdd if=voting_disk_name f=backup_file_name

Dd if=/dev/rdsk/c4t600C0FF000000000098ADE240330A000d0s4 f=votingdisk.bak# dd if=/dev/zero f=/dev/rdsk/c4t600C0FF000000000098ADE240330A000d0s4 bs=512 count=261120

test

# dd if=/dev/rdsk/c4t600C0FF000000000098ADE240330A000d0s4 f=/data/backup/rac/vd_backup0420.bak

261120000 record entry

261120: 0 record call-out

# cd / data/backup/rac

# ls

Ocr0420.bak ocrdisk vd_backup0420.bak votingdisk.bak votingdisk0420.bak

# dd if=/data/backup/rac/vd_backup0420.bak f=/dev/rdsk/c4t600C0FF000000000098ADE240330A000d0s4

261120000 record entry

261120: 0 record call up backup OCR disk

View backup

$ocrconfig-showbackup

Backup

/ data/oracle/crs/bin/ocrconfig-export / data/backup/rac/ocrdisk.bak

Restore requires stopping all nodes, Stop the Oracle Clusterware software on all of the nodes

/ data/oracle/crs/bin/ocrconfig-import file_name

Restore of automatic backup # / data/oracle/crs/bin/ocrconfig-showbackup

# / data/oracle/crs/bin/ocrconfig-restore / data/oracle/crs/cdata/db168crs/backup00.ocrhosta$cluvfy comp ocr-n all / / Verification

Ocr check

# ocrcheck configuration path is located in

If you need to change the path configuration of the OCR disk in the / var/opt/oracle/ocrconfig_loc file.

OCR disk space check

# / data/oracle/crs/bin/ocrcheck

Status of Oracle Cluster Registry is as follows:

Version: 2

Total space (kbytes): 399752

Used space (kbytes): 3784

Available space (kbytes): 395968

ID: 148562961

Device/File Name: / dev/rdsk/c4t600C0FF000000000098ADE240330A000d0s5

Device/File integrity check succeeded Device/File not configured Cluster registry integrity check succeeded#

Status of ASM instance

Hosta$srvctl status asm-n hosta

The ASM instance + ASM1 is running on the node hosta.

The status of the node application on a specific node in hosta$

Hosta$srvctl status nodeapps-n hosta

The node on which VIP is running: hosta

The node on which GSD is running: hosta

The listener is not running on the node: hosta

The ONS daemon is running on the node: hosta

Status of all instances and services of hosta$

Hosta$srvctl status database-d cole

Instance cole1 is running on node hosta

Instance cole2 is running on node hostb

Hosta$ lists all configured databases

Hosta$srvctl config database

Cole

Hosta$

Displays the configuration of the RAC database hosta$srvctl config database-d cole

Hosta cole1 / data/oracle/OracleHome

Hostb cole2 / data/oracle/OracleHome

Hosta$ displays the configuration of the ASM instance

Hosta$srvctl config asm-n hosta

+ ASM1 / data/oracle/OracleHome displays the configuration of the node application-(VIP, GSD, ONS, listener)

Hosta$srvctl config nodeapps-n hosta-a-g-s-l

VIP already exists. : / a1-vip/10.1.1.9/255.255.0.0/ce0

GSD already exists.

The ONS daemon already exists.

The listener already exists.

Hosta$

All running instances in the cluster

SELECT

Inst_id

, instance_number inst_no

, instance_name inst_name

, parallel

, status

, database_status db_status

, active_state state

, host_name host

FROM gv$instance

ORDER BY inst_id; INST_ID INST_NO INST_NAME PAR STATUS DB_STATUS STATE HOST

1 1 cole1 YES OPEN ACTIVE NORMAL hosta 2 2 cole2 YES OPEN ACTIVE NORMAL hostb

All data files located in the disk group

SQL > select name from v$datafile

Union

Select member from v$logfile

Union

Select name from v$controlfile

Union

Select name from v$tempfile

After reading the above, do you have any further understanding of Oracle RAC basic maintenance commands? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report