The last two evenings I spent on installing Oracle 10g on my iBook. Don't ask why I have to have Oracle on an iBook, I just wanted to play around with it. Problem was that I haven't read somewhere before that right now no Oracle database seems to run on Apple's Tiger yet but only on 10.3 ("Panther").
When I realized that, I already had tried to solve the problem a few hours. So I wasn't in the mood to let it go. There had to be a way and I think - a few minutes ago - I found it.
But I will start from the beginning. I'd like to have a manual for myself, too, because I forget stuff like that when I haven't done it for some weeks or months...
1. System RequirementsMac OS X 10.4 Tiger
to be precise it was
$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.4.1
BuildVersion: 8B15
Developer Tools (Xcode) 2.0 installed
2. Create Required User and GroupsI used the command line instructions from the
Database Installation Guide 10g for Mac OS X.
As root create the
oinstall group with an unused group ID. I chose 600.
# nicl . -create /groups/oinstall
# nicl . -append /groups/oinstall gid 600
# nicl . -append /groups/oinstall passwd "*"
Next do the same for the
dba group. I chose 601 here.
# nicl . -create /groups/dba
# nicl . -append /groups/dba gid 601
# nicl . -append /groups/dba passwd "*"
Then create the user
oracle with an unused user ID. I chose 601 here again.
# nicl . -create /users/oracle
# nicl . -append /users/oracle uid 601
# nicl . -append /users/oracle gid 600
# nicl . -append /users/oracle shell /bin/bash
# nicl . -append /users/oracle home /Users/oracle
# nicl . -append /users/oracle realname "Oracle Owner"
Now add the oracle user to the dba group.
# nicl . -append /groups/dba users oracle
Create a home directory and change the owner and group:
# mkdir /Users/oracle
# chown oracle:oinstall /Users/oracle
Finally, set the password for the oracle user:
# passwd oracle
3. Create DirectoriesI created two directories, one for the Oracle software and one for the data files. This is a
suggestion in the Quick Installation Guide and is not needed. Right now it does not even make sense because both directory are on the same volume. So, don't care and handle the following section as you want.
Create the Oracle software directory as follows:
# mkdir -p /Volumes/OSX/Applications/oracle
Create the directory for datafile as follows:
# mkdir -p /Volumes/OSX/oradata
Change the groups and permissions for the directories you just created by executing these commands:
# chown -R oracle:oinstall /Volumes/OSX/Applications/oracle
# chown -R oracle:oinstall /Volumes/OSX/oradata
then
# chmod -R 775 /Volumes/OSX/Applications/oracle
# chmod -R 775 /Volumes/OSX/oradata
4. Configure Kernel ParametersWhen installing Oracle on Linux or other flavors or UNIX, certain kernel parameters will have to be adjusted for Oracle to run properly. The Quick Installation Guide specifies the
proper minimum values.
To verify the kernel parameter values, execute:
# /usr/sbin/sysctl -a | grep corefile
# /usr/sbin/sysctl -a | grep sem
# /usr/sbin/sysctl -a | grep maxproc
I got the following output:
# /usr/sbin/sysctl -a | grep corefile
kern.corefile = /cores/core.%P
# /usr/sbin/sysctl -a | grep sem
kern.sysv.semmni: 87381
kern.sysv.semmns: 87381
kern.sysv.semmnu: 87381
kern.sysv.semmsl: 87381
kern.sysv.semume: 10
kern.posix.sem.max: 10000
# /usr/sbin/sysctl -a | grep maxproc
kern.maxproc = 532
kern.maxprocperuid = 100
So I only had to adjust the last two values by executing:
/usr/sbin/sysctl -w kern.maxproc=2068
/usr/sbin/sysctl -w kern.maxprocperuid=2068
To make these values stick, that is, presist after a reboot, edit
/etc/sysctl.conf and add lines for values that need changing. I used vi to edit the file, but you can use any text editor.
kern.maxproc=2068
kern.maxprocperuid=2068
5. Set Shell LimitsFor performance reasons, shell limits need to be adjusted. Begin by navigating to the directory that contains the
IPServices script.
# cd /System/Library/StartupItems/IPServices
Using any text editor, edit the file IPServices and add the following ulimit commands inside the StartService() function:
ulimit -Hu 2068
ulimit -Su 2068
ulimit -Hn 65536
ulimit -Sn 65536
It should then look like this:
StartService ()
{
if [ -a /etc/com.apple.named.conf.proxy ]
then
echo "Starting Internet address sharing"
/usr/libexec/InternetSharing
fi
ulimit -Hu 2068
ulimit -Su 2068
ulimit -Hn 65536
ulimit -Sn 65536
}
6. Configure User EnvironmentThe installer will be run from the oracle user. But before you can run the installer, however, the environment for oracle has to be set properly.
While logged in as oracle, I created the
.bash_profile for the user which contains the following:
umask 022
ORACLE_BASE="/Applications/oracle"
ORACLE_SID=AW01
ORACLE_HOME="/Applications/oracle/product/10.1.0/db_1"
export ORACLE_BASE ORACLE_SID ORACLE_HOME
export PATH=$PATH:$ORACLE_HOME/bin
Actually I added the ORACLE_HOME much later, so this is the result from the later installation.Then I sourced the .bash_profile by exectuing
oracle$ source ~/.bash_profile
7. Add Hostname to /etc/hostsBecause I get the IP address through DHCP from a wireless router, I had to make sure the installer could find this IP address by adding it to my
/etc/hosts file. You may not need to do this, depending on how your machine is networked. If, during the install process, you see an error related to the installer not being able to determine the IP address, stop the installer, perform these steps and launch the installer again. As Root, edit the file
/etc/hosts and add an entry with your hostname and IP address. I determined my IP address by executing the following commands as root:
root# hostname
root# ifconfig -a
The first command returned iBook.local. The second returned configuration details for each network device. The IP address for en0 is 192.168.0.133. So, I added a line to my
/etc/hosts file.
It was interesting that I had to log off from the system to make these changes be recognized by the oracle installer while it was immediately available in the shell.8. Installing OracleFirst you have to
download the necessary files from OTN. To install the database, you'll need the file
ship_mac_db.cpio.gzYou have to download them either as user oracle or copy them to /tmp and then get them as oracle and move them to /Volumes/Application/oracle/stage. I created the
stage directory there first.
In the
stage directory you have to umcompress the file:
oracle$ gunzip ship_mac_db.cpio.gz
oracle$ cpio -idm <>
Now start the installer and hold ya horses:
oracle$ cd Disk1
oracle$ ./runInstaller
If you don't know what to do in the installer take a look at the Quick Installation Guide, because I don't want to write that down now.
And now comes the tricky part, because the installer will not finish successfully, but break while trying to start some assistant at the end of installation.
9. Fixing the Oracle Installation
When the installer breaks just finish the installation as possible. We now will relink the complete libraries. I don't know why I have to do that but maybe it would have helped to set the gcc version before installing oracle. I will try to that next time.
But now we change the default gcc version:
gcc_select 3.3
Change directory to $ORACLE_HOME/lib
and
mv libnnz10.dylib libnnz10.dylib.ori
Now make sure that you have added $ORACLE_HOME/bin
to your path. If not do so and then
relink all
When everything has been relinked you only have to move that file back
mv libnnz10.dylib.ori libnnz10.dylib
Now you will be able to run dbca and create your database.
Was a tricky one, but Google knew a few links that solved the problem, after reading through a bunch of useless ones.
Update: Just a small note. Please read the comments below for additional information. Matthew has also been able to install Oracle on Leopard already. Thanks again.
Technorati Tags: hacking, mac, oracle, os x, database