Tag Archives: HowTo

Google forms and regular expressions for response validation

I was kind of shocked with the proliferation of teachers now using Google Classroom to conduct classes, that the documentation for the Quiz sections of the Classwork assignments is quite insufficient (or presumes you’re an IT geek like me, and can just figure out what programming is available to you.)

The example situation is given by this Blog entry related to Google Classroom and students’ answers being marked Incorrect because on Short Text responses, every answer is matched as a “literal” string – that is, upper and lowercase letters MATTER (a lot!)

Link to:
Student’s answers were marked wrongly in a short answer quiz by Google Forms.

https://support.google.com/edu/classroom/thread/39155344

The odd thing is while Google provided a solution for simple e-mail address validation, and various numerical responses, it’s been horrible at dealing with text answers.

The answer is in the 3rd category of Response Validation: Regular Expressions. RegEx’s are commonly used in programming languages and OS shells (like Linux, Unix, HPUX, etc.) since when scripting various commands, we often need to parse parameters and do things with various input like file directory listings, and long lists of things separated by some arbitrary character (like a comma or a vertical bar character.)

Thus here in my example, dealing with a student who was marked with Incorrect answers simply because they didn’t provide the exact case required by the 3 answer versions entered by the instructor (e.g. “Any Dog”, “any dog”, “ANY DOG”) – and the student typed “Any dog” and got it marked Incorrect.

One more typical way to prevent this is specifying in the Quiz preamble the exact format responses you want as an instructor for the short answers. For example, “Please enter all short answers in lowercase letters only, with no leading or trailing space or tab characters.”

But a more practical way is exercising that Regular Expression engine that’s built into Google Forms.

My example question wanting a response from the student like “inner core” (preferably providing a graphic picture of the planet’s layers and just labeling them A/B/C/D/E would have been simpler, but maybe I’m testing vocabulary at this point.)

Selecting the Response Validation type “Regular expression” and using “Matches” the pattern: “^[A-Z]” is interepreted as meaning, “if the Short answer text contains any uppercase letters from A to Z” then display the warning text “Please use all lowercase answers only!” – and do not accept the answer, as submitted.

Regular Expressions can get really complicated, but if you think of them as basically describing what’s in a string of text and matching it as either TRUE or FALSE (and preferably keeping your Answer expectations limited unless you happen to be teaching a course in OS-level scripting, in which case, go ahead and get as complicated as you’d like…) I think you’ll find your student’s will be gently guided into providing the answers in the form you were thinking of when you prepared the Quiz.

And isn’t that what this was all about in the first place?

Here’s a link to a more thorough (and lengthy, and complicated) discussion of the power of Google Forms using Regular Expressions:

Advertisement

R12.1 R12.2 Oracle eBusiness Suite – Moving FNDLOAD files by script

Oracle eBusiness Suite Logo
Oracle eBusiness Suite Logo

Most administrators become familiar with the FNDLOAD utility ($FND_TOP/bin/FNDLOAD) which is used to move various objects between instances that have been defined and set up using the front-end (Menus, FlexField setups, Users, Alerts, Concurrent Programs, et.al.)

Yes, you can manually re-enter all that information using the front-end forms and OAF pages, but you do have a utility to do that for you: FNDLOAD.

Typing FNDLOAD by itself with no parameters gives you a general idea of what kinds of parameters it takes:

You have not provided the required arguments for this program.
Usage: FNDLOAD logon 0 Y mode configfile datafile [ entity [ param ... ] ]

where
logon is username/password[@connect]
mode is either UPLOAD or DOWNLOAD
configfile is the configuration file
datafile is the data file
entity is an entity name, or - to specify all values in an upload
param is a NAME=VALUE string used for parameter substitution

But you can, like most of these utilities, create a script wrapper which makes the process more driven to support repetitive change migrations.

Here’s an example using many of the various parameters in a format that simply downloads the object from the source instance and uploads the resulting *.ldt file into the target instance.  Just comment out things you don’t want (or isn’t supported by your particular EBS version) and add new objects as they become supported by FNDLOAD in the future.

# $1 FRSID From Instance sample: apps/apps@DEV1.world
# $2 TYPE: CONC Concurrent Program
# RGRP Request Group
# FORM Form Function
# FDFF Descriptive FlexField
# VSET FND Value Set
# MENU Menu
# ALRT Oracle Alert
# FLDR Folder
# MESG Oracle Message
# LKUP Lookup Values
# USER FND User
# RPROF Responsibility Profile Level
# PROF Profile with no Level specific
# RSET RequestSet
# RSLK RequestSet Links
# RESP Responsibility
# FPER Form Personalization
# XMLT XML Template
# XLAD XLA Definitions
# WADIINTG Web ADI Integrator
# WADILAYO Web ADI Layout
# WADIMAPC Web ADI Mapping Code
# WADISTYL Web ADI Style
# PJSTAT Project Statuses
# ATTCAT Attachment Categories
# $3 OBJECT Object Short Name, Function Name, Responsibility Key, Etc.
# $4 APPL_SN Application ShortName
# $5 TOSID Destination Instance sample: apps/apps@DEV2.world
#
FRSID=$1
ATYP=$2
AOBJ="$3"
AASN=$4
TOSID=$5

fpwd=`echo $FRSID|awk '{FS="/"} {print $2}'|awk '{FS="@"} {print $1}'`
fsid=`echo $FRSID|awk '{FS="@"} {print toupper($2)}'`

tpwd=`echo $TOSID|awk '{FS="/"} {print $2}'|awk '{FS="@"} {print $1}'`
tsid=`echo $TOSID|awk '{FS="@"} {print toupper($2)}'`


fdbline=`tnsping $fsid|awk '/Attempting/ {print $0}'`
ffullhname=`echo $fdbline|awk '{print $5}'|awk '{FS="="} {print $4}'|awk '{FS=")"} {print $1}'`
fhport=`echo $fdbline|awk '{print $5}'|awk '{FS="="} {print $5}'|awk '{FS=")"} {print $1}'`
fhname=`echo $ffullhname|awk '{print $1}'|awk '{FS="."} {print $1}'`

tdbline=`tnsping $tsid|awk '/Attempting/ {print $0}'`
tfullhname=`echo $tdbline|awk '{print $5}'|awk '{FS="="} {print $4}'|awk '{FS=")"} {print $1}'`
thport=`echo $tdbline|awk '{print $5}'|awk '{FS="="} {print $5}'|awk '{FS=")"} {print $1}'`
thname=`echo $tfullhname|awk '{print $1}'|awk '{FS="."} {print $1}'`


tdbline=`tnsping $tsid|awk '/Attempting/ {print $0}'`
tfullhname=`echo $tdbline|awk '{print $5}'|awk '{FS="="} {print $4}'|awk '{FS=")"} {print $1}'`
thport=`echo $tdbline|awk '{print $5}'|awk '{FS="="} {print $5}'|awk '{FS=")"} {print $1}'`
thname=`echo $tfullhname|awk '{print $1}'|awk '{FS="."} {print $1}'`

sqlsmt=""
sqlsmt=$sqlsmt" select 'XMLT:'||DS_APP_SHORT_NAME||':'||DATA_SOURCE_CODE||': '"
sqlsmt=$sqlsmt" from xdo.xdo_templates_b "
sqlsmt=$sqlsmt" where template_code = '"$AOBJ"' "
sqlsmt=$sqlsmt" and application_short_name = '"$AASN"';"
sqlout=`echo $sqlsmt | sqlplus -s $FRSID`

DSASN=`echo $sqlout|awk '{FS=":"} {print $5}'`
DSCODE=`echo $sqlout|awk '{FS=":"} {print $6}'`

rtime=`date +%m%d%H%M%S`

if (test $ATYP = "CONC") then
FNDLOAD $FRSID 0 Y DOWNLOAD $FND_TOP/patch/115/import/afcpprog.lct "$AOBJ".ldt PROGRAM APPLICATION_SHORT_NAME=$AASN CONCURRENT_PROGRAM_NAME="$AOBJ"
FNDLOAD $TOSID 0 Y UPLOAD $FND_TOP/patch/115/import/afcpprog.lct "$AOBJ".ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE
elif (test $ATYP = "FORM") then
FNDLOAD $FRSID 0 Y DOWNLOAD $FND_TOP/patch/115/import/afsload.lct "$AOBJ".ldt FUNCTION FUNCTION_NAME="$AOBJ"
FNDLOAD $TOSID 0 Y UPLOAD $FND_TOP/patch/115/import/afsload.lct "$AOBJ".ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE
elif (test $ATYP = "ATTCAT") then
FNDLOAD $FRSID 0 Y DOWNLOAD $FND_TOP/patch/115/import/afattach.lct "$AOBJ".ldt FND_DOCUMENT_CATEGORIES CATEGORY_NAME="$AOBJ"
FNDLOAD $TOSID 0 Y UPLOAD $FND_TOP/patch/115/import/afattach.lct "$AOBJ".ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE
elif (test $ATYP = "RGRP") then
FNDLOAD $FRSID 0 Y DOWNLOAD $FND_TOP/patch/115/import/afcpreqg.lct "$AOBJ".ldt REQUEST_GROUP APPLICATION_SHORT_NAME=$AASN REQUEST_GROUP_NAME="$AOBJ"
FNDLOAD $TOSID 0 Y UPLOAD $FND_TOP/patch/115/import/afcpreqg.lct "$AOBJ".ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE
elif (test $ATYP = "FDFF") then
FNDLOAD $FRSID O Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct "$AOBJ".ldt DESC_FLEX APPLICATION_SHORT_NAME=$AASN DESCRIPTIVE_FLEXFIELD_NAME="$AOBJ"
FNDLOAD $TOSID 0 Y UPLOAD $FND_TOP/patch/115/import/afffload.lct "$AOBJ".ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE
elif (test $ATYP = "VSET") then
FNDLOAD $FRSID O Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct "$AOBJ".ldt VALUE_SET FLEX_VALUE_SET_NAME="$AOBJ"
FNDLOAD $TOSID 0 Y UPLOAD $FND_TOP/patch/115/import/afffload.lct "$AOBJ".ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE
elif (test $ATYP = "MENU") then
FNDLOAD $FRSID 0 Y DOWNLOAD $FND_TOP/patch/115/import/afsload.lct "$AOBJ".ldt MENU MENU_NAME="$AOBJ"
FNDLOAD $TOSID 0 Y UPLOAD $FND_TOP/patch/115/import/afsload.lct "$AOBJ".ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=REPLACE
elif (test $ATYP = "ALRT") then
FNDLOAD $FRSID 0 Y DOWNLOAD $ALR_TOP/patch/115/import/alr.lct "$AOBJ".ldt ALR_ALERTS APPLICATION_SHORT_NAME=$AASN ALERT_NAME="$AOBJ"
FNDLOAD $TOSID 0 Y UPLOAD $ALR_TOP/patch/115/import/alr.lct "$AOBJ".ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE
elif (test $ATYP = "FLDR") then
FNDLOAD $FRSID 0 Y DOWNLOAD $FND_TOP/patch/115/import/fndfold.lct "$AOBJ".ldt FND_FOLDERS NAME="$AOBJ"
FNDLOAD $TOSID 0 Y UPLOAD $FND_TOP/patch/115/import/fndfold.lct "$AOBJ".ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE
elif (test $ATYP = "MESG") then
FNDLOAD $FRSID 0 Y DOWNLOAD $FND_TOP/patch/115/import/afmdmsg.lct "$AOBJ".ldt FND_NEW_MESSAGES APPLICATION_SHORT_NAME=$AASN MESSAGE_NAME="$AOBJ"
FNDLOAD $TOSID 0 Y UPLOAD $FND_TOP/patch/115/import/afmdmsg.lct "$AOBJ".ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE
elif (test $ATYP = "LKUP") then
FNDLOAD $FRSID 0 Y DOWNLOAD $FND_TOP/patch/115/import/aflvmlu.lct "$AOBJ".ldt FND_LOOKUP_TYPE APPLICATION_SHORT_NAME=$AASN LOOKUP_TYPE="$AOBJ"
FNDLOAD $TOSID 0 Y UPLOAD $FND_TOP/patch/115/import/aflvmlu.lct "$AOBJ".ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE
elif (test $ATYP = "USER") then
FNDLOAD $FRSID 0 Y DOWNLOAD $FND_TOP/patch/115/import/afscursp.lct "$AOBJ".ldt FND_USER USER_NAME="$AOBJ"
FNDLOAD $TOSID 0 Y UPLOAD $FND_TOP/patch/115/import/afscursp.lct "$AOBJ".ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE
elif (test $ATYP = "PROF") then
FNDLOAD $FRSID 0 Y DOWNLOAD $FND_TOP/patch/115/import/afscprof.lct "$AOBJ".ldt PROFILE APPLICATION_SHORT_NAME=$AASN PROFILE_NAME="$AOBJ"
FNDLOAD $TOSID 0 Y UPLOAD $FND_TOP/patch/115/import/afscprof.lct "$AOBJ".ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE
elif (test $ATYP = "RPROF") then
FNDLOAD $FRSID 0 Y DOWNLOAD afscprofr.lct "$AOBJ".ldt PROFILE APPLICATION_SHORT_NAME=$AASN PROFILE_NAME="$AOBJ" FND_PROFILE_OPTION_VALUES LEV="10003"
FNDLOAD $TOSID 0 Y UPLOAD $FND_TOP/patch/115/import/afscprof.lct "$AOBJ".ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE
elif (test $ATYP = "RSET") then
FNDLOAD $FRSID 0 Y DOWNLOAD $FND_TOP/patch/115/import/afcprset.lct "$AOBJ".ldt REQ_SET REQUEST_SET_NAME="$AOBJ"
FNDLOAD $TOSID 0 Y UPLOAD $FND_TOP/patch/115/import/afcprset.lct "$AOBJ".ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE
FNDLOAD $FRSID 0 Y DOWNLOAD $FND_TOP/patch/115/import/afcprset.lct "$AOBJ"_LINK.ldt REQ_SET_LINKS REQUEST_SET_NAME="$AOBJ"
FNDLOAD $TOSID 0 Y UPLOAD $FND_TOP/patch/115/import/afcprset.lct "$AOBJ"_LINK.ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE
elif (test $ATYP = "RELK") then
FNDLOAD $FRSID 0 Y DOWNLOAD $FND_TOP/patch/115/import/afcprset.lct "$AOBJ".ldt REQ_SET_LINKS REQUEST_SET_NAME="$AOBJ"
FNDLOAD $TOSID 0 Y UPLOAD $FND_TOP/patch/115/import/afcprset.lct "$AOBJ".ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE
elif (test $ATYP = "RESP") then
FNDLOAD $FRSID 0 Y DOWNLOAD $FND_TOP/patch/115/import/afscursp.lct "$AOBJ".ldt FND_RESPONSIBILITY RESP_KEY="$AOBJ"
FNDLOAD $TOSID 0 Y UPLOAD $FND_TOP/patch/115/import/afscursp.lct "$AOBJ".ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE
elif (test $ATYP = "FPER") then
FNDLOAD $FRSID 0 Y DOWNLOAD $FND_TOP/patch/115/import/affrmcus.lct "$AOBJ".ldt FND_FORM_CUSTOM_RULES function_name="$AOBJ"
FNDLOAD $TOSID 0 Y UPLOAD $FND_TOP/patch/115/import/affrmcus.lct "$AOBJ".ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE
elif (test $ATYP = "XMLT") then
FNDLOAD $FRSID 0 Y DOWNLOAD $XDO_TOP/patch/115/import/xdotmpl.lct "$AOBJ".ldt XDO_DS_DEFINITIONS APPLICATION_SHORT_NAME=$AASN DATA_SOURCE_CODE="$DSCODE" TMPL_APP_SHORT_NAME=$DSASN TEMPLATE_CODE="$AOBJ"
FNDLOAD $TOSID 0 Y UPLOAD $XDO_TOP/patch/115/import/xdotmpl.lct "$AOBJ".ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE

sqlsmt=""
sqlsmt=$sqlsmt"select distinct 'XMLTYPE:'||xdo_file_type||':'||file_content_type||':'||"'\n'
sqlsmt=$sqlsmt" decode(file_content_type,'application/rtf','rtf', "'\n'
sqlsmt=$sqlsmt" 'text/xml', 'xml', "'\n'
sqlsmt=$sqlsmt" lower(xdo_file_type))||':'||territory||':'||replace(file_name,' ','_')||':' xtype"'\n'
sqlsmt=$sqlsmt" from xdo.xdo_lobs "'\n'
sqlsmt=$sqlsmt" where application_short_name = '"$AASN"' "'\n'
sqlsmt=$sqlsmt" and lob_type = 'TEMPLATE_SOURCE' "'\n'
sqlsmt=$sqlsmt" and lob_code = '"$AOBJ"'; "'\n'
sqlsmt=$sqlsmt"exit "'\n'
echo $sqlsmt > $rtime.sql
sqlplus -s $FRSID @$rtime.sql > $rtime.out

for i in `awk '/XMLTYPE/ {print $0}' $rtime.out`
do
ftype=`echo $i|awk '{FS=":"} {print $2}'`
ctype=`echo $i|awk '{FS=":"} {print $3}'`
fext=`echo $i|awk '{FS=":"} {print $4}'`
terr=`echo $i|awk '{FS=":"} {print $5}'`
filename=`echo $i|awk '{FS=":"} {print $6}'|awk '{FS="."} {print $1}'`
sname=`echo $i|awk '{FS=":"} {print $6}'`
if (test $terr = "00") then
fname="TEMPLATE_SOURCE_"$AASN"_"$AOBJ"_en".$fext
else
fname="TEMPLATE_SOURCE_"$AASN"_"$AOBJ"_en_"$terr.$fext
fi
java oracle.apps.xdo.oa.util.XDOLoader DOWNLOAD -DB_USERNAME apps -DB_PASSWORD $fpwd -JDBC_CONNECTION "$fhname:$fhport:$fsid" -APPS_SHORT_NAME $AASN -LOB_TYPE TEMPLATE_SOURCE -LOB_CODE "$AOBJ" -XDO_FILE_TYPE $ftype -FILE_NAME $sname -LANGUAGE en -TERRITORY $terr -LCT_FILE $XDO_TOP/patch/115/import/xdotmpl.lct -LOG_FILE "$filename".log
mv "$fname" "$sname"
java oracle.apps.xdo.oa.util.XDOLoader UPLOAD -DB_USERNAME apps -DB_PASSWORD $tpwd -JDBC_CONNECTION "$thname:$thport:$tsid" -APPS_SHORT_NAME $AASN -LOB_TYPE TEMPLATE_SOURCE -LOB_CODE "$AOBJ" -XDO_FILE_TYPE $ftype -FILE_CONTENT_TYPE "$ctype" -FILE_NAME "$sname" -LANGUAGE en -TERRITORY $terr -LCT_FILE $XDO_TOP/patch/115/import/xdotmpl.lct -LDT_FILE "$AOBJ".ldt -DRVX_FILE "$AOBJ".drvx -LOG_FILE "$filename".log -CUSTOM_MODE FORCE
done
elif (test $ATYP = "XMLD") then
sqlsmt=""
sqlsmt=$sqlsmt"select distinct 'XMLTYPE:'||xdo_file_type||':'||file_content_type||':'||"'\n'
sqlsmt=$sqlsmt" decode(file_content_type,'application/rtf','rtf', "'\n'
sqlsmt=$sqlsmt" 'text/xml', 'xml', "'\n'
sqlsmt=$sqlsmt" lower(xdo_file_type))||':'||territory||':'||replace(file_name,' ','_')||':' xtype"'\n'
sqlsmt=$sqlsmt" from xdo.xdo_lobs "'\n'
sqlsmt=$sqlsmt" where application_short_name = '"$AASN"' "'\n'
sqlsmt=$sqlsmt" and lob_type = 'DATA_TEMPLATE' "'\n'
sqlsmt=$sqlsmt" and lob_code = '"$AOBJ"'; "'\n'
sqlsmt=$sqlsmt"exit "'\n'
echo $sqlsmt > $rtime.sql
sqlplus -s $FRSID @$rtime.sql > $rtime.out

for i in `awk '/XMLTYPE/ {print $0}' $rtime.out`
do
ftype=`echo $i|awk '{FS=":"} {print $2}'`
ctype=`echo $i|awk '{FS=":"} {print $3}'`
fext=`echo $i|awk '{FS=":"} {print $4}'`
terr=`echo $i|awk '{FS=":"} {print $5}'`
filename=`echo $i|awk '{FS=":"} {print $6}'|awk '{FS="."} {print $1}'`
sname=`echo $i|awk '{FS=":"} {print $6}'`
fname="DATA_TEMPLATE_"$AASN"_$AOBJ"
java oracle.apps.xdo.oa.util.XDOLoader DOWNLOAD -DB_USERNAME apps -DB_PASSWORD $fpwd -JDBC_CONNECTION "$fhname:$fhport:$fsid" -APPS_SHORT_NAME $AASN -LOB_TYPE DATA_TEMPLATE -LOB_CODE "$AOBJ" -XDO_FILE_TYPE $ftype -FILE_NAME $sname -LANGUAGE en -TERRITORY $terr -LCT_FILE $XDO_TOP/patch/115/import/xdotmpl.lct -LDT_FILE "$AOBJ".ldt -DRVX_FILE "$AOBJ".drvx -LOG_FILE "$filename".log
mv "$fname".xml "$sname"
java oracle.apps.xdo.oa.util.XDOLoader UPLOAD -DB_USERNAME apps -DB_PASSWORD $tpwd -JDBC_CONNECTION "$thname:$thport:$tsid" -LOB_TYPE DATA_TEMPLATE -LOB_CODE "$AOBJ" -XDO_FILE_TYPE $ftype -FILE_NAME "$sname" -APPS_SHORT_NAME $AASN -LANGUAGE en -TERRITORY US -LCT_FILE $XDO_TOP/patch/115/import/xdotmpl.lct -LDT_FILE "$AOBJ".ldt -DRVX_FILE "$AOBJ".drvx -LOG_FILE "$filename".log -CUSTOM_MODE FORCE
done
# WADIINTG Web ADI Integrator
# WADILAYO Web ADI Layout
# WADIMAPC Web ADI Mapping Code
# WADISTYL Web ADI Style
elif (test $ATYP = "WADIINTG") then
# FNDLOAD $FRSID 0 Y DOWNLOAD $BNE_TOP/patch/115/import/bneint.lct "$AOBJ".ldt BNE_INTEGRATORS INTEGRATOR_ASN=$AASN INTEGRATOR_CODE="$AOBJ"
# FNDLOAD $TOSID 0 Y UPLOAD $BNE_TOP/patch/115/import/bneint.lct "$AOBJ".ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE
FNDLOAD $FRSID 0 Y DOWNLOAD $BNE_TOP/patch/115/import/bneintegrator.lct "$AOBJ".ldt BNE_INTEGRATORS INTEGRATOR_ASN=$AASN INTEGRATOR_CODE="$AOBJ"
FNDLOAD $TOSID 0 Y UPLOAD $BNE_TOP/patch/115/import/bneintegrator.lct "$AOBJ".ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE
elif (test $ATYP = "WADILAYO") then
FNDLOAD $FRSID 0 Y DOWNLOAD $BNE_TOP/patch/115/import/bnelay.lct "$AOBJ".ldt BNE_LAYOUTS LAYOUT_ASN=$AASN LAYOUT_CODE="$AOBJ"
FNDLOAD $TOSID 0 Y UPLOAD $BNE_TOP/patch/115/import/bnelay.lct "$AOBJ".ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE
elif (test $ATYP = "WADIMAPC") then
FNDLOAD $FRSID 0 Y DOWNLOAD $BNE_TOP/patch/115/import/bnemap.lct "$AOBJ".ldt BNE_MAPPINGS MAPPING_ASN=$AASN MAPPING_CODE="$AOBJ"
FNDLOAD $TOSID 0 Y UPLOAD $BNE_TOP/patch/115/import/bnemap.lct "$AOBJ".ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE
elif (test $ATYP = "WADISTYL") then
FNDLOAD $FRSID 0 Y DOWNLOAD $BNE_TOP/patch/115/import/bness.lct "$AOBJ".ldt BNE_STYLESHEETS CONTENT_ASN=$AASN STYLESHEET_CODE="$AOBJ" STYLESHEET_ASN=$AASN
FNDLOAD $TOSID 0 Y UPLOAD $BNE_TOP/patch/115/import/bness.lct "$AOBJ".ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE
elif (test $ATYP = "XLAD") then
sqlsmt=""
sqlsmt=$sqlsmt"select distinct 'APPLID:'||application_id"'\n'
sqlsmt=$sqlsmt" from applsys.fnd_application "'\n'
sqlsmt=$sqlsmt" where application_short_name = '"$AASN"'; "'\n'
sqlsmt=$sqlsmt"exit "'\n'
echo $sqlsmt > $rtime.sql
sqlplus -s $FRSID @$rtime.sql > $rtime.out
for i in `awk '/APPLID/ {print $0}' $rtime.out`
do
APPLID=`echo $i|awk '{FS=":"} {print $2}'`
done

FNDLOAD $FRSID 0 Y DOWNLOAD $MWD_TOP/admin/ldt/xlaaadrule.lct "$AOBJ".ldt XLA_AAD APPLICATION_ID=$APPLID AMB_CONTEXT_CODE=DEFAULT FEDERAL=N
FNDLOAD $TOSID 0 Y UPLOAD $MWD_TOP/admin/ldt/xlaaadrule.lct "$AOBJ".ldt XLA_AAD APPLICATION_ID=$APPLID AMB_CONTEXT_CODE=DEFAULT UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE
elif (test $ATYP = "PJSTAT") then
FNDLOAD $FRSID 0 Y DOWNLOAD $PA_TOP/patch/115/import/paprjsta.lct "$AOBJ".ldt PA_PROJECT_STATUSES
FNDLOAD $TOSID 0 Y UPLOAD $PA_TOP/patch/115/import/paprjsta.lct "$AOBJ".ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE
FNDLOAD $FRSID 0 Y DOWNLOAD $PA_TOP/patch/115/import/paprjsta.lct "$AOBJ"_CONTROLS.ldt PA_PROJECT_STATUS_CONTROLS
FNDLOAD $TOSID 0 Y UPLOAD $PA_TOP/patch/115/import/paprjsta.lct "$AOBJ"_CONTROLS.ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE
FNDLOAD $FRSID 0 Y DOWNLOAD $PA_TOP/patch/115/import/pacinest.lct "$AOBJ"_ALLOW.ldt PA_NEXT_ALLOW_STATUSES
FNDLOAD $TOSID 0 Y UPLOAD $PA_TOP/patch/115/import/pacinest.lct "$AOBJ"_ALLOW.ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE
fi
rm $rtime.sql
rm $rtime.out
#chmod 777 *.log
#chmod 777 *.rtf
#chmod 777 *.ldt
#chmod 777 *.xml

Top 7 Reasons Organizations Should Not Automatically Switch to Hosted Enterprise Technology

Cloud with No Symbol
Not Cloud?

A college education can make you think differently.  As I read the original article, the many times my Statistics professors pointed out that anyone can basically lie with numbers to make them support whichever position they want. This was equally true in a class I took on Mass Persuasion and Propaganda.

Thus I present this same article, with an inversion of the concluded statistical results of the IDG survey, with minor modifications to the explanations given to suit the results of the measures.  Respect given to the original author, Tori Ballantine, who is a product marketing lead at Hyland Cloud.  No offense is intended by this grammatical exercise in statistical results inversion.

Original Article:

Top 7 Reasons Manufacturers Should Host Enterprise Technology
https://www.mbtmag.com/article/2018/07/top-7-reasons-manufacturers-should-host-enterprise-technology

Top 7 Reasons Organizations Should Not Automatically Switch to Hosted or Cloud Enterprise Technology

As one of the leading industries that was an early adopter of process automation, manufacturing is often ahead of the curve when it comes to seeking ways to improve processes — yet still has work to do in the technology adoption realm. While the trend for cloud adoption is increasing over on-premises solutions overall, some organizations, including manufacturers, are hesitant to make the transition to the cloud.

There are countless compelling reasons to transition to hosted enterprise applications. According to a recent survey from IDG, IT leaders at companies with 250+ employees, from a wide range of industries and company sizes, agreed on seven areas where cloud computing should benefit their organizations. These included:

Disaster Recovery

Disasters, both natural and man-made, are inherently unpredictable. When the worst-case scenario happens, organizations need improved disaster recovery capabilities in place — including the economic resources to replicate content in multiple locations. According to the IDG survey, about 33 percent, of IT leaders did not find disaster recovery as the number one reason they would move, or have moved to hosted enterprise solutions. By switching to a hosted solution, about 1/3 of organizations could not get their crucial application running as soon as possible after an emergent situation, and are therefore unable to serve their customers.

Data Availability

IT leaders know that data and content are essential components of their daily business operations. In fact, according to the IDG research, 45 percent of survey participant listed data availability as the second leading limitation cited about cloud enterprise applications being unable to provide. Access to mission-critical information, when they need it, wherever they are, is essential for organizations to stay competitive and provide uninterrupted service. With no noticeable increase to uptime compared to on-premises applications, hosted solutions did not provide 24/7/365 data availability.

Cost Savings

It shouldn’t come as a surprise that the third most popular reason IT leaders seek cloud solutions is because of cost savings. Hosting in the cloud eliminates the need for upfront investment in hardware and the expense of maintaining and updated hosting infrastructure by shifting the cost basis to long-term operational costs. While hosting software solutions on-premises carries more than just risk; it carries a fair amount of operational costs. By hosting enterprise solutions in the cloud, organizations will reduce capital costs with a possible reduction in operating costs — including staffing, overtime, maintenance and physical security when centralized under a hosting provider.

Incident Response

The IDG survey found that 55 percent of IT professionals listed incident response as another area where cloud solutions provided no significant benefit over on-premises options. Large-scale systems can develop more efficient incident response capabilities, and improve incident response times compared to smaller, non-consolidated systems. As seconds tick by, compliance fines can increase along with end-user dissatisfaction. So having a quick incident response time is essential to reduce risk and ensure end-user satisfaction.

Security Expertise

The best providers that offer hosted solutions constantly evaluate and evolve their practices to protect customers’ data. This is crucial because up to 59 percent of IDG survey responders noted that security expertise as another leading reason they do not select cloud applications. Organizations with cloud-hosted applications could take advantage of the aggregated security expertise from their vendors to improve their own operations and make sure information is safe, but only by complying with externally-driven security standards that were either not enforceable due to application restrictions (legacy versioning, design constraints, third-party non-compliant architecture, et.al.) To ensure your content stays safe, it’s important to seek cloud providers with the right credentials — look for certifications such as SOC 1 and 2 or 3 audited, ISO 27001 and CSA STAR Registrant.

Geographical Disbursement

The IDG survey found that over 63 percent of IT professionals were not seeking geographical disbursement in where their data is stored. In the event of data unavailability in a local data center, having a copy of the data in a separate geographical area ensures performance and availability of the data sources, though resources to use the data may not be readily available as they are co-located in the local region of the primary data.

Expert Access

IT professionals seek hosted solutions because the best hosted software applications employ top-notch security professionals. Gaining access to these professionals’ insight helps ensure concerns are addressed and the software delivers on the organization’s needs.

In order to facilitate the best possible experience for your customers, it’s important to keep up with technology trends that give you the data and insights you need to provide quality service. For many firms, it means not only focusing on process automation on the manufacturing floor, but also within the internal processes driven by data. There’s a huge shift happening with how organizations choose to deploy software. In fact, according to a recent AIIM study, almost 25% of respondents from all industries are not seeking to deploy cloud software in any fashion. 60 percent of those surveyed plan to focus on a non-hybrid approach, focusing primarily on leveraging on-premises deployments, while 38 percent said they will deploy cloud solutions.

As noted in the seven areas above, the reasons for the lack of shift to selecting hosted enterprise applications are diverse and compelling. The cloud provides users with greater access to their information, when and where they need to access it — and doesn’t confine users to a on-premise data source. When combined with the other benefits of improved business continuity, cost savings, incident response, security expertise and expert access, organizations should carefully consider that their important information and content is more available and secure in the cloud.

 

R12.2 eBusiness Suite EBS – During ADOP phase = prepare data dictionary corruption missing parent

Adop-PrepareDuring an online patching session with ADOP, when the prepare phase checks the data dictionary integrity, you receive the following error:

R12.2 eBusiness Suite EBS – During ADOP phase = prepare data dictionary corruption missing parent:
Verifying data dictionary.
[UNEXPECTED]Data dictionary corrupted:
[UNEXPECTED]Data dictionary corruption – missing parent
1416131 ORA$BASE APPS BPA_GUIDED_PICKING SYNONYM
1416121 ORA$BASE APPS CO_CLIPPERSHIP_INTERFACE SYNONYM
1416132 ORA$BASE APPS BPA_PRINT_GUIDED_PICK_LABELS SYNONYM
1416128 ORA$BASE APPS GEM_ESIG_INQUIRY_CORE SYNONYM
[UNEXPECTED]Data dictionary corruption detected. Provide details to
[UNEXPECTED]Oracle Support and ask for a bug to be opened against the
[UNEXPECTED]Online Patching component of Oracle Application Install.

[STATEMENT] Please run adopscanlog utility, using the command

“adopscanlog -latest=yes”

Issue:

The corruption is detected with the $AD_TOP/sql/ADZDDBCC.sql scriptis executed just prior to setting up the ADOP session.  This is also a mandatory check performed during pre-upgrade readiness checking for R12.2 upgrades.

Solution:

There is a rudimentary, but effective script supplied in $AD_TOP/patch/115/sql named adzddmpfix.sql (and a number of other adzd___ named scripts that address other data dictionary issues, such as the common TimeZone timestamp issues (Doc ID 2017686.1))

This script is run as SYS and requires all middle-tier services to be shutdown because it’s rebuilding all of the APPS synonyms for objects and recompiling afterwards.

sqlplus “/ as sysdba” @$AD_TOP/patch/115/sql/adzddmpfix.sql

REM $Header: adzddmpfix.sql 120.0.12020000.3 2015/09/14 10:10:32 sstomar noship$
REM dbdrv: none
REM +======================================================================+
REM | Copyright (c) 2005, 2015 Oracle and/or its affiliates. |
REM | All rights reserved. |
REM | Version 12.0.0 |
REM +======================================================================+
REM | FILENAME
REM | adzddmpfix.sql
REM |
REM | DESCRIPTION
REM | Warning: this script is an experimental workaround to the Oracle
REM | Database data Dictionary “missing parent” corruption described in
REM | Bug 20627866. This bug currently has no other known fix, but this
REM | script will repair the problem sufficiently to allow adop to continue
REM | executing.
REM |
REM | Warning: You must be connected as SYSDBA with application services
REM | shutdown to run this script
REM | Usage:
REM | sqlplus / as sysdba
REM | @adzddmpfix.sql
REM |
REM |
REM +=======================================================================+

Sample output:

SQL> @adzddmpfix.sql
“—- Fixing Data Dictionary Corruptions (missing parent) —-”

4 rows deleted.

Commit complete.

System altered.

“—- Compiling invalids —-”

Don’t forget to re-run the $AD_TOP/sql/ADZDDBCC.sql script to identify whether the data dictionary corruption is still present afterwards.

 

R12.2 Running AutoConfig Manually

The follwing script is located in $AD_TOP/bin:

adconfig.sh

This file which is normally executed under the adautocfg.sh wrapper script in $ADMIN_SCRIPTS_HOME, can also be executed manually to bypass certain limitations found when configuring the PATCH filesystem, in particular.

The format of the command is:

adconfig.sh run=INSTE8 contextfile=$CONTEXT_FILE

Sample output:

Enter the APPS user password: Script execution phase specified: INSTE8

The log file for this session is located at: /u01/oracle/fs1/inst/apps/$ENV_ID/admin/log/02120957/adconfig.log

AutoConfig is configuring the Applications environment...

AutoConfig will consider the custom templates if present.
 Using CONFIG_HOME location : /u01/oracle/fs1/inst/apps/$ENV_ID
 Classpath : /u01/oracle/fs1/FMW_Home/Oracle_EBS-app1/shared-libs/ebs-appsborg/WEB-INF/lib/ebsAppsborgManifest.jar:/u01/oracle/fs1/EBSapps/comn/java/classes

Using Context file : /u01/oracle/fs1/inst/apps/$ENV_ID/appl/admin/$ENV_ID.xml

Context Value Management will now update the Context file

Updating Context file...COMPLETED

Execution phase specified at run time: INSTE8
 No uploading of Context File and its templates to database.

Configuring templates from all of the product tops...
 Configuring AD_TOP........COMPLETED
 Configuring FND_TOP.......COMPLETED
 Configuring ICX_TOP.......COMPLETED
 Configuring MSC_TOP.......COMPLETED
 Configuring IEO_TOP.......COMPLETED
 Configuring BIS_TOP.......COMPLETED
 Configuring CZ_TOP........COMPLETED
 Configuring SHT_TOP.......COMPLETED
 Configuring AMS_TOP.......COMPLETED
 Configuring CCT_TOP.......COMPLETED
 Configuring WSH_TOP.......COMPLETED
 Configuring CLN_TOP.......COMPLETED
 Configuring OKE_TOP.......COMPLETED
 Configuring OKL_TOP.......COMPLETED
 Configuring OKS_TOP.......COMPLETED
 Configuring CSF_TOP.......COMPLETED
 Configuring IBY_TOP.......COMPLETED
 Configuring JTF_TOP.......COMPLETED
 Configuring MWA_TOP.......COMPLETED
 Configuring CN_TOP........COMPLETED
 Configuring CSI_TOP.......COMPLETED
 Configuring WIP_TOP.......COMPLETED
 Configuring CSE_TOP.......COMPLETED
 Configuring EAM_TOP.......COMPLETED
 Configuring GMF_TOP.......COMPLETED
 Configuring PON_TOP.......COMPLETED
 Configuring FTE_TOP.......COMPLETED
 Configuring ONT_TOP.......COMPLETED
 Configuring AR_TOP........COMPLETED
 Configuring AHL_TOP.......COMPLETED
 Configuring IES_TOP.......COMPLETED
 Configuring OZF_TOP.......COMPLETED
 Configuring CSD_TOP.......COMPLETED
 Configuring IGC_TOP.......COMPLETED

AutoConfig completed successfully.

Getting Started with OEM 13cR2 (13.2.2.0.0) Enterprise Manager

oem13c_mainpage_ss
OEM13c Release 2 Enterprise Manager Summary Page

Relatively easy installation, a new learning curve to master for post-installation maintenance and patching.
The principal changes in Release 2 of 13c are the segregation of the Cloud Management Services plugins (and related functionality) to specific licensable plugin components – namely:

  • Cloud Services Management – used for provisioning, allocation, and administration (think “infrastructure”) of Oracle Public Cloud-based resources (databases, development tools, middleware, etc.)
  • Oracle Cloud Application – a portal punch-out to access Oracle Cloud-based applications such as hosted e-Business Suite, Cloud Content Management, Cloud SOA Suite, Cloud Identity Management, etc. (think “apps”.)
  • Cloud Framework – a repackaging of the EM OMS framework components, and the only portion of the “cloud” components included in the base OEM licensing.
    Installation guide: http://www.oracle.com/technetwork/oem/grid-control/documentation/oem-091904.html

Oracle Cloud Framework
Cloud Management related plugins for OEM13cR2

This proof-of-concept testbed system was based upon the latest available installer set – Oracle Enterprise Manager Cloud Control 13c Release 2 Plug-in Update 1 (13.2.0.0) – we happen to be testing backwards-compatibility with some 10g databases before committing to the upgrade.  Direct (out-of-place) upgrades are supported for version of EM 12.1.0.4 and newer.

Download page for OEM 13c R2
http://www.oracle.com/technetwork/oem/enterprise-manager/downloads

Fusion Middleware in this release is Weblogic 12.1.3
The host system is built upon Windows Server 2012 R2, single-tier, 16GB RAM, 2 cores, also hosting the OMS repository database in a 12.2.0.1.0 EE installation.  Since the DB Templates provided seemed to be specific for a 12.1.x database (and errors out in certain steps during the build), I simply created a generic database from the standard template with the pre-requisite parameter settings (e.g. _allow_insert_with_update_check=TRUE; sessions > 300; shared_pool_size (10% of SGA); etc.) , and pre-created the required tablespaces:

MGMT_AD4J_TS
MGMT_ECM_DEPOT_TS
MGMT_TABLESPACE

  During the installation, the (Oracle Universal Installer) OUI will create the following new users assigned to these tablespaces:

Open:
SYSMAN
SYSMAN_TYPES
SYSMAN_BIPLATFORM
SYSMAN_STB
SYSMAN_OPSS
SYSMAN_MDS
MGMT_VIEW

Expired & Locked:
CLOUD_ENGINE_USER
CLOUD_SWLIB_USER
EUS_ENGINE_USER
SYSMAN_RO

The standard download set includes a single executable file (.exe or .bin) and several additional ZIP archives.  These are to be staged in a single directory, and the ZIP files do NOT need to be pre-extracted.

Overall, the installation was straight-forward and as-documented (despite this being a Windows installation – which usually has its own quirks.) The portion that I feel has the steepest learning curve is post-installation maintenance, and particularly patching. The new tool in 13c, the OMSpatcher (Patchset 19999993 – think of it as a Java wrapper for opatch) was really designed for use specficially in a cloud-based environment and hasn’t been completely polished for use on-premise in smaller installations.

For example, it is designed to rely upon an active Weblogic AdminServer to instantiate it’s requests for inventory versioning information and component availability for patching. But if any of those components are actually in-use by the AdminServer itself, it will tend to fail to apply, and instead provide a lengthy step-by-step instruction set of how to accomplish all of the steps manually. Depending on the complexity of your OEM setup (e.g. the number of registered plugins and target types) this could take over an hour to get the patching utility to fail and then provide the manual steps.

The OEM-specific version of OPatch (Patchset 6880880) is quite different than its predecessors.  While the OMSPatcher uses the prior “unzip into the existing Oracle Home” installation technique, the OPatch utility itself now is a Java installer that relies on the OUI to allow updating of component versioning and inventory adjustments. Most importantly, you will need to “install” the new version of OPatch before being allowed to continue with your planned patching:

$JAVA_PATH\java -jar $PATCH_STAGE\6880880\opatch_generic.jar -silent oracle_home=$ORACLE_HOME (being updated for OPatch)

This OPatch update needs to be applied (before patching) to every Oracle Home using 13c technology (the OMS home, the Agent Home, other FMW homes at version 12.1.3 or newer, etc.)

See MOS EM 13c: How to Apply a Patch to the Enterprise Manager 13c Cloud Control OMS Oracle Home (Doc ID 2091619.1) for details about making an OMSPatcher property file, and why you want to create one.

Final steps executed:
Build general purpose 12.2.0.1.0 database with new tablespaces.
Install Oracle Enterprise Manager Cloud Control 13c Release 2 Plug-in Update 1 (13.2.0.0)
Patch 19999993: EM OMSPatcher latest version 13.8.0.0.2 (unzip to ORACLE_HOME)
Patch 6880880: EM OPatch latest version 13.9.0.0.0 (both OMS and Agent)

cd $PATCH_STAGE\<patch#>
$FMW_HOME\OMSPatcher\omspatcher apply -analyze -property_file 
$FMW_HOME\OMSPatcher\omspatcher apply -property_file  [OMS_DISABLE_HOST_CHECK=true  -- a useful option added to deal with virtual host names]

Patch 25163555: Tracking bug for Back-porting 24588124 oms side fix
Patch 25604219: MERGE REQUEST ON TOP OF 13.2.0.0.0 FOR BUGS 25497622 25497731 25506784
Patch 25387277: APR-2017 PSU OMS 13.2.0.0.170418
Patch 25162444: EM-BEACON Bundle Patch 13.2.0.0.161231 (Agent)
Patch 25580746: EM-AGENT Bundle Patch 13.2.0.0.170331 (Agent)

Other useful references:

Enterprise Manager 13.2 Master Bundle Patch List (Doc ID 2219797.1)
13.2.0.0.170418 Enterprise Manager Base Platform Patch Set Update (PSU) Readme for Oracle Management Server (OMS) (Doc ID 2246778.1)

How To Get Those Customizations to Work Correctly with Oracle EBS R12.2 Editioning (EBR)

Oracle e-Business Suite R12.2 Overview of Edition-Based Redefinition (EBR) in 11gR2 databases.
Oracle e-Business Suite R12.2 Overview of Edition-Based Redefinition (EBR) in 11gR2 databases.

Scenario:
Creating a new view based upon the AP.AP_SUPPLIERS table to reside in a new XXCUSTOMSCHEMA.

If you attempt the simple:

create or replace force view XXCUSTOMSCHEMA.AP_SUPPLIER_NEW_V
as
SELECT *
FROM ap.ap_suppliers ;

It works, but your data and table definition may change whenever patching editions are in-play.

If you attempt to just reference the editioned object instead:

create or replace force view XXCUSTOMSCHEMA.AP_SUPPLIER_NEW_V
as
SELECT *
FROM ap.ap_suppliers# /* or the preferred apps.ap_suppliers synonym */

You will receive the ominous ORA-38818: illegal reference to editioned object error message.

What’s missing? The XXCUSTOMSCHEMA isn’t recognized as an edition-friendly schema by Oracle’s e-Business Suite (nor the database), yet.

Create your XXCUSTOMSCHEMA in the usual way:

create user XXCUSTOMSCHEMA
identified by (password)
default tablespace USERS
temporary tablepace TEMP
profile DEFAULT
account UNLOCK;

/* as APPS user */

exec FND_ORACLE_USER_PKG.LOAD_ROW(‘XXCUSTOMSCHEMA’, ‘CUSTOM’, ‘INVALID’, NULL, ‘N’, ‘B’);

/* as SYSTEM user */

alter session set current_schema=APPS;
exec AD_ZD_PREP.ENABLE_CUSTOM_USER(‘XXCUSTOMSCHEMA’);

/* Create your SELECT grants to the editioned objects as APPS user */

grant select on ap.ap_suppliers#  to XXCUSTOMSCHEMA;

/* OR if you’re running newer than 12.2.5…the editioning security will cause hundreds of invalid editioned object stubs that need re-compilation unless you instead use */

exec AD_ZD.grant_privs(‘SELECT’, ‘AP_SUPPLIERS’, ‘XXCUSTOMSCHEMA’,X_GRANT_TO_TABLE=>TRUE)

PL/SQL procedure successfully completed.

SQL> exec AD_ZD.revoke_privs(‘SELECT’,’AP_SUPPLIERS’,’XXCUSTOMSCHEMA’);

/* Create your custom view referencing the APPS synonym – which points to the editioned object */

create or replace force view XXCUSTOMSCHEMA.AP_SUPPLIER_NEW_V
as
SELECT *
FROM apps.ap_suppliers ;

This is the same process when creating procedures and functions with the usual caveat that unless it’s a 12c database, you cannot create materialized views on the editioned objects.

For the 11gR2 EBS users, you would stick with the existing non-editioned table object reference:

CREATE MATERIALIZED VIEW APPS.XXAP_SUPPLIER_NEW_MV
(
vendor_id,
vendor_name
)
AS
SELECT aps.vendor_id, aps.vendor_name
FROM ap.ap_suppliers aps;

/* The owning schema for the materialized view must have CREATE TABLE, VIEW AND INDEX privileges on the destination tablespace */

New OEM 12c/13c Agent Install Won’t Keep Running – Dies After Awhile

Many agents - Copyright by Warner Bros.,The Wachowski Brothers used without permission as educational content.
Agents are often hard to kill, usually. Images Copyright by Warner Bros., The Wachowski Brothers; used without permission as educational content.

OEM agents tend to occupy memory based upon how many targets they have to keep track of in a particular host.  At another organization, we tended to spin up VM’s for each instance environment, so at maximum, a particular agent might have a few hundred targets (especially on an e-Business Suite Applications Tier.)  In those circumstances, the default Java memory settings are probably fine.

In this environment, we run our hosts to death, and on this particular proof-of-concept host, we have 43 instances running on it, with variants of 10g, 11g, and 12c databases combined.

We are doing a fresh install of OEM 12.1.0.5.0 for our POC before setting up the 13c production OMS, and after deploying the agent to this particular database host, the agent would startup fine, run for about 20 or so minutes and then abruptly die without warning.

Re-starts fine, passes the usual tests fine (before the 20 minutes or so goes by) and then dies again.

AGENT_INST=/u01/app/oracle/agent12c/agent_inst

cd $AGENT_INST/bin

./emctl status agent

Oracle Enterprise Manager Cloud Control 12c Release 5
Copyright (c) 1996, 2015 Oracle Corporation.  All rights reserved.
—————————————————————
Agent Version          : 12.1.0.5.0
OMS Version            : 12.1.0.5.0
Protocol Version       : 12.1.0.1.0
Agent Home             : /u01/app/oracle/agent12c/agent_inst
Agent Log Directory    : /u01/app/oracle/agent12c/agent_inst/sysman/log
Agent Binaries         : /u01/app/oracle/agent12c/core/12.1.0.5.0
Agent Process ID       : 10598
Parent Process ID      : 10499
Agent URL              : https://itsrv33c.mydomain:3872/emd/main/
Local Agent URL in NAT : https://itsrv33c.mydomain:3872/emd/main/
Repository URL         : https://itsrv35g.mydomain:1159/empbs/upload
Started at             : 2016-11-09 09:57:05
Started by user        : oracle
Operating System       : HP-UX version B.11.31 (IA64W)
Last Reload            : (none)
Last successful upload                       : 2016-11-09 10:19:26
Last attempted upload                        : 2016-11-09 10:19:26
Total Megabytes of XML files uploaded so far : 0.2
Number of XML files pending upload           : 0
Size of XML files pending upload(MB)         : 0
Available disk space on upload filesystem    : 16.92%
Collection Status                            : Collections enabled
Heartbeat Status                             : Ok
Last attempted heartbeat to OMS              : 2016-11-09 10:19:53
Last successful heartbeat to OMS             : 2016-11-09 10:19:53
Next scheduled heartbeat to OMS              : 2016-11-09 10:20:53

—————————————————————
Agent is Running and Ready

./emctl pingOMS

Oracle Enterprise Manager Cloud Control 12c Release 5
Copyright (c) 1996, 2015 Oracle Corporation.  All rights reserved.
—————————————————————
EMD pingOMS completed successfully

$AGENT_INST/sysman/log/gcagent.log contains

—– Wed Nov  9 09:39:43 2016::26900::Agent Launched with PID 27336 at time Wed
Nov  9 09:39:43 2016 —–
—– Wed Nov  9 09:39:43 2016::27336::Time elapsed between Launch of Watchdog p
rocess and execing EMAgent is 34 secs —–
2016-11-09 09:39:44,287 [1:main] WARN – Missing filename for log handler ‘wsm’
2016-11-09 09:39:44,302 [1:main] WARN – Missing filename for log handler ‘opss’
2016-11-09 09:39:44,305 [1:main] WARN – Missing filename for log handler ‘opsscf
g’
Agent is going down due to an OutOfMemoryError
—– Wed Nov  9 09:40:06 2016::26900::Checking status of EMAgent : 27336 —–
—– Wed Nov  9 09:40:06 2016::26900::EMAgent exited at Wed Nov  9 09:40:06 201
6 with return value 57. —–
—– Wed Nov  9 09:40:06 2016::26900::EMAgent will be restarted because of an O
ut of Memory Exception. —–
—– Wed Nov  9 09:40:06 2016::26900::writeAbnormalExitTimestampToAgntStmp: exi
tCause=OOM : restartRequired=1 —–
—– Wed Nov  9 09:40:06 2016::26900::Restarting EMAgent. —–

That means, the agent is starting, then stopping, then restarting, then stopping (aka “thrashing”)

Take a look for the running agent daemon at the OS level:

ps -ef | grep agent12c
oracle 26900     1  0 09:39:09 pts/0     0:00 /u01/app/oracle/agent12c/core/12.1.0.5.0/perl/bin/perl /u01/app/oracle/agent12c/core/12.1.0.5.0/bin/emwd.pl agent /u01/app/oracle/…
oracle 27665 26900  0 09:40:12 pts/0     1:01 /u01/app/oracle/agent12c/core/12.1.0.5.0/jdk/bin/IA64W/java -Xmx169M -XX:MaxPermSize=96M -server -Djava.security.egd=file:///de…

Oh – it’s set up for the default of 169MB of RAM.  Check My Oracle Support.

EM 12c: emctl start agent Fails ‘Fatal agent error: State Manager failed at Startup’ ‘restarted because of an Out of Memory Exception’ Reported in emagent.nohup /gcagent.log (Doc ID 1950490.1)

Verify this setting also in the $AGENT_INST/sysman/log/gcagent.log:

—– Wed Nov  9 09:40:06 2016::26900::Auto tuning the agent at time Wed Nov  9
09:40:06 2016 —–
inMemoryLoggingSize=6291456
_SchedulePersistTimer=30
MaxThreads=10
agentJavaDefines=-Xmx169M -XX:MaxPermSize=96M
SchedulerRandomSpreadMins=5
UploadMaxNumberXML=5000
UploadMaxMegaBytesXML=50.0
Auto tuning was successful

Well, it’s trying. Per the above Doc ID 1950490.1

Stop the agent.

$AGENT_INST/bin/emctl stop agent

Edit the $AGENT_INST/sysman/config/emd.properties   (this contains the runtime parameters for the agent):

old entry:
agentJavaDefines=-Xmx169M -XX:MaxPermSize=96M

new entry:
agentJavaDefines=-Xmx512M -XX:MaxPermSize=96M

(You may tune these values up or down according to your environment requirements)

Restart the agent:

$AGENT_INST/bin/emctl stop agent

Agent runs, and keeps running like the E-Bunny.

R12.2 adop phase fs_clone fails because it can’t copy a file.

Complexity leading to fragility
Complex Systems Integration (Courtesy of: https://www.mulesoft.com/resources/esb/business-process-integration)

Oracle…sometimes blinding in complexity, and a foreshadowing of what happens when a system becomes so complex that it becomes fragile.

This is what the screen session looks like:

adnodemgrctl.sh: check the logfile /u01/oradev/fs1/inst/apps/DEV2_itsrv33m/logs/appl/admin/log/adnodemgrctl.txt for more information …
[UNEXPECTED]fs_clone has failed.
[STATEMENT] Please run adopscanlog utility, using the command
“adopscanlog -latest=yes”
to get the list of the log files along with snippet of the error message corresponding to each log file.
adop exiting with status = 2 (Fail)

Here is what it looks like in the adop.log

[EVENT]     Performing CLONE steps.
[PROCEDURE] [START 2016/11/08 08:20:19] CLONE Patch File System from Run File System
[PROCEDURE] Calling: /u01/oradev/fs2/EBSapps/appl/ad/12.0.0/patch/115/bin/txkADOPPreparePhaseSynchronize.pl
[EVENT]     Log: /u01/oradev/fs_ne/EBSapps/log/adop/25/20161108_081645/fs_clone/itsrv33m
[UNEXPECTED]Error occurred running “perl /u01/oradev/fs2/EBSapps/appl/ad/12.0.0/patch/115/bin/txkADOPPreparePhaseSynchronize.pl -contextfile=/u01/oradev/fs2/inst/apps/DEV2_itsrv33m/appl/admin/DEV2_itsrv33m.xml -patchcontextfile=/u01/oradev/fs1/inst/apps/DEV2_itsrv33m/appl/admin/DEV2_itsrv33m.xml -promptmsg=hide -console=off -mode=create -sync_mode=copy -sessionid=25 -timestamp=20161108_081645 -outdir=/u01/oradev/fs_ne/EBSapps/log/adop/25/20161108_081645/fs_clone/itsrv33m”
[UNEXPECTED]occurred during CLONE Patch File System from Run File System, running command: “perl /u01/oradev/fs2/EBSapps/appl/ad/12.0.0/patch/115/bin/txkADOPPreparePhaseSynchronize.pl -contextfile=/u01/oradev/fs2/inst/apps/DEV2_itsrv33m/appl/admin/DEV2_itsrv33m.xml -patchcontextfile=/u01/oradev/fs1/inst/apps/DEV2_itsrv33m/appl/admin/DEV2_itsrv33m.xml -promptmsg=hide -console=off -mode=create -sync_mode=copy -sessionid=25 -timestamp=20161108_081645 -outdir=/u01/oradev/fs_ne/EBSapps/log/adop/25/20161108_081645/fs_clone/itsrv33m”.
[EVENT]     Releasing managed server ports.
[PROCEDURE] [START 2016/11/08 08:30:55] Releasing ports
[STATEMENT] Calling task: “Releasing ports on itsrv33m”; script: “/u01/oradev/fs2/inst/apps/DEV2_itsrv33m/admin/install/txkCloneAcquirePort.pl”; args: ” -option=close -server=itsrv33m.mwd.h2o -ports=5570,7015,7615,7415,7215,7216,7217,7815,6114,6214,10013 -log=/u01/oradev/fs_ne/EBSapps/log/adop/25/20161108_081645/fs_clone/itsrv33m/txkCloneAcquirePort.log”
[PROCEDURE] [START 2016/11/08 08:30:56] Releasing ports on itsrv33m
[PROCEDURE] Calling: /u01/oradev/fs2/inst/apps/DEV2_itsrv33m/admin/install/txkCloneAcquirePort.pl
[EVENT]     Log: /u01/oradev/fs_ne/EBSapps/log/adop/25/20161108_081645/fs_clone/itsrv33m/txkCloneAcquirePort.log
[PROCEDURE] [END   2016/11/08 08:30:57] Releasing ports on itsrv33m
[PROCEDURE] [END   2016/11/08 08:30:57] Releasing ports

How cryptic!  Looks complicated.  This system happens to have AD/TXK.Delta.8, so the logs related to adop are all being centralized under the session # (in this case “25”.)

Diving deep into the log subdirectories:

/u01/oradev/fs_ne/EBSapps/log/adop/25/20161108_081645/fs_clone/itsrv33m/TXK_SYNC_create/txkADOPPreparePhaseSynchronize.log

================================
Inside copyComnUtil()…
================================

Directory /u01/oradev/fs1/EBSapps/comn already exists.
Removing the directory: /u01/oradev/fs1/EBSapps/comn/util

Copying the directory
———————
SOURCE : /u01/oradev/fs2/EBSapps/comn/util
TARGET : /u01/oradev/fs1/EBSapps/comn/util

Execute SYSTEM command : cp -rH  /u01/oradev/fs2/EBSapps/comn/util /u01/oradev/fs1/EBSapps/comn/util
EXIT STATUS: 1
Copied /u01/oradev/fs2/EBSapps/comn/util into /u01/oradev/fs1/EBSapps/comn/utilLOG FILE: /u01/oradev/fs_ne/EBSapps/log/adop/25/20161108_081645/fs_clone/itsrv33m/TXK_SYNC_create/cp_rH.out

<snip>
======================================
Inside copyCloneLogsToFSNE()…
======================================

Creating the directory: /u01/oradev/fs_ne/EBSapps/log/adop/25/20161108_081645/fs_clone/itsrv33m/TXK_SYNC_create/fsclone_apply

Copying the directory
———————
SOURCE : /u01/oradev/fs2/inst/apps/DEV2_itsrv33m/admin/log/clone
TARGET : /u01/oradev/fs_ne/EBSapps/log/adop/25/20161108_081645/fs_clone/itsrv33m/TXK_SYNC_create/fsclone_apply

/u01/oradev/fs2/EBSapps/comn/adopclone_itsrv33m/bin/adclone.pl did not go through successfully.
LOG DIRECTORY: /u01/oradev/fs_ne/EBSapps/log/adop/25/20161108_081645/fs_clone/itsrv33m/TXK_SYNC_create/fsclone_apply.
*******FATAL ERROR*******
PROGRAM : (/u01/oradev/fs2/EBSapps/appl/ad/12.0.0/patch/115/bin/txkADOPPreparePhaseSynchronize.pl)
TIME    : Tue Nov  8 08:30:55 2016
FUNCTION: main::runFSCloneApply [ Level 1 ]
ERRORMSG: /u01/oradev/fs2/EBSapps/comn/adopclone_itsrv33m/bin/adclone.pl did not go through successfully.

/u01/oradev/fs_ne/EBSapps/log/adop/25/20161108_081645/fs_clone/itsrv33m/TXK_SYNC_create/fsclone_apply/FSCloneApplyAppsTier_11080821.log

(One innocuous, but annoying file, owned by someone other than applmgr, and happened to be 600 (user read/write only):)

Done copying /u01/oradev/fs2/EBSapps/appl/wms to /u01/oradev/fs1/EBSapps/appl/wms/
Copying /u01/oradev/fs2/EBSapps/appl/gmf to /u01/oradev/fs1/EBSapps/appl/gmf/
WARNING:
.end std out.
cp: cannot open /u01/oradev/fs2/EBSapps/appl/mwd/12.0.0/sql/MWDPOLPO.xsl: Permission denied

.end err out.
WARNING: Copying of /u01/oradev/fs2/EBSapps/appl/mwd failed
ERROR: Copying failed, so stopping all the parallel threads
Done copying /u01/oradev/fs2/EBSapps/appl/okc to /u01/oradev/fs1/EBSapps/appl/okc/
WARNING: Copying of /u01/oradev/fs2/EBSapps/appl/okc failed
Done copying /u01/oradev/fs2/EBSapps/comn/java/classes/oracle/apps/pqh to /u01/oradev/fs1/EBSapps/comn/java/classes/oracle/apps/pqh/
WARNING: Copying of /u01/oradev/fs2/EBSapps/comn/java/classes/oracle/apps/pqh failed
Done copying /u01/oradev/fs2/EBSapps/appl/gmf to /u01/oradev/fs1/EBSapps/appl/gmf/
WARNING: Copying of /u01/oradev/fs2/EBSapps/appl/gmf failed
Done copying /u01/oradev/fs2/EBSapps/comn/java/classes/oracle/apps/ies to /u01/oradev/fs1/EBSapps/comn/java/classes/oracle/apps/ies/
WARNING: Copying of /u01/oradev/fs2/EBSapps/comn/java/classes/oracle/apps/ies failed
Done copying /u01/oradev/fs2/EBSapps/appl/msc to /u01/oradev/fs1/EBSapps/appl/msc/
WARNING: Copying of /u01/oradev/fs2/EBSapps/appl/msc failed
Done copying /u01/oradev/fs2/EBSapps/appl/ams to /u01/oradev/fs1/EBSapps/appl/ams/
WARNING: Copying of /u01/oradev/fs2/EBSapps/appl/ams failed
Done copying /u01/oradev/fs2/EBSapps/appl/cs to /u01/oradev/fs1/EBSapps/appl/cs/
WARNING: Copying of /u01/oradev/fs2/EBSapps/appl/cs failed
START: Inside exitClone….
Updating status INCOMPLETE for ApplyApplTop
START: Updating status INCOMPLETE for action ApplyApplTop
END: Updated status INCOMPLETE for action ApplyApplTop

One file.  A single file.  Could have been a hidden file. Could have been anywhere in the entire AppsTier filesystem.  This one file stopped ADOP cold from performing.  This happened to be phase=fs_clone, but could have been a patching session, or a post-clone config (adcfgclone.pl) session.

Remove the file, and:

The fs_clone phase completed successfully.
adop exiting with status = 0 (Success)

Complexity leads to unintentional fragility.

Oracle Configuration Manager Quick Tip – EBS R12.2 Disconnected Collections

Collecting Disconnected Mode OCM data for e-Business Suite R12.2
per MOS Document ID 1447334.1 - Oracle E-Business Suite Release 12.2: Release Notes for Oracle Configuration Manager

My Oracle Support - Download Collector page
MOS Oracle Configuration Manager Collector Download screen.

This method is used whenever your EBS instance is behind a firewall and no proxy server is available to reach the OCM collector end-point (ccr.oracle.com)

The reason you want to use OCM is not only because it provides a complete catalog of your Oracle software versions, modules and plug-ins, so that they can easily be associated with a Service Request (SR) instead of the analyst asking for every RDA script being run for every component in your application and database. 

It also enables the full functionality of that Systems Tab in My Oracle Support (buried just above your Settings menu) that allows you to do light versions of lifecycle management comparisons (such as what the instance looked like 2 weeks ago versus now) without having to own the OEM Lifecycle Management license. It comes compliments of your support agreement.

This also enables the full functionality of the patch and security recommendations section vital towards identifying high priority one-off patches specific to your particular configuration and platform.

Basically, instead of having a cron job periodically automatically upload the configurations to ccr.oracle.com, you will be creating the same staged configuration file, but uploading it to your Customer Support Identifier (CSI) via a Draft Service Request (SR) or a currently Open SR via the File Attachment... feature of the SRs.

In the background of MOS is a managed file transfer handler that looks for the specifically named "ocmconfig.jar" files and when detected, route them over to the Configuration Manager engine for automatic uploading to your CSI account.

While not as convenient as the automatic cron method, for those of use with no direct internet connectivity to ccr.oracle.com, our OEM and MOS functionalities become quite limited if the configurations aren't present under our CSI's.e.g. ORACLE_BASE=/u01/app/oracle
# Oracle DB Home cd $ORACLE_HOME unset ORACLE_CONFIG_HOME export JAVA_HOME=$ORACLE_HOME/jdk cd $ORACLE_HOME/ccr # Clear prior CCR installation, if required. rm -rf $ORACLE_HOME/ccr/* cd $ORACLE_HOME unzip <patch_stage_dir>/p5567658_<ver>_<platform>.zip cd $ORACLE_HOME/ccr/bin # Run setupCCR in Disconnected mode ./setupCCR -s -d # Create ORACLE_OCM user and related grants . $ORACLE_HOME/ccr/admin/scripts/installCCRSQL.sh collectconfig -s <SID> -r SYS # Additional grants for APPS EBS Collector . $ORACLE_HOME/ccr/admin/scripts/installCCRSQL.sh ebs_collectconfig -u <APPSUSERNAME> # Run the collection and generate the ocmconfig.jar cd $ORACLE_HOME/ccr/bin ./emCCR collect # ocmconfig.jar location $ORACLE_HOME/ccr/hosts/$HOSTNAME/state/upload # Oracle 10.1.2 iAS Home . $ORACLE_BASE/EBSapps.env run export ORACLE_HOME=$ORACLE_HOME export ORACLE_CONFIG_HOME=$INST_TOP/ora/10.1.2 export JAVA_HOME=$ORACLE_HOME/jdk # Remove prior OCM config, if needed rm -rf $ORACLE_HOME/ccr/* rm -rf $ORACLE_CONFIG_HOME/ccr/* cd $ORACLE_HOME unzip <patch_stage_dir>/p5567658_<ver>_<platform>.zip # Bugfix specific to HP-UX Itanium - verify file permissions to execute chmod 754 $ORACLE_HOME/ccr/bin/deployPackages chmod 754 $ORACLE_HOME/ccr/bin/emSnapshotEnv cd $ORACLE_HOME/ccr/bin ./setupCCR -s -d # Disconnected mode # Run the collection and generate the ocmconfig.jar cd $ORACLE_HOME/ccr/bin ./emCCR collect # ocmconfig.jar location $INST_TOP/ora/10.1.2/ccr/state/upload #Repeat for patch filesystem; . $ORACLE_BASE/EBSapps.env patch # Oracle FMW WebLogic Home # source the Domain environment . $ORACLE_BASE/EBSapps.env run . $EBS_DOMAIN_HOME/bin/setDomainEnv.sh export ORACLE_HOME=$FMW_HOME/utils export ORACLE_CONFIG_HOME=$INST_TOP/ora/FMW # Remove prior OCM config, if needed rm -rf $ORACLE_HOME/ccr/* rm -rf $ORACLE_CONFIG_HOME/ccr/* cd $ORACLE_HOME unzip <patch_stage_dir>/p5567658_<ver>_<platform>.zip # Bugfix specific to HP-UX Itanium - verify file permissions to execute chmod 754 $ORACLE_HOME/ccr/bin/deployPackages chmod 754 $ORACLE_HOME/ccr/bin/emSnapshotEnv cd $ORACLE_HOME/ccr/bin ./setupCCR -s -d # Disconnected mode # Run the collection and generate the ocmconfig.jar cd $ORACLE_HOME/ccr/bin ./emCCR collect # ocmconfig.jar location $INST_TOP/FMW/ccr/state/upload #Repeat for patch filesystem; . $ORACLE_BASE/EBSapps.env patch # Upload all of your ocmconfig.jar files (can be named uniquely - e.g. mydbocmconfig.jar) per MOS Document ID 763142.1 - How to upload the collection file ocmconfig.jar to My Oracle Support for Oracle Configuration Manager (OCM) running in Disconnected Mode.
# Also can ZIP up all of them at once and upload them to your Draft SR (or current open SR as long as you're happy with the CSI (Customer Support Identifier) that will receive the new configurations.
# Trick is have the string "ocmconfig" and .jar as the extension of each file
Have fun with your new Systems tab in My Oracle Support!

TRCSESS – Trace Information for Various Oracle Sessions or Modules – Quick & Dirty Tip

Database Sessions view from Oracle SQL Developer
Database Sessions view from Oracle SQL Developer

— Find your session

SQL> /* a Dell TOAD type query */

SELECT ROUND (BITAND (s.ownerid, 65535)) parent_session_sid,
ROUND (BITAND (s.ownerid, 16711680) / 65536) parent_session_instid,
RAWTOHEX (SADDR) AS saddr,
s.SID,
s.SERIAL#,
s.AUDSID,
RAWTOHEX (PADDR) AS paddr,
s.USER#,
s.USERNAME,
s.COMMAND,
s.OWNERID,
s.TADDR,
s.LOCKWAIT,
s.STATUS,
s.SERVER,
s.SCHEMA#,
s.SCHEMANAME,
s.OSUSER,
s.PROCESS,
s.MACHINE,
s.PORT,
s.TERMINAL,
UPPER (s.PROGRAM) PROGRAM,
s.TYPE,
s.SQL_ADDRESS,
s.SQL_HASH_VALUE,
s.SQL_ID,
s.SQL_CHILD_NUMBER,
s.SQL_EXEC_START,
s.SQL_EXEC_ID,
s.PREV_SQL_ADDR,
s.PREV_HASH_VALUE,
s.PREV_SQL_ID,
s.PREV_CHILD_NUMBER,
s.PREV_EXEC_START,
s.PREV_EXEC_ID,
s.PLSQL_ENTRY_OBJECT_ID,
s.PLSQL_ENTRY_SUBPROGRAM_ID,
s.PLSQL_OBJECT_ID,
s.PLSQL_SUBPROGRAM_ID,
s.MODULE,
s.MODULE_HASH,
s.ACTION,
s.ACTION_HASH,
s.CLIENT_INFO,
s.FIXED_TABLE_SEQUENCE,
s.ROW_WAIT_OBJ#,
s.ROW_WAIT_FILE#,
s.ROW_WAIT_BLOCK#,
s.ROW_WAIT_ROW#,
s.TOP_LEVEL_CALL#,
s.LOGON_TIME,
s.LAST_CALL_ET,
s.PDML_ENABLED,
s.FAILOVER_TYPE,
s.FAILOVER_METHOD,
s.FAILED_OVER,
s.RESOURCE_CONSUMER_GROUP,
s.PDML_STATUS,
s.PDDL_STATUS,
s.PQ_STATUS,
s.CURRENT_QUEUE_DURATION,
s.CLIENT_IDENTIFIER,
s.BLOCKING_SESSION_STATUS,
s.BLOCKING_INSTANCE,
s.BLOCKING_SESSION,
s.FINAL_BLOCKING_SESSION_STATUS,
s.FINAL_BLOCKING_INSTANCE,
s.FINAL_BLOCKING_SESSION,
s.SEQ#,
s.EVENT#,
s.EVENT,
s.P1TEXT,
s.P1,
s.P1RAW,
s.P2TEXT,
s.P2,
s.P2RAW,
s.P3TEXT,
s.P3,
s.P3RAW,
s.WAIT_CLASS_ID,
s.WAIT_CLASS#,
s.WAIT_CLASS,
s.WAIT_TIME,
s.SECONDS_IN_WAIT,
s.STATE,
s.WAIT_TIME_MICRO,
s.TIME_REMAINING_MICRO,
s.TIME_SINCE_LAST_WAIT_MICRO,
s.SERVICE_NAME,
s.SQL_TRACE,
s.SQL_TRACE_WAITS,
s.SQL_TRACE_BINDS,
s.SQL_TRACE_PLAN_STATS,
s.SESSION_EDITION_ID,
s.CREATOR_ADDR,
s.CREATOR_SERIAL#,
s.ECID,
stat.cpu – stat.CPU_this_call_start cpu_this_call,
stat.CPU,
stat.UGA_memory,
stat.PGA_memory,
stat.Commits,
stat.Rollbacks,
si.Block_Gets,
si.Consistent_Gets,
si.Physical_Reads,
si.Block_Changes,
si.Consistent_Changes,
p.program “OSProgram”,
p.spid,
p.pid
FROM V$SESSION S,
V$SESS_IO si,
V$PROCESS p,
(  SELECT ss.sid stat_sid,
SUM (
DECODE (sn.name, ‘CPU used when call started’, ss.VALUE, 0))
CPU_this_call_start,
SUM (
DECODE (sn.name, ‘CPU used by this session’, ss.VALUE, 0))
CPU,
SUM (DECODE (sn.name, ‘session uga memory’, ss.VALUE, 0))
uga_memory,
SUM (DECODE (sn.name, ‘session pga memory’, ss.VALUE, 0))
pga_memory,
SUM (DECODE (sn.name, ‘user commits’, ss.VALUE, 0)) commits,
SUM (DECODE (sn.name, ‘user rollbacks’, ss.VALUE, 0))
rollbacks
FROM v$sesstat ss, v$statname sn
WHERE     ss.STATISTIC# = sn.STATISTIC#
AND (   sn.name = ‘CPU used when call started’
OR sn.name = ‘CPU used by this session’
OR sn.name = ‘session uga memory’
OR sn.name = ‘session pga memory’
OR sn.name = ‘user commits’
OR sn.name = ‘user rollbacks’)
GROUP BY ss.sid) stat
WHERE     (    (s.USERNAME IS NOT NULL)
AND (NVL (s.osuser, ‘x’) <> ‘SYSTEM’)
AND (s.TYPE <> ‘BACKGROUND’))
AND si.sid(+) = s.sid
AND p.addr(+) = s.paddr
AND stat.stat_sid = s.sid

— Setup a Client Trace:

SQL> exec dbms_monitor.client_id_trace_enable (client_id=>'<terminal or client string>’);
PL/SQL procedure successfully completed.

— Setup a trace for all matching session threads for a module:
SQL> exec dbms_monitor.serv_mod_act_trace_enable (service_name=>'<ORACLE_SID or SERVICE_NAME>’, module_name=>'<MODULE from V$SESSION>’);
PL/SQL procedure successfully completed.

Visit your trace directory (in 11gR2 and up, you can consolidate the various dump locations using the init.ora parameter diagnostic_dest='<filepath>’)

# *.trc looks through every trace file in the directory for the matching module string
# Can also use any of the other options to search for specific sessions:
# [action=action_name]
# [clientid=client_id]
# [session=session_id]

oracle > trcsess output=mytrace.trc module=”<MODULE from V$SESSION>” *.trc

# Then just execute your normal tkprof command to format the consolidated output

oracle > tkprof mytrace.trc myformattedtrace.txt sys=no sort=exeela explain=<user/pwd>

# Voila!  All the traces for a specific session, module, or action at a specific time.

— Don’t forget to disable your tracing afterwards!

SQL> exec dbms_monitor.client_id_trace_disable (client_id=>'<terminal or client string>’);
PL/SQL procedure successfully completed.

— Setup a trace for all matching session threads for a module:
SQL> exec dbms_monitor.serv_mod_act_trace_disable (service_name=>'<ORACLE_SID or SERVICE_NAME>’, module_name=>'<MODULE from V$SESSION>’);
PL/SQL procedure successfully completed.

Oracle DataGuard and Standby Database Archive Logs

Users see your wonderful DataGuard implementation like this:

Simple Oracle Dataguard Architecture
Simple Oracle Dataguard Architecture courtesy of https://appsdbatraining.files.wordpress.com

And yet, you know the actual picture looks more like this:

A map of Oracle DataGuard Architecture components
A map of Oracle DataGuard Architecture components

High-availability – the concept behind it makes every DBA shudder because every time it seems you deal with one element and have it protected, there’s another underlying component that also needs protection and redudancy, or else your solution is still insufficient.

Real Application Clusters (RAC) covers individual database host failures but is sensitive to failure of the storage subsystem or the network interconnections between the hosts.

Recovery Manager (RMAN) is your vital tool to keeping track of what’s backed up and where is it.  And its catalog of recovery information could reside locally in copies of the controlfiles, or centrally in another database.  Depends on your backup strategies, really.  Are you using SAN-based backups (snaps, virtual images, deduplicated block replication) or off-site methods that would have to be shipped back to start recovery?

But the typical first-time setup scenario, is you use the OEM-based jiffy whizbang method to setup your new DataGuard environment at the recommendation of one of the steps int the Maximum Availability Advisor (MAA), and everything’s up and running nicely.  You schedule a new weekly full backup, plus daily incremental backup as Oracle recommended practices prescribe, and notice everything’s running smoothly.

Except on your standby database, the archivelogs are piling up and not being deleted automatically.  What’s next?

This thread was a basic discussion in the Oracle Community forums of the topic:

https://community.oracle.com/thread/2388130?start=0&tstart=0

This is a typical RMAN-based configuration:

On Primary

RMAN> CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON STANDBY;

On Standby ( Depends upon where backup is preformed )

RMAN> CONFIGURE ARCHIVELOG DELETION POLICY TO NONE;

Or

RMAN> CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON ALL STANDBY;

/* if Standby Where Backups Are Not Performed  */

Source:

Data Guard Concepts and Administration 12c

http://docs.oracle.com/database/121/SBYDB/toc.htm

12 Using RMAN to Back Up and Restore FilesRMAN Configurations at the Primary Database
12.3.4 RMAN Configurations at a Standby Where Backups Are Not Performed

The following RMAN configurations are recommended at a standby database where backups are not done:

  1. Connect RMAN to the standby database as target, and to the recovery catalog.
  2. Enable automatic deletion of archived logs once they are applied at the standby database (this is also applicable to all terminal databases when the cascading or far sync instance features are in use):
  3. CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON ALL STANDBY;

 

** However, that doesn’t really take into consideration what might happen if a final archivelog before switchover of roles doesn’t quite make it on the standby (for whatever reason, it gets corrupted during playback or something similar which results in a Database Needs More Recovery error.)

Based upon:

12.3.3 RMAN Configurations at a Standby Database Where Backups are Performed

The following RMAN configurations are recommended at a standby database where backups are done:

  1. Connect RMAN to the standby database (where backups are performed) as target, and to the recovery catalog.
  2. Enable automatic backup of the control file and the server parameter file:

3.  RMAN > CONFIGURE CONTROLFILE AUTOBACKUP ON;

  1. Skip backing up data files for which there already exists a valid backup with the same checkpoint:

5.  RMAN > CONFIGURE BACKUP OPTIMIZATION ON;

  1. Configure the tape channels to create backups as required by media management software:

7.  RMAN > CONFIGURE CHANNEL DEVICE TYPE SBT PARMS ‘<channel parameters>’;

  1. Because the archived logs are backed up at the standby database, Oracle recommends that you configure the BACKED UP option for the log deletion policy:

9.  RMAN > CONFIGURE ARCHIVELOG DELETION POLICY BACKED UP n TIMES TO [DEVICE TYPE SBT];

 

I came up with the configuration of:

 

On Standby ( Depends upon where backup is preformed )

# If no DataGuard is present (single DB host):

# Ensure daily RMAN backup job is being executed in OEM or via cron.

RMAN> CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 1 TIMES TO DISK;

 

And setup a 2nd backup set for the Standby Host DB.  This puts the backups into the defined Fast Recovery Area and manages both the backups and archivelog retention in the same mountpoint.

 

Each has its pros and cons depending on the scenario.You need to lay out your entire architecture scheme including backup solutions and play out the various scenarios that you’re required to cover as far as your Quality of Service (QOS) guarantee to your end-user population.

And of course, if you’re using the advanced cross-WAN FarSync DataGuard implementation architecture (wherein there’s a separate Failover Archive Log (FAL) standby database whose sole purpose in life is to cache archivelogs in case the data replication stream is too much for WAN bandwidth to handle in real-time.) this all still applies because the FAL server is basically just another standby target which needs managing just as much as any regular LAN-based full DataGuard standby instance (it’s just missing the big datafiles and handles all the archivelog traffic.)  You’ll just have even more servers and services involved in keeping the whole thing running (like your Global Names Service servers and databases, which might also be RAC and DataGuard protected, or your Single-Sign On authentication services, or even the OEM Cloud Control OMS itself orchestrating all of that.)