Recent Posts














POPULAR TAGS





CATEGORIES


Installing Crunchbang Linux (#!) & Oracle 11g Enterprise

March 20th, 2012

A Step by Step guide on installing Crunchbang Linux (A Debian based lightweight distro – referred to as #! from here on) and configuring it for, and installing, Oracle 11g R2 Enterprise Edition.

Downloading ISO file and Installing Crunchbang

First of all make sure the MD5 checksum given on the download page matches your downloaded file. I used MD5 for Mac OSX, Linux comes with MD5, Windows you will need to download a 3rd party MD5 checker. You can burn without doing this of course, but at least validate the data is readable and correct with your burner software. That is no substitute  for MD5 though, so you have no guarantees using this method. It took me three attempts to get a valid download file, in the end using a bit torrent client for better stability.

Once you have your bootable CD (i.e. you have burned the iso image file using suitable software) then installation of #! is reasonably straightforward. Assumptions here are a clean install on an intel based  x86 desktop PC/Server.

Once your selections are made re. country/language/network name/user name etc. the installation asks for partitioning information. To keep it simple, and because this is going to be my own Oracle sandpit server, I created the following partitions:

#1 primary 10GB /

#5 logical 3GB swap

#6 logical 150GB /home

But you can configure to suit your needs of course. The default partitions as recommended by the installer seemed a little tight on space to me, and I didn’t want to have to mess around with the volumes during the Oracle install, hence my simple approach.

OK, so once done, the changes are written to disk and the system installs. #! Is a lightweight distribution and it installs pretty quickly. Its a fairly hands on OS, which is why I chose it.

Once installed and rebooted, the system prompts you to run ‘cb-welcome’ which I did. NB Internet connection required. (My ASUS USB Wireless Card was detected and wireless connection was easy. I would stay away from Netgear though, if possible, which I learned from many lost days during previous Linux installations.) [UPDATE: I had to turn power management off for the ASUS USB adapter for stability of connection. I wrote 'iwconfig wlan0 power off' into the /etc/rc.local file so it is run at startup.]

cb-welcome guides you through the latest system changes and also installs things like Printer Support and Java Runtime Environment.

Crunchbang really is very easy to install. Oracle, however, is a slightly different kettle of fish…

Prerequisites for Oracle 11g

Once cb-welcome has run through the following prerequisites were checked and installed if required. Obviously, if your linux installation is missing any of the packages I have marked as ‘already installed’ just install them using apt-get as normal. Need to SUDO to root user or be root for all these.

binutils     –     already installed

autconf    -    REQUIRED – (run apt-get install autoconf)

automake    -    already installed

bzip2    -    already installed

gcc    -    already installed

less    -    already installed

libc6-dev    -    already installed

make    -    already installed

libstdc++5    -    REQUIRED (apt-get install libstdc++5)

unzip    -    already installed

zlibc    -    REQUIRED (apt-get install zlibc)

libaio1    -    REQUIRED (apt-get install libaio1)

build-essential    -    already installed

Also, the packages unixODBC, unixODBC-dev, elfutils, sysstat, pdksh and expat are not mandatory requirements, but the installer does check for them so I recommend installing. None of them are very large.

x-terminal

For the x-terminal I used fluxbox as it was recommended elsewhere. Any will do though.

apt-get install fluxbox

Set Up Oracle User and Groups

groupadd oinstall
groupadd dba
useradd oracle -m -d /home/oracle -g oinstall -G dba -s /bin/bash
passwd oracle

Kernel Settings & Limits

To keep things simple I have put these into three scripts:

ksettings.sh lists all current settings

setmin.sh sets all required parameters to the minimum required by Oracle

setlimits.sh adds the limit parameters required by Oracle

Create Directories & Permissions

Many DBAs have specific ways of creating directories, separating data types, recovery files, pfiles, striping across disks  etc. This is no production database though, so I am again keeping things nice and simple and creating the minimum I require.

Firstly navigating to /home which is my largest partition.

mkdir -p u01/app/oracle
mkdir -p u02/oradata
mkdir -p u03/recovery_area
chown -R oracle:oinstall u01 u02 u03
chmod -R 775 u01 u02 u03

Create Links

To prevent a couple of errors when the Oracle installer tries to link some libraries located slightly differently within Debian systems, add the following links:

ln -s /usr/bin/awk /bin/awk
ln -s /usr/bin/basename /bin/basename

And finally:

Reboot!

Running The Oracle Intaller

Assuming you have downloaded, checksummed, unpacked and transferred over your Oracle files….

Debian and certainly Crunchbang is unsupported at Oracle so some PreReqs will appear to be missing during Install. So, we can ignore them! Include the -ignoreSysPrereqs flag when running the installer. If the steps above have been successful (and you can check them again now with the ksettings.sh script) then installation should complete. Remember to run this as oracle!

su oracle

path_to_installer/database/runInstaller -ignoreSysPrereqs

Nb: If running this directly on the server and not through an XTerminal or anything, the main user (the user you entered when installing #!) needs to issue the command ‘xhost +’ Once you have SU’d to oracle, oracle needs to export the DISPLAY variable, like ‘export DISPLAY=”:0.0″ – This will allow the Installer to run correctly.

Work through the installer making as many or as few changes as you require. A lot of defaults are already set. Ignore the Prerequisite Checks failures (if any) – as long as above steps were followed, Oracle will install.*

And that’s it. Oralce 11g Enterprise Edition installed on an Openbox Linux distribution. Now wasn’t that more fun than installing Express Edition on Windows?

* UPDATE – UBUNTU 12.10

Having just installed Oracle 11g on Ubuntu 12.10 following my own guide above, spending a long and frustrating day doing so (fun though eh?),  the additional steps below need to be followed. This took me ages to locate, so putting them here so you don’t have to :)

First of all you might get errors saying some files can’t be found. These files are there and are are easily fixed using symbolic links as we did above with awk etc. Just set a symbolic link from /lib/i386-linux-gnu/<filename> to either /lib or /usr/lib as required (the error messages explain all. Look in the make.log in the ‘install’ directory under ORACLE_HOME)

Next, you will get some errors during the linking phase of the install. Once you get the first error:

Error in invoking target 'agent nmhs' of makefile

you need to open up a terminal, su to root user, and run the following:

export ORACLE_HOME=<path to oracle_home>
sed -i 's/^\(\s*\$(MK_EMAGENT_NMECTL)\)\s*$/\1 -lnnz11/g' $ORACLE_HOME/sysman/lib/ins_emagent.mk

Then you can hit ‘Retry’.

On the next error, which is actually a biggy and a long list of errors (check the make.log if you want to depress yourself) you need to open up a terminal, su to root user, and run the following:

export ORACLE_HOME=<path to oracle_home>
sed -i 's/^\(\$LD \$LD_RUNTIME\) \(\$LD_OPT\)/\1 -Wl,--no-as-needed \2/g' $ORACLE_HOME/bin/genorasdksh
sed -i 's/^\(\s*\)\(\$(OCRLIBS_DEFAULT)\)/\1 -Wl,--no-as-needed \2/g' $ORACLE_HOME/srvm/lib/ins_srvm.mk
sed -i 's/^\(TNSLSNR_LINKLINE.*\$(TNSLSNR_OFILES)\) \(\$(LINKTTLIBS)\)/\1 -Wl,--no-as-needed \2/g' $ORACLE_HOME/network/lib/env_network.mk
sed -i 's/^\(ORACLE_LINKLINE.*\$(ORACLE_LINKER)\) \(\$(PL_FLAGS)\)/\1 -Wl,--no-as-needed \2/g' $ORACLE_HOME/rdbms/lib/env_rdbms.mk

Again, hit the ‘Retry’ button.

After this it went very smoothly with no issues at all.

One quirk, which I think might be common across all distributions, is any special characters in passwords you select during database creation will cause an ORA-00992 error. Don’t know why. Don’t care. Just ignore it and reset passwords at the end. Or, better still, use non special character passwords. Has to be a bug…

There are loads of posts out there regarding Enterprise Manager and Listeners, automatic starting of db etc. etc. so not going to repeat them here.

Enjoy!


Dashcode – Checking List Values with Java

November 1st, 2011

Dashcode comes bundled with Apple’s Xcode iOS development tools, and I’ve been using it for a while now developing web enabled apps, as opposed to native objective C apps which you buy from iTunes/install on phone etc.  Web apps are often preferred as they offer more control, as well as cross compatibility and easier version update. They don’t, however, provide a form of income (in basic buy-the-app-online terms), but if your company or business is looking to provide your customers with a web enabled, appealing mobile interface which will in turn lead to more business, then web apps could well be the way to go.

I will be posting here fairly regularly with Dashcode snippets and ideas/solutions, but this first post comes as a response to  a problem I had, and one which I spent a good deal of time trying to solve. Like most solutions, the answer was fairly simple in the end, but I could find no information online anywhere, so I’m happy to provide it here.

Checking List Values With Java

The problem

Attaching a datasource for your web app is relatively easy with Dashcode, and Apple provides ready made ‘List’ parts for you to attach them to. I wont be going into how that is done in this post, but basically you have a stacklayout with a list of fetched values, attaching key values to the list labels. You can then click the list and move to a more detailed view of that record. Fairly straight forward, iPhone functionality.

What I needed to do was check each value of the list and do something different, depending on what values were fetched. However, the label element, the element that the datasource is attached to, can not be referenced in the normal getElementById or Name way. Every attempt to do so caused Dashcode to error.

Solution

Dashcode creates a default class name for your list labels, appending _template to the label name. So for example, lets say we have a list label called recordTitle – Dashcode calls the class of that element recordTitle_template.

It is this class we can reference in the getElementsByClassName() method in Java, which creates an array of values, which is exactly what we want.

So we end up with something like :

var labelArray = document.getElementsByClassName("recordTitle_template");
for (var i = 0; i<labelArray.length; i++)
{
if (labelArray[i].innerHTML="value to test for"){
// do something here;
}
else {
// do something else
}
}

A very neat and quick way to check through each value of the list and create conditional statements based on their values.


Google Plus Circles For Dummies!

July 18th, 2011

I’ve been using Google Plus for a week or two now having received an invite out of the blue, and I have to say, like most people, I think it has huge potential and provides a refreshing alternative to facebook. Google Plus is a much better thought out platform for sharing content and posts with specific groups of contacts. It takes the notorious facebook complexity out of privacy settings and enables you quickly and easily to target your posts, photos, videos, whatever to those  you want to share it with.

Great, I thought, how easy and simple is that? Create your circles, add the people into the circles, post away. Easy. But then the more I thought about it the more confused I became. The more posts I read on the same subject, the more confused I became. Who exactly sees my posts and when? It is, actually, very easy and my confusion came about by making a false assumption, but I suspect I’m not the only one. To that end, see below for my Google Plus Circles For Dummies Guide!

Who Sees My Post And When?

Every time you post in Google+ you can choose who you share your post with. So, for example, I set up a circle with 50 users who follow the same football team as I do. I searched through profiles and anybody who mentioned the team name and that they were a fan, I added. Great, I thought, a quick and easy way to share information with like minded people.

Well, yes and no, but mainly no.

A Public Post

First of all, a public post is not really a public post in that it doesn’t appear in anybody’s stream unless they have you in one or more of their circles. It’s easier to think of being in somebody’s circle as being followed by them. It can be a one way follow, or, if you add them to one of your circles, a two way follow. So, choose Public if you want everybody on Google+ who has you in a circle to see your post. In addition, and this is where the public bit comes in, anybody who looks at your profile and chooses your posts tab can see what you have posted. In that respect, it is open to the public, but not sent to anybody other than your followers.

(more…)


Joomla 1.5 – Customise The Article Icons

June 15th, 2011

I wanted a nice and simple way to offer a quick tweet button on each article in the same style and positioning as the email/print/pdf icons, which gives a very smart look, especially to section/category lists or blog articles.

I’m not sure how relevant being able to open up articles as pdf files is to most joomla installations, it certainly isn’t to any I have done, so I thought I’d re-use and re-hash the pdf code, the code responsible for supplying the icon and link to the pdf file, and adapt that to make a very neat twitter icon with dynamic title link.

First thing was to actually edit the typography.png file, which you will find in various places in a joomla installation. But if your template has one (most do), that is the one to edit. Open it up in photoshop or similar and carefully cut the pdf icon and replace it with the icon you want, in this case the standard blue twitter t icon.

I used photoshop guidelines to ensure positioning was correct, as the icon css is very precise. Just make sure that the new icon fits in the same space as the old PDF one.

Next I needed to edit the icon.php file which is located in the html/com_content folder of your theme.

The relevant section begins:

function pdf($article, $params, $access, $attribs = array())
{

I basically commented out the original pdf function and added a new one:

(more…)


SQLite for Small Businesses

May 20th, 2011

Small businesses need to make every penny count, and paying for web hosting is no exception. There are free and very cheap options available of course, such as Freeola (which I would recommend by the way) but they often do not include the use of a MySQL database, the bit required to store your data, essential if using a CMS (Content Management System).

We at Tessera Designs, however, have based some excellent systems around SQLite, a file based relational database more than capable of running a CMS. With some tweaks to core systems and existing plugins we have fully functional sites using nothing more than SQLite and PHP, which even the cheapest, or even the free providers include.

So don’t feel you need to add the monthly cost of MySQL provision to your budget, at least not to start with, you can be up and running with fantastic results for exactly zero a month! Contact us for more information.


Page 1 of 212
Weboy
WordPress Themes