Wednesday, March 23, 2011

oracle remove unwanted character from data column

// remove \r @ \n
update table-nama set column-name = REPLACE
(REPLACE( col_name, CHR(10) ), CHR(13) )

// replace white space update table-nama set column-name = REPLACE(REPLACE( col_name,' ' ), '' )

Tuesday, March 22, 2011

app server status

Current Time: Tuesday, 22-Mar-2011 09:12:55 MYT
Restart Time: Sunday, 20-Mar-2011 04:57:45 MYT
Parent Server Generation: 3
Server uptime: 2 days 4 hours 15 minutes 9 seconds
Total accesses: 378750 - Total Traffic: 3.2 GB
CPU Usage: u100.86 s20.33 cu0 cs0 - .0644% CPU load
2.01 requests/sec - 17.7 kB/second - 8.8 kB/request
112 requests currently being processed, 55 idle workers

eis server problem

Mar 21 13:50:21 - kernel: sd 0:0:1:0: timing out command, waited 360s
Mar 21 13:50:21 - kernel: sd 0:0:1:0: SCSI error: return code = 0x00000008
Mar 21 13:50:21 - kernel: end_request: I/O error, dev sdb, sector 38647

Wednesday, March 16, 2011

Web Server Status

Current Time: Wednesday, 16-Mar-2011 10:54:37 MYT
Restart Time: Friday, 04-Mar-2011 07:02:10 MYT
Parent Server Generation: 24
Server uptime: 12 days 3 hours 52 minutes 26 seconds
Total accesses: 9187307 - Total Traffic: 77.1 GB
CPU Usage: u842.46 s257.47 cu0 cs0 - .105% CPU load
8.74 requests/sec - 77.0 kB/second - 8.8 kB/request
234 requests currently being processed, 64 idle workers

Tuesday, March 15, 2011

Server Status

Current Time: Tuesday, 15-Mar-2011 00:47:12 MYT
Restart Time: Friday, 04-Mar-2011 07:02:10 MYT
Parent Server Generation: 22
Server uptime: 10 days 17 hours 45 minutes 1 second
Total accesses: 8373127 - Total Traffic: 70.2 GB
CPU Usage: u791.83 s273.79 cu0 cs0 - .115% CPU load
9.02 requests/sec - 79.3 kB/second - 8.8 kB/request
96 requests currently being processed, 79 idle workers

Monday, March 14, 2011

Oracle PHP returning clause statement

If you just want to retrieve an auto-increment field like an integer, you don't have to use the oci_new_descriptor function:

   $dbh = ociplogon("username","pw","sid");

   $query = "INSERT INTO employees (name) VALUES ('Jones') RETURNING employee_no INTO :employee_no";
   $stmt = oci_parse($dbh, $query);

   // oci_new_descriptor not necessary...

   // Bind the variable to the parsed statement.
   // I used '8' as the minimum length - otherwise it was setting the default length to '1', so when an employee_no like 18366 was returned, the variable would be set to '1' (the first digit), so make sure you set a length.
   oci_bind_by_name($stmt, ":employee_no", $employee_no, 8);
   oci_execute($stmt, OCI_DEFAULT);

   // Commit the change
   oci_commit($dbh);

   // Free resources associated with the statement
   oci_free_statement($stmt);

  print "new employee no is: $employee_no";

Oracle Server Overloaded?? RAM added to 32G

top - 17:32:31 up 3 days, 16:45,  3 users,  load average: 10.04, 10.15, 10.48
Tasks: 153 total,  11 running, 142 sleeping,   0 stopped,   0 zombie
Cpu(s): 90.1% us,  4.4% sy,  0.0% ni,  1.0% id,  2.9% wa,  0.5% hi,  1.0% si
Mem:  32904160k total, 32845724k used,    58436k free,   527928k buffers
Swap:  2097144k total,   148640k used,  1948504k free, 31528636k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 1158 oracle9   20   0 5029m 2.8g 2.8g R 96.5  9.1 325:23.94 oracle
 2968 oracle9   17   0 5028m 1.7g 1.7g R 94.5  5.3  30:07.38 oracle
 2795 oracle9   25   0 5028m 2.0g 2.0g R 93.8  6.5  53:39.48 oracle
 3046 oracle9   24   0 5028m 1.6g 1.6g R 92.9  5.0  22:26.82 oracle
 2539 oracle9   18   0 5029m 2.2g 2.2g R 91.5  7.1  79:07.46 oracle
 2966 oracle9   17   0 5028m 1.7g 1.7g R 90.2  5.4  29:24.80 oracle
 3072 oracle9   25   0 5028m 1.5g 1.5g R 85.9  4.8   9:15.69 oracle
 3070 oracle9   18   0 5028m 1.5g 1.5g R 50.3  4.8  10:02.54 oracle
 3074 oracle9   15   0 5028m 1.6g 1.6g D 33.6  5.0  10:10.16 oracle
 9960 oracle9   15   0 5033m 759m 751m S 26.6  2.4 505:34.59 oracle
 2988 oracle9   18   0 5028m 1.6g 1.6g R 10.6  5.3  26:40.31 oracle
 9968 oracle9   16   0 28908 5260 2872 S  0.7  0.0  16:13.83 tnslsnr
15463 root      16   0  4360 1128  840 S  0.3  0.0   7:21.80 top

Saturday, March 12, 2011

Thursday, March 10, 2011

Understanding Load average Linux

What does Load Average give you when you doing TOP, w ...
See here. :)
http://blog.scoutapp.com/articles/2009/07/31/understanding-load-averages

PHP adodb oci8 ORACLE

Should You Use Persistent Connections

One question that is frequently asked is should you use persistent connections to Oracle. Persistent connections allow PHP to recycle existing connections, reusing them after the previous web pages have completed. Non-persistent connections close automatically after the web page has completed. Persistent connections are faster because the cost of reconnecting is expensive, but there is additional resource overhead. As an alternative, Oracle allows you to pool and reuse server processes; this is called Shared Server (also known as MTS).

The author's benchmarks suggest that using non-persistent connections and the Shared Server configuration offer the best performance. If Shared Server is not an option, only then consider using persistent connections.

source: http://phplens.com/lens/adodb/docs-oracle.htm

Oracle Server Overloaded??

Oracle Server TOP status

top - 11:55:45 up 189 days, 22:49,  7 users,  load average: 21.59, 20.06, 20.53
Tasks: 216 total,  14 running, 202 sleeping,   0 stopped,   0 zombie
Cpu(s): 95.2% us,  3.7% sy,  0.0% ni,  0.0% id,  0.0% wa,  0.2% hi,  0.7% si
Mem:   8156992k total,  8133480k used,    23512k free,    73756k buffers
Swap:  2097144k total,  1328752k used,   768392k free,  6994464k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
15615 oracle9   19   0 5029m 2.6g 2.6g R 96.5 33.5  99:02.07 oracle
15426 oracle9   18   0 5029m 2.6g 2.5g R 85.1 32.8  69:58.65 oracle
18765 oracle9   17   0 5029m 1.7g 1.7g R 84.1 21.4   8:42.19 oracle
18797 oracle9   18   0 5029m 1.7g 1.7g R 80.2 21.4   6:54.84 oracle
15734 oracle9   18   0 5029m 2.4g 2.4g R 79.5 31.0  69:05.59 oracle
18763 oracle9   17   0 5029m 1.6g 1.6g R 77.8 21.0   8:02.84 oracle
16117 oracle9   20   0 5029m 2.2g 2.2g R 74.8 27.8  19:58.24 oracle
18809 oracle9   17   0 5029m 1.5g 1.5g R 71.8 19.5   3:59.30 oracle
18767 oracle9   18   0 5029m 1.7g 1.7g R 70.8 22.4   7:57.53 oracle
13959 oracle9   17   0 5029m 2.9g 2.9g R 39.2 37.6 275:38.99 oracle
 1816 oracle9   15   0 5034m 817m 808m S 34.6 10.3   2122:38 oracle
18803 oracle9   18   0 5029m 1.5g 1.5g R  2.3 19.8   4:10.62 oracle
 1821 oracle9   15   0 36852 6304 1592 S  1.0  0.1  55:57.40 tnslsnr
15329 spk         15   0 38580 1944 1256 S  0.3  0.0   0:44.84 sshd
18795 oracle9   21   0 5028m 1.5g 1.5g R  0.3 18.8   2:56.18 oracle

Oracle Server Top Status

top - 11:52:11 up 189 days, 22:45,  7 users,  load average: 16.05, 18.26, 20.21
Tasks: 216 total,  11 running, 205 sleeping,   0 stopped,   0 zombie
Cpu(s): 96.9% us,  1.5% sy,  0.0% ni,  0.0% id,  0.1% wa,  0.5% hi,  1.0% si
Mem:   8156992k total,  8131756k used,    25236k free,    75116k buffers
Swap:  2097144k total,  1341488k used,   755656k free,  6987084k cached


Seems like the oracle server is out of memory. It start to use swap space now.
And the CPU load seem overload also.

What todo ??

statcounter from8to5.blogspot.com

as per today chart ... Ganbatte!!

Tor browser control port

The tor proxy can be change automatically by issuing command in the tor control port #default 9051.
Have it enable in torrc file

http://thesprawl.org/memdump/?entry=8

Tuesday, March 8, 2011

Change vidalia identity programatically

# check for ControlPort 9051 is the the torrc file

telnet 127.0.0.1 9051
Escape character is '^]'.
AUTHENTICATE <Hexed_Cookie_Contents_Here>
250 OK
signal NEWNYM
250 OK
quit

Saturday, March 5, 2011

Linux :: Determine which kernel version is in use

To determine which kernel version is in use, type the following in a terminal window:

rpm -qf /boot/vmlinuz

Friday, March 4, 2011

Server status

Current Time: Friday, 04-Mar-2011 23:30:22 MYT
Restart Time: Friday, 04-Mar-2011 07:02:10 MYT
Parent Server Generation: 0
Server uptime: 16 hours 28 minutes 11 seconds
Total accesses: 570849 - Total Traffic: 5.0 GB
CPU Usage: u458.55 s96.34 cu0 cs0 - .936% CPU load
9.63 requests/sec - 88.7 kB/second - 9.2 kB/request
111 requests currently being processed, 49 idle workers

14” Laptops Powered by Intel(R) Core™ i5 processors starting at RM2,149* - only in Dell


Dell™ Inspiron™ 14R
Power through your daily tasks with ease.
Intel® Core™ i5-480M processor
Genuine Windows® 7 Home Premium
4GB* Memory / 500GB* Hard Drive
14" HD WLED TrueLife™ Display
1 year In-Home Services*
Online price
RM 2,299*
Price includes delivery
Recommended upgrades
Microsoft® Office Home and Student 2010 at RM274
McAfee® SecurityCenter™ (15 to 24 Months) at RM35
Dell™ Inspiron™ 14R
Shop Now
E-value code: T512019MY
Dell™ Inspiron™ 14
Dell™ Inspiron™ 14
Compact and lightweight design for mobility and entertainment.
Intel® Core™ i5-480M processor
Genuine Windows® 7 Home Premium
4GB* Memory / 500GB*
Hard Drive
14" HD WLED TrueLife™ Display
1 year In-Home Services*
Dell™ Inspiron™ One 2310
Dell™ Inspiron™
One 2310
All in One. Fun for All.
Intel® Core™ i3-380M processor
Genuine Windows® 7
Home Premium
4GB* Memory / 500GB*
Hard Drive
23" WLED Non-Touch Screen
1 year In-Home Services*
Online price
RM  2,149*
Price includes delivery
Shop Now
E-value code:T512027MY
Online price
RM  2,499*
Price includes delivery
Shop Now
E-value code: T211101MY
Alienware OptX™ 23" Full HD Monitor (AW2310) Dell™ 24" Full HD WLED Monitor (ST2420L) Targus Curve 16 Backpack (grey/platinum)
Alienware OptX™ 23" Full HD Monitor (AW2310) Dell™ 24" Full HD WLED
Monitor (ST2420L)
Targus Curve 16 Backpack (grey/platinum)
Fully compatible with NVIDIA® 3D
Vision™ technology.
Slim and elegant design. Carry and protect your laptops in style.
Online price
RM 1,499*
Price includes delivery
Online price
RM 599*
Price includes delivery
Online price
RM 119*
Price includes delivery
Shop Now Shop Now Shop Now
E-value code: T14AW2310MY E-value code: T14ST2420LMY E-value code: 460-11472

Centos 7 reset root/ any user lost password / lockout due to cant remember password

1. Need to be in front of the terminal. (Physically if not vm). 2. Reboot the server 3. Press 'e' in the GRUB2 boot screen. 3. bunch...