28 September 2007

Automate Startup/Shutdown of Oracle Products on SLES 10.0

Previous Posts:
Oracle 10g Rel 2 on SLES 10.0
Installation Prepation
Hardware and Software check
Software Installation
Patch Oracle Database Software
Create Database
Install Oracle HTTP Server
Install APEX
Install BI Publisher
Next Posts:
Install Oracle Workflow

Automated Startup and Shutdown of installed Oracle products will be implemented using shell script "dbora". This script is based on description that You can find in Oracle Metalink.

First check that the file /etc/oratab contains entry for the Database that You like to Start/shut:
vl094:~ # cat /etc/oratab
DB094:/appl/oracle/product/10.2.0/db_1:Y


For the Start/Shut for the Database and the Listener I will use scripts distributed with Oracle DB Software located in $ORACLE_HOME/bin:
dbstart $ORACLE_HOME - to start the database and listener and
dbshut $ORACLE_HOME - to stop the database and listener. You must remember that this two scripts requires one parameter, this parameter is ORACLE_HOME.

You must save the Script in /etc/init.d.
Set scripts permissions:
vl094:~ # cd /etc/init.d/
vl094:/etc/init.d # chmod 755 dbora

Register Service:
vl094:/etc/init.d # /sbin/chkconfig --add dbora
dbora 0:off 1:off 2:off 3:on 4:off 5:on 6:off


"chkconfig" will create symbolic links under rc3.d and rc5.d to /etc/init.d/dbora.

SLES "insserv" utility (used from "chkconfig") uses the following header to define run level and start/shut order:
     6  ### BEGIN INIT INFO
7 # Provides: dbora
8 # Required-Start: $local_fs $remot_fs $netdeamons
9 # Required-Stop:
10 # Default-Start: 3 5
11 # Default-Stop: 0 1 2 3 4 5 6
12 # Description: start/shutdown of Database and other Oracle Products
13 ### END INIT INFO
Script to start BI Publisher is not running in background after the start. So I started the BI Publisher Script with "nohup" and in background with "&".
After the start I simply wait for 60 seconds, and then continue with the next step. Naturally, there is better methods to check if the process is started, but for me it works perfectly.
    46      # oracle bi publisher
47 echo "Starting BI Publisher..."
48 su - $OBIP_USER -c "nohup $OBIP_HOME/oc4j_bi/bin/oc4j -start
>>$OBIP_HOME/startbip.log &"

49 RET_BIP=$?
50 echo "Sleeping 60 sec..."
51 sleep 60

I noticed that the Oracle HTTP Server processes need sometimes about a minute to startup - so I am "sleeping"for 60 seconds after start of Oracle HTTP Server. Not so elegant - but in my style.
    55      # oracle http server
56 su - $OHS_USER -c "$OHS_HOME/opmn/bin/opmnctl startall"
57 RET_HS=$?
58 echo "Sleeping 60 sec..."
59 sleep 60
The "touch" command would create a file at the startup of the database. The Oracle process would now have a lock on the above file which should be released at time of OS reboot. The script which is called by 'inittab' whenever the run level is changed, looks for the existence of a lock file in "/var/lock/subsys". If this lock file does not exist, the stop command will not be issued.
    60      # touch lock file
61 touch /var/lock/subsys/dbora

I added simple logging - log file will be located in /tmp/dbora.log

Here is the complete Script:

vl094:/etc/init.d # cat -n dbora

1 #! /bin/sh
2 #
3 # Author: Flavio, Modified script "dbora"
found on "metalink.oracle.com"

4 # Homepage: OracleByFla.blogspot.com
5 #
6 ### BEGIN INIT INFO
7 # Provides: dbora
8 # Required-Start: $local_fs $remot_fs $netdeamons
9 # Required-Stop:
10 # Default-Start: 3 5
11 # Default-Stop: 0 1 2 3 4 5 6
12 # Description: start/shutdown of Database
and other Oracle Products

13 ### END INIT INFO
14
15 #
16 #
17 # home's of oracle products
18 #
19 # oracle db, listener, em
20 ODB_HOME="/appl/oracle/product/10.2.0/db_1"
21 # oracle http server
22 OHS_HOME="/appl/orahs/product/10.2.0/db_1"
23 # oracle bi publisher
24 OBIP_HOME="/appl/orabip/OraHome_1"
25 #
26 # operating system users, owners of oracle
software products

27 #
28 # oracle db, listener, em
29 ODB_USER="oracle"
30 # oracle http server
31 OHS_USER="orahs"
32 # oracle bi publisher
33 OBIP_USER="orabip"
34
35 #
36 # oradb log file
37 #
38 DBORALOG="/tmp/dbora.log"
39
40 case "$1" in
41 start)
42 echo "`date` Begin of Oracle Start Block
43 # oracle database and listener
44 su - $ODB_USER -c "$ODB_HOME/bin/dbstart $ODB_HOME"
45 RET_DB=$?
46 # oracle bi publisher
47 echo "Starting BI Publisher..."
48 su - $OBIP_USER -c "nohup $OBIP_HOME/oc4j_bi/bin/oc4j -start
>>$OBIP_HOME/startbip.log &"

49 RET_BIP=$?
50 echo "Sleeping 60 sec..."
51 sleep 60
52 # oracle em
53 su - $ODB_USER -c "$ODB_HOME/bin/emctl start dbconsole"
54 RET_EM=$?
55 # oracle http server
56 su - $OHS_USER -c "$OHS_HOME/opmn/bin/opmnctl startall"
57 RET_HS=$?
58 echo "Sleeping 60 sec..."
59 sleep 60
60 # touch lock file
61 touch /var/lock/subsys/dbora
62 RET_TOUCH=$?
63 echo "`date` Start Returns: RET_DB=$RET_DB
RET_BIP=$RET_BIP RET_HS=$RET_HS RET_EM=$RET_EM
RET_TOUCH=$RET_TOUCH" | tee -a $DBORALOG

64 echo "End of Oracle Start Block"
65 ;;
66 stop)
67 echo "`date` Begin of Oracle Stop Block..." | tee -a $DBORALOG
68 # oracle http server
69 su - $OHS_USER -c "$OHS_HOME/opmn/bin/opmnctl stopall"
70 RET_HS=$?
71 # oracle bi publisher
72 echo "Stopping BI Publisher..."
73 su - $OBIP_USER -c "$OBIP_HOME/jdk/bin/java
-jar $OBIP_HOME/oc4j_bi/j2ee/home/admin.jar ormi://localhost:20002
oc4jadmin qwertz1 -shutdown force >>$OBIP_HOME/stopbip.log"

74 RET_BIP=$?
75 # oracle database and listener
76 su - $ODB_USER -c "$ODB_HOME/bin/dbshut $ODB_HOME"
77 RET_DB=$?
78 # oracle em
79 su - $ODB_USER -c "$ODB_HOME/bin/emctl stop dbconsole"
80 RET_EM=$?
81 # remove lock file
82 rm -f /var/lock/subsys/dbora
83 RET_RM=$?
84 echo "`date` Stop Returns: RET_DB=$RET_DB
RET_BIP=$RET_BIP RET_HS=$RET_HS
RET_EM=$RET_EM RET_RM=$RET_RM" | tee -a $DBORALOG

85 echo "End of Oracle Stop Block"
86 ;;
87 restart)
88 echo "`date` Begin of Oracle Restart Block.." | tee -a $DBORALOG
89 $0 stop
90 RET_STOP=$?
91 $0 start
92 RET_START=$?
93 echo "`date` Restart Returns `date`: RET_STOP=$RET_STOP
RET_START=$RET_START" | tee -a $DBORALOG

94 echo "End of Oracle Restart Block"
95 ;;
96 *)
97 echo "Usage: $0 {start|stop|restart}"
98 exit 1
99 ;;
100 esac
101
102 exit $?
Here is standard output of my "start" test:
vl094:/etc/init.d # ./dbora start
Sat Sep 29 21:51:01 CEST 2007 Begin of Oracle Start Block...
Processing Database instance "DB094": log file /appl/oracle/product/10.2.0/db_1/startup.log
Starting BI Publisher...
Sleeping 60 sec...
TZ set to Europe/Vienna
Oracle Enterprise Manager 10g Database Control Release 10.2.0.3.0
Copyright (c) 1996, 2006 Oracle Corporation. All rights reserved.
http://vl094.fla.net:1158/em/console/aboutApplication
Starting Oracle Enterprise Manager 10g Database Control ........................ started.
------------------------------------------------------------------
Logs are generated in directory /appl/oracle/product/10.2.0/db_1/vl094.fla.net_DB094/sysman/log
opmnctl: starting opmn and all managed processes...
Sleeping 60 sec...
Sat Sep 29 21:54:57 CEST 2007 Start Returns: RET_DB=0 RET_BIP=0 RET_HS=0 RET_EM=0 RET_TOUCH=0
End of Oracle Start Block

Here is standard output of my "stop" test:
vl094:/etc/init.d # ./dbora stop
Sat Sep 29 21:55:13 CEST 2007 Begin of Oracle Stop Block...
opmnctl: stopping opmn and all managed processes...
Stopping BI Publisher...
Processing Database instance "DB094": log file /appl/oracle/product/10.2.0/db_1/shutdown.log
TZ set to Europe/Vienna
Oracle Enterprise Manager 10g Database Control Release 10.2.0.3.0
Copyright (c) 1996, 2006 Oracle Corporation. All rights reserved.
http://vl094.fla.net:1158/em/console/aboutApplication
Stopping Oracle Enterprise Manager 10g Database Control ...
... Stopped.
Sat Sep 29 21:59:09 CEST 2007 Stop Returns: RET_DB=0 RET_BIP=0 RET_HS=0 RET_EM=0 RET_RM=0
End of Oracle Stop Block


Regards,
Flavio




25 September 2007

Installing Oracle BI Publisher on SLES 10.0

Previous Posts:
Oracle 10g Rel 2 on SLES 10.0
Installation Prepation
Hardware and Software check
Software Installation
Patch Oracle Database Software
Create Database
Install Oracle HTTP Server
Install APEX
Next Posts:
Automate Startup/Shutdown
Install Oracle Workflow

For the Installation of Oracle BI Publisher I have created one more Linux user: orabip.
This User will be the owner of BI Publisher Software.

NOTE: Before You start this Installation please stop the Oracle Enterprise Manager with the command "emctl stop dbconsole"
and stop the Oracle HTTP Server using the command "$ORACLE_HOME/opmn/bin/opmnctl stop"

For the Architecture and background of PDF printing in APEX 3.0 plase consult following document:
http://www.oracle.com/technology/products/database/application_express/html/configure_printing.html
Please ignore the statement: At this time, the standalone BI Publisher download for Linux does not seem to be working ...
It's working now!

Connect to Linux Box as root and execute following commands:
vl094:~ # useradd -u 5003 -g oinstall -G dba -d /appl/home/orabip -s /bin/bash orabip
vl094:~ # mkdir /appl/orabip
vl094:~ # mkdir /appl/home/orabip
vl094:~ # chmod 775 /appl/home/orabip
vl094:~ # chown orabip:oinstall /appl/orabip /appl/home/orabip
vl094:~ # passwd orabip
Changing password for orabip.
New Password:
Bad password: too simple
Reenter New Password:
Password changed.


Download the Oracle BI Publisher installation Files and Installation Documentation:
BI Publisher 10.1.3.3.for Linux x86
The downloaded file is marked with "redhat" - ignore this - it works well under SLES to!

Connect to Linux Box as user orabip:
vl094:~ # ssh -Xl orabip vl094
Password:
/usr/X11R6/bin/xauth: creating new authority file /appl/home/orabip/.Xauthority


Using cpio You can get the Package content:
cpio -idmv < bipublisher_linux_x86_redhat_101330_disk1.cpio

Do not create or add any environment variable in the orapib's .bash_profile file. Change directory to Installation Directory:
orabip@vl094:~> cd RH_Linux/Oracle_Business_Intelligence_Publisher_Standalone/install/

Start Installer:
orabip@vl094:~/RH_Linux/Oracle_Business_Intelligence_Publisher_Standalone/install> ./runInstaller
Starting Oracle Universal Installer...

Checking installer requirements...

Checking operating system version: must be redhat-2.1AS, redhat-3, redhat-4, redhat-5, suse-9, suse-10, SuSE-9 or SuSE-10
Passed


All installer requirements met.

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2007-09-25_09-43-09PM. Please wait ...orabip@vl094:~/RH_Linux/Oracle_Business_Intelligence_Pul> Oracle Universal Installer, Version 10.1.0.6.0 Production
Copyright (C) 1999, 2007, Oracle. All rights reserved.


Form: Welcome.

Press "Next"
--------------------------------------------------------------
Form: File LocationChange Path for BPHome1 to /appl/orabip/OraHome_1.
Press "Next".
--------------------------------------------------------------
Form: Select Installation Type.
Select Option Basic.
Press "Next"
--------------------------------------------------------------
Form. Choose OC4J Administrator Password.

Enter value qwertz1 for Password.
Press "Next".
--------------------------------------------------------------
Form: Summary.
Press "Install".
--------------------------------------------------------------
Form: Install.
Wait ...
--------------------------------------------------------------
Form : End of Installation.Press "Exit".
--------------------------------------------------------------
Form: Exit.
Press "Yes".

BI Publisher is Installed!

Start with command:

/appl/orabip/OraHome_1/oc4j_bi/bin/oc4j -start

Stop with command (Port 23791 will be changed to 20002):
/appl/orabip/OraHome_1/jdk/bin/java -jar /appl/orabip/OraHome_1/oc4j_bi/j2ee/home/admin.jar ormi://localhost:23791 oc4jadmin qwertz1 -shutdown force

NOTE (Port Conflict):
We have installed 3 different Oracle products that use "oc4j". Now we have "port conflict". I solve this problem changing the server port numbers in jms.xml and rmi.xml.The changes is done for "orahs" and "orabip" users. "oracle" users configuration is not modified.
Changes for user "orahs" - Oracle HTTP Server user.
1) Edit $ORACLE_HOME/j2ee/home/config/jms.xml

Change the standard port value 9127 to 21127.
<jms-server port="21127">
2) Edit $ORACLE_HOME/j2ee/home/config/rmi.xml
Change the standard port value 23791 to 20001.

<rmi-server port="20001" >
3) Edit $ORACLE_HOME/j2ee/home/config/internal-settings.xml
Change the default port values (NOTE: old values are changed to comment!):

<!-- sep-property name="port" value="5555" / -->
<sep-property name="port" value="21555" />
<!-- sep-property name="ssl-port" value="5556" / -->
<sep-property name="ssl-port" value="21556" />
<!-- sep-property name="ssl-client-server-auth-port" value="5557" / -->
<sep-property name="ssl-client-server-auth-port" value="21557" />
4) Edit http-web-site-xml.
Change the default port value from 8888 to 28881.

<web-site port="28881" display-name="OC4J 10g (10.0.2) HTTP Web Site">
Changes for user "orabip" - Oracle BI Publisher user.
1) Edit /appl/orabip/OraHome_1/oc4j_bi/j2ee/home/config/jms.xml
Change the standard port value 9127 to 22127.

<jms-server port="22127">
2) Edit /appl/orabip/OraHome_1/oc4j_bi/j2ee/home/config/rmi.xml
Change the standard port value 23791 to 20002.

<rmi-server
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/rmi-server-10_0.xsd"
port="20002"
ssl-port = "23943"
schema-major-version="10"
schema-minor-version="0"
>

Command to stop BI Publisher is changed (new "rmi" port!):
/appl/orabip/OraHome_1/jdk/bin/java -jar /appl/orabip/OraHome_1/oc4j_bi/j2ee/home/admin.jar ormi://localhost:20002 oc4jadmin qwertz1 -shutdown force

NOTE (Oracle Notification Server "netstat spam").
After Oracle HTTP Server Start (using opmnctl startall) I noticed that the system decreased performance. Linux command "netstat -a" show me about 54000 lines of output(!?!) - normaly is about 380, mostly with the content:
tcp 0 0 127.0.0.1:49463 127.0.0.1:6113 TIME_WAIT
tcp 0 0 127.0.0.1:49462 127.0.0.1:6113 TIME_WAIT
tcp 0 0 127.0.0.1:49461 127.0.0.1:6113 TIME_WAIT
tcp 0 0 127.0.0.1:49460 127.0.0.1:6113 TIME_WAIT
tcp 0 0 127.0.0.1:49459 127.0.0.1:6113 TIME_WAIT
etc etc

I added in "listener.ora" one row at end of file:
SUBSCRIBE_FOR_NODE_DOWN_EVENT_LISTENER=OFF
This works! The "line count" from netstat -a is about 380 now.


Don't forget to startup the stopped processes using
"emctl start dbconsole;" and
"$ORACLE_HOME/opmn/bin/opmnctl start"

Now we can configure Application Express to use BI Publisher for PDF Printing:
  • Connect to APEX Administration Page on http://vl094.fla.net:7780/pls/apex/apex_admin.
  • Select option"Manage Service".
  • Under "Mnage Environment Settings" select "Instance setings".
  • On "Instance Settings" Form select option "Report Printing".
You are now on "Report Printing" Form.

Select BI Publisher "Advanced Support".
Enter following values:
Print Server Host address: vl094.fla.net
Print server Port: 9704
Print server Script: /xmlpserver/convert.
Press "Apply Changes".

Congratulation: You are ready to use PDF Printig with APEX!

Here You can see a simple "PDF Printing in APEX" video demonstration.








Regards,
Flavio

Installing APEX - Oracle Application Express 3.0.1 on SLES 10.0

Previous Posts:
Oracle 10g Rel 2 on SLES 10.0
Installation Prepation
Hardware and Software check
Software Installation
Patch Oracle Database Software
Create Database
Install Oracle HTTP Server
Next Posts:
Install BI Publisher
Automate Startup/Shutdown
Install Oracle Workflow

The Installation of Oracle Application Express consists of Installation of PL/SQL Packages and other DB Objects (Users, Tables, Indexes ...) and Configuration of Oracle HTTP Servers modplsql module.

Download the Installation and Documentation Files:
Oracle Application Express 3.0.1

Following Steps will be executed as user oracle.

Connect to Linux Box as user oracle:
vl094:~ # ssh -Xl oracle vl094
Password:
Last login: Tue Sep 25 17:26:20 2007 from vl094.fla.net
oracle@vl094:~>


Unzip the file apex_3.0.1.zip and change directory to apex.
You cann access the Documentation using the HTML file welcome.html.
Start SQLPLUS and install Apex in the database.
oracle@vl094:~/apex> sqlplus

SQL*Plus: Release 10.2.0.3.0 - Production on Tue Sep 25 19:06:55 2007

Copyright (c) 1982, 2006, Oracle. All Rights Reserved.

Enter user-name: / as sysdba

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> @apexins qwertz SYSAUX SYSAUX TEMP /i/

Check the spool file install.log for errors.

Following steps will be executed as user orahs - Oracle HTTP Server software owner.

Connect to Linux Box as User orahs:
vl094:~ # ssh -Xl orahs vl094
Password:
Last login: Tue Sep 25 17:48:34 2007 from vl094.fla.net
orahs@vl094:~>


Copy the Image File to Apach Directory:
orahs@vl094:~> cp -rf /appl/home/oracle/apex/images/ $ORACLE_HOME/Apache/Apache/

Create the tnsnames.ora file with connection string to DB094.
orahs@vl094:~> cat /appl/orahs/product/10.2.0/db_1/network/admin/tnsnames.ora
DB094 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vl094.fla.net)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = DB094.fla.net)
)
)


Check the connection with the DB:
orahs@vl094:~> sqlplus system/qwertz@DB094

SQL*Plus: Release 10.1.0.3.0 - Production on Tue Sep 25 20:04:23 2007

Copyright (c) 1982, 2004, Oracle. All rights reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options
orahs@vl094:~>


Modify the dads.conf file:
orahs@vl094:~> cat /appl/orahs/product/10.2.0/db_1/Apache/modplsql/conf/dads.conf
# ============================================================================
# mod_plsql DAD Configuration File
# ============================================================================
# 1. Please refer to dads.README for a description of this file
# ============================================================================

# Note: This file should typically be included in your plsql.conf file with
# the "include" directive.

# Hint: You can look at some sample DADs in the dads.README file

# ============================================================================
Alias /i/ "/appl/orahs/product/10.2.0/db_1/Apache/Apache/images/"
AddType text/xml xbl
AddType text/x-component htc
<Location /pls/apex>
Order deny,allow
PlsqlDocumentPath docs
AllowOverride None
PlsqlDocumentProcedure wwv_flow_file_mgr.process_download
PlsqlDatabaseConnectString DB094 TNSFormat
PlsqlNLSLanguage AMERICAN_AMERICA.AL32UTF8
PlsqlAuthenticationMode Basic
SetHandler pls_handler
PlsqlDocumentTablename wwv_flow_file_objects$
PlsqlDatabaseUsername APEX_PUBLIC_USER
PlsqlDefaultPage apex
PlsqlDatabasePassword qwertz
Allow from all
</Location>

Restart the Oracle HTTP Server:
orahs@vl094:~> /appl/orahs/product/10.2.0/db_1/opmn/bin/opmnctl stopall
opmnctl: stopping opmn and all managed processes...
orahs@vl094:~> sleep 60
orahs@vl094:~> /appl/orahs/product/10.2.0/db_1/opmn/bin/opmnctl startall
opmnctl: starting opmn and all managed processes...


Connect to APEX on http://vl094:7780/pls/apex/apex_admin.

Form: Application Express Administration Service
Enter Usename ADMIN, Password qwertz.
Press Login.
-----------------------------------------------------------------------------------
Form: Change Password.
I entered 3 times the value qwertz.
Press "Apply Changes".
-----------------------------------------------------------------------------------
form: Change Password.
Press "Return"
-----------------------------------------------------------------------------------
Form: Application Express Administration Services.
Enter username ADMIN and password qwertz.
Press "Login".
-----------------------------------------------------------------------------------
Form: Application Express Administration.
Press "Logout".
-----------------------------------------------------------------------------------


Congratulation: Oracle Application Axpress is installed!

Regards,
Flavio

24 September 2007

Installing Oracle HTTP Server on SLES 10.0

Previous Posts:
Oracle 10g Rel 2 on SLES 10.0
Installation Prepation
Hardware and Software check
Software Installation
Patch Oracle Database Software
Create Database
Next posts:
Install APEX
Install BI Publisher
Automate Startup/Shutdown
Install Oracle Workflow

In this Post I will try to describe the Installation of Oracle HTTP Server on SLES 10.0. The installation files are located on "Companion CD".

Downloads:
Companion CD Installation Guide for Linux x86
Oracle Database 10g Companion CD Release 2 (10.2.0.1.0) for Linux x86

NOTE:
  • I downloaded and Installed required RPM package "compat-db" from http://rpm.pbone.net. The Installation package compat-db-4.1.25-9.i386.rpm is prepared for CentOS (!?) but the Installation on SLES was without any problems.
  • Before installation I edited the file /etc/SuSE-release and changed the version to 9. After Installaion I edited this file and changed to original value of 10.
I decided to Install the Oracle HTTP Server under different user as oracle. New user is orahs.
Here are all creation and modification commands:

Create Linux user orahs (password is as default by playing with Oracle: qwertz)
vl094:~ # useradd -u 5002 -g oinstall -G dba -d /appl/home/orahs -s /bin/bash orahs
vl094:~ # passwd orahs
Changing password for orahs.
New Password:
Bad password: too simple
Reenter New Password:
Password changed.

Create home and base directory for orahs.
vl094:~ # mkdir -p /appl/home/orahs
vl094:~ # chown -R orahs:oinstall /appl/home/orahs

vl094:~ # chmod 775 /appl/home/orahs

vl094:~ # mkdir -p /appl/orahs

vl094:~ # chown -R orahs:oinstall /appl/orahs


Modify file /etc/profile.d/oracle.sh
if [ $USER = "oracle" -o $USER = "orahs" ]; then
if [ $SHELL = "/bin/ksh" ]; then

ulimit -p 16384
ulimit -n 65536
else

ulimit -u 16384 -n 65536

fi

fi


Modify file /etc/security/limits.conf (add orahs user)
orahs soft nproc 2047
orahs hard nproc 16384

orahs soft nofile 1024

orahs hard nofile 65536


Connect to SLES server as Linux user orahs
vl094:~ # ssh -Xl orahs vl094
Password:
Last login: Mon Sep 24 23:21:40 2007 from vl094.fla.net


Create file .bash_profile
orahs@vl094:~> cat .bash_profile
#

ORACLE_BASE=/appl/orahs

export ORACLE_BASE

ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1

export ORACLE_HOME

PATH=$ORACLE_HOME/bin:$PATH

export PATH

if [ -z "$LD_LIBRARY_PATH" ]

then

LD_LIBRARY_PATH=$ORACLE_HOME/lib

else
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
fi

export LD_LIBRARY_PATH


Unzip the downloaded file
I unziped the Companion Installation Files in /appl/home/orahs/companion
orahs@vl094:~> ls companion/ doc install response runInstaller stage welcome.html

Install Oracle HTTP Software
Press "Next".
-------------------------------------------------------------------------------------------
Form: Select a product to Install.
Select Oracle Database 10g Companion Products 10.2.0.1
Press "Next".
-------------------------------------------------------------------------------------------
Form: Specify Home details.
Enter OraDb10g_home for Name.
Enter /appl/orahs/prodct/10.2.0/db_1 for Path.
Press "Next".
-------------------------------------------------------------------------------------------
Form: Available Product Components.
Select Apache standalone 10.1.0.0.
Press "Next".
-------------------------------------------------------------------------------------------
Form: Prerequisite Checks.
No requirements to be verified!!!
Press "Next"
-------------------------------------------------------------------------------------------
Form: Summary.
Press "Install".
-------------------------------------------------------------------------------------------
Form: Execute Configuration Scripts.
vl094:~ # /appl/orahs/product/10.2.0/db_1/root.sh
Running Oracle10 root.sh script...
The following environment variables are set as:
ORACLE_OWNER= orahs
ORACLE_HOME= /appl/orahs/product/10.2.0/db_1

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]:
The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]:
The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]:

Adding entry to /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.

Press "OK".
-------------------------------------------------------------------------------------------
Form: End of Installation.
Press "Exit".
-------------------------------------------------------------------------------------------
Form: Exit.
Press "OK".

Patch Oracle HTTPS Software
Form: Welcome.
Press "Next".
-------------------------------------------------------------------------------------------
Form: Specify Home Details.
Accept values for Name = OraDb10g_home, Path = /appl/orahs/product/10.2.0/db_1
Press"Next".
-------------------------------------------------------------------------------------------
Form: Summary
Press "Install".
-------------------------------------------------------------------------------------------
Form. End of Installation.
Pres "Exit".
-------------------------------------------------------------------------------------------
Form: Exit.
Press "Yes".

Congratulation: The Oracle HTTP Server is installed!

Content of the .bash_profile file:
orahs@vl094:~> cat /appl/home/orahs/.bash_profile
#
ORACLE_BASE=/appl/orahs
export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$PATH
export PATH
if [ -z "$LD_LIBRARY_PATH" ]
then
LD_LIBRARY_PATH=$ORACLE_HOME/lib
else
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
fi
export LD_LIBRARY_PATH


Stopping Oracle HTTP Server
orahs@vl094:~> /appl/orahs/product/10.2.0/db_1/opmn/bin/opmnctl stopall
opmnctl: stopping opmn and all managed processes...


Starting Oracle HTTP Server
orahs@vl094:~> /appl/orahs/product/10.2.0/db_1/opmn/bin/opmnctl startall
opmnctl: starting opmn and all managed processes...


Connect to Oracle HTTP server: http://vl094.fla.net:7780


Regards,
Flavio

23 September 2007

Oracle 10g Rel 2 on SLES 10.0 - Create Database

Previous Posts:
Oracle 10g Rel 2 on SLES 10.0
Installation Prepation
Hardware and Software check
Software Installation
Patch Oracle Database Software
Next Posts:
Install Oracle HTTP Server
Install APEX
Install BI Publisher
Automate Startup/Shutdown
Install Oracle Workflow

I will first create the Listener and then the Database.
Listener name is like default "LISTENER". It will be created using "netca".
Database name is DB094. Database will be configured and created using "dbca".

Connect to Linux Box as User oracle.
Configure and start the Listener using "Network Configuration Assistant".
oracle@vl094:~> netca

Form: Welcome
Select Listener configuration.
Press "Next".
------------------------------------------------------------------------------
Form: Listener
Select Add.
Press "Next".
-----------------------------------------------------------------------------
Form: Listener name.
Accept default value LISTENER.
Press "Next".
------------------------------------------------------------------------------
Form: Select Protocols.
Select TCP.
Press "Next"
------------------------------------------------------------------------------
Form: TCP/IP Protocoll
Select standard port 1521.
Press "Next".
------------------------------------------------------------------------------
Form: More Listeners.
Select No.
Press "Next"
------------------------------------------------------------------------------
Form: Done.
Press "Next" and on next Form "Finish".

Check Listener status:
oracle@vl094:~> lsnrctl stat

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 23-SEP-2007 20:41:35

Copyright (c) 1991, 2005, Oracle. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=vl094.fla.net)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 23-SEP-2007 20:38:43
Uptime 0 days 0 hr. 2 min. 52 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /appl/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File /appl/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=vl094.fla.net)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successful


Check the configuration file:
oracle@vl094:~> cat $ORACLE_HOME/network/admin/listener.ora
# listener.ora Network Configuration File: /appl/oracle/product/10.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /appl/oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
)
)

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vl094.fla.net)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
)

Create DB using Database Configuration assistant:
oracle@vl094:~> dbca
Form: Welcome
Press "Next".
--------------------------------------------------------------------------------
Form: Operations.
Select Create a Database.
Press "Next"
--------------------------------------------------------------------------------
Form: Database Template.
Select Custom Database.
Press "Next".
--------------------------------------------------------------------------------
Form: Database Identification.
For Global Database Name enter: DB094.fla.net.
For SID enter: DB094
--------------------------------------------------------------------------------
Form: Management Options
Select Configure the Database with Enterprise Manager.
Check Enable Daily Backup.
Enter oracle for OS Username, qwertz for Password.
Press "Next".
--------------------------------------------------------------------------------
Form: Database Credentials.
Check: Use the same Password for all account.
Enter "qwertz" for password.
Press "Next".
--------------------------------------------------------------------------------
Form: Storage Options.
Select File System.
Press "Next".
--------------------------------------------------------------------------------
Form: Database File Locations.
Select Use Database File Locations from Templates.
Press "Next".
--------------------------------------------------------------------------------
Form: Recovery Configuration.
Select option Specify Flash Recovery Area and accept Default values for Flash Recovery Area and Flash Recovery Area Size.
Select option Enable Archiving.
Press "Next"
--------------------------------------------------------------------------------
Form: Database Content.

Select all options.
Press "Next".
--------------------------------------------------------------------------------
Form: Initialization Parameters/Memory
Select option Typical and leave or set Percent value to 40.
--------------------------------------------------------------------------------
Form: Initialization Parameters/Sizing
Leave default values for Blocksize 8192 and for Processes 150.
--------------------------------------------------------------------------------
Form: Initialization Parameters/Character Sets
Select option Use Unicode (Al32UTF8).
Select AL16UTF16 for National Character Set.
Leave American for Default Language.
Select Germany for Default Date Format.
--------------------------------------------------------------------------------
Form: Initialization Parameters/Connection Mode
Leave default value Dedicated Server Mode selected.
Press "Next".
--------------------------------------------------------------------------------
Form: Database Storage
Accept default values - press "Next".
--------------------------------------------------------------------------------
Form: Confirmation
Press "OK".
--------------------------------------------------------------------------------
Form: Creation Options.
Select options: Create Database, Generate Database Creation Scripts and Save as a Database Template.
Press "Finish"
--------------------------------------------------------------------------------

Confirm the Information: Generation of the script.
Press "OK".
--------------------------------------------------------------------------------
Confirm the Information: Template creation.
Press "OK".
--------------------------------------------------------------------------------
Form: Database Configuration Assistants.
Wait until all componnents are installed.
--------------------------------------------------------------------------------
Confirm the Information about DB creation.
Press "OK".

Congratulation: Database is created!

Starting and stopping installed product.
Content of the oracle's .bash_profile file:
oracle@vl094:~> cat /appl/home/oracle/.bash_profile
#
ORACLE_BASE=/appl/oracle
export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$PATH
export PATH
if [ -z "$LD_LIBRARY_PATH" ]
then
LD_LIBRARY_PATH=$ORACLE_HOME/lib
else
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
fi
export LD_LIBRARY_PATH
ORACLE_SID=DB094
export ORACLE_SID


Stopping Listener
oracle@vl094:~> lsnrctl stop

LSNRCTL for Linux: Version 10.2.0.3.0 - Production on 25-SEP-2007 17:33:43

Copyright (c) 1991, 2006, Oracle. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=vl094.fla.net)(PORT=1521)))
The command completed successfully


Stopping Enterprise Manager
oracle@vl094:~> emctl stop dbconsole
TZ set to Europe/Vienna
Oracle Enterprise Manager 10g Database Control Release 10.2.0.3.0
Copyright (c) 1996, 2006 Oracle Corporation. All rights reserved.
http://vl094.fla.net:1158/em/console/aboutApplication
Stopping Oracle Enterprise Manager 10g Database Control ...
... Stopped.


Stopping Database
oracle@vl094:~> sqlplus / as sysdba

SQL*Plus: Release 10.2.0.3.0 - Production on Tue Sep 25 17:35:03 2007

Copyright (c) 1982, 2006, Oracle. All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options


Starting Listener
oracle@vl094:~> lsnrctl start

LSNRCTL for Linux: Version 10.2.0.3.0 - Production on 25-SEP-2007 17:36:05

Copyright (c) 1991, 2006, Oracle. All rights reserved.

Starting /appl/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 10.2.0.3.0 - Production
System parameter file is /appl/oracle/product/10.2.0/db_1/network/admin/listener.ora
Log messages written to /appl/oracle/product/10.2.0/db_1/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=vl094.fla.net)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=vl094.fla.net)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.3.0 - Production
Start Date 25-SEP-2007 17:36:05
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /appl/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File /appl/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=vl094.fla.net)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully


Starting Database
oracle@vl094:~> sqlplus / as sysdba

SQL*Plus: Release 10.2.0.3.0 - Production on Tue Sep 25 17:36:40 2007

Copyright (c) 1982, 2006, Oracle. All Rights Reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 289406976 bytes
Fixed Size 1261396 bytes
Variable Size 125829292 bytes
Database Buffers 159383552 bytes
Redo Buffers 2932736 bytes
Database mounted.
Database opened.
SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options


Starting enterprise Manager
oracle@vl094:~> emctl start dbconsole
TZ set to Europe/Vienna
Oracle Enterprise Manager 10g Database Control Release 10.2.0.3.0
Copyright (c) 1996, 2006 Oracle Corporation. All rights reserved.
http://vl094.fla.net:1158/em/console/aboutApplication
Starting Oracle Enterprise Manager 10g Database Control ......................... started.
------------------------------------------------------------------
Logs are generated in directory /appl/oracle/product/10.2.0/db_1/vl094.fla.net_DB094/sysman/log


Connect to enerprise Manager at http://vl094.fla.net/em.
Enter User sys, Password qwertz and select Connect As SYSDBA. Accept the Licence Text.


Regards,
Flavio