Autoconfig Internals
So what happens when you run adconfig.sh script? Remember it uses the XML file generated using adbldxml command. This XML file itself is build based upon the environment settings. You should ensure that the environment is set correctly by executing (CONTEXT_NAME).env script.
So one half of the equation comes from the XML file that we generated. The other half is the templates for each of the configuration file the AutoConfig process ultimately generates.
For each of the configuration file that gets generated as a result of running AutoConfig, Oracle uses a template file that come with the initial install process.
For example, if you review the adalnctl.sh file in the $AD_TOP/admin/template directory, you will see the template in action. Following is the extract from the template file adalnctl.sh located in $AD_TOP/admin/template directory
# FILENAME
# adalnctl.sh
# # DESCRIPTION
# Start / Stop Applications RPC Listener process for %s_dbSid%
# Make sure the logfile directory exists
#
if [ ! -d "%s_com%/admin/log/%s_dbSid%" ];
then mkdir -p %s_com%/admin/log/%s_dbSid%
fi;
# # Set up the logfile for this instance #
if [ -n "$SRVLOG" ];
then LOGFILE=$SRVLOG
else
LOGFILE=”%s_com%/admin/log/%s_dbSid%/adalnctl.txt”
fi;
touch $LOGFILE
Notice the s_dbSid variable being used in this script. The value for this variable will be read from the XML file generated when we ran the perl script adbldxml.pl.
Following the excerpt from the actual (CONTEXT_NAME).xml file located under $APPL_TOP/admin directory. Note that I have removed <> tags to enhance readability.
oa_system
oa_system_name oa_var=”s_systemname”SND1/oa_system_name global_db_name oa_var=”s_dbSid”snd1/global_db_name
global_db_name oa_var=”s_dbGlnam”>SND1/global_db_name
db_name_lower oa_var=”s_dbSidLower”snd1/db_name_lower
PRINTER oa_var=”s_printer”noprint/PRINTER
!oa_system_config
Now see the extract from actual adalnctl.sh in the $COMMON_TOP/admin/scripts/ directory.
As you can see, the actual file is created as copy from the template with values replaced from XML file.
# FILENAME
# adalnctl.sh
# # DESCRIPTION
# Start / Stop Applications RPC Listener process for snd1
# # Make sure the logfile directory exists #
if [ ! -d `dirname /u10/apps/snd1/comn/admin/log/snd1_ebdev03/adalnctl.txt` ];
then mkdir -p `dirname /u10/apps/snd1/comn/admin/log/snd1_ebdev03/adalnctl.txt`
fi;
# # Set up the logfile for this instance #
if [ -n "$SRVLOG" ]; then LOGFILE=$SRVLOG
else LOGFILE=”/u10/apps/snd1/comn/admin/log/snd1_ebdev03/adalnctl.txt” fi;
touch $LOGFILE
Conclusion
We have seen how AutoConfig creates the configuration files from template files.
Leave a Reply
You must be logged in to post a comment.