1. 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
2, the status of a single instance
$ srvctl Status instance-d orcl-i Orcl2
Instance Orcl2 is running on node linux2
3, the state of the database global naming Service
$ srvctl Status service-d orcl-s orcltest
Service Orcltest is running on instance (s) Orcl2, ORCL1
4, the State 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
5. The state of the ASM instance
$ srvctl Status Asm-n linux1
ASM instance +ASM1 is running on node linux1.
6, List all the configured databases
$ srvctl Config Database
Orcl
7, display the RAC database configuration
$ 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
8. Display all services of the specified cluster database
$ srvctl Config service-d ORCL
Orcltest Pref:orcl2 ORCL1 Avail:
9, Display node application configuration-(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:eth1
GSD exists.
ONS Daemon exists.
Listener exists.
10, display the ASM instance configuration
$ srvctl Config asm-n linux1
+asm1/u01/app/oracle/product/10.2.0/db_1
11. 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
12, 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
Rows selected.
13. All ASM disks that belong 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
14. Start/Stop RAC cluster
Make sure that you are logged on as an Oracle UNIX user. We will run all commands from the RAC1 node:
# su–oracle
$ hostname
Rac1
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/
15. Stop Oracle RAC 10g environment
The first step is to stop the Oracle instance. When this instance (and related services) is closed, the ASM instance is closed. Finally, turn off 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
16. Launch 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 successfully started, the ASM instance is started. 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
17. Use SRVCTL to start/stop all instances
Start/Stop all instances and their enabled services. I just thought it would be fun. Add this step as a way to close all instances!
$ srvctl Start database-d ORCL
$ srvctl Stop database-d ORCL
18, Kai stop listening
Hostb$lsnrctl Start Listener_hostb
Hostb$lsnrctl Stop Listener_hostb
19, Backup
Votning DISKDD If=voting_disk_name Of=backup_file_name
DD IF=/DEV/RDSK/C4T600C0FF000000000098ADE240330A000D0S4 of=votingdisk.bak# DD If=/dev/zero of=/dev/rdsk/ C4T600C0FF000000000098ADE240330A000D0S4 bs=512 count=261120