Saturday, April 18, 2009

Menginstall Oracle 10g di Slackware

,
Create Oracle user and install and management groups (as root):
groupadd dba
groupadd oinstall
adduser oracle #make the initial group oinstall, and additional groups dba,users

Download (this may not work, in which case you will have to go to http://www.oracle.com to get the download):
wget http://download.oracle.com/otn/linux/oracle10g/ship.db.cpio.gz

unpack:
gunzip ship.db.cpio.gz
cpio -idmv < ship.db.cpio

If your swapdisk is less than a 1GB, then;
dd if=/dev/zero of=/directory/with/much/free/space/tempswap bs=1k count=1000000
chmod 600 tempswap
mke2fs tempswap
mkswap tempswap
swapon tempswap

Next, check required system memory, run this:
sysctl -a

And check those values against these:
Needed Check with
shmmax = 2147483648 cat /proc/sys/kernel/shmmax
shmmni = 4096 cat /proc/sys/kernel/shmmni
shmall = 2097152 cat /proc/sys/kernel/shmall
shmmin = 1 ipcs -lm |grep "min seg size"
semmsl = 250 cat /proc/sys/kernel/sem | awk '{print $1}'
semmns = 32000 cat /proc/sys/kernel/sem | awk '{print $2}'
semopm = 100 cat /proc/sys/kernel/sem | awk '{print $3}'
semmni = 128 cat /proc/sys/kernel/sem | awk '{print $4}'
file-max = 65536 cat /proc/sys/fs/file-max
ip_local_port_range = 1024 65000 cat /proc/sys/net/ipv4/ip_local_port_range

Note: Don't change the value of any kernel parameter on a system where it is already higher than listed as Needed.
If they are found lacking, modify /etc/sysctl.conf:
# Kernel Parameters for Oracle 10.1.0
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000

Then, to make these values effective immediately (without a reboot), run:
sysctl -p

Then, create (or modify) your ~/.profile file to contain these settings:
# user-specific settings

PATH=$PATH:$HOME/bin

# Oracle Environment

ORACLE_BASE=/opt/oracle; export ORACLE_BASE
ORACLE_HOME=/opt/oracle; export ORACLE_HOME
ORACLE_SID=ROQDB; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
export TNS_ADMIN=$ORACLE_HOME/config
NLS_LANG=AMERICAN; export NLS_LANG
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/openwin/lib
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/td/lib:/usr/ucblib:/usr/local/lib
export LD_LIBRARY_PATH fi
if [ -z $CLASSPATH ]
then
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib
export CLASSPATH
else
CLASSPATH=$CLASSPATH:$ORACLE_HOME/JRE:$ORACLE_HOME/jlib
CLASSPATH=$CLASSPATH:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/network/jlib
export CLASSPATH
fi
ORAENV_ASK=NO

#set shell search paths
PATH=$PATH:$ORACLE_HOME/bin

Now, on to the install (as root):
mkdir /opt/oracle
chown oracle /opt/oracle
chgrp oinstall /opt/oracle

As user oracle (from an xterminal):
cd Disk1
./runInstaller -ignoreSysPrereqs

Here were my selections... (boleh diubah sesuai keinginan)
Destination; Name: OraDB10g_home1, Path: /opt/oracle
Installation Type: Enterprise Edition
Chose "General Purpose" starter database
Global database name: ROQDB.myhost
SID: ROQDB

Once done, here's how you test if the database starts up:
sqlplus /nolog

conn / as sysdba

startup

The simplest way to configure Oracle's network connectivity is to use netca; here were my selections:
Listener Configuration:
Add/Reconfigure
LISTENER
TCP
Use Standard Port of 1521

Naming Methods Configuration:
Local Naming

Local Net Service Name Configuration:
Add/Reconfigure
ROQDB
Service Name: ROQDB
TCP
Host Name: myhost
Use Standard Port of 1521
Then test it.

And here are the files that were generated...
(/opt/oracle/config/ldap.ora):
# ldap.ora Network Configuration File: /opt/oracle/config/ldap.ora
# Generated by Oracle configuration tools.

DIRECTORY_SERVERS= (192.168.2.173:389:636)

DIRECTORY_SERVER_TYPE = OID

(/opt/oracle/config/listener.ora):
# listener.ora Network Configuration File: /opt/oracle/config/listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /opt/oracle)
(PROGRAM = extproc)
)
)

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = myhost.mydomain.org)(PORT = 1521))
)
)
)

(/opt/oracle/config/sqlnet.ora):
# sqlnet.ora Network Configuration File: /opt/oracle/config/sqlnet.ora
# Generated by Oracle configuration tools.

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

(/opt/oracle/config/tnsnames.ora):
# tnsnames.ora Network Configuration File: /opt/oracle/config/tnsnames.ora
# Generated by Oracle configuration tools.

ROQDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = myhost)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ROQDB)
)
)

EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = myhost)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ROQDB)
)
)

If you have trouble getting tnsping to work, try the following:
Back up all the .ora files in /opt/oracle/config, then copy these files into this directory:
cp /opt/oracle/network/admin/sqlnet.ora /opt/oracle/config/
cp /opt/oracle/network/admin/listener.ora /opt/oracle/config/
cp /opt/oracle/network/admin/tnsnames.ora /opt/oracle/config/

Now it's time to set things up so Oracle automatically starts up when Linux starts:
cat > /etc/rc.d/rc.dbora
#!/bin/sh
#
# dbora This scripts starts and shuts down the
# oracle database
#
# chkconfig: 345 99 10
# description: This script calls the dbstart script
# to start Oracle
# and dbshut to stop it
# processname: oracle*
# config: /etc/oratab
#
# Set ORACLE_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut;
# Set ORA_OWNER to the user id of the owner of the
# Oracle database in ORACLE_HOME.

export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=/opt/oracle
export ORACLE_SID=ROQDB

ORACLE_HOME=/opt/oracle
ORA_OWNER=oracle

if [ ! -f $ORACLE_HOME/bin/dbstart ]
then
echo "Oracle startup: cannot start"
exit
fi

case "$1" in
'start')
su $ORA_OWNER -c $ORACLE_HOME/bin/dbstart &
su $ORA_OWNER -c "$ORACLE_HOME/bin/lsnrctl start" &
;;
'stop')
su $ORA_OWNER -c "$ORACLE_HOME/bin/lsnrctl stop " &
su $ORA_OWNER -c $ORACLE_HOME/bin/dbshut &
;;
'restart')
su $ORA_OWNER -c "$ORACLE_HOME/bin/lsnrctl stop " &
su $ORA_OWNER -c $ORACLE_HOME/bin/dbshut &
sleep 15
su $ORA_OWNER -c $ORACLE_HOME/bin/dbstart &
su $ORA_OWNER -c "$ORACLE_HOME/bin/lsnrctl start " &
;;

esac

Then, make it executable:
chmod 755 /etc/rc.d/rc.dbora

Then add this code to the /etc/rc.d/rc.M file:
# Start Oracle - roq
if [ -x /etc/rc.d/rc.dbora ]; then
. /etc/rc.d/rc.dbora start
fi

Then add this code to /etc/rc.d/rc.K (above the "# Kill all processes" line) and to /etc/rc.d/rc.0:
# Shut down Oracle - roq
if [ -x /etc/rc.d/rc.dbora ]; then
. /etc/rc.d/rc.dbora stop
fi

Then edit the /etc/oratab file to insert your database for the autostart, the format of the line you need is: SID:ORACLE_HOME:AUTO_START:
ROQDB:/opt/oracle:Y

NOTE if you still have difficulty starting, add the oracle group to the root user: usermod -g oracle root
To allow other applications to connect to Oracle, it may be necessary to add the following to /etc/profile:
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=/opt/oracle
export ORACLE_SID=ROQDB

If you want to access the Oracle Enterprise Manager (OEM), then you need to have started the service: /opt/oracle/bin/emctl start dbconsole
Then you can browse to it using: http://localhost:5500/em
If you want to use the web version of SQL*Plus then you need to have started it: /opt/oracle/bin/isqlplusctl start
If you need to check your log-files, you can find them here: /opt/oracle/admin/ROQDB

CATATAN TAMBAHAN:
Jika pada proses instalasi terjadi sedikit error, tinggal diignore saja. Waktu kemarin saya meginstall Oracle di komputer saya juga menemui beberapa error tapi Oracle tetap bisa berjalan dengan baik. Tidak ada masalah.

sumber: http://www.roqet.org/oracle_on_slackware.html dengan sedikit diedit dan ditambah :)

8 comments:

  1. Love this blog I'll be back when I have more time.

    ReplyDelete
  2. jIyFoj rvqxbaqjvpje, [url=http://pangphittikd.com/]pangphittikd[/url], [link=http://jhqcienyshop.com/]jhqcienyshop[/link], http://gyumbwdfdunz.com/

    ReplyDelete
  3. eQG3Xv zxmqzqcgfquq, [url=http://kogvqfrycdgf.com/]kogvqfrycdgf[/url], [link=http://vbwvscheiftt.com/]vbwvscheiftt[/link], http://zdcvnnaxyykk.com/

    ReplyDelete
  4. CSTiWz knyuiwmgsfzl, [url=http://tbyckeutenca.com/]tbyckeutenca[/url], [link=http://eiehfqjsszns.com/]eiehfqjsszns[/link], http://qbiibqparqow.com/

    ReplyDelete
  5. jsSykI zddekjydtjpd, [url=http://dwgmazcopyuq.com/]dwgmazcopyuq[/url], [link=http://kiehlzohbkpa.com/]kiehlzohbkpa[/link], http://qclizzbhzxwz.com/

    ReplyDelete
  6. Ada versi bahasa indonesia nya gk mas nya? Hehehe.. Kemarin aq nyuba install n' berhasil nyampe bisa SQLPLUS tapi gak bisa masuk administration yg Versi Web nya (http://localhost:5500/em).. apa port nya berubah ya?

    ReplyDelete
  7. harusnya bisa. Ndak ada masalah..

    ReplyDelete
  8. Thanks. So many tutorials about installing Oracle under Linux out there but all are stick in the mud with just only some OS (licensed) over and over again, i think this one is C&P, but frankly it just might work...

    ReplyDelete