I tried to install Oracle Express 11g on CentOS following steps in this blog:
http://www.davidghedini.com/pg/entry/install_oracle_11g_xe_on
I installed successfully but i was unable to connect to the database. It kept giving me error:
ORA-01031: insufficient privilegesI found the answer in this forum: http://www.orafaq.com/forum/t/169798/0/
Summary:
yum install libaio bc flex net-tools
add your hostname to /etc/hosts
unzip oracle.zip
cd Disk1
rpm -ivh oracle.rpm
/etc/init.d/oracle-xe configure
usermod -a -G dba username (replace username with any username to access db)
all above must be run as root.
And then add envvar ORACLE_HOME and ORACLE_SID to user's ~/.bash_profile (case sensitive!)
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
export ORACLE_SID=XE
Also add oracle bin to the PATH:
PATH=$PATH:/u01/app/oracle/product/11.2.0/xe/bin
Restart, and now i can log in into sqlplus this way:
sqlplus / as sysdba
I tried to connect to db as user system with the password supplied during oracle-xe configure after installation, i get nasty error saying password invalid. I have to log in as sysdba and set the password of the user system (used in APEX):
alter user system identified by password
And now, setting ssh so i can access my centos from mac.
First check if sshd is already started and listening to port 22:
sudo netstat -tulpn | grep :22
If sshd is already started, then you should see sshd listed there, listening on port 22. If nothing shows up, then start sshd as root:
chkconfig sshd on
service sshd start
Add the following to /etc/sysconfig/iptables if not already present
-A input -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
And restart iptables
service iptables restart
To connect with SSH from mac host to centos guest virtualbox, activate adapter 2 in virtualbox -> settings -> network.
http://aruljohn.com/info/virtualbox-access-guest-from-host-nat/
Choose host only adapter for adapter 2. In the name drop down list, if none is already present, create one from virtualbox preference.
When this is done, run ifconfig as root from inside centos to find out the ip address to connect to. In my case, the ip address is 192.168.56.102.
Now i can ssh to my centos from my mac.
Open port for Application Manager/Apex and ORCL db. These ports are defined in oracle-xe configure after installation. Add entries in iptables (in my case, apex at 10001 and ORCL db at 1521):
-A input -m state --state NEW -m tcp -p tcp --dport 10001 -j ACCEPT
-A input -m state --state NEW -m tcp -p tcp --dport 1521 -j ACCEPT
Restart iptables:
service iptables restart.
Now i can access oracle db (thru SQL developer) and apex (http://192.168.56.102:10001/apex/f?p=4950) from my mac.
On a related thread, another story...
My mac has a meager RAM of only 4GB. I allocated 1 GB to the centos on virtualbox and when i fire up eclipse, firefox, and sql dev on mac host and oracle db on centos gues, my mac goes down to its knees.
I tried to prune the memory allocated to centos to half its installation size. centos still runs well, but ORCL would not start complaining:
ORA-01034: ORACLE not available ORA-27101: shared memory realm does not exist. I tried to fiddle with SGA resizing (init.ora) but none works. I decided to do a fresh reinstall of centos and ORCL.
This time, i created centos virtual machine with RAM 512.
I booted it with centos live CD iso. When i get to the desktop, i clicked "install to hard disk" icon. But nothing happened. I learned later that centos would not install thru GUI at 512 MB RAM. So i had to sudo and run the executable symlinked by the install to hard disk icon.
I got a centos installation without GUI. Oracle installation succeeded, but sqlplus would not start with error message of inssuficient permission. I would be happy to have CLI centos and lean ORCL on it, but i simply did not have time to fiddle to get it to work. So i decided to reinstall centos with 768 MB. GUI installation worked, and i get to the above steps.
I will try to find out what cause ORCL to refuse to start when in centos no GUI mode. When i have time. Which is very likely never going to happen. .-))