Tinkster |
09-05-2005 02:58 AM |
I found the following a while ago (lives in my snippets-folder):
Quote:
Yep, got Oracle 10g running on Slack 10/current. These are my own notes, so
are only a basic guide to remind me. And what makes sense to me might not
to other poeple, but it may be of use:
===========================================================================
7- RUN ORACLE ON SLACKWARE
INSTALLING ORACLE9i/10g
These were originally based on 9i but have been changed to cover 10g,
although much as stayed the same.
System Requirements (realistic minimum):
RAM = 512MB
SWAP = 1024MB
/tmp = 400MB free
files = 2500MB installation size
data = 1200MB initial database installation size
To find sizes:
grep MemTotal /proc/meminfo
grep SwapTotal /proc/meminfo
df -h /tmp
\1.
Delete OLD files
rm -f -R /etc/oratab
rm -f -R /etc/orainst.loc
rm -f -R /usr/local/bin/oraenv
rm -f -R /usr/local/bin/coraenv
rm -f -R /usr/local/bin/dbhome
open /etc/hosts enter IP_ADDRESS HOST.DOMAIN HOST specific to your setup:
192.168.1.1 localhost.mydomain localhost
\2.
groupadd dba
groupadd oinstall
groupadd oper
After the groups are created, we can add an account for the Oracle owner:
useradd -c DBA -g oinstall -G dba oracle
which will create the oracle account, with primary group oinstall and
secondary - dba.
In addition, users who will use this database instance can be added to the
dba group in the /etc/group file.
\3.
You must create two mount points, one for the programs and one for the
database and enter the details into /etc/profile
add to /etc/profile :
---------------------------------------------------------------------
ORACLE_BASE=/mnt/oracle/app
ORACLE_HOME=/mnt/oracle/data
ORACLE_SID=ORA10g
PATH=$PATH:$ORACLE_HOME/bin
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:$ORACLE_HOME/network/lib
export PATH ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH
---------------------------------------------------------------------
Create the directories
QUOTE
cd /mnt
mkdir oracle
cd oracle
mkdir app
mkdir data
chown oracle.dba /mnt/oracle /mnt/oracle/app /mnt/oracle/data
chmod 775 /mnt/oracle -R
\4.
Add these lines to rc.local:
# ORACLE SETTINGS
cd /proc/sys/kernel
echo
echo 250 32000 100 128 > sem
echo 2147483648 > shmmax
echo 4096 > shmmni
echo 2097152 > shmall
echo 65536 > /proc/sys/fs/file-max
ulimit -n 65536
echo 1024 65000 > /proc/sys/net/ipv4/ip_local_port_range
ulimit -u 16384
umask 0022
echo
echo
#
\5.
Login as user oracle and after mounting the first disk, invoke a new
terminal window and change directory to /mnt/cdrom. This is your
installation mount point. From here run (use ./runInstaller -help to get a
list of options):
ldconfig
depmod -a
../runInstaller -ignoreSysPrereqs &
If you get an Xlib error similar to "Failed to connect to server,"
"Connection refused by server," or "Can't open display" when starting the
Oracle Universal Installer, you must run one of the following shell
commands on your X workstation.
In the session on your workstation, enter the following (type hostname to
get the host name):
hostname
xhost + whatever_the_hostname_command_returned
$DISPLAY=127.0.0.1:0.0; export DISPLAY
\6.
Unix Group Name should be oinstall
File locations should be fine as entered in /etc/profile
Database (first option) - Standard Database - CUSTOM INSTALL - NEW DATABASE,
select most options, change location from {BASE} to /mnt/oracle/data
Change passwords, unlock accounts of SYS, SYSTEM, DBSNMP, MDSYS
databasename = ora10glive
SID as mentioned in /etc/profile = ora10g
Ignore the errors during install, there will be scripts to run as root which
may seem to crash but they just take time. While setting up database the
Database Configuration Assistant might fail, unless the Custom option has
been selected.
Once installed relink takes a few mins by typing relink all
Edit /etc/oratab
Change ORTD: / blah from N to Y
Below is an example of a startup script, Oracle should start automatically
after the install, but will need a script or manual startup the next time
you re-boot / switch the machine off and on.
##############################################################################
# Create a script from this and place it in /usr/local/bin called eg #
#oracle-do
# Call it from RC.local after previous settings made as oracle-do start for
#example
#
#!/bin/bash
#
# Run-level Startup script for the Oracle Instance and Listener
#
# chkconfig: 345 91 19
# description: Startup/Shutdown Oracle listener and instance
ORA_HOME="/mnt/oracle/app"
ORA_OWNR="oracle"
# if the executables do not exist -- display error
if [ ! -f $ORA_HOME/bin/dbstart -o ! -d $ORA_HOME ]
then
echo "Oracle startup: cannot start"
exit 1
fi
# depending on parameter -- startup, shutdown, restart
# of the instance and listener or usage display
case "$1" in
start)
# Oracle listener and instance startup
echo -n "Starting Oracle: "
su - $ORA_OWNR -c "$ORA_HOME/bin/lsnrctl start"
su - $ORA_OWNR -c $ORA_HOME/bin/dbstart
touch /var/lock/subsys/oracle
echo "password"
;;
stop)
# Oracle listener and instance shutdown
echo -n "Shutdown Oracle: "
su - $ORA_OWNR -c "$ORA_HOME/bin/lsnrctl stop"
su - $ORA_OWNR -c $ORA_HOME/bin/dbshut
rm -f /var/lock/subsys/oracle
echo "password"
;;
reload|restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 start|stop|restart|reload"
exit 1
esac
exit 0
#############################################################################
To check if Oracle and its Listener is running type in ps -afx which should
give you something like:
5259 ? S 0:00 /oracle/data/bin/tnslsnr LISTENER -inherit
5300 ? S 0:00 ora_pmon_ORA10g
5302 ? S 0:00 ora_mman_ORA10g
5304 ? S 0:00 ora_dbw0_ORA10g
5306 ? S 0:00 ora_lgwr_ORA10g
5308 ? S 0:00 ora_ckpt_ORA10g
5310 ? S 0:00 ora_smon_ORA10g
5312 ? S 0:00 ora_reco_ORA10g
5314 ? S 0:00 ora_cjq0_ORA10g
5316 ? S 0:00 ora_d000_ORA10g
5318 ? S 0:00 ora_s000_ORA10g
5322 ? S 0:02 oracleORA10g (DESCRIPTION=(LOCAL=YES
(ADDRESS=(PROTOCOL=beq)))
5324 ? S 0:00 ora_qmnc_ORA10g
5326 ? S 0:00 ora_mmon_ORA10g
5328 ? S 0:00 ora_mmnl_ORA10g
5330 ? D 0:01 ora_j000_ORA10g
5332 ? D 0:00 ora_j001_ORA10g
5334 ? S 0:00 ora_j002_ORA10g
5336 ? R 0:02 ora_j003_ORA10g
5338 ? S 0:00 ora_j004_ORA10g
5340 ? S 0:00 ora_q000_ORA10g
\7.
After a re-boot it is possible the LISTENER will not work due to permissions
on the directory as it should be run by the user who installed it eg
oracle. So either change the groups that the user oracle is part of, or
make sure you su as oracle before trying to run the listener.
Try running lsnrctl start LISTENER as below:
root@axia:~# su oracle
oracle@axia:/mnt/oracle/data/bin$ ./lsnrctl start LISTENER
LSNRCTL for Linux: Version 10.1.0.2.0 - Production on 13-MAR-2004 17:00:57
Copyright © 1991, 2004, Oracle. All rights reserved.
Starting /mnt/oracle/data/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.1.0.2.0 - Production
System parameter file is /mnt/oracle/data/network/admin/listener.ora
Log messages written to /mnt/oracle/data/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=axia.axiahome
(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.1.0.2.0 - Production
Start Date 13-MAR-2004 17:00:57
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /mnt/oracle/data/network/admin/listener.ora
Listener Log File /mnt/oracle/data/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=axia.axiahome)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this
service...
The command completed successfully
oracle@axia:/mnt/oracle/data/bin$
\8.
SQLPLUS can be used to carry out operations in Oracle, eg create users,
tables etc.
sqlplus /nolog
connect sys/password as sysdba
create user steveo identified by password
grant dba to steveo
grant sysdba to steveo
SqlPlus can also be used to start the database eg
sqplus /nolog
connect / as sysdba
startup
To change passwords + unlock the accounts if not done through the GUI
installation:
sqlplus /nolog
connect / as sysdba
alter user username identified by password account unlock
ISQLPLUS is the web based version of SQLPLUS:
Usage:
isqlplusctl start| stop
root@axia:~# isqlplusctl start
iSQL*Plus 10.1.0.2.0
Copyright © 2004 Oracle. All rights reserved.
Starting iSQL*Plus ...
iSQL*Plus started.
root@axia:~#
Load browser:
http://localhost:5560/isqlplus
With 10g, enterprise manager is web based:
Oracle Enterprise Manager 10g Database Control commands:
emctl start| stop| status dbconsole
emctl secure
oracle@axia:/root$ emctl start dbconsole
|
Cheers,
Tink
|