Bu yazıda Oracle Restart bileşeni olan srvctl (Server Control Utility) komutunu inceleyeceğiz. srvctl komutu Oracle GRID yazılımının kurulu ortamlarda bulunur ve özellikle RAC (Real Application Cluster) olmak üzere veritabanı, GRID bileşenlerini yönetmek için kullanılır. Srvctl komutu oracle kullanıcısı ile çalıştırılmalıdır. Sunucu tarafındaki komut olduğu için, komutu çalıştırabilmek adına öncelikle veritabanı sunucularına SSH bağlantısı yapılması gereklidir.
İlk öğrenmemiz gereken komut, nasıl yardım alacağımız olmalıdır. -h parametresi ile srvctl’li çalıştırdığımızda yönetebileceğimiz tüm bileşenler ve onlara ait parametreler açıklamaları ile birlikte ekrana yazılır. Çıktısı uzun olduğu için bir kısmından sonrasını eklemeyelim.
1 2 3 4 5 6 7 8 9 10 11 |
srvctl -h Usage: srvctl {-version | -version -fullversion | -fullversion} Usage: srvctl config all Usage: srvctl add database -db <db_unique_name> -oraclehome <oracle_home> [-dbtype {RACONENODE | RAC | SINGLE} [-server "<server_list>"] [-instance <inst_name>] [-timeout <timeout>]] [-domain <domain_name>] [-spfile <spfile>] [-pwfile <password_file_path>] [-role {PRIMARY | PHYSICAL_STANDBY | LOGICAL_STANDBY | SNAPSHOT_STANDBY | FAR_SYNC}] [-startoption <start_options>] [-stopoption <stop_options>] [-startconcurrency <start_concurrency>] [-stopconcurrency <stop_concurrency>] [-dbname <db_name>] [-policy {AUTOMATIC | MANUAL | NORESTART | USERONLY}] [-serverpool "<serverpool_list>" [-pqpool <pq_server_pools>]] [-node <node_list>] [-diskgroup "<diskgroup_list>"] [-acfspath "<acfs_path_list>"] [-eval] [-fixed] [-css_critical {YES | NO}] [-cpucount <cpu_count>] [-memorytarget <memory_target>] [-maxmemory <max_memory>] [-defaultnetnum <network_number>] [-verbose] Usage: srvctl config database [-db <db_unique_name> [-all] | -serverpool <serverpool_name> | -home] [-verbose] Usage: srvctl start database -db <db_unique_name> [-startoption <start_options>] [-startconcurrency <start_concurrency>] [-node <node> | -serverpool "<serverpool_list>"] [-eval] [-verbose] Usage: srvctl stop database -db <db_unique_name> [-stopoption <stop_options>] [-stopconcurrency <stop_concurrency>] [-serverpool "<serverpool_list>"] [-drain_timeout <timeout>] [-force] [-eval] [-verbose] Usage: srvctl status database {-db <db_unique_name> {[-serverpool <serverpool_name>] | [-sid] [-home]} | -serverpool <serverpool_name> | -thisversion | -thishome} [-force] [-detail] [-verbose] . . . . . . . . . . . . . . . |
Yardımdan sonraki ilk komutumuz veritabanı durumunu kontrol etmek. Ancak buna ait yardım almak için öncelikle yardım komutunu çalıştıralım.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
srvctl status database -h Displays the current state of the database. Usage: srvctl status database {-db <db_unique_name> {[-serverpool <serverpool_name>] | [-sid] [-home]} | -serverpool <serverpool_name> | -thisversion | -thishome} [-force] [-detail] [-verbose] -db <db_unique_name> Unique name for the database -serverpool <pool_name> Display information on nodes within server pool -sid Displays the SID of the Oracle instance running on this node -home Displays Oracle home of specified database -thisversion Display status of databases that are of the same Oracle product version as 'srvctl.' -thishome Display status of databases that are configured in this Oracle Home. -force Include disabled applications -detail Print detailed status information -verbose Verbose output -help Print usage |
Yardımdan görüleceği gibi db_uniqune_name (v$database view’inden) değeri VTPROD olan veritabanını aşağıdaki gibi kontrol edebiliriz. RAC ortamı için birden fazla instance olması durumunda tüm instance’lara ait durumları görebiliriz. Her bir node üzerine bağlanıp tek tek bakmaya gerek kalmaz.
1 2 3 |
srvctl status database -db VTPROD Instance VTPROD1 is running on node vtprod1 Instance VTPROD2 is running on node vtprod2 |
Tüm veritabanını değil, sadece bazı instance’ları kontrol etmek için komutumuzu aşağıdaki gibi yazarız. Ek olarak, bu komutu RAC node’larından herhangi biri üzerinde çalıştırabiliriz. Özellikle kontrol edeceğimiz node bağlanmak zorunda değiliz.
1 2 |
srvctl status instance -db VTPROD -i VTPROD1 Instance VTPROD1 is running on node vtprod1 |
Oracle veritabanı hizmeti Listener üzerinden verilmektedir. Listener’leri aşağıdaki gibi kontrol edebiliriz. İsim verilmediğinde ismi LISTENER olan listener’in durumunu gösterir. Bu listener’ler sunucularda hizmet veren local_listener’lerdir. (v$parameter)
1 2 3 |
srvctl status listener Listener LISTENER is enabled Listener LISTENER is running on node(s): vtprod2,vtprod1 |
SCAN listener’ler RAC’a ait sanal IP’lerden oluşan 3 adet listener’i ifade eder. SCAN_LISTENER’e ait kontrol aşağıdaki gibi yapılır.
1 2 3 4 5 6 7 |
srvctl status scan_listener SCAN Listener LISTENER_SCAN1 is enabled SCAN listener LISTENER_SCAN1 is running on node vtprod1 SCAN Listener LISTENER_SCAN2 is enabled SCAN listener LISTENER_SCAN2 is running on node vtprod2 SCAN Listener LISTENER_SCAN3 is enabled SCAN listener LISTENER_SCAN3 is running on node vtprod2 |
RAC ortamında kullanılan ASM (Automatic Storage Management) kontrolünü yapmak için:
1 2 |
srvctl status asm ASM is running on vtprod2,vtprod1 |
ASM’deki disk grupları kontrol etmek için: DATA disk grup ismidir.
1 2 |
srvctl status diskgroup -diskgroup DATA Disk Group DATA is running on vtprod2,vtprod1 |
Sonraki yazıda srvctl ile bazı bileşenlerin kapatılıp ve açılmasını öğreneceğiz…
Elinize sağlık hocam