Tuesday, February 23, 2010

aio-max-nr parameter for Oracle database 11G R12 on Ubuntu

When installing a Oracle database on a Linux server, for example Ubuntu you can come across a warning during the installation that you have to change your aio-max-nr parameter. This warning will most likely come in a format like below:

This is a prerequisite condition to test whether the OS kernel parameter "aio-max-nr" is properly set.
Expected Value : 1048576
Actual Value : 65536

The /proc/sys/fs/aio-max-nr file is the maximum number of allowable concurrent requests. The maximum is commonly 64KB, which is adequate for most applications. This is related to asynchronous I/O usage on your system. IBM is running a great article on this which you can find here at the IBM website where they dive into the POSIX AIO API.

To solve the problem in hand you have to add the below line to your /etc/sysctl.conf file.

fs.aio-max-nr = 1048576

After you have done so you can activate your settings by executing the following command:

sysctl -p /etc/sysctl.conf

When this is done you should be set and ready to continue the installation of your database.

mem parameter for Oracle database 11G R12 on Ubuntu

When installing Oracle database 11G release 2 on a Ubuntu Linux you can come accross some mem related parameters which you have to set correctly.

Most likely those will be:
- rmem_default
- rmem_max
- wmem_default
- wmem_max

The Oracle database installer will check those and expects certain values for those parameteres.

- rmem_default = 262144
- rmem_max = 4194304
- wmem_default = 262144
- wmem_max = 1048576

To set those parameters in such a way that it will stay after a reboot you will have to make some changes to the file /etc/sysctl.conf . You will have to add the following:

net.core.rmem_default=262144
net.core.wmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_max=1048576

after you have added those lines you can activate them without a reboot by executing the following command:

sysctl -p /etc/sysctl.conf

After this your database should be able to install.

ip_local_port_range parameter for Oracle database 11G R12 on Ubuntu

When installing a Oracle database on a Ubuntu linux system the installer can ask you to change the settings of your ip_local_port_range parameter. This will most likely be presented to you in the following format:

OS Kernel parameter: ip_local_port_range
This is a prerequisite condition to test whether the OS kernel parameter "ip_local_port_range" is properly set.
Expected Value : between 9000 & 65500
Actual Value : between 32768 & 61000

The /proc/sys/net/ipv4/ip_local_port_range defines the local port range that is used by TCP and UDP traffic to choose the local port. You will see in the parameters of this file two numbers: The first number is the first local port allowed for TCP and UDP traffic on the server, the second is the last local port number. For high-usage systems you may change its default parameters to 32768-61000 -first-last.


echo "net.ipv4.ip_local_port_range = 9000 65500" >> /etc/sysctl.conf
sysctl -p /etc/sysctl.conf

This should solve your problem and you should be able to install the Oracle database on your system.

shmmax parameter for Oracle database 11G R12 on Ubuntu

When installing a Oracle database 11G release 2 on a Linux system you can encounter the following error:

OS Kernel Parameter: shmmax
This is a prerequisite condition to test whether the OS kernel parameter "shmmax" is properly set.
Expected Value : 536870912
Actual Value : 33554432

The SHMMAX parameter is used to define the maximum size (in bytes) for a shared memory segment and should be set large enough for the largest SGA size. If the SHMMAX is set incorrectly (too low), it is possible that the Oracle SGA (which is held in shared segments) may be limited in size.

The way to solve this issue is executing the following commands:

echo "kernel.shmmax=536870912" >> /etc/sysctl.conf
sysctl -p /etc/sysctl.conf

This should resolve your issue and make sure you can install your database.

semopm parameter for Oracle database 11G R12 on Ubuntu

When installing a Oracle database 11G release 2 database on Linux you can encounter the following error. I received this when installing Oracle database 11G release 2 on a Ubuntu Linux system.

OS Kernel Parameter: semopm

This is a prerequisite condition to test whether the OS kernel parameter "semopm" is properly set. (more details)
Expected Value : 100
Actual Value : 32


The SEMOPM kernel parameter is used to control the number of semaphore operations that can be performed per semop system call.

The semop system call (function) provides the ability to do operations for multiple semaphores with one semop system call. A semaphore set can have the maximum number of SEMMSL semaphores per semaphore set and is therefore recommended to set SEMOPM equal to SEMMSL. Oracle recommends setting the SEMOPM to a value of no less than 100. When you need to change the semopm value you can do the following:

echo "kernel.sem=250 32000 100 128" >> /etc/sysctl.conf
sysctl -p /etc/sysctl.conf

This should solve this issue and you should be able to install the database.

file-max parameter for Oracle database 11G R12 on Ubuntu

While installing a Oracle 11G release 2 database on Ubuntu Linux I encountered the following error:

OS Kernel Parameter: file-max

This is a prerequisite condition to test whether the OS kernel parameter "file-max" is properly set.
Expected Value
: 6815744
Actual Value
: 198903

Stating that the file-max kernel setting should read 6815744. The solution to this is to edit the file /etc/sysctl.conf and add the (or change a existing line to) line to the following:

fs.file-max = 6815744

After you have done so you will have to activate the new file-max setting. One can do so by a reboot or you can do it on the fly by executing the following command:

sysctl -p /etc/sysctl.conf

This should have resolved your issue. You can check it by executing the oracle database installer or you can directly check from the command line by executing the following command:

cat /proc/sys/fs/file-max

The result of this should now list 6815744

Wednesday, February 17, 2010

Steven Feuerstein at Capgemini NL

Within some time we get Steven Feuerstein as a guest speaker at one our Capgemini events and I was asked to write something in our newsletter to warm the people to come… One of the things I have been writing is a reference to the below youtube movie which is partially made by Steven.

"You did WHAT?

You wrote an explicit cursor? You declared a variable using the VARCHAR2 datatype? You raised an exception to skip over unnecessary lines of code?

If slip-ups like these sound familiar (or if you don't know why these are mistakes), join Quest for a one-hour Webcast featuring guest speaker, Steven Feuerstein, as he examines common mistakes in Oracle PL/SQL programming. Learn how to correct mistakes to improve the maintainability and performance of your application.

This Webcast will also demonstrate CodeXpert — a powerful feature available within Toad® that will help you avoid common mistakes and ensure you implement PL/SQL best practices in your daily activities. "




Friday, February 12, 2010

Create logical volumes in HP-UX

I have been requested some time ago by one of our DBA’s to assist in building some test environments. We do currently have some HP-UX systems available as test environments. Problem is that those servers have been used in the past couple of years for all kind of test environments and for some reason people decided to organize the disks and logical volumes in a strange way by dividing them all in small parts where we will be in need of some large logical volumes to be able to install Oracle EBS R12.

To be able to get a large /u01 mount to be able to install Oracle EBS R12 on HP-UX I have taken the following steps:

(1) Identify how the disks are currently arranged. You can use the standard df command for this.


cjibu601:root-/ # df -k
/appora/cjibow (/dev/vg00/dbsoft ) : 19662197 total allocated Kb
19639976 free allocated Kb
22221 used allocated Kb
0 % allocation used
/asmbck (/dev/vg00/asmbck ) : 62916663 total allocated Kb
62883134 free allocated Kb
33529 used allocated Kb
0 % allocation used
/backup (/dev/vg00/backup ) : 97305244 total allocated Kb
77897028 free allocated Kb
19408216 used allocated Kb
19 % allocation used
/home (/dev/vg00/lvol5 ) : 130920 total allocated Kb
22928 free allocated Kb
107992 used allocated Kb
82 % allocation used
/mnt/test (/dev/vg00/test ) : 19662196 total allocated Kb
19639975 free allocated Kb
22221 used allocated Kb
0 % allocation used
/opt (/dev/vg00/lvol6 ) : 6533208 total allocated Kb
2597920 free allocated Kb
3935288 used allocated Kb
60 % allocation used
/oradata (/dev/vg00/oradata ) : 98306681 total allocated Kb
98263900 free allocated Kb
42781 used allocated Kb
0 % allocation used
/tmp (/dev/vg00/lvol4 ) : 521568 total allocated Kb
458424 free allocated Kb
63144 used allocated Kb
12 % allocation used
/usr (/dev/vg00/lvol7 ) : 6392288 total allocated Kb
3854232 free allocated Kb
2538056 used allocated Kb
39 % allocation used
/var (/dev/vg00/lvol8 ) : 4710776 total allocated Kb
1003760 free allocated Kb
3707016 used allocated Kb
78 % allocation used
/stand (/dev/vg00/lvol1 ) : 391712 total allocated Kb
204008 free allocated Kb
187704 used allocated Kb
47 % allocation used
/ (/dev/vg00/lvol3 ) : 654256 total allocated Kb
214200 free allocated Kb
440056 used allocated Kb
67 % allocation used
cjibu601:root-/ #



(2) Now we do know what is mounted and where they are mounted so we will be able to take a closer look at the logical volumes. You can check the settings of a logical volume in HP-UX by using the lvdisplay command. For example a lvdisplay on /dev/vg00/backup


cjibu601:root-/tmp # lvdisplay /dev/vg00/backup
--- Logical volumes ---
LV Name /dev/vg00/backup
VG Name /dev/vg00
LV Permission read/write
LV Status available/syncd
Mirror copies 0
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 100096
Current LE 782
Allocated PE 782
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation strict
IO Timeout (Seconds) default



(3) After we have found all the information we needed we can remove the logical volumes. First you have to unmount them by using umount. When the logical volumes you want to remove are dismounted you can remove them by using lvremove. For example lvremove /dev/vg00/backup


(4) After removing all the unwanted logical volumes you want to do some housekeeping by removing all the references in /etc/fstab and removing the mountpoint on your filesystem. This will prevent you system from trying to mount a logical volume in the future which is no longer existing because you just removed it.


(5) Now you can create a large new logical volume. One can do so by using the command lvcreate. When executing lvcreate you need to give some extra information. –L is the size you want it to have in MB’s, -n is the name you want your logical volume to have. In our case that is u01 and you have to state what logical volume group it will be part of. This last one is in our case /dev/vg00

This will end up in the following:


cjibu601:root-/dev/vg00 # lvcreate -L 319232 -n u01 /dev/vg00
Logical volume "/dev/vg00/u01" has been successfully created with
character device "/dev/vg00/ru01".
Logical volume "/dev/vg00/u01" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
cjibu601:root-/dev/vg00 #



(6) Now we have a new logical volume named u01 which is located at /dev/vg00/u01 all we have to do now is to make sure we get a filesystem on this one. One can do so by executing the newfs command. Please note that we do NOT use /dev/vg00/u01 we do use in this case /dev/vg00/ru01 .


cjibu601:root-/dev/vg00 # newfs -F vxfs /dev/vg00/ru01
version 6 layout
326893568 sectors, 326893568 blocks of size 1024, log size 16384 blocks
largefiles supported
cjibu601:root-/dev/vg00 #



(7) Now you can add this to your /etc/fstab file and mount your new logical volume.

Deserted island testing Linux and Oracle 11G database

Within some time I will try something new, a exiting exercise. For some reason some people around me decided we had to go for a ski and snowboard trip. I tried to fight this and make sure I did not have to be part of this trip as I do not like snowboarding and such. However, with some help from alcohol, they convinced me to join them on the trip. I agreed on a couple of conditions, they should not worry about me having no fun if I not joined them while they were snowboarding and they should leave me in peace when I decided to stay behind.

So I will be a long weekend in somewhere in Europe most of the time alone and honestly I am looking forward to it. When we go my new house should have finished and I should have moved over. No more builders asking me all kind of questions about what type of solution I would like for a particular building problem and it will give me some time to relax from a hectic time at work before the next phase of hectic projects start. Finally some time to keep up with my reading and most important do the island test of my Linux laptop.

The island test is, in my opinion, that you test an installation and your own knowledge and problem solving capabilities like you where on a deserted island. I am already prepping my laptop for this by installing a Oracle database and some tools I will need for the project I hope to finish in this long weekend. I will have no access to the internet or to people who will be capable of helping me solving the issues I encounter.

The project I will be undertaking, besides reading a 500+ page book I like to read is a script that will create the documentation on database installations I need to provide from time to time. All the settings that are applied, a database relation diagram, etc etc… Customers do expect those documents from time to time and it is always a hassle to create those documents so I decided to create a script that will create a docx document for me.

If it is any good I will post it into the public domain so everyone can benefit from this.

Friday, December 18, 2009

Ubuntu Linux network proxy

In my previous company I made the switch from Windows to Linux. Again at my current company I am trying the same at the moment. The difference between the situation now and the previous situation is that I am switching more and more between locations and customers. I feel from time to time a laptop nomad and have to change settings every time I am at a different network.

I have been switching to Ubuntu Linux and here you can setup your network proxy quite easy. You have different profiles you can set and store and simply select the profile of the customer you are currently at. You can find this tool under "System" -> "Preferences" -> "Network Proxy". As you can see in the screenshot below you can set a profile and the settings are not that different from for example the firefox settings for a proxy server.

Under the details button you can state a possible username password you might need if your proxy server needs some form of authentication. The good part about this is that you only have to set it here and all your applications are now using this setting.

If you travel a lot between different networks the option to make different profiles is very very handy.



Monday, October 12, 2009

Mono, Tomboy, .NET and my mistake

My Mother told me something a long time ago, if you are wrong and you made a mistake this is not something to be ashamed of as long as you admit you did.

So maybe it is time to admit it for some parts. I am talking about my post on Mono/TomBoy and how it tangles in .NET into mainstream Linux. After posting this blogpost it took some time for Google to pick it up and tell people the page was out in the open. However after it did I was contacted via a comment by the lead developer from the Tomboy project.

Sandy had to state some things about my post and I am glad to have received this update. It might changes my opinion on some parts however not in all. Sandy stated the following:

1) Mono does not depend on any .NET or any Microsoft code. It is a free software *reimplementation* of the .NET runtime, framework, and languages. All of the code you need to run Tomboy (for example) is 100% open source and free software, and totally compatible with the GNU GPL. Richard Stallman agrees with this and has stated it before. So you are more than welcome to download the Mono source, and tweak the runtime or change the C# language or do anything you want! :-)

Agreed, you are completely right and I was wrongly informed that some parts of Mono where closed. I did already know that the complete sourcecode of Tomboy was opensource and could be changed however I was under the impression that some parts of Mono where still closed and under control by Microsoft. So I have to change my opinion on this based upon the information from Sandy.


2) Richard Stallman's main complaints about Mono that I have heard are the following:
a) Because Mono is a reimplementation of .NET, and Microsoft decides what is in .NET, you could say that Microsoft indirectly influences what ends up happening in Mono.
b) Microsoft has a lot of patents on a lot of things, and Stallman is concerned that there might be patents that affect Mono.

So, Stallman's argument against Mono is not about having the source, or it not being free software, or anything like that. It's more of a political and philosophical thing.

Lets not keep us at the statement given by Stallman. My own opinion is that as a patent might (read might) be end up in mono it can influence Tomboy so one should not take this risk. Maybe I am a purist like Stallman that might be the case. However this is my opinion. So as I stated in my previous post I would like to be able to pack my stuff and go to a island and be able to do whatever I like. So even if I have all the sourcecode I can still end up in a situation where a ship comes to my island and tells me I am doing illegal things because I am tinkering with patents by Microsoft. To prevent this one should pick a language in which this will never happen.

It might be a political and philosophical discussion however I think we have to have this discussion to be able to think about what we do allow in mainstream Linux and what not. Currently I am under the impression that we should prevent this wherever we can to protect the purity of Linux. In my humble opinion we should try to prevent it from happing that anything which potentially can harm the free form of linux ends up in a Linux distribution.

So I might have made some mistakes and I hope I have corrected them in this post, I might have been not to clear on some points and I hope I have corrected them in this post and I hope some people would like to comment on this post so we might be able to start a discussion on it. This is because I have the feeling this is a discussion we will have to have to decide what to do with those political and philosophical implications of opensource.

Sunday, October 11, 2009

No .NET in Linux

Richard Stallman has opposed against a single app, Tomboy, which has become part of the current unstable release of Debian Linux. Reason for this is that it is depending on MONO. Mono is a cross platform, open source .NET development framework and his concern is that Microsoft might someday stop with .NET and as MONO is depending on .NET also all the applications build with MONO are depending on it and so are depending on a Microsoft. His statement is that all that is in Linux should be open and by this all the source codes should be available which is not the case with .NET.

Richard is seen as one of the most brilliant people in the opensource world however also seen as one the hardliners in the opensource world who is not willing to make any compromise on his thoughts of what opensource is and should be. Some people think he is reacting to strong and state that he has become to much of a hardliner. I do however agree with him on this. Linux should be complete opensource and by adding a application like Tomboy we are compromising to this thought. Linux should be a platform that you can change to your liking and by having a dependancy to closed source you loose this ability.

In my opinion you should be able to pack linux on a laptop, get all the sourcecode, and move to a deserted island and be able to do anything you like to it without having the need to contact anyone. Complete freedom and not depending on any other person. By adding tomboy to it you are depending on Microsoft and to the thinking of Microsoft. If you need a function changed in .NET for some reason you will have to wait until Microsoft decides to do it, if they ever do it. And not only is this the case with .NET it is also the case with for example C#.

it is not a issue of opposing against a language, everyone should pick the language he or she likes to use. It is opposing against mixing licenses in Linux. As Mono is depending on .NET and .NET is not GNU/GPL compliant it should never become part of a linux mainstream release. If you really like it you should have the option to implement it however I would vote against it as it is not GNU/GPL compliant.

If you coding in for example Python and you need a special part of the compiler changed for some reason you do have the ability to go to the Python website, check the sourcecode, change it and make you own version. That is complete freedom as it should be. Not many people will do it however you do have the option if it is really needed. As some person from the US army once stated about systems that would make it to the battlefield, “if we can not hack it we do not pack it” and that is a very true statement. If you do not have the option to make modifications to it when the situation calls for it it is useless.

So, placing Tomboy in Debian and by this making yourself depending on Microsoft is a very bad move. Richard can be seen as a hardliner however I can only agree with him on this part.



Linux find command

sometimes finding out the way a Linux or UNIX command is working can be fun. For example I have been looking into the way how the find command is working and I have had a lot of fun with it. find can give you a great option to locate exactly the files you want and with the pipe options in Linux you can get exact that output you want and need.

The reason for me to look into the find command was a interface at a server at a customer. The interface consist basically out of remote servers who place files with FTP in certain locations. On the server side we have a couple of processes scheduled looking for files in certain directories who will process and delete the files. The processes run every 10 minutes, as we have some files that can be large the processing can take some time so files can be at the location for some time. However, never longer than 1 hour. So what we want the administrators would like to have is a system that looks for files older than 1 hour because this can indicate a interface that is stuck for some reason.

As we maintain a large number of servers and interfaces this can not be done by hand and has to be automated. The solution is to schedule a scrip that will look for the files and send the output every hour via mail. Even in the cases no files older than 1 hour are find a mail should be send because this is a trigger to see if the check has run.

First is to find out how you can locate files older than 1 hour. We will be using the find command for this. We will use the following command:

find . -type f -mmin +60

find is the command to find files. the “.” indicates that you want to look in the current directory. than we have the “-type f” option. “-type” allows you to set what kind of files you are looking for. f states that you are looking for regular files. If you for example are looking for directories you can state d and if you are looking for a link you can state l. for the complete list you can refer to the man page of find.

We also states -mmin +60. This indicates that you are looking for files older than 60 minutes. You can play with +60, if you are looking for files for example that are NOT older than 60 minutes you can state -60 instead.

Now we do not want the standard output because we do want to have more information, somewhat like the output we get from the ls command. For this we can do a “internal” pipe to the ls command with the -exec option. for the -exec we set ls -la so we get all the ls output. The command will look like this:

find . -type f -mmin +60 -exec ls -la {} \;

However this is still not what we want because we only want the filename and the time it is created. currently we get something like:

-rw-r–r– 1 jlouwers staff 0 Oct 11 11:14 ./x
-rw-r–r– 1 jlouwers staff 0 Oct 11 11:23 ./z/x

So we have to change the output and we can do this by using awk. We have to pipe the output from the above command to awk and than make sure we only get what we want. And what we want is filename and time. nothing more. So we can do this by using awk. According to the UNIX manual pages AWK is a pattern scanning and processing language… simple told.. it is a damn handy tool to make stuff look like the way you want it.

We pipe the data into the following command:
awk ‘{print $8,$9,$10}’

which makes the complete command look like:
find . -type f -mmin +60 -exec ls -la {} \; | awk ‘{print $9,$10}’

and the output will look like:
11:14 ./inbound_225/225int_inb.txt_65466
11:15 ./inbound_225/225int_inb.txt_65467
11:25 ./inbound_225/225int_inb.txt_65468
11:23 ./inbound_256/256int_inb.txt_43221
11:24 ./inbound_256/256int_inb.txt_43222

One last thing you might want to add, if you are running the command on a directory and you do not have access to all sub-directories you might end up in a situation where you get access denied errors in your output which can disturb your checks so you can pipe all the error messages to /dev/null . You can do this by editing the command that it will look like the command below:

find . -type f -mmin +60 -exec ls -la 2>>/dev/null {} \; | awk ‘{print $8,$9,$10}’

A lot more options are in the find command, you have however to check out the manual and have some fun with it while trying.



Sunday, October 04, 2009

Sun Solaris manual pages

We are now providing again a option to check UNIX manual pages from our website. Special thanks to the University of Alabama, University of Athens, SGI and the University of Southampton.

Read the complete story at terminalcult.org >>


TEDx in Amsterdam

TEDx is coming to Amsterdam. Very exciting to have a TEDx event in Amsterdam. TED is a small nonprofit devoted to Ideas Worth Spreading. It started out (in 1984) as a conference bringing together people from three worlds: Technology, Entertainment, Design.

Read the complete story on terminalcult.org >>