Wednesday, February 13, 2019

DMZ Configuration on R12

DMZ Configuration on R12


* OS verification
* Backup the source (prodcution instance)
* Copy the source application tier to the DMZ machine
* Create user and group for the DMZ machine
* Create directories for the target DMZ and give them the required grant and ownership
* Configure the DMZ
* Run autoconfig on both application tiers and the database tier
* Start and check the services

--> OS Verification

i)   Create OS user

ii)  Host file format
The  “/etc/hosts”  file  should use the  following  format  and Hostname  length should be less than 255 characters.
IP Address   Full Qualified Hostname    alias
Example:
10.10.19.39   externalnode.oracle.com    externalnode
10.10.11.31   internalnode.oracle.com    internalnode

iii) Mount Point / Storage Details
All disks in a disk group should have the same I/O density (Megabytes per second of transfer rate per Gigabyte of capacity)

iv)  Software Requirement
Ar, ld, make, X Display Server

v)   Login into the Source and shut the application services

vi)  Take a backup of the application directories and transfer it to the target server

--> Configuring DMZ

vii)  login as: appldmz

viii) Check the below settings

echo $PATH
which make
which ld

ix)  Navigate to the location where the files have been transfered.

x)  And further navigate to the clone bin diretory and run the adcfgclone.pl with appsTier
pwd
/oracle/appldmz
apps  inst
cd apps/apps_st/comn/clone/bin

perl adcfgclone.pl appsTier

It will ask the instance specific details:

Target System Hostname (virtual or normal) [externalnode] :
Target System Database SID : RAC1
Target System Database Server Node [irecruit] : internal
Target System Base Directory : /oracle/appldmzTarget System Forms ORACLE_HOME Directory [/oracle/appldmz/apps/tech_st/10.1.2] :Target System Web ORACLE_HOME

Directory [/oracle/appldmz/apps/tech_st/10.1.3] :
Target System APPL_TOP Mountpoint [/oracle/appldmz/apps/apps_st/appl] :
Target System COMMON_TOP Directory [/oracle/appldmz/apps/apps_st/comn] :
Target System Instance Home Directory [/oracle/appldmz/inst] :
Username for the Applications File System Owner [appldmz] :
Target System Root Service [enabled] :
Target System Web Entry Point Services [enabled] :
Target System Web Application Services [enabled] :
Target System Batch Processing Services [enabled] :
Target System Other Services [disabled] :
Do you want to preserve the Display [internal:0.0] (y/n) ? : n
Target System Display [irecruit:0.0] :
Do you want the the target system to have the same port values as the source system (y/n)[y] ? : n
Target System Port Pool [0-99] : 10

xi)  Once this process completes succesfully shut down the services change the following parameters in the .xml file

s_isWeb                           ----required value=YES
s_isWebDev                     ----required value=YES
s_http_listen_parameter    ----New Port for the http listener
s_https_listen_parameter  ----New Port for the https listener
s_webentryurlprotocol      ----Set the value to the web entry protocol (http/https)
s_webentryhost                ----Set the value to the webentry host
s_webentrydomain            ----Set the value to the webentry domain
s_active_webport              ----Set the value to the active port
s_login_page                    ----Set the value to point to the new webentry configuration
s_server_ip_address          ----Set the value of this variable to the IP address of the external facing network interface

xii)  Run the node clean package as apps user
Sqlplus apps/********
exec fnd_conc_clone.setup_clean;
commit;
exit
Run autoconfig in the series as stated below
a)  database tier
b)  primary apps tier (prodcution)
c)  DMZ (externalnode)

xiii)  After the completion of the autoconfig run the following script as apps from the primary node
sqlplus apps/welcome @$FND_TOP/patch/115/sql/txkChangeProfH.sql SERVRESP

This would change the profile options hierarchy type values to SERVRESP. Run autoconfig again on the primary node. As seen in the following lines

@txkChangeProfH.sql SERVRESP
Changing the hierarchy type for the  Profile APPS_WEB_AGENT
Profile APPS_WEB_AGENT hierarchy type has been
successfully changed to SERVRESP
Changing the hierarchy type for the  Profile APPS_SERVLET_AGENT
Profile APPS_SERVLET_AGENT hierarchy type has been
successfully changed to SERVRESP
Changing the hierarchy type for the  Profile APPS_JSP_AGENT
Profile APPS_JSP_AGENT hierarchy type has been
successfully changed to SERVRESP
Changing the hierarchy type for the  Profile APPS_FRAMEWORK_AGENT
Profile APPS_FRAMEWORK_AGENT hierarchy type has been
successfully changed to SERVRESP
Changing the hierarchy type for the  Profile ICX_FORMS_LAUNCHER
Profile ICX_FORMS_LAUNCHER hierarchy type has been
successfully changed to SERVRESP
Changing the hierarchy type for the  Profile ICX_DISCOVERER_LAUNCHER
Profile ICX_DISCOVERER_LAUNCHER hierarchy type has been
successfully changed to SERVRESP
Changing the hierarchy type for the  Profile ICX_DISCOVERER_VIEWER_LAUNCHER
Profile ICX_DISCOVERER_VIEWER_LAUNCHER hierarchy type has been
successfully changed to SERVRESP
Changing the hierarchy type for the  Profile HELP_WEB_AGENT
Profile HELP_WEB_AGENT hierarchy type has been
successfully changed to SERVRESP
Changing the hierarchy type for the  Profile APPS_PORTAL
Profile APPS_PORTAL hierarchy type has been
successfully changed to SERVRESP
Changing the hierarchy type for the  Profile CZ_UIMGR_URL
Profile CZ_UIMGR_URL hierarchy type has been
successfully changed to SERVRESP
Changing the hierarchy type for the  Profile QP_PRICING_ENGINE_URL
Profile QP_PRICING_ENGINE_URL hierarchy type has been
successfully changed to SERVRESP
Changing the hierarchy type for the  Profile TCF:HOST
Profile TCF:HOST hierarchy type has been
successfully changed to SERVRESP
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit
Production
With the Partitioning, OLAP and Data Mining options

xiv)  After the completion of the script start the primary instance and login as sysadmnin, And change the following profiles at server level
Server  : externalnode <server_name>
Profile : Node Trust Level <profile_name>
Make the changes at the server level to external

This Completes the DMZ Configuration !!!
xv)  Expose the responsibility to the external tier as per the requirement.

xvi) Once the above process is completed, the DMZ node can be started with the sequence given below.

xvii)  Startup and shutdown of DMZ Applications

We can start the externalnode(DMZ) node with the following sequence

adopmnctl.sh start
adoafmctl.sh start
adformsctl.sh start
adoacorectl.sh start
adapcctl.sh start

To stop the DMZ follow the sequence stated below

adapcctl.sh stop
adoacorectl.sh stop
adformsctl.sh stop
adoafmctl.sh stop
adopmnctl.sh stop

URL :  http://externalnode.oracle.com:8010/OA_HTML/IrcVisitor.jsp

Note:

1.Check SERVER_ADDRESS in fnd_nodes for external tier, make sure it should be pointing to external hostname, if it is not showing add node to fnd_nodes using the Sysadmin –> Install –> nodes.
Check the below columns:
*NODE_NAME                   
*SERVER_ADDRESS               
*HOST                   
*DOMAIN

2.Enable Oracle E-Business Suite Application Server Security

1.Set the value of Application Server Security Authentication (s_appserverid_authentication) to SECURE, in the CONTEXT_FILE on all the nodes.
2.Run AutoConfig on each Applications middle tier to complete the configuration.
3.After AutoConfig completes successfully, restart Oracle HTTP Server and OC4J processes








Oracle Applications Cloning Steps For 12.2.x

Oracle Applications Cloning Steps For 12.2.x


High-level steps of cloning process with AD and TKX delta6
=============================================:

1.Execute the adpreclone.pl dbtier and appsTier
2.Copy the database and applications files (run filesystem) from source to target
3.Configure the database tier on the target server
4.Configure the applcation tier on the run edition
5.Copy the run editon to the patch edition
6.Configure the application tier with patch edition

High-level steps of cloning process with AD and TKX Delta7
=============================================:

1.Execute the adpreclone.pl on dbtier and appsTier.
2.Copy the database and applcation files (run file system) from source to target.
3.Configure the database tier on the target server.
4.Configure the applcation tier on the run edition with the dualfs option.
5.Copy the run editon to the patch edition
6.Configure the application tier with patch edition

Note:
When using the dualfs option, you don't have to copy the patch file system from the run file system. Rapid clone will copy the patch file system and configure both file systems.

What happens when you run adpreclone and adcfgclone.

When you run this commnad adpreclone.pl dbTier ?
This will run in two steps Techstack and database.

1.Techstack:
It will create following directories in the ORACLE_HOME/appsutil/clone
Jlib, db, data where “Jlib” relates to libraries “db” will contain the techstack information, “data” will contain the information related to datafiles and required for cloning.
Creates driver files at ORACLE_HOME/appsutil/driver/instconf.drv
Converts inventory from binary to xml, the xml file is located at $ORACLE_HOME/appsutil/clone/context/db/Sid_context.xml

2.Prepare database for cloning:
This includes creating datbase control file script and datafile location information file at
$ORACLE_HOME/appsutil/template
adcrdbclone.sql, dbfinfo.lst
Generates database creation driver file at ORACLE_HOME/appsutil/clone/data/driver
data.drv
Copy JDBC Libraries at ORACLE_HOME/appsutil/clone/jlib/classes12.jar and appsoui

When Running adpreclone appsTier ?
This will create stage directory at $COMMON_TOP/clone. This also run in two steps.

1.Techstack:
Creates template files for
Oracle_iAS_Home/appsutil/template
Oracle_806_Home/appsutil/template

Creates Techstack driver files for
IAS_ORACLE_HOME/appsutil/driver/instconf.drv
806_ORACLE_HOME/appsutil/driver/instconf.drv

2.APPL_TOP preparation:
-It will create application top driver file $COMMON_TOP/clone/appl/driver/appl.drv
-Copy JDBC libraries $COMMON_TOP/clone/jlib/classes111.zip

Configuring the target system
Once it is done . Run as below adcfclone.pl for apps Tier and dbTier.

On database side:
cd $ORACLE_HOME/appsutils/clone/binperl adcfgclone.pl dbTier pwd=apps
This will use the templates and driver files those were created while running adpreclone.pl on source system and has been copied to target system.

Following scripts are run by adcfgclone.pl dbTier for configuring techstack

* adchkutl.sh — This will check the system for ld, ar, cc, and make versions.
* adclonectx.pl — This will clone the context file. This will ceate a new context file as per the details of this instance.
* runInstallConfigDriver — located in $Oracle_Home/appsutil/driver/instconf.drv
* Relinking $Oracle_Home/appsutil/install/adlnkoh.sh — This will relink ORACLE_HOME

1.On database side, following scripts are run
Driver file $Oracle_Home/appsutil/clone/context/data/driver/data.drv
Create database adcrdb.zip
Autoconfig is run
Control file creation adcrdbclone.sql

2.On Application Side:
COMMON_TOP/clone/bin/perl adcfgclone.pl appsTier pwd=apps
Following scripts are run by adcfgclone.pl
Creates context file for target adclonectx.pl

Run driver files
$ORACLE_HOME/appsutil/driver/instconf.drv
$IAS_ORACLE_HOME/appsutil/driver/instconf.drv

Relinking of Oracle Home $ORACLE_HOME/bin/adlnk806.sh $IAS_ORACLE_HOME/bin/adlnkiAS.sh
At the end it will run the driver file $COMMON_TOP/clone/appl/driver/appl.drv and then runs autoconfig.

What is Dualfs option in 12.2.x ?

What is Dualfs option in 12.2.x ?


Oracle Applications R12.2.5 New Features: dualfs in cloning

From Oracle Applications Release 12.2.5 Version, we have dualfs option for cloning applications tier.We can use this feature in earlier 12.2.x versions also, if AD-TXK Delta 7 patch is applied. Before AD-TXK Delta 7, it was required to run adcfgclone twice on run and patch filesystems.Using dualfs option,we can create both run and patch fs at one time.

syntax:

-bash$ perl adcfgclone.pl appsTier dualfs

Difference Between SQL TRACE, EXPLAIN PLAN and TKPROF.

Difference Between SQL TRACE, EXPLAIN PLAN and TKPROF.


Overview Of SQL TRACE
-------------------------------
The diagnostic tool 'sql trace' provides performance information about individual SQL statements and generates the following statistics for each statement:

* parse, execute, and fetch counts
* CPU and elapsed times
* physical reads and logical reads
* number of rows processed
* misses on the library cache

This information is input to a trace (.trc) file and sql trace can be enabled/disabled for a session or an instance.

Setting Initialization Parameters:

1.SQL_TRACE
Enable/Disable SQL Trace for the instance.(TRUE/FALSE)

2.TIMED_STATISTICS
Enable/Disable the collection of timed statistics, such as CPU and elapsed times.(TRUE/FALSE)

3.USER_DUMP_DEST
Specifies the destination for the trace file.

Enabling/Disabling SQL Trace:

ALTER SESSION SET SQL_TRACE = TRUE;
ALTER SESSION SET SQL_TRACE = FALSE;

Enabling/Disabling TIMED_STATISTICS:

ALTER SYSTEM SET TIMED_STATISTICS = TRUE;
ALTER SESSION SET TIMED_STATISTICS = FALSE:

Trace Files
-----------
Oracle will generate trace (.trc) files for every session where the value of SQL_TRACE = TRUE and write them to the USER_DUMP_DEST destination. If tracing has been enabled for the instance then individual trace files will be generated for each session, unless otherwise disabled (see above). Note, that the generated files may be owned by an operating system user other than your own so you may have to get this user to grant you access before you can use TKPROF to format them.

Using TKPROF
-------------------
The TKPROF facility accepts as input an SQL trace file and produces a formatted output file.

Simple Example
-------------------
This example shows TKPROF being run to format a trace file named "dsdb2_ora_18468.trc" and writing it to a formatted output file named "dsdb2_trace.out".

$ TKPROF dsdb2_ora_18468.trc dsdb2_trace.out SYS=NO EXPLAIN=SCOTT/TIGER

The EXPLAIN PLAN Command
----------------------------------------
The EXPLAIN PLAN command displays the execution plan chosen by the Oracle optimizer for SELECT, UPDATE, INSERT, and DELETE statements. A statement's execution plan is the sequence of operations that Oracle performs to execute the statement. By examining the execution plan, you can see exactly how Oracle executes your SQL statement. This information can help you determine whether the SQL statement you have written takes advantage of the indexes available.

Creating the Output Table
-------------------------------
Before you can issue an EXPLAIN PLAN statement, there must exist a table to hold its output, you do either of the following:

* Run the SQL script "UTLXPLAN.SQL" to create a sample output table called PLAN_TABLE in your schema.

* Issue a CREATE TABLE statement to create an output with any name you choose.  You can then issue an EXPLAIN PLAN statement and direct its output to this table.  Any table used to store the output of the EXPLAIN PLAN command must have the same column names and datatypes as the PLAN_TABLE

SQL Trace Facility Statistics
----------------------------------
TKPROF lists the statistics for a SQL statement returned by the SQL trace facility in rows and columns.  Each row corresponds to one of
three steps of SQL statement processing:

* PARSE
This step translates the SQL statement into an execution plan. This includes checks for proper security authorization and checks or the existence of tables, columns, and other referenced objects.

* EXECUTE
This step is the actual execution of the statement by Oracle. For INSERT, UPDATE, and DELETE statements, this step modifies the data.  For SELECT statements, the step identifies the selected rows.

* FETCH
This step retrieves rows returned by a query.Fetches are only performed for SELECT statements.

How To Collect 10046 Trace (SQL_TRACE) Diagnostics for Performance Issues

How To Collect 10046 Trace (SQL_TRACE) Diagnostics for Performance Issues


Gathering 10046 trace

The 10046 trace is the equivalent of setting SQL_TRACE=TRUE. The advantage of using the event is that additional details may be written to the trace file depending on the level specified with the event. This event is often requested to be set by Oracle Support when gathering information for specific SQL issues and particular when investigating and/or diagnosing performance issues. Event 10046 is the standard method of gathering extended sql_trace information for Oracle sessions.

Trace Location

11g R1 and above:

With the introduction of the new diagnosability infrastructure introduced in Oracle Database 11g Release 1, traces and core files are placed in a location controlled by the DIAGNOSTIC_DEST initialization parameter.
To show the location of the DIAGNOSTIC_DEST, the following command can be used:
SQL> show parameter diagnostic_dest

Pre 11g R1:

Event 10046 tracing will produce a trace file in the <Parameter user_dump_dest> for user processes and <Parameter background_dump_dest> for background processes.
To show the location of the user_dump_dest, the following command can be used:

SQL> show parameter user_dump_dest

Note: Some examples include setting a 'tracefile_identifier' to assist with finding the resultant trace output.

Session Tracing

This tracing can be used where the session is accessible to the user prior to the start of the statement(s) to be traced.
To gather 10046 trace at the session level:
alter session set tracefile_identifier='10046';

alter session set timed_statistics = true;
alter session set statistics_level=all;
alter session set max_dump_file_size = unlimited;

alter session set events '10046 trace name context forever,level 12';

-- Execute the queries or operations to be traced here --

select * from dual;
exit;

If the session is not exited then the trace can be disabled using:

alter session set events '10046 trace name context off';

Note that if the session is not closed cleanly and tracing is disabled, then important trace information may be missing from the trace file.

Note: "statistics_level=all" is set here so as to gather some level of statistics in cases where the parameter has been changed from the default and recommended level of "TYPICAL" (to BASIC). In order to diagnose performance issues, some level of statistics is required. A value of "ALL" may not be absolutely necessary but has been chosen over "TYPICAL" so as to have the most comprehensive information for diagnosis.

Tracing a process after it has started

If trace from an existing session is required then oradebug can be used to attach to the session and initiate 10046 tracing.
The first step is to identify the session to be traced by some means:

For example, in SQL*Plus, start a session to find the OS process id (spid) for the target session:
select p.PID,p.SPID,s.SID
from v$process p,v$session s
where s.paddr = p.addr
and s.sid = &SESSION_ID
/

SPID is the operating system Process identifier (os pid)
PID is the Oracle Process identifier (ora pid)

If you do not know the Session ID then you can use a select similar to the following to help you identify the target session:

column line format a79
set heading off
select 'ospid: ' || p.spid || ' # ''' ||s.sid||','||s.serial#||''' '||
  s.osuser || ' ' ||s.machine ||' '||s.username ||' '||s.program line
from v$session s , v$process p
where p.addr = s.paddr
and s.username <> ' ';

Document For multi threaded processes in 12c, use newly added column stid from v$process to find specific thread, as Oracle combines many processes into a single ospid.  To find the specific thread, use following syntax:

oradebug setospid <spid> <stid>

Once the OS process id for the process has been determined then the trace can be initialised as follows:

Lets assume that the process to be traced has an os pid of 9834.
Login to SQL*Plus as a dba and execute the following:
connect / as sysdba
oradebug setospid 9834
oradebug unlimit
oradebug event 10046 trace name context forever,level 12
Remember to replace the example '9834' value with the actual os pid.

Note that it is also possible to attach to a session via oradebug using the 'setorapid'.

In this case the PID (Oracle Process identifier ) would be used (rather than the 'SPID') and the oradebug text would change to:
connect / as sysdba
oradebug setorapid 9834
oradebug unlimit
oradebug event 10046 trace name context forever,level 12
Remember to replace the example '9834' value with the actual ora pid.

To disable oradebug tracing once tracing is finished:
oradebug event 10046 trace name context off
Document For multi threaded processes in 12c, use newly added column stid from v$process to find specific thread, as Oracle
combines many processes into a single ospid.  To find the specific thread, use following sytax:
oradebug setospid <spid> <stid>oradebug unlimit
The tracefile name will be something like <instance><spid>_<stid>.trc.

Instance wide tracing
Note: Please be cautious when setting system wide, as this will impact performance due to every session being traced.

This setting will trace every session that is created after the parameter is set. Existing sessions will not be traced.

Setting system-wide 10046 tracing can be useful for scenarios where a problem session is known to occur but cannot be identified in advance.
In this situation, tracing can be enabled for a short period of time, the problem can then be reproduced and tracing disabled and the resultant traces searched for evidence of the problem.

System-wide tracing can be enabled as follows:
alter system set events '10046 trace name context forever,level 12';

The setting can be disabled in all sessions by using the following command:
alter system set events '10046 trace name context off';

Initialisation parameter setting

This setting will trace every session in the instance when it is restarted.
event="10046 trace name context forever,level 12"

The setting can be disabled by removing the parameter and restarting the instance or by using an alter system command as follows:
alter system set events '10046 trace name context off'

Monday, February 11, 2019

WebLogic Server Life Cycle States


WebLogic Server Life Cycle States