Home
|
UNIX
|
Practical
Notes on Oracle (draft)
Installation
Make sure thoses packages are installed,
gcc
libXtst
openmotif
Tweek the system,
vi /etc/sysctl.conf
For example,
fs.file-max = 65536
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 262144
Also,
vi /etc/security/limits.conf
For example,
@dba soft nproc 2047
@dba hard nproc 16384
@dba soft nofile 2048
@dba hard nofile 65536
PAM
session required pam_limits.so
Edit oracle's profile,
vi ~oracle/.bash_profile
For example,
ORACLE_BASE=/home/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/rdbms111; export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH; export PATH
NLS_LANG=AMERICAN_AMERICA.AL32UTF8; export NFS_LANG
TMP=$ORACLE_BASE/tmp; export TMP
ORACLE_SID=V111; export ORACLE_SID
EDITOR=vi; export EDITOR
umask 022
Note. to setup ORACLE_HOME, locate the product/10* folder or something alike.
As for oracle-xe's the variables you may source this file inside oracle's.profile
. /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh
Launch the installer,
/path/to/runInstaller
Note. in case the system version doesn't match (in example while installing 10g on RHEL5) try this,
/path/to/runInstaller -ignoreSysPrereqs
Eventually make the init scripts yourself. As for Oracle-XE, it's installed here,
ls -l /etc/init.d/oracle-xe
System administration
A few commands,
lsnrctl start
lsnrctl status
ps aux | grep ora # see if a database is mounted/started
As for oracle-xe, to disable Oracle XML DB HTTP Server,
sqlplus '/ as sysdba'
EXEC DBMS_XDB.SETHTTPPORT(0);
Or to configure it differently,
exec DBMS_XDB.setListenerEndPoint('1','0.0.0.0','8080','1');
EXEC DBMS_XDB.SETHTTPPORT(8090);
Oracle SQL*Plus
Do all the database maintenance as user,
su - oracle
oraenv ...
[...]
Beside ORACLE_HOME and all that defined in ~oracle/.bash_profile set the ORACLE_SID variable to the database you need to maintain, start or shutdown.
Note. to setup ORACLE_SID, enter the datadir and list its content (e.g. oradata/).
Then,
sqlplys '/ as sysdba'
or
sqlplus sys/lala@$ORACLE_SID as sysdba
Note this alternative (same),
sqlplus /nolog
connect sys / as sysdba
To create the pfile,
CREATE pfile='inittest.ora' FROM spfile='/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/dbs/spfileXE.ora';
Some useful SQL commands,
startup
startup mount
startup mount pfile=init.ora
alter database archivelog;
alter database open;
archivelog list;
archivelog all;
alter database close;
shutdown
shutdown immediate
shutdown abord
Refs.
APEX (Oracle Application Express) web interface
To connect to the interface,
Create a table using the interface,
Object Browser > Create > X columns
Then logout, login again and go to,
Object Browser
Check table is there.
Refs.
Random notes
Oracle Application Express is installed in the FLOWS_030100 schema.
The structure of the link to the Application Express administration services is as follows:
host:port/pls/apex/apex_admin (Oracle HTTP Server with mod_plsql)
host:port/apex/apex_admin (Oracle XML DB HTTP listener with the embedded PL/SQL gateway)
The structure of the link to the Application Express development interface is as follows:
host:port/pls/apex (Oracle HTTP Server with mod_plsql)
host:port/apex (Oracle XML DB HTTP listener with the embedded PL/SQL gateway)
References