View previous topic :: View next topic |
Author |
Message |
dragoncow2 n00b
Joined: 16 Aug 2004 Posts: 6 Location: USA/EAST COAST
|
Posted: Fri Aug 20, 2004 1:05 pm Post subject: Oracle10g on Gentoo AMD64. |
|
|
There are many different threads containing information about getting oracle to run on gentoo. Since I wrote a little how-to though, I decided to start a new one.
http://158.59.200.112/~spec/oracleandgentoo.html
Hopefully this helps someone. |
|
Back to top |
|
|
drumz Apprentice
Joined: 10 Nov 2002 Posts: 213
|
Posted: Sun Aug 22, 2004 1:23 pm Post subject: |
|
|
I'm sure the other Oracle gentoo'ers appreicate your instructions, but it appears we can't connect to the box.
Would you post your instructions here in the thread you started? |
|
Back to top |
|
|
dragoncow2 n00b
Joined: 16 Aug 2004 Posts: 6 Location: USA/EAST COAST
|
Posted: Sun Aug 22, 2004 3:54 pm Post subject: |
|
|
Sorry, that webserver is filled with hate :-/
--------------------------
Oracle 10g on Gentoo on amd64
It took me around 3 days of work to get any version of oracle to work on a Gentoo/Opteron server, but I have finally succeeded. First, download the x86 linux database from oracle, and extract like they tell you.
$ gunzip *.gzip
$ cpio -idmv < *db*
Now edit your /etc/sysctl.conf file and make it look roughly like....this:
# /etc/sysctl.conf:
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/sysctl.conf,v 1.3 2002/11/18 19:39:22 azarah Exp $
# Disables packet forwarding
#net.ipv4.ip_forward = 0
# Disables IP dynaddr
#net.ipv4.ip_dynaddr = 0
# Disable ECN
net.ipv4.tcp_ecn = 0
# Enables source route verification
#net.ipv4.conf.default.rp_filter = 1
# Disables the magic-sysrq key
#kernel.sysrq = 0
kernel.shmmax = 2147483648
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
vm/nr_hugepages = 64
Run sysctl -p after editing your file to make the changes without having to reboot.
Note: nr_hugepages thingy is important....
Before you continue, you may wanna look into your kernel's config file. Make sure your kernel has CONFIG_HUGETLBFS=y and CONFIG_HUGETLB_PAGE=y
To check do this command: zcat /proc/config.gz |grep -i hugetlb
Okay, now it might be a good idea to do something like...
$ echo "64" > /proc/sys/vm/nr_hugepages
Add the group "dba", then find out dba's group number ($ cat /etc/group |grep dba). Next you should issue this command:
$ echo "#" /proc/sys/vm/hugetlb_shm_group where # is dba's group number.
# (this is from oracle's documentation):
Add the following lines to /etc/security/limits.conf file:
* soft nproc 2047
* hard nproc 16384
* soft nofile 1024
* hard nofile 65536
Add or edit the following line in the /etc/pam.d/login file, if it does not already exist:
session required /lib/security/pam_limits.so
So now all the system settings are more suited towards Oracle, but you're still running in a 64bit environment. So follow these directions and install a 32bit chroot. I installed mine in /usr/local, because it had the most space, choose a place that's going to have enough space to install oracle (5-10gigs would be cool). A 32bit chroot is basically reinstalling gentoo into a chrooted environment. Follow these wonderful instructions: http://www.gentoo.org/proj/en/base/amd64/technotes.xml?part=2&chap=4
Getting the emul libraries won't hurt, but the main part you want to pay attention to is "4.c." Also, without being in the chroot, it'll probably help to mount proc to your chrooted environment's proc. (ie: $ mount -t proc none /path/to/chroot/gentoo/proc), that probably should've been done already though (during the chroot's install). Now you should move your Disk1 folder into the chroot's /usr/local/src, and then log into the chroot. ($ linux32 chroot /path/to/gentoo/ /bin/bash). Now run these commands...
$ groupadd oinstall
$ groupadd dba
$ useradd -g oinstall -G dba oracle
$ chmod oracle:oinstall -R /usr/local/src/Disk1
(oracle documentation, you should do this nowishly)
For the Bourne, Bash, or Korn shell, add the following lines to the /etc/profile file (or the /etc/profile.local file on SuSE systems):
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
In a new terminal type "xhost +", and then close the term. Now we need to set some variables, so open up ~/.profile with your favourite editor (nano is easy, if you don't know vim). The first line should be "umask 022". Save and exit, now you're gonna want to set ORACLE_BASE and ORACLE_SID, to do this type:
$ ORACLE_BASE=/usr/local/oracle
$ ORACLE_SID=ORCL
$ export DISPLAY=0.0
Now you should be able to run the installer...
$ /usr/local/src/Disk1/runInstaller -ignoreSysPrereqs
Go through the installer like normal, when it gets to the dbca, and it says it fails, just say okay and continue. Sometime during the install it'll tell you to run a script as root, make sure you're in the chrooted-gentoo when you run that script. Now you should run 'oraenv', which will update all your variables for you. Remember, whenever you're in the chrooted environment and are working...you should always run oraenv first. It helps with things. At any rate, you can try to run dbca yourself and go through the process of creating a database, but for me it always crashed at the end. I manually copied an initORCL.ora file from a different oracle server and then did something like....
$ sqlplus /nolog
SQL> connect / as sysdba
SQL> CREATE DATABASE ORCL
CONTROLFILE REUSE;
SQL> startup
(If that doesn't work, it's close enough, just find the right syntax).
Now you have your database created, and you can easily launch a listener.
--------------------------------------------------------
#initORCL.ora
db_name=ORCL
log_checkpoint_interval = 10000
global_names = TRUE
control_files = (ora_control1, ora_control2)
REMOTE_LOGIN_PASSWORDFILE=exclusive
--------------------------------------------------------
There's my .ora file, you could probably use something similar to that....also make sure your tnsnames.ora file is valid. It's in $ORACLE_HOME/network/admin/tnsnames.ora Here's my tnsnames:
-------------------------------------------
#tnsnames.ora
# tnsnames.ora Network Configuration File: /usr/local/oracle/product/10.1.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = genfire)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ORCL)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
-------------------------------------------
Just be sure to change your host....mine's genfire, yours is probably not.
Now we're almost done, all that's left is some init scripts.
We should probably run this command so you can give sysdba privilages out:
$ orapwd file=/usr/local/oracle/product/10.1.0/db_1/dbs/orapwORCL password=seeeekrit
Now in sqlplus you can grant users sysdba.
$ sqlplus /nolog
SQL> connect / as sysdba
SQL> (insert magical SQL command that grants a user sysdba privilages)
Now quit out of the chroot, because the init scripts need to go in the 64bit environment. (That's what boots after all.)
-------------------------------------
#!/bin/bash
#/etc/init.d/chrootenv
mount -o bind /tmp /usr/local/loracle/tmp
mount -t proc none /usr/local/loracle/proc/
# The first binds tmp into the chrooted's tmp, so X will work in the chrooted environment
# The second just mounts proc again, so the processes aren't all screwy.
-------------------------------------
Put that in /etc/init.d and run chmod +x /etc/init.d/chrootenv, then run
$ update-rc add chrootenv default
I have yet to find a way to automate the bringing up of a database, the listener can be brought up with:
$ linux32 chroot /usr/local/loracle/ su - oracle -c "/usr/local/oracle/bin/lsnrctl start"
and the iSQL*Plus can be started with
$ linux32 chroot /usr/local/loracle/ su - oracle -c "/usr/local/oracle/bin/isqlplusctl start"
As for the database however, dbstart doesn't seem to work on my machine, and I don't know how to start a database in command-line mode with sqlplus, if anyone could solve this last step it would be completely automated. (There are minor problems with how I created the database, but only because I don't know anything at all about Oracle, use these instructions more as a loose guide..., in example, I don't understand how to implement rollback segments, and all the system tables are non-existant, so that makes some errors for oracle's enterprise manager)
If you have any questions or comments, feel free to e-mail me at dragoncow2@gmail.com. |
|
Back to top |
|
|
dragoncow2 n00b
Joined: 16 Aug 2004 Posts: 6 Location: USA/EAST COAST
|
Posted: Sun Aug 22, 2004 4:01 pm Post subject: |
|
|
Actually, that reminds me, if someone could test this out in their spare time(hehehe...), could they run Oracle's database configurator and find a solution as to why it crashes. It's a java error, but I have no idea what it relates to.
$ $ORACLE_HOME/bin/dbca |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|