29
Oracle10g RAC Oracle10g RAC Administration Administration Using srvctl and other tools for Using srvctl and other tools for managing RAC servers managing RAC servers

Oracle10g RAC Administration

  • Upload
    benita

  • View
    37

  • Download
    0

Embed Size (px)

DESCRIPTION

Oracle10g RAC Administration. Using srvctl and other tools for managing RAC servers. Overview. SRVCTL command syntax SRVCTL command examples OCR and CRS administration. SRVCTL. Used to control Oracle RAC instances, services, CRS, and Automatic Storage Management (ASM) - PowerPoint PPT Presentation

Citation preview

Page 1: Oracle10g RAC Administration

Oracle10g RACOracle10g RACAdministrationAdministration

Using srvctl and other tools for Using srvctl and other tools for managing RAC serversmanaging RAC servers

Page 2: Oracle10g RAC Administration

OverviewOverview

SRVCTL command syntaxSRVCTL command syntax SRVCTL command examplesSRVCTL command examples OCR and CRS administrationOCR and CRS administration

Page 3: Oracle10g RAC Administration

SRVCTLSRVCTL

Used to control Oracle RAC Used to control Oracle RAC instances, services, CRS, and instances, services, CRS, and Automatic Storage Management Automatic Storage Management (ASM)(ASM)

Same as Oracle9i srvctl but with Same as Oracle9i srvctl but with more options and featuresmore options and features

Can control all systems in the clusterCan control all systems in the cluster Uses the OCRUses the OCR

Page 4: Oracle10g RAC Administration

SRVCTL Command ScopeSRVCTL Command Scope

The srvctl command may be used to The srvctl command may be used to administer multiple RAC sub-systemsadminister multiple RAC sub-systems

There are options for controlling:There are options for controlling: DatabasesDatabases InstancesInstances ServicesServices NodeappsNodeapps Automatic Storage Management instances Automatic Storage Management instances

(ASM)(ASM)

Page 5: Oracle10g RAC Administration

Available SRVCTL Available SRVCTL CommandsCommands Several basic management commands are Several basic management commands are

available for srvctl (not all commands are available for srvctl (not all commands are available for each option)available for each option) startstart stopstop statusstatus enableenable disabledisable addadd removeremove modifymodify relocaterelocate configconfig getenv, setenv, and unsetenvgetenv, setenv, and unsetenv

Page 6: Oracle10g RAC Administration

Commonly Used SRVCTLCommonly Used SRVCTLDatabase CommandsDatabase Commands srvctl start database –d srvctl start database –d db_unique_name db_unique_name [–o[–o

start_optionsstart_options] [-c] [-c connect_string | connect_string | -q-q {prompt for credentials}{prompt for credentials}] ]

srvctl stop database –d srvctl stop database –d db_unique_name db_unique_name [–o[–o start_optionsstart_options] [-c] [-c connect_string | connect_string | -q-q {prompt for credentials}{prompt for credentials}]]

srvctl enable database –d srvctl enable database –d db_unique_namedb_unique_name srvctl disable database –d srvctl disable database –d db_unique_namedb_unique_name srvctl status database –d srvctl status database –d db_unique_name db_unique_name [-[-

ff {include disabled applications {include disabled applications}] –v}] –v {verbose}{verbose}]]

Page 7: Oracle10g RAC Administration

SRVCTL Database SRVCTL Database Command ExamplesCommand Examples$ srvctl start database -d wwprd$ srvctl start database -d wwprd$ srvctl status database -d wwprd$ srvctl status database -d wwprd

Instance wwprd1 is running on node Instance wwprd1 is running on node wwprod3wwprod3

Instance wwprd2 is running on node Instance wwprd2 is running on node wwprod4wwprod4

$ srvctl stop database -d wwprd$ srvctl stop database -d wwprd$ srvctl disable database -d wwprd$ srvctl disable database -d wwprd

Page 8: Oracle10g RAC Administration

Commonly Used SRVCTLCommonly Used SRVCTLInstance CommandsInstance Commands srvctl start instance –d srvctl start instance –d dbid dbid –i–i instance_list instance_list

[–o[–o start_options start_options] [-c] [-c connect_string | connect_string | -q-q {prompt for credentials}{prompt for credentials}] ]

srvctl stop instance –d srvctl stop instance –d dbid dbid –i–i instance_list instance_list [–o[–o start_options start_options] [-c] [-c connect_string | connect_string | -q-q {prompt for credentials}{prompt for credentials}]]

srvctl enable instance –d srvctl enable instance –d dbid dbid –i–i instance_list instance_list

srvctl disable instance –d srvctl disable instance –d dbid dbid –i–i instance_list instance_list

srvctl status instance –d srvctl status instance –d dbid dbid –i–i instance_list instance_list [-f[-f {include disabled applications {include disabled applications}] –v}] –v {verbose}{verbose}]]

Page 9: Oracle10g RAC Administration

SRVCTL Instance SRVCTL Instance Command ExamplesCommand Examples

$ srvctl start instance -d wwprd -i wwprd1$ srvctl start instance -d wwprd -i wwprd1$ srvctl status instance -d wwprd -i $ srvctl status instance -d wwprd -i

wwprd1wwprd1Instance wwprd1 is running on node Instance wwprd1 is running on node

wwprod3wwprod3$ srvctl stop instance -d wwprd -i wwprd1$ srvctl stop instance -d wwprd -i wwprd1$ srvctl disable instance -d wwprd -i $ srvctl disable instance -d wwprd -i

wwprd1wwprd1

Page 10: Oracle10g RAC Administration

SRVCTLSRVCTLInstance CommandsInstance Commands In order to avoid the instance In order to avoid the instance

starting on reboot, stop and disable starting on reboot, stop and disable the instancethe instance

srvctl stop instance –d srvctl stop instance –d dbiddbid –i –i sidsid srvctl disable instance –d srvctl disable instance –d dbiddbid –i –i sidsid

$ srvctl status database -d wwprd -f$ srvctl status database -d wwprd -fInstance wwprd1 is disabledInstance wwprd1 is disabledInstance wwprd2 is running on node wwprod4Instance wwprd2 is running on node wwprod4

Page 11: Oracle10g RAC Administration

SRVCTLSRVCTLInstance CommandsInstance Commands In order to start a disabled instance, In order to start a disabled instance,

enable it and then startenable it and then start srvctl enable instance –d srvctl enable instance –d dbiddbid –i –i sidsid

$srvctl status database -d wwprd -f$srvctl status database -d wwprd -fInstance wwprd1 is not running on node Instance wwprd1 is not running on node

wwprod3wwprod3Instance wwprd2 is running on node wwprod4Instance wwprd2 is running on node wwprod4

srvctl start instance –d srvctl start instance –d dbiddbid –i –i sidsid

Page 12: Oracle10g RAC Administration

SRVCTLSRVCTLInstance CommandsInstance Commands Notice the difference between Notice the difference between

stopped and disabledstopped and disabledInstance wwprd1 is disabledInstance wwprd1 is disabledInstance wwprd1 is not running on node Instance wwprd1 is not running on node

wwprod3wwprod3

Page 13: Oracle10g RAC Administration

SRVCTLSRVCTLNodeapps CommandsNodeapps Commands Used to control Node ApplicationsUsed to control Node Applications

VIPVIP GSDGSD ListenerListener ONSONS

Page 14: Oracle10g RAC Administration

Commonly Used SRVCTLCommonly Used SRVCTLNodeapps CommandsNodeapps Commands

srvctl start nodeapps –n srvctl start nodeapps –n node_namenode_name srvctl stop nodeapps –n srvctl stop nodeapps –n node_name node_name srvctl status nodeapps –n srvctl status nodeapps –n node_namenode_name

Page 15: Oracle10g RAC Administration

SRVCTL Nodeapps SRVCTL Nodeapps ExamplesExamples

$ srvctl start nodeapps -n wwprod3$ srvctl start nodeapps -n wwprod3$ srvctl status nodeapps -n wwprod3$ srvctl status nodeapps -n wwprod3VIP is running on node: wwprod3VIP is running on node: wwprod3GSD is running on node: wwprod3GSD is running on node: wwprod3Listener is running on node: wwprod3Listener is running on node: wwprod3ONS daemon is running on node: ONS daemon is running on node:

wwprod3wwprod3$ srvctl stop nodeapps -n wwprod3$ srvctl stop nodeapps -n wwprod3

Page 16: Oracle10g RAC Administration

Commonly Used SRVCTLCommonly Used SRVCTLService CommandsService Commands srvctl start service –d srvctl start service –d db_unique_name db_unique_name [-s [-s

service_name_listservice_name_list [-i [-i instance_nameinstance_name] ] [ –o] ] [ –o start_optionsstart_options] [-c] [-c connect_string | connect_string | -q-q {prompt for {prompt for credentials}credentials}] ]

srvctl stop service –d srvctl stop service –d db_unique_name db_unique_name [-s [-s service_name_listservice_name_list [-i [-i instance_nameinstance_name] ] [ –o] ] [ –o start_optionsstart_options] [-c] [-c connect_string | connect_string | -q-q {prompt for {prompt for credentials}credentials}] [-f ] [-f {force}{force}]]

srvctl enable service –d srvctl enable service –d db_unique_name db_unique_name [-s [-s service_name_listservice_name_list | -s | -s service_nameservice_name -i -i instance_nameinstance_name ] ]

srvctl disable service –d srvctl disable service –d db_unique_namedb_unique_name dbid dbid [-s [-s service_name_listservice_name_list | -s | -s service_nameservice_name -i -i instance_nameinstance_name ] ]

srvctl status service –d srvctl status service –d db_unique_name db_unique_name [-s [-s service_name_listservice_name_list] [-f] [-f {include disabled {include disabled applicationsapplications}] –v}] –v {verbose} {verbose}]]

Page 17: Oracle10g RAC Administration

SRVCTL Service Command SRVCTL Service Command ExamplesExamples

$ srvctl start service –d wwprod –s ERP$ srvctl start service –d wwprod –s ERP$ srvctl status service -d wwprd –s ERP$ srvctl status service -d wwprd –s ERPService ERP is running on node wwprod1Service ERP is running on node wwprod1Service ERP is running on node wwprod2Service ERP is running on node wwprod2$ srvctl stop service –d wwprod –s ERP$ srvctl stop service –d wwprod –s ERP$ srvctl disable service –d wwprod –s ERP$ srvctl disable service –d wwprod –s ERP

Page 18: Oracle10g RAC Administration

Commonly Used SRVCTLCommonly Used SRVCTLASM CommandsASM Commands

srvctl start asm –n srvctl start asm –n node_name node_name [–i[–i asm_instance_nameasm_instance_name] [-o] [-o start_options start_options] ]

srvctl stop asm –n srvctl stop asm –n node_name node_name [–i[–i asm_instance_nameasm_instance_name] [-o] [-o start_options start_options]]

srvctl enable asm –n srvctl enable asm –n node_name node_name [–i[–i asm_instance_nameasm_instance_name]]

srvctl disable asm –n srvctl disable asm –n node_name node_name [–i[–i asm_instance_nameasm_instance_name]]

srvctl status asm –n srvctl status asm –n node_namenode_name

Page 19: Oracle10g RAC Administration

SRVCTL ASM Command SRVCTL ASM Command ExamplesExamples

$ srvctl start asm –n wwprod3$ srvctl start asm –n wwprod3$ srvctl status asm -n wwprod3$ srvctl status asm -n wwprod3ASM is running on node wwprod3ASM is running on node wwprod3$ srvctl stop asm –n wwprod3$ srvctl stop asm –n wwprod3$ srvctl disable asm –n wwprod3$ srvctl disable asm –n wwprod3

Page 20: Oracle10g RAC Administration

Using SRVCTL to Add a Node Using SRVCTL to Add a Node to SRVMto SRVM

$ srvctl add database –d wwprd –o $ srvctl add database –d wwprd –o /opt/oracle/product/10.2.0 –p /opt/oracle/product/10.2.0 –p /u01/spfile+ASM.ora/u01/spfile+ASM.ora

$ srvctl add instance –d wwprd –i wwprd1 -n $ srvctl add instance –d wwprd –i wwprd1 -n wwprod1wwprod1

$ srvctl add nodeapps –n wwprod1 –o $ srvctl add nodeapps –n wwprod1 –o /opt/oracle/product/10.2.0 –A 128.96.108.1/opt/oracle/product/10.2.0 –A 128.96.108.1

Page 21: Oracle10g RAC Administration

OCR (Oracle Cluster OCR (Oracle Cluster Repository)Repository) Used to store configuration and state Used to store configuration and state

information about the clusterinformation about the cluster Modified by srvctlModified by srvctl Used by CRSUsed by CRS

Page 22: Oracle10g RAC Administration

OCR (Oracle Cluster OCR (Oracle Cluster Repository)Repository) Dump the OCR by using ocrdumpDump the OCR by using ocrdump

Creates a human readable fileCreates a human readable file OCRDUMPFILEOCRDUMPFILE

Page 23: Oracle10g RAC Administration

OCR (Oracle Cluster OCR (Oracle Cluster Repository)Repository) The %ORA_CRS_HOME%\bin\OCRCHECK The %ORA_CRS_HOME%\bin\OCRCHECK

command checks OCR integrity and statuscommand checks OCR integrity and statusStatus of Oracle Cluster Registry is as follows : Status of Oracle Cluster Registry is as follows :

Version Version : : 2 2 Total space (kbytes) Total space (kbytes) : :

262144 262144 Used space (kbytes) Used space (kbytes) : :

16256 16256 Available space (kbytes) Available space (kbytes) : :

245888 245888 ID ID : :

1918913332 1918913332 Device/File Name Device/File Name : :

/dev/raw/raw1 /dev/raw/raw1 Device/File Device/File

integrity integrity check check succeeded succeeded

Device/File Name Device/File Name : : /oradata/mirror.ocr /oradata/mirror.ocr

Device/File Device/File integrity integrity check check succeeded succeeded

Cluster registry integrity check Cluster registry integrity check succeeded succeeded

Page 24: Oracle10g RAC Administration

OCR and Cluster OCR and Cluster CommandsCommands Located in %ORA_CRS_HOME%\binLocated in %ORA_CRS_HOME%\bin

crs_statcrs_stat Shows info about the CRS servicesShows info about the CRS services

olsnodesolsnodes Lists the nodes in the clusterLists the nodes in the cluster

Page 25: Oracle10g RAC Administration

Cluster Verification UtilityCluster Verification Utility To verify whether your system meets all of the To verify whether your system meets all of the

criteria for an Oracle Clusterware installation:criteria for an Oracle Clusterware installation: cluvfy stage -pre crsinst -n cluvfy stage -pre crsinst -n node_listnode_list [ -c [ -c ocr_locationocr_location ] ]

[-r { 10gR1 | 10gR2 } ][ -q [-r { 10gR1 | 10gR2 } ][ -q voting_diskvoting_disk ] [ -osdba ] [ -osdba osdba_grouposdba_group ] [ -orainv ] [ -orainv orainventory_grouporainventory_group ] [-verbose] ] [-verbose]

To verify whether your system meets all of the To verify whether your system meets all of the criteria for a RAC installation, use the pre-check criteria for a RAC installation, use the pre-check command for the Database Installation stage as command for the Database Installation stage as follows:follows: cluvfy stage -pre dbinst -n cluvfy stage -pre dbinst -n node_listnode_list [-r { 10gR1 | 10gR2 [-r { 10gR1 | 10gR2

} ] [ -osdba } ] [ -osdba osdba_grouposdba_group ] [ -orainv ] [ -orainv orainventory_grouporainventory_group ] [-verbose] ] [-verbose]

To verify the integrity of all of the Oracle To verify the integrity of all of the Oracle Clusterware components, use the component Clusterware components, use the component verification crs command as follows:verification crs command as follows: cluvfy comp crs [ -n cluvfy comp crs [ -n node_listnode_list ] [-verbose] ] [-verbose]

Page 26: Oracle10g RAC Administration

Cluster Verification UtilityCluster Verification Utility To verify the integrity of each individual Cluster To verify the integrity of each individual Cluster

Manager sub-component, use the component Manager sub-component, use the component verification command clumgr as follows:verification command clumgr as follows: cluvfy comp clumgr [ -n cluvfy comp clumgr [ -n node_listnode_list ] [-verbose] ] [-verbose]

To verify the integrity of the Oracle Cluster To verify the integrity of the Oracle Cluster Registry, use the component verification Registry, use the component verification command ocr as follows:command ocr as follows: cluvfy comp ocr [ -n cluvfy comp ocr [ -n node_listnode_list ] [-verbose] ] [-verbose]

To check the integrity of your entire cluster, To check the integrity of your entire cluster, which means to verify that all of the nodes in the which means to verify that all of the nodes in the cluster have the same view of the cluster:cluster have the same view of the cluster: cluvfy comp clu cluvfy comp clu

Page 27: Oracle10g RAC Administration

CRS StatusCRS Status Creating a tabular report:Creating a tabular report: %ORA_CRS_HOME%\bin\crs_stat -t%ORA_CRS_HOME%\bin\crs_stat -t

NameName Type Type Target Target State State Host Host --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

------- ------- ora.rac1.gsd ora.rac1.gsd application application ONLINE ONLINE ONLINE ONLINE

rac1rac1ora.rac1.oemora.rac1.oem application application ONLINE ONLINE ONLINEONLINE

rac1rac1ora.rac1.ons ora.rac1.ons application application ONLINE ONLINE ONLINE ONLINE

rac1rac1ora.rac1.vipora.rac1.vip application application ONLINE ONLINE ONLINEONLINE

rac1rac1ora.rac2.gsd ora.rac2.gsd application application ONLINE ONLINE ONLINE ONLINE

rac2rac2ora.rac2.oemora.rac2.oem application application ONLINE ONLINE ONLINEONLINE

rac2rac2ora.rac2.ons ora.rac2.ons application application ONLINE ONLINE ONLINE ONLINE

rac2rac2ora.rac2.vipora.rac2.vip application application ONLINE ONLINE ONLINEONLINE

rac2rac2

Page 28: Oracle10g RAC Administration

ReviewReview What is the srvctl command to start the What is the srvctl command to start the

wwprod1 instance for database wwprod1 instance for database wwprod?wwprod?

True or False: If you want to perform True or False: If you want to perform maintenance on an instance, all that maintenance on an instance, all that you have to do is stop the instance with you have to do is stop the instance with srvctl.srvctl.

What command would you use to list What command would you use to list the status for the database wwprod, the status for the database wwprod, including any disabled instances?including any disabled instances?

If the VIP service is stopped, what If the VIP service is stopped, what command could you use to restart it?command could you use to restart it?

How could you check Oracle Cluster How could you check Oracle Cluster Registry integrity?Registry integrity?

Page 29: Oracle10g RAC Administration

SummarySummary The SRVCTL command may be used to The SRVCTL command may be used to

administer multiple Real Application administer multiple Real Application Cluster components, including:Cluster components, including: DatabasesDatabases InstancesInstances ServicesServices NodeappsNodeapps Automatic Storage Management instances Automatic Storage Management instances

(ASM)(ASM) The Oracle Cluster Repository is used to The Oracle Cluster Repository is used to

store configuration and state store configuration and state information about the clusterinformation about the cluster

The OCR may be administered with the The OCR may be administered with the ocrdump, ocrcheck, cluvfy, srvctl, ocrdump, ocrcheck, cluvfy, srvctl, olsnodes, and crs_stat commandsolsnodes, and crs_stat commands