HomeOracle Page 6 - The Oracle Application Server 10g Infrastructure
Writing Your Own Infrastructure Repository Log Scripts - Oracle
If you need to handle the administration and management of Oracle Application Server 10g, this article covers the metadata repository (iasdb), the Single Sign-On (SSO) security framework, and the Oracle Application Server 10g Management Services. It is excerpted from chapter 2 of the book, Oracle Application Server 10g Administration Handbook, written by John Garmany and Donald Burleson (McGraw-Hill/Osborne, 2004; ISBN: 0072229586).
As we just noted, the OEM viewer is great for quick online queries, but most administrators write SQL*Plus scripts to directly extract the repository log message, often e-mailing it to the desktop.
To see how this works, here is a sample Korn shell script that will extract the online repository logs for SSO and mail them to the Application Server 10g administrator: mail_logs.ksh
#!/bin/ksh # First, we must set the environment . . . . ORACLE_SID=iasdb export ORACLE_SID ORACLE_HOME=`cat /etc/oratab|grep $ORACLE_SID:|cut -f2 - ':'` export ORACLE_HOME PATH=$ORACLE_HOME/bin:$PATH export PATH # Get the server name host=`uname -a|awk '{ print $2 }'` ${ORACLE_HOME}/bin/sqlplus system/`cat password.txt`<<! spool log_rpt_mgt.1st @sso_audit_log.sq l spool off exit; ! #************************************ # Filter only error messages #************************************ grep –i error log_rpt_mgt.lst > errors_log.lst
Note the password security in the SQL*Plus invocation line. You can save the SYSTEM password on your server in a file called password.txt and protect it by setting the file permissions such that only the Oracle user may view the password:
oracle> chmod 700 password.txt oracle> ls -al *.txt -rwx------ 1 oracle oracle 13 Aug 18 05:35 password.txt
Now that you’ve seen how easy it is to write SQL*Plus scripts against the iasdb instance, let’s take a look at the log tables and see which are the most important to the Application Server 10g administrator.
Viewing the Repository Log Tables
Because Oracle has been very careful to use uniform table naming conventions, you can write a simple SQL*Plus query to see the Application Server 10g log tables. In the following listing, we select all iasdb tables that contain the string LOG.
The output shows each of the iasdb schemas and their associated log tables. Remember, not all of the log tables are populated with meaningful information, so you must carefully examine each log file to see the contents.