Operating Systems
Comparing RPM’s between servers
Periodically, I will want to compare the RPM installations between two or more servers. Sometimes, I may not care about the specific versions of each RPM, but only that *some* version exists. To do this, I can use awk and print only the name of the RPM up to but not including where the... »
Using awk to extract bind variable values from a trace file
While troubleshooting a high CPU utilization problem recently, I found that half the sessions using a given database service were using a high amount of CPU, while the other were using a normal amount. Since I knew they were each running the exact same code, the logical conclusion was that the data differed. I... »
ipcrm not removing SGA shared memory segment
Today, I had an issue I had seen before, but I can never remember how I fix it. As such, I wanted to document it here. Although rare, periodically an abnormally terminated instance will leave behind a shared memory segment. Since the SGA is attached by key which is the database name and instance_number,... »
Loop through and print directory size
1 2 3 4 5 6 7 8 9 10 11 Set objShell = CreateObject("WScript.Shell") Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFolder = objFSO.GetFolder("C:\") Set colSubfolders = objFolder.Subfolders For Each objSubfolder in colSubfolders on error resume next Wscript.Echo objSubfolder.Name, objSubfolder.Size Next »
awk silliness
This one-liner will print every other character in upper case. 1 2 3 oracle@emgrid01 ~ >echo "the quick brown fox jumped over the lazy dog" | awk -F "" '{for (i=1; i <= NF;i++) {if (i % 2 == 0) {printf ("%s",$i)} else {printf ("%s",toupper($i))}};print ""}' ThE QuIcK BrOwN FoX JuMpEd oVeR ThE LaZy... »
instr() in awk
If you have a long command line string, as you may find with java processes with a lot of properties, what is below will allow you to print those “columns” with a certain value as delimited by a space in awk. This is much easier to read than just grepping for the value in... »
Who is the big load on my server?!
What is below will show SQL statements for a given window (the last four days in the example below) that are tightly correlated with load average on a server. In general, a statistical correlation greater than 60 means there is an increasing degree of correlation between the two data sets. If one goes up,... »
Using awk with group by functionality
You can use the following example if you need to total numbers over a group in a given file. We first show our sample file… 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 14:30:57 oracle@emgrid01 ~ >cat list.txt steve:61 steve:14 becky:57... »
Is memory allocated actually in use?
In an earlier article, we talked about actually initializing memory rather than just allocating it. This post will show how we can look at what is allocated in Linux, as well as when it shows as being in use and when it doesn’t. I found that memory will show up in pmap (really, pmap... »
Huge pages
Huge Pages is a feature available in later Linux kernels that provides two important benefits: 1. Locks the memory available to huge pages, so it cannot be paged to disk 2. Make the TLB (translation lookaside buffer) much smaller on the processor, as the number of entries is much smaller. This is due to... »