February 7th 2014

Enable/Disable service startup pada RAC 11gR2

Pada saat selesai melakukan instalasi Oracle RAC, secara default status semua service (cluster, asm, database) yaitu enable sehingga pada saat server di reboot maka oracle service akan otomatis up. Untuk melakukan disable dan enable service pada level cluster, asm, dan database, kita bisa menggunakan command srvctl enable/disable service.

Disable service database

1
[oracle@rac11n1 ~]$ srvctl disable DATABASE -d SASDB

Disable service instance

1
[oracle@rac11n1 ~]$ srvctl disable instance  -d SASDB -i SASDB1

Disable service asm

1
[oracle@rac11n1 ~]$ srvctl disable asm -n SASDB1

Enable service database

1
[oracle@rac11n1 ~]$ srvctl enable DATABASE -d SASDB

Enable service instance

1
[oracle@rac11n1 ~]$ srvctl enable instance  -d SASDB -i SASDB1

Enable service asm

1
[oracle@rac11n1 ~]$ srvctl enable asm -n SASDB1

Tags: ,

No Comments yet »

November 8th 2013

Error "OPatch failed with error code 73" ketika menjalankan opatch utility

Beberapa waktu yang lalu sempat mengalami kejadian error "Inventory load failed... OPatch cannot load inventory for the given Oracle Home." saat menjalankan opatch. Detail errornya sebagai berikut :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
[oracle@helios ~]$ opatch lsinventory
Oracle Interim Patch Installer version 11.2.0.3.5
Copyright (c) 2013, Oracle Corporation.  ALL rights reserved.
 
 
Oracle Home       : /u02/app/oracle/product/11.2.0/dbhome_1
Central Inventory : /u01/app/oracle/inventory
   FROM           : /u02/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
OPatch version    : 11.2.0.3.5
OUI version       : 11.2.0.3.0
Log file location : /u02/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2013-11-08_03-45-20AM_1.log
 
List OF Homes ON this system:
 
  Home name= OraDb11g_home1, Location= "/u01/app/oracle/product/11.2.0/dbhome_1"
Inventory LOAD failed... OPatch cannot LOAD inventory FOR the given Oracle Home.
Possible causes are:
   Oracle Home dir. path does NOT exist IN Central Inventory
   Oracle Home IS a symbolic link
   Oracle Home inventory IS corrupted
LsInventorySession failed: OracleHomeInventory gets NULL oracleHomeInfo
OPatch failed WITH error code 73

Sebelumnya memang ada task untuk memindahkan direktori oracle software ke disk lain, ternyata ada satu yang ketinggalan yaitu melakukan setting oracle inventory ke oracle home yang baru. Ada 2 cara untuk melakukan setting oracle inventory ke path oracle home yang baru, yaitu :

1. Deattach oracle inventory pada oracle home lama lalu setelah itu attach oracle home baru.

2. Create oracle inventory baru yang mengarah ke oracle home yang baru dengan ORACLE_HOME_NAME yang berbeda.

Untuk melakukan konfigurasi oracle inventory dengan oracle home menggunakan utility runInstaller pada direktori $ORACLE_HOME/oui/bin. Berikut command untuk melakukan deattach & attach :

Deattach oracle inventory pada oracle home lama.

1
[oracle@helios DATABASE]$ ./runInstaller -silent -detachHome ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1

Attach oracle inventory pada oracle home baru

1
[oracle@helios DATABASE]$ ./runInstaller -silent -attachHome ORACLE_HOME=/u02/app/oracle/product/11.2.0/dbhome_1

Create oracle inventory baru pada oracle home baru dengan ORACLE_HOME_NAME yang berbeda.

1
2
3
4
5
6
7
[oracle@helios bin]$ ./runInstaller -silent -attachHome ORACLE_HOME="/u02/app/oracle/product/11.2.0/dbhome_1" ORACLE_HOME_NAME="OraDb11g_home2"
Starting Oracle Universal Installer...
 
Checking swap SPACE: must be greater than 500 MB.   Actual 1012 MB    Passed
The inventory pointer IS located at /etc/oraInst.loc
The inventory IS located at /u02/app/oracle/inventory
'AttachHome' was successful.

Setelah selesai melakukan konfigurasi, test menggunakan command opatch lsinventory. Apakah masih muncul error yang sama ?.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
[oracle@helios bin]$ opatch lsinventory
Oracle Interim Patch Installer version 11.2.0.3.5
Copyright (c) 2013, Oracle Corporation.  ALL rights reserved.
 
 
Oracle Home       : /u02/app/oracle/product/11.2.0/dbhome_1
Central Inventory : /u02/app/oracle/inventory
   FROM           : /u02/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
OPatch version    : 11.2.0.3.5
OUI version       : 11.2.0.3.0
Log file location : /u02/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2013-11-08_07-00-57AM_1.log
 
Lsinventory Output file location : /u02/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2013-11-08_07-00-57AM.txt
 
--------------------------------------------------------------------------------
Installed Top-level Products (1):
 
Oracle DATABASE 11g                                                  11.2.0.3.0
There are 1 products installed IN this Oracle Home.
 
 
Interim patches (1) :
 
Patch  16619892     : applied ON Wed Oct 23 04:18:31 UTC 2013
UNIQUE Patch ID:  16346737
Patch description:  "Database Patch Set Update : 11.2.0.3.7 (16619892)"
   Created ON 23 Jun 2013, 09:03:20 hrs PST8PDT
Sub-patch  16056266; "Database Patch Set Update : 11.2.0.3.6 (16056266)"
Sub-patch  14727310; "Database Patch Set Update : 11.2.0.3.5 (14727310)"
Sub-patch  14275605; "Database Patch Set Update : 11.2.0.3.4 (14275605)"
Sub-patch  13923374; "Database Patch Set Update : 11.2.0.3.3 (13923374)"
Sub-patch  13696216; "Database Patch Set Update : 11.2.0.3.2 (13696216)"
Sub-patch  13343438; "Database Patch Set Update : 11.2.0.3.1 (13343438)"
   Bugs fixed:
     13593999, 13566938, 10350832, 14138130, 12919564, 13561951, 13624984
     13588248, 13080778, 13914613, 13804294, 14258925, 12873183, 13645875
     14472647, 12880299, 14664355, 12998795, 14409183, 13719081, 14469008
     13492735, 14263036, 12857027, 13496884, 13015379, 14263073, 13742433
     13732226, 16314469, 16368108, 12905058, 6690853, 13742434, 12849688
     12950644, 13742435, 13464002, 13063120, 13534412, 12879027, 13958038
     14613900, 12585543, 13790109, 12535346, 16382448, 12588744, 11877623
     12395918, 13814739, 13786142, 12847466, 13649031, 13855490, 13981051
     12582664, 12797765, 14262913, 12923168, 16279401, 12912137, 13612575
     13384182, 13466801, 13484963, 14207163, 13724193, 13772618, 11063191
     16694777, 13070939, 12797420, 15869211, 13041324, 16279211, 16314467
     16314468, 12976376, 11708510, 13680405, 13742437, 13026410, 14589750
     13737746, 13742438, 14644185, 15841373, 13326736, 13596521, 14398795
     13579992, 13001379, 16344871, 13099577, 9873405, 13742436, 14275605
     9858539, 14841812, 11715084, 16231699, 14040433, 9703627, 12662040
     12617123, 16530565, 14207317, 12845115, 12764337, 13354082, 14459552
     13397104, 13913630, 12964067, 12983611, 13550185, 12780983, 13810393
     12583611, 14546575, 15862016, 13476583, 13489024, 11840910, 13903046
     15862017, 13572659, 16294378, 13718279, 14088346, 13657605, 13448206
     16314466, 14480676, 13419660, 13632717, 14668670, 14063281, 14110275
     13430938, 13467683, 13420224, 13812031, 14548763, 16299830, 12646784
     14512189, 12755116, 14035825, 13616375, 13427062, 12861463, 12834027
     15862021, 13632809, 13377816, 13036331, 14727310, 16619892, 13685544
     13499128, 15862018, 13584130, 16175381, 12829021, 15862019, 12794305
     14546673, 12791981, 13561750, 13503598, 13787482, 10133521, 12718090
     13848402, 13399435, 14023636, 9095696, 13860201, 12401111, 13257247
     13362079, 14176879, 12917230, 16014985, 13923374, 14220725, 13524899
     14480675, 16306019, 13559697, 12974860, 9706792, 12940620, 14480674
     13916709, 13098318, 14076523, 13773133, 15905421, 16794244, 13340388
     12731940, 13528551, 13366202, 12894807, 13343438, 13454210, 12748240
     14205448, 13385346, 14127231, 15853081, 14273397, 14467061, 12971775
     13923995, 14571027, 13582702, 13907462, 10242202, 13493847, 13857111
     13035804, 13544396, 16382353, 8547978, 14226599, 16794241, 14062795
     13035360, 12925089, 12693626, 13332439, 14038787, 11071989, 14062796
     16794243, 12913474, 14841409, 14390252, 16314470, 13370330, 13059165
     14062797, 14062794, 12959852, 12345082, 13358781, 12960925, 16703112
     9659614, 14546638, 13699124, 13936424, 14301592, 16794240, 13338048
     12938841, 12658411, 12620823, 12656535, 14062793, 12678920, 13038684
     14062792, 13807411, 16742095, 16794238, 15862022, 12594032, 13250244
     12612118, 9761357, 14053457, 13742464, 14052474, 13911821, 13457582
     7509451, 13527323, 13791364, 15862020, 13910420, 12780098, 13502183
     13696216, 13705338, 10263668, 14841558, 16794242, 15862023, 16056266
     16794239, 15862024, 13554409, 13645917, 13103913, 12772404, 13011409, 14063280
 
 
 
--------------------------------------------------------------------------------
 
OPatch succeeded.

Tags: ,

No Comments yet »

October 29th 2013

Mengganti ip address pada RAC 11gR2

Sudah lama ngga mengupdate blog ini karena sibuk dalam pekerjaan. Kali ini ingin membuat catatan kecil untuk merubah ip address baik itu public maupun private ip address pada Oracle RAC 11gR2. Langkah untuk mengganti ip address yaitu : configure ip address baru di grid infrastructure, lalu setelah itu configure ip address di level OS, remove ip address lama di sisi grid infrastructure. Contoh, saya akan mengubah private ip address dari 10.10.10.0 ke 172.19.49.0.

1. Untuk melihat eksisting ip address pada GI.

1
2
3
[grid@NODE1 ~]$ oifcfg getif
eth3  10.10.10.0  global  cluster_interconnect
bond0  10.124.111.160  global  public

2. Add ip address baru pada GI menggunakan setif, gunakan opsi -global agar di NODE2 otomatis ikut berubah.

1
[grid@NODE1 ~]$ oifcfg setif -global eth1/172.19.49.0:cluster_interconnect

3. Check ip address apakah sudah ada.

1
2
3
4
[grid@NODE1 ~]$ oifcfg getif
eth3  10.10.10.0  global  cluster_interconnect
bond0  10.124.111.160  global  public
eth3  172.19.49.0  global  cluster_interconnect

4. Configure private network ip address di level OS (tidak saya tampilkan detail, karena masing-masing OS berbeda cara konfigurasinya) & jangan lupa untuk merubah juga pada host files

5. Lakukan test ping private ip address

1
2
3
4
5
6
7
[root@NODE1 ~]# ping node2-priv
PING node2-priv (172.19.49.2) 56(84) bytes OF DATA.
64 bytes FROM NODE2 (172.19.49.2): icmp_seq=1 ttl=64 TIME=13.5 ms
64 bytes FROM NODE2 (172.19.49.2): icmp_seq=2 ttl=64 TIME=16.2 ms
64 bytes FROM NODE2 (172.19.49.2): icmp_seq=3 ttl=64 TIME=0.324 ms
64 bytes FROM NODE2 (172.19.49.2): icmp_seq=4 ttl=64 TIME=0.301 ms
64 bytes FROM NODE2 (172.19.49.2): icmp_seq=5 ttl=64 TIME=0.421 ms

6. Delete private ip address yang lama dengan opsi delif

1
[grid@NODE1 ~]$ oifcfg delif -global eth1/10.10.10.0:cluster_interconnect

7. Untuk melihat kembali ip address pada GI.

1
2
3
[grid@NODE1 ~]$ oifcfg getif
eth3  172.19.49.0  global  cluster_interconnect
bond0  10.124.111.160  global  public

Tags: ,

No Comments yet »

August 26th 2013

Kill banyak process menggunakan 1 command line

Sudah beberapa bulan ngga update blog ini, start lagi dengan note untuk melakukan kill banyak process yang similiar dengan satu command line. Sample :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
[oracle@VENUS ~]$ ps -ef | grep psp0
oracle     301  2365  0 Jun26 ?        04:48:51 xe_psp0_ORCL
oracle     311 27713  0 Jul08 ?        04:47:47 xe_psp0_ORCL
oracle     364 32185  1 Aug10 ?        04:49:32 xe_psp0_ORCL
oracle     373 30737  0 Jul09 ?        04:49:36 xe_psp0_ORCL
oracle     376  1436  0 Jun25 ?        04:50:11 xe_psp0_ORCL
oracle     400 30945  0 Jul29 ?        04:51:29 xe_psp0_ORCL
oracle     401 29904  6 Aug23 ?        04:49:27 xe_psp0_ORCL
oracle     476   561  0 Jul22 ?        04:51:50 xe_psp0_ORCL
oracle     561   969  0 Jul22 ?        04:51:24 xe_psp0_ORCL
oracle     571 30730  0 Jun25 ?        04:49:05 xe_psp0_ORCL
oracle     631 28596  1 Aug12 ?        04:49:02 xe_psp0_ORCL
oracle     813 15017  0 Jul03 ?        04:52:07 xe_psp0_ORCL
oracle     848 32536  1 Aug13 ?        04:52:25 xe_psp0_ORCL
oracle     934 30125  2 Aug17 ?        04:54:00 xe_psp0_ORCL
oracle     937  1489  0 Jun15 ?        04:46:41 xe_psp0_ORCL
oracle     969 30571  0 Jul21 ?        04:50:12 xe_psp0_ORCL
oracle    1106  7358  1 Aug14 ?        04:53:24 xe_psp0_ORCL
oracle    1214 29356  0 Aug04 ?        04:54:15 xe_psp0_ORCL
oracle    1267  1820  0 Jun21 ?        04:46:56 xe_psp0_ORCL
oracle    1343 30210  0 Jul25 ?        04:50:48 xe_psp0_ORCL
oracle    1379  2622  0 Jun26 ?        04:49:20 xe_psp0_ORCL
oracle    1436 32476  0 Jun24 ?        04:47:23 xe_psp0_ORCL
oracle    1489  1521  0 Jun14 ?        04:47:27 xe_psp0_ORCL
oracle    1521 32726  0 Jun14 ?        04:47:50 xe_psp0_ORCL
oracle    1676 17443  0 Jun14 ?        04:48:56 xe_psp0_ORCL
oracle    1820  8253  0 Jun21 ?        04:47:24 xe_psp0_ORCL
oracle    1893   400  0 Jul29 ?        04:50:17 xe_psp0_ORCL
oracle    1896 30955  1 Aug10 ?        04:58:16 xe_psp0_ORCL
oracle    2010 12902  0 Jun07 ?        05:12:09 xe_psp0_ORCL
oracle    2103  4226  0 Jul26 ?        04:49:20 xe_psp0_ORCL
oracle    2216 14286  0 Jun06 ?        05:47:56 xe_psp0_ORCL

Kita bisa memanfaatkan fungsi awk untuk grep PID dari processes tersebut lalu kill menggunakan xargs.

1
ps -ef | grep psp | grep -v grep | awk '{print $2}' | xargs KILL -9

No Comments yet »

April 12th 2013

Oratop utility

Oratop merupakan salah satu fitur yang bagus untuk dimiliki (nice to have) oleh seorang database administrator. Utilitas ini mirip seperti top nya Linux. Namun sayangnya oratop tidak disediakan bebas, anda harus mendownloadnya di support oracle untuk dapat memanfaatkan fitur ini. Cara menjalankannya sangat mudah sekali :

1. Download terlebih dahulu oratop disini untuk 64 bit atau versi 32 bit.

2. Rubah permission dari file oratop menjadi executable.

1
bash-4.1$  chmod 755 oratop

3. Setting environment database pada bash profile

1
2
3
4
5
ORACLE_HOSTNAME=hsejkorc01; export ORACLE_HOSTNAME
ORACLE_BASE=/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOME
ORACLE_SID=ussddb; export ORACLE_SID
PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:/usr/sbin:$PATH; export PATH

4. Execute file oratop untuk menjalankannya.

Fitur ini sangat bagus untuk melihat real time performance dari database oracle sehingga bila terjadi "sesuatu" dapat segera ditindaklanjuti

Tags: ,

No Comments yet »

Next »