Installing Oracle Database 10gR2, OHS & Apex 2.2.1 on EL4U4 Linux x86 (OTN Installfest) --------------------------------------------------------------------- NoCOUG Feb 2007 *** This guide is for test purposes only - not production *** ### Install Oracle 10g (10.2.0.1) on EL4 Boot from EL4 dvd press enter for graphical install ** Need at least 512MB RAM / 2.5GB Space ** + Select custom package install + Automaticaly or Manually partition your hard drive with Disk Druid /tmp = 512MB ext3 fixed size /boot = 128MB ext3 fixed size swap = 1024MB fixed size / = fill to maximum allowable size + Accept defaults for GRUB boot loader, configure networking, set hostname eg.joburg + Most Linux distros and EL4 ship with default security preferences locked down. For testing purposes I typically turn off the firewall and disable SE Linux. + Set language preferences and root password + Make sure the packages essential for installing Oracle are selected. Desktop : X Window System; Gnome or KDE Editors : at least one editor - vi etc. Graphical Internet : a web browser - firefox Development : Development Tools, and Legacy Software Development System : Administration Tools (useful) + Uncheck the non-essential packages. Servers : Web Server, and Windows File Server System : Printing support For post-install configuration login as root -------------------------------------------- + Install the pre-requisite rpms from the EL4 dvd # cd /media/cdrom/Enterprise/RPMS/ # rpm -ivh libaio-0.3.105-2.i386.rpm (the DB needs this) # rpm -ivh compat-db-4.1.25-9.i386.rpm (Apex needs this) + create groups # /usr/sbin/groupadd oinstall # /usr/sbin/groupadd dba # /usr/sbin/groupadd oper + create OS user oracle with group permissions and home /opt/oracle # /usr/sbin/useradd -g oinstall -G dba,oper -d /opt/oracle oracle + set user oracle's password # /usr/bin/passwd oracle + Append user oracle's bash profile with PATH and ORACLE:BASE,HOME and SID information # vi /opt/oracle/.bash_profile umask 022 PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin LD_LIBRARY_PATH=/usr/lib:/usr/X11R6/lib ORACLE_BASE=/opt/oracle ORACLE_HOME=$ORACLE_BASE/product/10gR2 ORACLE_SID=orcl PATH=$ORACLE_HOME/bin:$PATH export PATH LD_LIBRARY_PATH ORACLE_BASE ORACLE_HOME ORACLE_SID + Create the directory for the software installation and assign ownership to oracle:oinstall # chown -R oracle:oinstall /opt # chmod -R 775 /opt + Make sure the correct kernel parmeters are appended to sysctl.conf # vi /etc/sysctl.conf (these can be easily copied from the Quick Installation Guide for Linux x86 doc on the Oracle10g CD) kernel.shmall = 2097152 kernel.shmmax = 2147483648 kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 net.core.rmem_default = 262144 net.core.rmem_max = 262144 net.core.wmem_default = 262144 net.core.wmem_max = 262144 fs.file-max = 65536 net.ipv4.ip_local_port_range = 1024 65000 + set the kernel parameters or reboot # /sbin/sysctl -p Login in to xwindows session as user oracle ------------------------------------------- + Mount the Oracle10gR2 dvd and run the Database installer mount /media/cdrom/ (cd $HOME && /media/cdrom/database/runInstaller) - follow the installer instructions (installer checks for 3GB of swap, default partitioning gives 2GB ) - use password mgmt to unlock DBuser HR & set password 'hr' + Installation successful http://joburg:5560/isqlplus ( iSQL*Plus Url ) http://joburg:5560/isqlplus/dba ( iSQL*Plus DBA Url ) http://joburg:1158/em (bookmark the Enterprise Manager console) + The following enables the oracle user to dbshut, dbstart, lsnrctl start and stop As root # vi /etc/oratab change :N to :Y # cp /etc/oratab /opt/oracle/oratab ### Install OHS from the Database Companion CD + Mount the Oracle10gR2 dvd and run the Companion installer mount /media/cdrom/ (cd $HOME && /media/cdrom/companion/runInstaller) - click next on the welcome screen - select Oracle Database 10g Companion Products 10.2.0.1.0 - specify the OHS home name and location eg. OHS_HOME and /opt/oracle/product/ohs - select Apache Standalone 10.1.2.0.0 new install - install (when running /opt/oracle/product/ohs/root.sh choose defaults so you do not overwrite dbhome, oraenv, and coraenv in /usr/local/bin ) + Installation successful http://joburg:7777 (Oracle HTTP Server & Welcome Page) + Apply the patch ### Install Apex 2.2.1 from the OTN Download + requirements for installing Apex 2.2 $ sqlplus sys/oracledb as sysdba SQL> SHOW PARAMETER PFILE; NAME TYPE VALUE ---------------------- --------------- --------------------------------------------- spfile string /opt/oracle/product/10gR2/dbs/spfileorcl.ora SQL> SHOW PARAMETER SHARED_POOL_SIZE; NAME TYPE VALUE ---------------------- --------------- --------------------------------------------- shared_pool_size big integer 0 SQL> ALTER SYSTEM SET SHARED_POOL_SIZE='100M' SCOPE=spfile; System altered. SQL> SHUTDOWN SQL> STARTUP + make sure the target DB is up - with the listner and OHS processes stopped. $ dbstart $ lsnrctl stop (to stop the database listner) $ /opt/oracle/product/ohs/opmn/bin/opmnctl stopproc ias-component=HTTP_Server (## note: if you are connecting to a remote DB then start the listner ##) you can use the following to start HTTP Server proccess later $ /opt/oracle/product/ohs/opmn/bin/opmnctl startproc ias-component=HTTP_Server + install the Apex database objects into the target database copy apex_2.2.1.zip to /opt/oracle and extract to apex_2.2.1 directory $ cd /opt/oracle/apex_2.2.1/apex $ ls -l apexins.sql -r--r--r-- 1 oracle oinstall 3645 Sep 8 14:01 apexins.sql $ chmod +x apexins.sql makes it executable $ sqlplus sys/oracledb as sysdba SQL> @apexins oracledb SYSAUX SYSAUX TEMP /i/ none (where SYSAUX is the tablespace for the Apex 'Application' and 'Files' users, and oracledb is the pswd for the Apex admin account, the Apex schema owner, and the Apex files schema owner.) Apex is now installed in the FLOWS_020200 schema. http://host:port/pls/apex/apex_admin is the Apex admin link http://host:port/pls/apex is the Apex development interface + recompiling invalid PL/SQL Packages and Restarting Processes $ cd $ORACLE_HOME $ sqlplus sys/oracledb as sysdba SQL> @?/rdbms/admin/utlrp.sql (not mandatory but quick) + copying the images directory to the Oracle home for OHS $ cd /opt/oracle/apex_2.2.1/ $ cp -rf apex/images /opt/oracle/product/ohs/Apache/Apache + configure the Oracle HTTP Server with mod_plsql to connect to the target database create a marvel.conf file with DAD information to access Apex $ cd /opt/oracle/product/ohs/Apache/modplsql/conf $ vi marvel.conf edit the following sample marvel.conf content to replace ORACLE_HOME, host, port, service_name, and apex_public_user_password (same as first parameter supplied to apexins.sql) with appropriate values, and save it as marvel.conf ---snip--- Alias /i/ "/opt/oracle/product/ohs/Apache/Apache/images/" AddType text/xml xbl AddType text/x-component htc Order deny,allow PlsqlDocumentPath docs AllowOverride None PlsqlDocumentProcedure wwv_flow_file_manager.process_download PlsqlDatabaseConnectString joburg:1521:orcl ServiceNameFormat PlsqlNLSLanguage AMERICAN_AMERICA.AL32UTF8 PlsqlAuthenticationMode Basic SetHandler pls_handler PlsqlDocumentTablename wwv_flow_file_objects$ PlsqlDatabaseUsername APEX_PUBLIC_USER PlsqlDefaultPage apex PlsqlDatabasePassword oracledb Allow from all ---snip--- + edit the httpd.conf file to reference marvel.conf $ vi /opt/oracle/product/ohs/Apache/Apache/conf/httpd.conf include "/opt/oracle/product/ohs/Apache/modplsql/conf/marvel.conf" + Stop and restart the Oracle HTTP server $ /opt/oracle/product/ohs/opmn/bin/opmnctl stopproc ias-component=HTTP_Server $ dbstart (make sure the DB is up) $ lsnrctl start (make sure the listner is running) $ /opt/oracle/product/ohs/opmn/bin/opmnctl startproc ias-component=HTTP_Server + applying the PL/SQL Web Toolkit Patch ? + logging in to Apex http://hostname:port/pls/database_access_descriptor/ port is the HTTP Server's port which by default is 7777 and the default DAD is 'apex' eg. http://joburg:7777/pls/apex + create a workspace http://joburg:7777/pls/apex/apex_admin login as admin/oracledb - under the Manage Workspace tab click 'Create Workspace' - enter 'obe' at the Workspace Name and click next - Re-use select 'No'. enter 'obe' for the schema name and password - select 'Medium: 5 Megabytes' then click next - enter 'obe/obepswd' as the admin username and password along with email address note: a new administrator user will be created in addition to the workspace - click creat to confirm the provisioning of the new workspace and admin user. - logout as admin user + log into the new workspace http://joburg:7777/pls/apex/apex Workspace : obe Username : OBE password : obepswd