Tuesday, June 24, 2008

Enable SSL with Oracle Applications 11i


Implementing SSL with Oracle Applications 11i

What is http?

Hypertext Transfer Protocol (HTTP) is a communications protocol for the transfer of information on the intranet and the World Wide Web. Its original purpose was to provide a way to publish and retrieve hypertext pages over the Internet.

What is Https?

Hypertext Transfer Protocol over Secure Socket Layer or HTTPS is a URI scheme used to indicate a secure HTTP connection. It is syntactically identical to the http:// scheme normally used for accessing resources using HTTP. Using an https: URL indicates that HTTP is to be used, but with a different default TCP port (443) and an additional encryption/authentication layer between the HTTP and TCP. This system was designed by Netscape Communications Corporation to provide authentication and encrypted communication and is widely used on the World Wide Web for security-sensitive communication such as payment transactions and corporate logons


Overview

This Document contains information for implementing SSL with Oracle E-Business Suite Release 11i. It implementation steps for configuring SSL with Oracle HTTP Server, Oracle Forms 6i server, and Oracle Database server.

Secure Sockets Layer (SSL) is an encrypted communication protocol that is designed to securely send messages across the Internet. It resides between Oracle HTTP Server on the application layer and the TCP/IP layer, transparently handling encryption and decryption when a secure connection is made by a client.

One common use of SSL is to secure Web HTTP communication between a browser and a Web server. This case does not preclude the use of non-secured HTTP. The secure version is simply HTTP over SSL (named HTTPS). The differences are that HTTPS uses the URL scheme https:// rather than http://, and its default communication port is 4443 on UNIX or 443 on Windows.


SSL Implementation with Oracle HTTP Server

The implementation of SSL for the Oracle HTTP server, is based on mod_ssl (http://www.modssl.org) and openssl (http://www.openssl. org) technology. The Oracle HTTP server installation under Oracle E-Business Suite Release 11i includes the mod_ssl and openssl components. Once openssl has been used to generate your digital certificate and the proper directives for Oracle HTTP server have been defined, the Oracle HTTP server is capable of starting and running in SSL mode.

1.How SSL works with Oracle HTTP ServerThe client sends a request to the server using HTTPS connection mode.
2.The server presents its certificate to the client. This certificate contains the server's identifying information.
3.The client checks its list of Trust points and compares the information in the certificate with the server's public key. If it matches, the server is authenticated as a trusted server.
4.The client sends the server a list of the encryption levels, or ciphers, that it can use.
5.The server receives the list and selects the strongest level of encryption that they have in common.
6.The client creates a session key which is used to encrypt the data and sends this session key to the server which can decrypt the data with its private key.


Step 1

SQL> select HOME_URL from icx_parameters;
HOME_URL
--------------------------------------------------
http://sys43.doyen.in:8000/oa_servlets/AppsLogin


In Apps node
cd $APPL_TOP/admin
cat VIS_sys43.xml grep login_page
http://sys43.doyen.in:8000/oa_servlets/AppsLogin



Step 2

Set ths following environment varibles
export SCRIPT_TOP=$COMMON_TOP/admin/scripts/sar_sys45
export APACHE_TOP=/oracle/app/apps/sarora/iAS/Apache
export OPENSSL_TOP=/oracle/app/apps/sarora/iAS/Apache/open_ssl
export OPENSSL_CONF=$OPENSSL_TOP/bin


Backup the context xml file in $APPL_TOP/admin
Edit the context xml file in $APPL_TOP/admin, change the SSL related variables to SSL values




Step 3

Using self signed certificate with Applications genereted by OpenSSL for WebSever

Certificate request file (.cer)
Actual certificate file (.crt)
Private Key file (.key)


OpenSSL is a cryptography toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) network protocols and related cryptography standards required by them. The openssl program is a command line tool for using the various cryptography functions of OpenSSL<80><99>s crypto library from the shell.

It can be used for

o Creation of RSA, DH and DSA key parameters
o Creation of X.509 certificates, CSRs and CRLs
o Calculation of Message Digests
o Encryption and Decryption with Ciphers
o SSL/TLS Client and Server Tests
o Handling of S/MIME signed or encrypted mail


$openssl req -x509 -newkey rsa:1024 -keyout cakey.pem -out cacert.pem -days 10000 -config openssl.cnf

Using configuration from openssl.cnf
Generating a 1024 bit RSA private key
.............................++++++
...........++++++
writing new private key to 'cakey.pem'
Enter PEM pass phrase:
Verifying password - Enter PEM pass phrase:
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:IN
State or Province Name (full name) [Some-State]:Tamil Nadu
Locality Name (eg, city) []:Chennai
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Doyensys
Organizational Unit Name (eg, section) []:ERP
Common Name (eg, YOUR name) []:sys43.doyen.in
Email Address []:erp@doyensys.com


$openssl req -nodes -new -x509 -keyout apache.key -out apache_request.pem -days 3650 -config openssl.cnf

Using configuration from openssl.cnf
Generating a 1024 bit RSA private key
....++++++
.................................................................................................++++++
writing new private key to 'apache.key'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:IN
State or Province Name (full name) [Some-State]:Tamil Nadu
Locality Name (eg, city) []:Chennai
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Doyensys
Organizational Unit Name (eg, section) []:ERP
Common Name (eg, YOUR name) []:sys43.doyen.in
Email Address []:erp@doyensys.com

# Note : give common name your url name (for example sys43.doyen.in)


$openssl x509 -x509toreq -in apache_request.pem -signkey apache.key -out apache.csr
Getting request Private Key
Generating certificate request

$openssl x509 -req -days 3650 -in apache.csr -signkey apache.key -out apache.crt
Signature ok
subject=/C=IN/ST=Tamil Nadu/L=Chennai/O=Doyensys/OU=ERP/CN=sys43.doyen.in/Email=erp@doyensys.com
Getting Private key



cp -f apache.crt $APACHE_TOP/Apache/conf/ssl.crt/server.crt
cp -f apache.key $APACHE_TOP/Apache/conf/ssl.key/server.key
cp -f cacert.pem $APACHE_TOP/Apache/conf/ssl.crt/ca.crt



Step 4

Stop Apps services.

Run Autoconfig.

Check Apache status



Step 5

SQL> select HOME_URL from icx_parameters;
HOME_URL
--------------------------------------------------
https://sys43.doyen.in:4443/oa_servlets/AppsLogin

In Apps node

cd $APPL_TOP/admin
cat VIS_sys43.xml grep login_page
https://sys43.doyen.in:4443/oa_servlets/AppsLogin




Troubleshooting SSL Certificate

Use the following commands to check the validity of the certificate.

1. openssl x509 -subject -in server.crt
This command will give the content of the certificate.

2. openssl x509 -noout -text -in server.crt
This command will check the validity of the certificate which will list out validity period.

3. openssl s_client -connect host.domain:sslport
This command will check whether ssl configuration works fine through command prompt.

Troubleshooting common SSL errors

1. Check out the following error,
[Tue Mar 15 21:37:25 2005] [notice] FastCGI: process manager initialized (pid 8951)
[Tue Mar 15 21:37:26 2005] [notice] Oracle HTTP Server Powered by Apache/1.3.19 configured -- resuming normal operations
[Tue Mar 15 21:37:59 2005] [error] mod_ssl: SSL handshake interrupted by system [Hint: Stop button pressed in browser?!] (System error follows)
[Tue Mar 15 21:37:59 2005] [error] System: Connection reset by peer (errno: 104)
[Tue Mar 15 21:38:02 2005] [error] mod_ssl: SSL handshake interrupted by system [Hint: Stop button pressed in browser?!] (System error follows)
[Tue Mar 15 21:38:02 2005] [error] System: Connection reset by peer (errno: 104)
[Tue Mar 15 21:38:03 2005] [error] mod_ssl: SSL handshake interrupted by system [Hint: Stop button pressed in browser?!] (System error follows)
[Tue Mar 15 21:38:03 2005] [error] System: Connection reset by peer (errno: 104)


This is encountered when using browsers which are not compatable with the certificate file.

If this happens only with IE not with Netscape then the issue is with Certificate Chain file.
Comment SSLCertificateChainFile in httpd.conf.




2. Check the following error

RSA server certificate CommonName (CN) '' does NOT match server name!?
This error is usually found in ssl_engine_log. This occurs if a certificate obtained/created for one host is used for a different host.

This error can be ignored if there are no issues with applications.

Oracle RDBMS 10g Installing Steps

Installing Oracle RDBMS 10g ...

1.Open a terminal window. Login as the root user.
2. Create these operating system groups: oinstall, dba, and, oper.
/usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
/usr/sbin/groupadd oper

3. Create the operating system user oracle:
/usr/sbin/useradd -g oinstall -G dba,oper -d /home/oracle oracle

4. Enter the following command to set the password of the oracle user:
/usr/sbin/passwd oracle

5. With an editor of your choosing edit /home/oracle/.bash_profile to include the following entries:

umask 022
ORACLE_BASE=/u01
ORACLE_HOME=$ORACLE_BASE/oracle/product/10.2.0/db_1
ORACLE_SID=orcl
PATH=$ORACLE_HOME/bin:$PATH:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:/usr/X11R6/lib


export PATH LD_LIBRARY_PATH
export ORACLE_BASE ORACLE_HOME ORACLE_SID

6. Create the directory for the software installation and assign ownership to oracle:oinstall.
mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01/app
chmod -R 775 /u01/app

7. Open the /etc/sysctl.conf file in any text editor and add lines similar to the following:
kernel.sem = 250 32000 100 128
kernel.shmmax = 2147483684
kernel.shmmni = 4096
kernel.shmall = 2097152
kernel.msgmnb = 360000
kernel.msgmni = 2878
kernel.msgmax = 8192
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144

8. Issue this command to set the kernel parameters:
/sbin/sysctl -p

9. Required RPMs.
binutils-2.15.92.0.2-15
compat-db-4.1.25-9
control-center-2.8.0-12.rhel4.2
gcc-3.4.4-2
gcc-c++-3.4.4-2
glibc-2.3.4-2.13
libc-common-2.3.4-2.13
gnome-libs-1.4.1.2.90-44.1
libstdc++-3.4.4-2
libstdc++-devel-3.4.4-2
make-3.80-5
pdksh-5.2.14-30.3
sysstat-5.0.5-11.rhel4

To check the installed RPMs, run this command:

rpm -qa binutils \
compat-db \
control-center \
gcc \
gcc-c++ \
glibc \
glibc-common \
gnome-libs \
libstdc++ \
libstdc++-devel \
make \
pdksh \
sysstat sort

10. Exit from root user.

11. Connect as oracle in a Xterm enabled window to begin the installation.
Mount the Oracle Database 10g DVD.
Execute the script /database/runInstaller from oracle's home directory, /home/oracle or unzip folder.
Download Oracle 10g(10.2.0.1) on Linux

12. unzip 10201_database_linux32.zip
13. ./runInstaller







14. Select Advanced Installation. Click Next.

15. Specify Inventory directory and credentials

Verify the Inventory Directory: /u01/oraInventory

Operating Group: oinstall

Click Next.


16. Specify Home Details
Verify the name for the installation : OraDb10g_home1
Verify the path : /u01/app/oracle/product/10.2.0/db_1
Click Next.


17. Product-Specific Prerequisite Checks

The installer will now verify the system meets all the minimum requirements for installing and configuring the chosen product. The checks should all succeeds. If so, click Next. If not consult the installation manual and verify all prerequisites have been met..



18.Select Configuration Option
Select Install database Software only.
Click Next.






19. On the Summary Screen: Click Install.


20.Execute Configuration Scripts
Open a terminal window and execute these steps in root user:
su - root
/u01/app/oracle/oraInventory/orainstRoot.sh


21. /u01/app/oracle/product/10.2.0/db_1/root.sh


22. Exit.

Monday, June 23, 2008

Oracle Apps Scripts

Runing Concurrent Requests

Set Line 123
Set Pages 1000
Set Head On


Column user_name Format A12 Heading "User Name"
Column start Format A20 Heading "Start Date Time"
Column status_code Format A12 Heading "Status"
Column queue_name Format A25 Heading "Manager - Node"
Column user_concurrent_program_name Format A37 Heading "Program Name"
Column Request_id Format 99999999 Heading "Request ID"


select
c.user_name,
a.Request_id,
to_char(a.actual_start_date,'DD-MON-YYYY HH24:MI:SS') "Start",
decode(a.status_code,
'A','Waiting',
'B', 'Resuming',
'C', 'Normal',
'D', 'Cancelled',
'E', 'Error',
'G', 'Warning',
'H', 'On Hold',
'I', 'Normal',
'M', 'No Manager',
'P', 'Scheduled',
'Q', 'Standby',
'R', 'Normal',
'S', 'Suspended',
'T', 'Terminating',
'U', 'Disabled',
'W', 'Paused',
'X', 'Terminated',
'Z', 'Waiting') status_code,
b.user_concurrent_queue_name||' - '||b.target_node "queue_name",
a.user_concurrent_program_name
from fnd_concurrent_worker_requests a,
fnd_concurrent_queues_vl b,
fnd_user c
where a.concurrent_queue_id=b.concurrent_queue_id
and a.phase_code='R'
and a.requested_by=c.user_id

Order by 5;





Managers that are currently running a request

Set Pages 1000
Set head on

Column Manager Format A20
Column Request Format 99999999
Column Program Format A15
Column User_Name Format A15
Column Started Format A15

prompt Managers that are currently running a request;
prompt ;

Select Concurrent_Queue_Name Manager,
Request_Id Request, User_name,
Concurrent_Program_Name Program, Run_Alone_Flag,
To_Char(Actual_Start_Date, 'DD-MON-YY HH24:MI') Started
from Fnd_Concurrent_Queues Fcq, Fnd_Concurrent_Requests Fcr,
Fnd_Concurrent_Programs Fcp, Fnd_User Fu, Fnd_Concurrent_Processes Fpro
where
Phase_Code = 'R' And
Fcr.Controlling_Manager = Concurrent_Process_Id And
(Fcq.Concurrent_Queue_Id = Fpro.Concurrent_Queue_Id And
Fcq.Application_Id = Fpro.Queue_Application_Id ) And
(Fcr.Concurrent_Program_Id = Fcp.Concurrent_Program_Id And
Fcr.Program_Application_Id = Fcp.Application_Id ) And
Fcr.Requested_By = User_Id
;

Thursday, June 19, 2008

Installing Oracle 10g On Linux 4.5

How to installing Oracle 10g

1. Open a terminal window. Login as the root user.

2. Create these operating system groups: oinstall, dba, and, oper.

/usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
/usr/sbin/groupadd oper

3. Create the operating system user oracle:

/usr/sbin/useradd -g oinstall -G dba,oper -d /home/oracle oracle

4. Enter the following command to set the password of the oracle user:

/usr/sbin/passwd oracle

5. With an editor of your choosing edit /home/oracle/.bash_profile to include the following entries:

umask 022

PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
LD_LIBRARY_PATH=/usr/lib:/usr/X11R6/lib

ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
ORACLE_SID=orcl


PATH=$ORACLE_HOME/bin:$PATH
export PATH LD_LIBRARY_PATH
export ORACLE_BASE ORACLE_HOME ORACLE_SID

6. Create the directory for the software installation and assign ownership to oracle:oinstall.

mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01/app
chmod -R 775 /u01/app

7. Open the /etc/sysctl.conf file in any text editor and add lines similar to the following:

kernel.sem = 250 32000 100 128
kernel.shmmax = 2147483684
kernel.shmmni = 4096
kernel.shmall = 2097152
kernel.msgmnb = 360000
kernel.msgmni = 2878
kernel.msgmax = 8192
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144

8. Issue this command to set the kernel parameters:
/sbin/sysctl -p

9. Required RPMs.

binutils-2.15.92.0.2-15
compat-db-4.1.25-9
control-center-2.8.0-12.rhel4.2
gcc-3.4.4-2
gcc-c++-3.4.4-2
glibc-2.3.4-2.13
libc-common-2.3.4-2.13
gnome-libs-1.4.1.2.90-44.1
libstdc++-3.4.4-2
libstdc++-devel-3.4.4-2
make-3.80-5
pdksh-5.2.14-30.3
sysstat-5.0.5-11.rhel4

To check the installed RPMs, run this command:

rpm -qa binutils \
compat-db \
control-center \
gcc \
gcc-c++ \
glibc \
glibc-common \
gnome-libs \
libstdc++ \
libstdc++-devel \
make \
pdksh \
sysstat sort

10. Exit from root user.

11. Connect as oracle in a Xterm enabled window to begin the installation.
Mount the Oracle Database 10g DVD.
Execute the script //database/runInstaller from oracle's home directory, /home/oracle.
Download Oracle 10g(10.2.0.1) on Linux

Example:
/media/cdrecorder/database/runInstaller

12. Select Advanced Installation. Click Next.

13. Specify Inventory directory and credentials
Verify the Inventory Directory: /u01/app/oracle/oraInventory
Operating Group: oinstall
Click Next.

14. Select Installation Type
Select Enterprise Edition (1.24 GB)
Click Product Languages.

15. Language Selection
Click the double arrow ( >> ) to select all.
Click OK.
Click Next.

16. Specify Home Details
Verify the name for the installation:
OraDb10g_home1
Verify the path:
/u01/app/oracle/product/10.2.0/db_1
Click Next.

17. Product-Specific Prerequisite Checks
The installer will now verify the system meets all the minimum requirements for installing and configuring the chosen product. The checks should all succeeds. If so, click Next. If not consult the installation manual and verify all prerequisites have been met..

18. Select Configuration Option
Select Create a database.
Click Next.

19. Select Database Configuration
Select General Purpose.
Click Next.

20. Specify Database Configuration Options
Global Database Name: orcl.oracle.com
SID: orcl
Database Character Set: Unicode standard UTF-8 AL32UTF8
Check box next to Create database with sample schemas
Click Next.

21. Select Database Management Option
Select Use Database Control for Database Management.
Click Next.

22. Specify Database Storage Option
Select File System
Click Next.

23. Specify Backup and Recovery Options
Select Do not enable Automated Backups
Click Next.

24. Specify Database Schema Passwords
Select Use the same password for all accounts
Password: oracle
Click Next.

25. On the Summary Screen: Click Install.

26. Click OK, when the Database Configuration Assistant completes.

Execute Configuration Scripts
Open a terminal window and execute these steps:

su -
/u01/app/oracle/oraInventory/orainstRoot.sh
/u01/app/oracle/product/10.2.0/db_1/root.sh
exit


27. After executing the scripts, click OK.

28. At the End of Installation screen click Exit, then click Yes

Unlock accounts

1. Unlock and assign passwords to all locked schemas in the database. Open a text editor and create a text file named unlock.sh which contains (cut and paste):

sqlplus -S /nolog < connect / as sysdba
SET LINESIZE 132
SET PAGESIZE 0
SET TERMOUT OFF
SET NEWPAGE 0
SET SPACE 0
SET ECHO OFF
SET FEEDBACK OFF
SET HEADING OFF
SPOOL x.sql
SELECT 'ALTER USER 'username' IDENTIFIED BY 'username' ACCOUNT UNLOCK;'
FROM dba_users
WHERE account_status LIKE '%LOCK%';
SPOOL OFF
@x.sql
!rm x.sql
exit
<
2. Change permissions on file unlock.sh to make it executable, then execute it.

chmod u+x unlock.sh
./unlock.sh


Wednesday, June 18, 2008

Installing the Oracle Maintenance Wizard


Maintenance Wizard version 2.x requires Oracle RDBMS 10g (10.2.0) with 10g iAS (10.1.3). Do not attempt to "re-use" existing 10g ORACLE_HOMES, as this has been known to cause errors during installation. Install a new standalone Oracle 10g RDBMS ORACLE_HOME for use by Maintenance Wizard.
Note: You CANNOT use the same database that the Applications are running in. The tool must be installed in a separate database from the Applications.




1.Install a new standalone Oracle 10g RDBMS ORACLE_HOME

Download Oracle RDBMS 10g(10.2.0)

a. Set the DISPLAY variable appropriately and export it.
Note: Before you run the Oracle Installer, ensure that an X Windows manager is running.

b. Install RDBMS 10g using the following command:
./runInstaller

c. Specify the desired ORACLE_HOME location.

d. Choose "Enterprise Edition".




e. Uncheck the option called "Create Starter database". Click NEXT.

f. Optionally, specify the oraInventory and operating system group, then click NEXT.

g. After successful Product-Specific Prerequisite Checks, choose "Install database Software only" and click NEXT

h. Click INSTALL.
i. When the installation has completed, exit the installer.
-----------------------

2. Install a new standalone Oracle 10g iAS ORACLE_HOME


Download Oracle iAS 10g (10.1.3)
a. Set the DISPLAY variable appropriately and export it.
Note: Before you run the Oracle Installer, ensure that an X Windows manager is running.

b. Run the installer.
./runInstaller

c. Specify the installation directory.

d. Choose "Advanced Installation Mode" and click NEXT.

e. Choose "Web Server and Process Management" (or "Integrated Web Server, J2EE Server and Process Management") and click NEXT.

f. Select your desired method of port configuration and click NEXT.

g. Optionally, select your desired Administration Instance settings and click NEXT.

h. Specify your Cluster Topology Configuration and click NEXT.

i. Click INSTALL.

j. Exit the installer.

k. When the installation has completed, exit the installer.
----------


3. Create the database.

a. Set the ORACLE_HOME variable appropriately.
ORACLE_HOME=; export ORACLE_HOME

b. Change to the bin directory.
cd $ORACLE_HOME/bin

c. Run the database creation utility.
./dbca


d. Choose "Create a Database".



e. Choose "General Purpose".



f. Specify the Global Database Name.



g. Specify whether to configure to database with Enterprise Manager.



h. Set the default password for the SYS and SYSTEM accounts. (PLEASE, record these in a secure location!)



i. Choose your storage mechanism. We recommend that you choose "File System" and select a Common Location.



j. Specify any desired recovery options.



k. Specify NO sample schemas.



l. In the Character Sets tab, do NOT modify the Default Language (American) and Default Date Format (US).



m. Specify the desired values for parameters SGA, PGA and processes.



n. When the process has completed, exit the Database Creation Assistant.
----------------------




4. Set up the listener for the Oracle RDBMS ORACLE_HOME.




Create LISTENER.ora and TNSNAMES.ora files in the Oracle RDBMS $ORACLE_HOME/network/admin directory.
Use of a sqlnet.ora file is not necessary for operation of SQL*Net. We strongly recommend against creating a sqlnet.ora file. If you are using a sqlnet.ora file and experience database connection issues with the Maintenance Wizard, it may be related to parameters such as "defaultdomain". Please consult the SQL*Net manual for details. You may use netca to configure your listener, or modify the following template: LISTENER.ORA file

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = yourhost.us.oracle.com)(PORT = 1521))
)
)
)

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = myora10g)
(ORACLE_HOME = /u02/ora10g/10.2.0)
(SID_NAME = myora10g)
)
)
TNSNAMES.ora file

ORA9I =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = yourhost.us.oracle.com)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = myora10g)
)
)




5. Set up the listener for the Oracle iAS ORACLE_HOME. Either copy the tnsnames.ora file or create a symbolic link.
To copy the file:
cp /network/admin/tnsnames.ora /network/admin/
Or, to create a symbolic link:
cd /network/admin
ln -s /network/admin/tnsnames.ora tnsnames.ora




6. Create the NEWEOF tablespace where the Maintenance Wizard schema objects will be stored. Connect to sqlplus as the system user, and execute the following command substituting in the full path to your datafile.
create tablespace NEWEOF datafile '/u01/oracle/oradata/eof01.dbf' size 50M AUTOEXTEND ON NEXT 5M MAXSIZE 75M;
Note: Do not create a Maintenance Wizard schema; the tool creates it automatically.




7. Verify that Zip and UnZip executables are installed and that ping is in the $PATH using the following commands:




8. Set the default shell for all UNIX accounts to Korn shell. You must do this for the MW UNIX owner on the MW node, as well as for all user accounts that will be used on the remote nodes (applmgr, oracle). For Linux ONLY, you will first have to manually install ksh into the /bin directory of each machine. The UNIX Korn shell is not automatically installed on Linux.




Installing the Oracle Maintenance Wizard


1. Login to the system as the same UNIX user that you used to install the RDBMS and iAS.


2. Ensure that the $ORACLE_HOME environment variable is set to point at RDBMS 10g before proceeding. At a minimum, take sure the following variables are set.
ORACLE_HOME=; export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$PATH; export PATH
TWO_TASK=;export TWO_TASK
TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN


3. Create a directory to extract the tool into (this will become your $EOF_HOME). Oracle recommends that you create the Maintenance Wizard directory in the RDBMS $ORACLE_HOME directory. Then set the $EOF_HOME environment variable as follows:
cd $ORACLE_HOME
mkdir eof
EOF_HOME=$ORACLE_HOME/eof; export EOF_HOME


4. Download the latest Maintenance Wizard Full Install version from Downloads and unzip it into ${EOF_HOME}.


5. Change directory to the $EOF_HOME/config directory.
cd ${EOF_HOME}/config


6. Run the installation script.
./setup.sh


7. Respond to the prompts shown below. Default values are shown in brackets.





8. You have the option to review your entries and make changes before the install begins.
Domain =
Oracle Home =
Connect String =
System Password =
Database Schema =
EOF Patch Stage =
Email for Anonymous FTP =
OracleMetaLink Username =
OracleMetaLink Password =
Maintenance Wizard Password =
Note: The automated patching and administration features of the tool require that a defaults file be located in the $APPL_TOP/admin/[SID] directory. The file may be named either defaults.txt or adalldefaults.txt. You must update this file whenever you make changes to entries that it references, such as changing a database password or moving directory paths. For more information about the defaults.txt file, please see Oracle Applications Maintenance Utilities.

10. Choose option 2 to review the todo.txt file for information about additional steps that you must perform, then choose option 3 to exit the installer.




11. It is strongly recommended that you increase the Timeout parameter in the httpd.conf file for Apache to a value of 10800 (3 hours) to allow long running steps (like patch downloads and merges) to complete successfully.




12. Stop and restart iAS.
opmnctl stopall
opmnctl startall
Note: You can rerun setup.sh to change the configuration if required (for example, if you make a mistake in your initial setup, or decide to use a different machine or location.)




Post Install Steps
1. Secure the $EOF_HOME/EOF.env file.
chmod 700 $EOF_HOME/EOF.env



2. Setup a client machine with Microsoft Internet Explorer (IE) 6.0 or higher.



3. In IE, under Tools -> Internet Options, click Settings. Select the radio button for "Every visit to the page."



4. If you are using IE 7.0 or higher, you need to allow the MW to set the status via a script so that your autorefresh works properly. Go to Tools -> Internet Options -> Security -> Local Intranet Zone -> Custom Level -> Scripting and set "Allow status bar updates via script" to checked.



5. Some customers have found that they had to change their Cookie settings as well. If you receive an ORA-1403 in the Apache error log while trying to log into the tool, you should go to Tools -> Internet Options -> Privacy Tab, click Advanced. In the Cookies section, choose Override automatic cookie handling. Under First-party cookies, select Accept. Select Always Allow Session Cookies.



6. Save and exit the IE Internet Options.



7. Login to the tool using the following URL and the pre-assigned username and password that you assigned it when you chose back in step 7 of Installation: SYSADMIN/YOURPASS:
http://hostname:portno/EOF/





8. Download the User Guide to learn how to create and configure customers and projects.



Uninstall Steps


1. Login to the database as the sys user.



2. Drop the Maintenance Wizard user and objects.
drop user neweof cascade;



3. Drop all directory objects that begin with "CONFIG_INSTANCE_" or "LOG_INSTANCE_".
declare
cursor all_dirs is
select * from dba_directories
where directory_name like 'CONFIG_INSTANCE_%'
or directory_name like 'LOG_INTANCE_%';
begin
for each_dir in all_dirs
loop
execute immediate 'drop directory ' each_dir.directory_name;
end loop;
end;
/



4. Stop and restart the database.



5. Under the iAS $APACHE_TOP/Apache/conf directory, edit the oracle_apache.conf file and remove the following section (where $EOF_HOME is your specific value):
# begin customizations
# Include EOF configuration information for Apache
include $EOF_HOME/config/EOF.conf
# end customizations
6. Under the $IAS_HOME/Apache/modplsql/conf directory, remove the dad information from the dads.conf file.



7. Stop and restart iAS.
opmnctl stopall
opmnctl startall



8. Remove Maintenance Wizard directories from the system.



9. Remove directories/files created under each user's home directory.



10. Remove entries from .rhosts or authorized_keys files.


Oracle DBA Scripts

Oracle Database size scripts

COLUMN "Total Mb" FORMAT 999,999,999.0
COLUMN "Redo Mb" FORMAT 999,999,999.0
COLUMN "Temp Mb" FORMAT 999,999,999.0
COLUMN "Data Mb" FORMAT 999,999,999.0

Prompt
Prompt "Database Size"

select (select sum(bytes/1048576) from dba_data_files) "Data Mb",
(select NVL(sum(bytes/1048576),0) from dba_temp_files) "Temp Mb",
(select sum(bytes/1048576)*max(members) from v$log) "Redo Mb",
(select sum(bytes/1048576) from dba_data_files) +
(select NVL(sum(bytes/1048576),0) from dba_temp_files) +
(select sum(bytes/1048576)*max(members) from v$log) "Total Mb"
from dual;


Oracle Tablespace size scripts

SET LINESIZE 135
SET PAGESIZE 9999
SET VERIFY OFF

COLUMN status FORMAT a9 HEADING 'Status'
COLUMN name FORMAT a20 HEADING 'Tablespace Name'
COLUMN type FORMAT a12 HEADING 'TS Type'
COLUMN extent_mgt FORMAT a10 HEADING 'Ext. Mgt.'
COLUMN segment_mgt FORMAT a9 HEADING 'Seg. Mgt.'
COLUMN ts_size FORMAT 999,999,999 HEADING 'Tablespace Size'
COLUMN used FORMAT 999,999,999 HEADING 'Used (in MB )'
COLUMN free FORMAT 999,999,999 HEADING 'Free (in MB)'
COLUMN pct_used FORMAT 999 HEADING 'Pct. Used'

BREAK ON report
COMPUTE SUM OF ts_size ON report
COMPUTE SUM OF used ON report
COMPUTE SUM OF free ON report
COMPUTE AVG OF pct_used ON report

SELECT
d.status status
, d.tablespace_name name
, d.contents type
, d.extent_management extent_mgt
, d.segment_space_management segment_mgt
, (NVL(a.bytes, 0) )/1024/1024 ts_size
, (NVL(a.bytes - NVL(f.bytes, 0), 0))/1024/1024 used
, (NVL(f.bytes, 0))/1024/1024 free
, NVL((a.bytes - NVL(f.bytes, 0)) / a.bytes * 100, 0) pct_used
FROM
sys.dba_tablespaces d
, ( select tablespace_name, sum(bytes) bytes
from dba_data_files
group by tablespace_name
) a
, ( select tablespace_name, sum(bytes) bytes
from dba_free_space
group by tablespace_name
) f
WHERE
d.tablespace_name = a.tablespace_name(+)
AND d.tablespace_name = f.tablespace_name(+)
AND NOT (
d.extent_management like 'LOCAL'
AND
d.contents like 'TEMPORARY'
)
UNION ALL
SELECT
d.status status
, d.tablespace_name name
, d.contents type
, d.extent_management extent_mgt
, d.segment_space_management segment_mgt
, (NVL(a.bytes, 0)/1024/1024) ts_size
, (NVL(t.bytes, 0)/1024/1024) used
, (NVL(a.bytes - NVL(t.bytes,0), 0))/1024/1024 free
, NVL(t.bytes / a.bytes * 100, 0) pct_used
FROM
sys.dba_tablespaces d
, ( select tablespace_name, sum(bytes) bytes
from dba_temp_files
group by tablespace_name
) a
, ( select tablespace_name, sum(bytes_cached) bytes
from v$temp_extent_pool
group by tablespace_name
) t
WHERE
d.tablespace_name = a.tablespace_name(+)
AND d.tablespace_name = t.tablespace_name(+)
AND d.extent_management like 'LOCAL'
AND d.contents like 'TEMPORARY'

order by 9
/



Identifying High CPU Consuming Sessions

select ss.sid,ss.value CPU ,se.username,se.program
from v$sesstat ss, v$session se
where ss.statistic# in
(select statistic#
from v$statname
where name = 'CPU used by this session')
and se.sid=ss.sid
--and ss.sid>6 -- disregard background processes
order by CPU;

Tuesday, May 20, 2008

Apache error : Apache JServ encountered a fatal error

Apache JServ encountered a fatal error

Oracle 9.2.0.8 Apache not working

In Log file

No such file or directory: Apache JServ encountered a fatal error; check your ApJServLogFile for details if none are present in this file. Exiting.

Solution

Please edit your
$ORACLE_HOME/Apache/Jserv/etc/jserv.properties file

comment out the lines that starts with:

#wrapper.env.copy= (2 LINES)