App Analyzer Environment Settings
1. Basic Settings
Data Source Settings
Location of configuration file: <<$BXM_HOME>>/admin/bin/config/datasource.properties
-- Oracle
driver-classname=oracle.jdbc.OracleDriver
uri=jdbc:oracle:thin:@<<DBUrl>>:<<DBPort>>:<<SID>>
username=<<DBUserName>>
password=<<DBPassword>>
-- MySql
driver-classname=com.mysql.jdbc.Driver
uri=jdbc:mysql://<<DBurl>>:<<DBPort>>/<<database>>
username=<<dbUserName>>
password=<<dbPassword>>
Set the data source used by BXM Web Admin.
Execution Shell Settings
Location of execution file: <<$BXM_HOME>>/admin/bin/dniAnalyzer.sh
#!/usr/bin/ksh
# set classpath
BXM_HOME={bxmHomeDir} (1)
CLASSPATH=$BXM_HOME/admin/bin/config
APP_HOME={bxmAppOnlineHome} (2)
JAVA_BIN=$JAVA_HOME/bin/java
for f in `find $BXM_HOME/admin/bxmAdmin/WEB-INF/lib -type f -name "*.jar"`
do
CLASSPATH=$CLASSPATH:$f
done
for f in `find $BXM_HOME/lib/bxm -type f -name "*.jar"`
do
CLASSPATH=$CLASSPATH:$f
done
for f in `find $BXM_HOME/lib/deps -type f -name "*.jar"`
do
CLASSPATH=$CLASSPATH:$f
done
OPT="-Xms512m -Xmx1024m -classpath $CLASSPATH "
# execute
for appName in $APP_HOME/*
do
FILE_NAME=$(basename $appName)
$JAVA_BIN $OPT bxm.app.analyze.AppAnalyzeApplication $appName false 2>&1 > $FILE_NAME.log &
done
#$JAVA_BIN $OPT bxm.app.analyze.AppAnalyzeApplication $APP_HOME false AnalyzeResources
sleep 300
V_GREP=$(ps aux | grep AppAnalyzeApplication | grep -v grep)
FLAG=$(expr length "$V_GREP")
#waiting analyze
while ["$FLAG" != "0"]
do
sleep 300
V_GREP=$(ps aux | grep AppAnalyzeApplication | grep -v grep)
FLAG=$(expr length "$V_GREP")
done
#start AfterAnalyze
$JAVA_BIN $OPT bxm.app.analyze.AppAnalyzeApplication $appName false AfterAnalyze 2>&1 > AfterAnalyze.log &
| 1 | BXM_HOME={bxmHomeDir}
Enter the directory where BXM is installed. |
||
| 2 | APP_HOME={bxmAppOnlineHome}
Enter the online Home directory of BXM. When there are multiple analysis targets, enter them as CSV.
|
BXM Config Settings
Check and, if necessary, modify the following values in "Admin Settings" of BXM Web Admin.
| Key | Sample (default) value | Description |
|---|---|---|
bxm.admin.dni.include.callee |
bxm.web.admin.online.* |
Set the targets for analyzing |
bxm.admin.dni.exclude.callee |
Na |
Set the targets to be excluded when analyzing Caller, Callee relationships. Write them as regular expressions, and when there are multiple targets, connect them with CSV. If there is no applicable item, enter "Na". When duplicated with the above setting, the "exclude" setting takes precedence. |
bxm.admin.dni.service. executor.name |
DefaultServiceExecutor |
If the service executor is customized, enter the name of the corresponding class. |
bxm.admin.dni.service. executor.info.class |
bxm.app.analyze.meta.visiter. DftServiceExecutorMethod |
If the meta information held by the customized service executor has been changed, customize the visitor class and enter the name of the corresponding class. |
bxm.admin.dni.dynamic. query.dft.rule |
bxm.app.analyze.meta.query. |
This is an option that defines the parsing classes for removing tags from Dynamic SQL in *.dbio files when parsing SQL and assembling it into SQL that can be analyzed. If there is no need to analyze Dynamic SQL, delete this option. |
2. Option Settings
bxm.admin.dni.dynamic.query.dft.rule Settings
* This is an option for removing tags for the SQL Parser. Note that if the SQL is not valid after removing the tags, an SQL analysis error may occur. (If the SQL analysis does not terminate normally, the table name of the corresponding SQL ID is stored as #ERROR.)
-
Configuration Method
Enter it in key=value format. The key is admin.dni.dynamic.query.dft.rule, and the value is the Full Qualified Name of the Rule Class that filters out tags of Dynamic SQL. When there are two or more, separate them with CSV (,).
-
Default Class Descriptions
-
DftRemoveTag
This corresponds to the if, choose, when, otherwise tags. As shown below, only the tags are removed so that SQL Parsing operates normally.
select emp_no from EMP_TST where 1=1 < if test="empDept != null && empDept != ''" > and emp_dept = #{empDept} </if> ↓ select emp_no from EMP_TST where 1=1 and emp_dept = #{empDept} -
DftRemoveTagRange
This corresponds to the selectKey, bind tags. As shown below, the ranges enclosed by tags are removed so that SQL Parsing operates normally.
<selectKey keyProperty="id" resultType="int" order="BEFORE"> select SEQ_ID.nexyval FROM DUAL </selectKey> insert into Students (id, name , email) values (#{id}, #{name}, #{email}) ↓ insert into Students (id, name , email) values (#{id}, #{name}, #{email}) -
DftReplaceTag
This corresponds to the where, set tags. The where tag is replaced with WHERE 1=1, and the set tag is replaced with SET so that SQL Parsing operates normally.
select emp_nm from emp_tst <where> <if> and emp_no = #{empNo}</if> </where> ↓ select emp_nm from emp_tst WHERE 1=1 <if> and emp_no = #{empNo}</if> -
DftReplaceTagRange
This corresponds to the foreach tag. The range enclosed by foreach is replaced with NULL so that SQL Parsing operates normally.
SELECT emp_nm FROM emp_tst WHERE emp_dept in <foreach item="item" index="index" collection="list" open="(" separator="," close=")"> #{item} </foreach> ↓ SELECT * FROM emp_tst WHERE emp_dept in NULL
-
Customization Area
You can customize the Dynamic SQL Rule classes that are configured in "bxm.admin.dni.dynamic.query.dft.rule Settings".
-
Open the BXM Web Admin customization source. Based on the Install set, this is the CustomizingSource/WebAdmin/bxm.web.admin project.
-
Under bxm/web/admin/dni/analyze/sql/dft, the Default Dynamic Parsing Rule classes exist, and in the custom package at the same level, create a class that implements the IParsingRuleIntrfc interface.
public class CustomRemoveTag implements IParsingRuleIntrfc { @Override public String applyParsingRule(String sql) throws Exception { // TODO Auto-generated method stub return null; } } -
Override and implement the method.
-
After deploying the source and changing the option value in bxm-instance-management.xml, restart the WAS of Web Admin.
Impact Analysis Settings in an HTTPS Environment
In the dniAnalyzer.sh shell of the App Analyzer, an analysis request is sent to BXM Web Admin, and this is affected when the environment is HTTPS. For normal operation in an HTTPS environment, SSL-related settings are required.
The following is dniAnalyzer.sh with the additional settings required when executing impact analysis in an HTTPS environment.
#!/usr/bin/ksh # set classpath BXM_HOME={bxmHomeDir} CLASSPATH=$BXM_HOME/admin/bin/config APP_HOME={bxmAppOnlineHome} JAVA_BIN=$JAVA_HOME/bin/java for f in `find $BXM_HOME/admin/bxmAdmin/WEB-INF/lib -type f -name "*.jar"` do CLASSPATH=$CLASSPATH:$f done for f in `find $BXM_HOME/lib/bxm -type f -name "*.jar"` do CLASSPATH=$CLASSPATH:$f done for f in `find $BXM_HOME/lib/deps -type f -name "*.jar"` do CLASSPATH=$CLASSPATH:$f done SSL_PATH=<<keystore>> #Location of certificate key (1) SSL_PASS=password #password (2) SSL_CTXT=SSLv3 #SSL version (3) # execute option JAVA_BIN=$JAVA_HOME/bin/java OPT="-Xms512m -Xmx1024m -Dbxm.cacert.path=$SSL_PATH -Dbxm.cacert.pass=$SSL_PASS -Dbxm.ssl.context=$SSL_CTXT -Djavax.net.debug=ssl -classpath $CLASSPATH " (4) # execute for appName in $APP_HOME/* do FILE_NAME=$(basename $appName) $JAVA_BIN $OPT bxm.app.analyze.AppAnalyzeApplication $appName false 2>&1 > $FILE_NAME.log & done #$JAVA_BIN $OPT bxm.app.analyze.AppAnalyzeApplication $APP_HOME false AnalyzeResources sleep 300 V_GREP=$(ps aux | grep AppAnalyzeApplication | grep -v grep) FLAG=$(expr length "$V_GREP") #waiting analyze while ["$FLAG" != "0"] do sleep 300 V_GREP=$(ps aux | grep AppAnalyzeApplication | grep -v grep) FLAG=$(expr length "$V_GREP") done #start AfterAnalyze $JAVA_BIN $OPT bxm.app.analyze.AppAnalyzeApplication $appName false AfterAnalyze 2>&1 > AfterAnalyze.log &1 SSL_PATH Enter the location where the certificate key exists as a canonical path.
2 SSL_PASS Enter the certificate password.
3 SSL_CTXT Enter the SSL Context. Enter context values such as TLSv1.2, SSLv3.
4 -Dbxm.cacert.path=$SSL_PATH -Dbxm.cacert.pass=$SSL_PASS -Dbxm.ssl.context=$SSL_CTXT -Djavax.net.debug=ssl Configure the java options. The -Djavax.net.debug=ssl option allows you to view SSL-related logs, and if you set this in the WAS environment of BXM Web Admin, you can check SSL-related logs in the Admin Log.