Tuesday, 7 June 2022

Enable Audio on VM

 please refer the below link

https://www.dynu.com/Resources/Tutorials/DynamicDNS/RemoteDesktop


https://serverspace.io/support/help/how-to-use-microphone-in-rdp-session/


SOA Purge Scripts

 Check if AutoPurge job is runnig - 


https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=301402729410603&parent=DOCUMENT&sourceId=2123653.1&id=2063039.1&_afrWindowMode=0&_adf.ctrl-state=2o1z1qf27_317


https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=10681729155985&id=2745847.1&displayIndex=2&_afrWindowMode=0&_adf.ctrl-state=n1857oksm_157#REF


https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=10715735917585&id=1563449.1&displayIndex=8&_afrWindowMode=0&_adf.ctrl-state=n1857oksm_312


https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=10678348728630&id=2276923.1&displayIndex=1&_afrWindowMode=0&_adf.ctrl-state=n1857oksm_116



Purge working script - 


--select * from work_item where state = 1 and execution_type != 1;

DECLARE

CURSOR c_bpm_data

IS

select distinct(b.flow_id) from cube_instance b where ROWNUM <= 1000 and state = 5;


TYPE t_bpm_data IS TABLE OF c_bpm_data%ROWTYPE

INDEX BY BINARY_INTEGER;


l_bpm_data t_bpm_data;

l_id_string VARCHAR2(32767);

KEEP_WORKFLOW_INST BOOLEAN;


BEGIN

  l_bpm_data.DELETE;

  OPEN c_bpm_data;

  LOOP

  FETCH c_bpm_data BULK COLLECT INTO l_bpm_data LIMIT 400;

  EXIT WHEN l_bpm_data.count=0;

  l_id_string := NULL;

  

  FOR m IN 1..l_bpm_data.COUNT

  LOOP

     IF l_bpm_data(m).flow_id IS NOT NULL

     THEN

        l_id_string := l_id_string||','||l_bpm_data(m).flow_id;

   END IF;

END LOOP;

  l_id_string := l_id_string||','; 

  l_id_string := LTRIM(l_id_string,',');

 dbms_output.put_line(l_id_string);

-- KEEP_WORKFLOW_INST := FALSE;


SOA.DELETE_INSTANCES_ADHOC(v_flowid_purge => l_id_string);

END LOOP;

CLOSE c_bpm_data;

END;








========================

to verify --



select table_name from user_tables where partitioned = 'YES';

select state, count(*) from cube_instance group by state;


select count(*) from cube_instance where trunc(creation_date) <= '03-JUN-22' ;

select count(*) from cube_instance where trunc(creation_date) >= '29-MAY-22' ;

select  * from cube_instance where state = 5; group by state;


execute soa.delete_instances ( to_timestamp('2022-05-01','YYYY-MM-DD'),to_timestamp('2022-05-07','YYYY-MM-DD'),20000,60,to_timestamp('2022-05-07','YYYY-MM-DD'),false,null,null,null,true);


call soa.delete_instances(to_timestamp('2022-05-01','YYYY-MM-DD'), to_timestamp('2022-05-07','YYYY-MM-DD'));


select state, id, composite_dn from composite_instance where id = 7;


select distinct(flow_id) from cube_instance  where extract(YEAR from CREATED_ON) = 2018 ;



execute soa.delete_instances ( to_timestamp('2022-05-01','YYYY-MM-DD'),to_timestamp('2022-05-07','YYYY-MM-DD'),20000,60,to_timestamp('2022-05-07','YYYY-MM-DD'),false,true);


select * from soa_purge_history;



SELECT OWNER, TABLE_NAME, PARTITIONING_TYPE, INTERVAL FROM DBA_PART_TABLES WHERE OWNER LIKE '%SOAINFRA' ORDER BY 1,2;

Tuesday, 4 January 2022

Linux useful commands

Linux find and copy command with time and date range

 find -type f -newermt "2022-1-4 00:00:00" \! -newermt "2022-1-4 10:30:00" -exec cp {} /tmp/test/ \;

Friday, 5 June 2020

SOA Domain failed during the AdminServer start up


INFO: Configuring the Service Table DataSource...
INFO: Getting Database Defaults...
Error: getDatabaseDefaults() failed. Do dumpStack() to see details.
Error: runCmd() failed. Do dumpStack() to see details.
Problem invoking WLST - Traceback (innermost last):
  File "/u01/oracle/container-scripts/createDomain.py", line 624, in ?
  File "/u01/oracle/container-scripts/createDomain.py", line 157, in createDomain
  File "/u01/oracle/container-scripts/createDomain.py", line 374, in extendSoaDomain
  File "/u01/oracle/container-scripts/createDomain.py", line 311, in configureJDBCTemplates
  File "/tmp/WLSTOfflineIni7524882329358641379.py", line 263, in getDatabaseDefaults
  File "/tmp/WLSTOfflineIni7524882329358641379.py", line 19, in command
Failed to build JDBC Connection object:
        at com.oracle.cie.domain.script.jython.CommandExceptionHandler.handleException(CommandExceptionHandler.java:69)
        at com.oracle.cie.domain.script.jython.WLScriptContext.handleException(WLScriptContext.java:2983)
        at com.oracle.cie.domain.script.jython.WLScriptContext.runCmd(WLScriptContext.java:735)
        at sun.reflect.GeneratedMethodAccessor155.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)

com.oracle.cie.domain.script.jython.WLSTException: com.oracle.cie.domain.script.jython.WLSTException: Got exception when auto configuring the schema component(s) with data obtained from shadow table:
Failed to build JDBC Connection object:


----------------------

$ pwd
/opt/oracle/product/12.2.0.1/dbhome_1/network/admin


$ cat sqlnet.ora
NAME.DIRECTORY_PATH= (TNSNAMES, EZCONNECT, HOSTNAME)
SQLNET.INBOUND_CONNECT_TIMEOUT=300

SOA Docker AdminServer failed to Start

SUPP_ATTRS = {severity-value=8, rid=0, partition-id=0, partition-name=DOMAIN} SERVER = AdminServer TIMESTAMP = 1591359709126 USERID = <WLS Kernel> MACHINE = f80e78590414 MSGID = BEA-101020 DATE = Jun 5, 2020 12:21:49,126 PM UTC SUBSYSTEM = HTTP CONTEXTID = 6781aeea-b679-439d-afb3-336ef966f685-0000006e TXID =  THREAD = [ACTIVE] ExecuteThread: '52' for queue: 'weblogic.kernel.Default (self-tuning)' SEVERITY = Error

WatchAlarmType: AutomaticReset
WatchAlarmResetPeriod: 30000
> 
<Jun 5, 2020 12:21:49,157 PM UTC> <Error> <Kernel> <BEA-000802> <ExecuteRequest failed
 java.lang.NullPointerException.
java.lang.NullPointerException
        at weblogic.servlet.internal.VirtualConnection.getLocalAddr(VirtualConnection.java:89)
        at weblogic.servlet.internal.ServletRequestImpl.getLocalAddr(ServletRequestImpl.java:1117)
        at com.bea.console.utils.ConsoleRequestListener.requestInitialized(ConsoleRequestListener.java:30)
        at weblogic.servlet.internal.EventsManager.notifyRequestLifetimeEvent(EventsManager.java:438)
        at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:28)
        Truncated. see log file for complete stacktrace
> 

com.oracle.bpel.client.BPELFault: faultName: {{http://schemas.oracle.com/bpel/extension}remoteFault} messageType:
{{http://schemas.oracle.com/bpel/extension}RuntimeFaultMessage} parts: {{ summary=<summary>oracle.fabric.common.FabricInvocationException: Unable to
invoke endpoint URI "http://soaapdevlb1.corppvt.com:7877/osb/QueryExpenditureService" successfully due to: javax.xml.soap.SOAPException:
javax.xml.soap.SOAPException: Bad response: 503 Service Unavailable from url http://soaapdevlb1.corppvt.com:7877/osb/QueryExpenditureService</summary>
,detail=<detail>Unable to invoke endpoint URI "http://soaapdevlb1.corppvt.com:7877/osb/QueryExpenditureService" successfully due to:
javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Bad response: 503 Service Unavailable from url
http://soaapdevlb1.corppvt.com:7877/osb/QueryExpenditureService</detail> ,code=<code>503</code>}

Solution –

Added  Server start parameter in config.xml and removed external DNS entry from config.xml

   </web-server-log>
    </web-server>
    <listen-address></listen-address>
        <server-start>
      <arguments>-Dweblogic.security.SSL.ignoreHostnameVerification=true -Dweblogic.configuration.schemaValidationEnabled=false -Xms2g -Xmx2g</arguments>
    </server-start>
    <server-diagnostic-config>
      <name>AdminServer</name>
    </server-diagnostic-config>
  </server>

Wednesday, 20 May 2020

Different timezone in WebLogic Logs and on OS

Check the time using the below commands,

date
hwclock
If this is as expected then check below

hwclock --localtime


If this is incorrect then synchronise using below command, (with root)

 hwclock --systohc --localtime



 https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/sect-configuring_the_date_and_time-hwclock



 or you add the below startup parameter in weblogic,

 -Duser.timezone=GMT

 but I think it is OS related issue so better you resolve it on OS. 

Sunday, 17 May 2020

SOA Database Purge Steps

SOA 12c database purge scripts

To check the purgeable instances,

select state, count(*) from cube_instance group by state;


Purge script,


execute soa.delete_instances ( to_timestamp('01-01-2016','MM-DD-YYYY'),to_timestamp('01-01-2020','MM-DD-YYYY'),20000,60,to_timestamp('01-03-2020','MM-DD-YYYY'),true,null,null,null,true);


Link for reference - 
https://docs.oracle.com/cloud/latest/soa121300/SOAAG/GUID-DBCFFB8F-3B67-4000-9F48-404D16D503DD.htm#SOAAG98235

Parameter details starting from (
1. min_creation_date Minimum creation period in days for the business flow instances.
2. max_creation_date Maximum creation period in days for the business flow instances.
3. batch_size Maximum number of flows selected for deletion. The default value is 20000.
4. max_runtime Expiration time at which the purge script exits the loop
5. retention_period  Specify the time interval in days for which to retain data.
6. purge_partitioned_component  You can invoke the same purge to delete partitioned data.
7. 7. Null,null, null   are place holder.
8. ignore_state hen set to true, purges all open and closed instances within the specified date range

Execute the script using SOAINFRA.

Note- Without null parameter we were getting the place holder issue. 

Wednesday, 8 April 2020

Restore SOA Production Database on Development environment


Use the below steps to backup and restore SOA schema from production to development environment. Please make sure you have a proper backup to restore if anything goes wrong. 
  1. stop the server 
  2. Take a backup of the existing database and restore it from backup
  3. Take a backup of the SOA domain. 
  4. Change the schema username of SOA instance as per prod schema.
  5. change the password as per dev schema.
  6. Execute the below steps,


Go to below and execute the wlst.sh

< MiddlewareHome>/oracle_common/bin/wlst.sh


modifyBootStrapCredential(jpsConfigFile='./jps-config.xml', username='PREFIX_OPSS', password='PASSWORD')


modifyBootStrapCredential(jpsConfigFile="/user_project/config/fmwconfig/jps-config.xml",username="PREFIX_OPSS",password="PASSWORD")


Reference -

https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=423438322466796&id=2427426.1&displayIndex=4&_afrWindowMode=0&_adf.ctrl-state=g9djwouzc_769#FIX

https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=418949888681059&id=2267189.1&displayIndex=7&_afrWindowMode=0&_adf.ctrl-state=g9djwouzc_159#SYMPTOM


Sunday, 2 February 2020

Docker Commands

Docker useful commands -   


  • docker –version
  • docker pull <image name>
  • docker run -it -d <image name>  -- This command is used to create a container from an image
  • docker ps  -- This command is used to list the running containers.
  • docker ps -a -- This command is used to show all the running and exited containers
  • docker exec -it <container id> bash  -- This command is used to access the running container
  • docker stop <container id> -  This command stops a running container
  • docker kill <container id> - This command kills the container by stopping its execution immediately. The difference between ‘docker kill’ and ‘docker stop’ is that ‘docker stop’ gives the container time to shutdown gracefully, in situations when it is taking too much time for getting the container to stop, one can opt to kill it
  • docker commit <conatainer id> <username/imagename>  -- This command creates a new image of an edited container on the local system
  • docker login  -- This command is used to login to the docker hub repositors
  • sync && sysctl -w vm.drop_caches=3   -- clear the cache memory on unbutu
  • docker logs --tail 300  containerID
  • docker logs --since 10 containerID  (10 Minutes)
  • docker inspect --format={{.LogPath}} containerID
  • tail -f `docker inspect --format={{.LogPath}} containerID`
  • grep error `docker inspect --format={{.LogPath}} containerID`


Tuesday, 22 October 2019

Netstat command



 Below netstat commands are helpful while troubleshooting the Socket timeout issue. 


  • ·         netstat -ie                          -- to show all interfaces
  • ·         netstat –r                            -- show current rounting table
  • ·         netstat –C                           -- show the current active connection
  • ·         netstat -at                            -- show all the current connection,
  -l    -- listen on local machine
  -p  -- processes

  • ·         netstat -tanp | grep PID
  • ·         netstat -nap | grep :Port
      Most of the 11 TCP states are easy to understand and most programmers know what they mean:
CLOSED: There is no connection.
LISTEN: The local end-point is waiting for a connection request from a remote end-point i.e. a passive open was performed.
SYN-SENT: The first step of the three-way connection handshake was performed. A connection request has been sent to a remote end-point i.e. an active open was performed.
SYN-RECEIVED: The second step of the three-way connection handshake was performed. An acknowledgement for the received connection request as well as a connection request has been sent to the remote end-point.
ESTABLISHED: The third step of the three-way connection handshake was performed. The connection is open.
FIN-WAIT-1: The first step of an active close (four-way handshake) was performed. The local end-point has sent a connection termination request to the remote end-point.
CLOSE-WAIT: CLOSE_WAIT means the operating system knows that the remote application has closed the connection and waits for the local application to also do so.
FIN-WAIT-2: The remote end-point has sent an acknowledgement for the previously sent connection termination request. The local end-point waits for an active connection termination request from the remote end-point.If the count is high then may be there is some issue, application is not closing the connection properly. Lots of FIN-WAIT-2 connection ead to a memory overflow.
LAST-ACK: The local end-point has performed a passive close and has initiated an active close by sending a connection termination request to the remote end-point.
CLOSING: The local end-point is waiting for an acknowledgement for a connection termination request before going to the TIME-WAIT state.
TIME-WAIT: The local end-point waits for twice the maximum segment lifetime (MSL) to pass before going to CLOSED to be sure that the remote end-point received the acknowledgement

Thursday, 26 September 2019

Secure WebLogic Cookie





A common Web security problem is session stealing. This happens when an attacker manages to get a copy of your session cookie, generally while the cookie is being transmitted over the network. This can only happen when the data is being sent in clear-text; that is, the cookie is not encrypted.
WebLogic Server allows a user to securely access HTTPS resources in a session that was initiated using HTTP, without loss of session data. To enable this feature, add AuthCookieEnabled="true" to the WebServer element in config.xml:
<WebServer Name="myserver" AuthCookieEnabled="true"/>
Setting AuthCookieEnabled to true, which is the default setting, causes the WebLogic Server instance to send a new secure cookie, _WL_AUTHCOOKIE_JSESSIONID, to the browser when authenticating via an HTTPS connection. Once the secure cookie is set, the session is allowed to access other security-constrained HTTPS resources only if the cookie is sent from the browser.
Thus, WebLogic Server uses two cookies: the JSESSIONID cookie and the _WL_AUTHCOOKIE_JSESSIONID cookie. By default, the JSESSIONID cookie is never secure, but the _WL_AUTHCOOKIE_JSESSIONID cookie is always secure. A secure cookie is only sent when an encrypted communication channel is in use. Assuming a standard HTTPS login (HTTPS is an encrypted HTTP connection), your browser gets both cookies.
For subsequent HTTP access, you are considered authenticated if you have a valid JSESSIONID cookie, but for HTTPS access, you must have both cookies to be considered authenticated. If you only have the JSESSIONID cookie, you must re-authenticate.
With this feature enabled, once you have logged in over HTTPS, the secure cookie is only sent encrypted over the network and therefore can never be stolen in transit. The JSESSIONID cookie is still subject to in-transit hijacking. Therefore, a Web site designer can ensure that session stealing is not a problem by making all sensitive data require HTTPS. While the HTTP session cookie is still vulnerable to being stolen and used, all sensitive operations require the _WL_AUTHCOOKIE_JSESSIONID, which cannot be stolen, so those operations are protected.
You can also specify a cookie name for JSESSIONID or _WL_AUTHCOOKIE_JSESSIONID using the CookieName parameter defined in the weblogic.xml deployment descriptor's <session-descriptor> element, as follows:
<session-descriptor>
    <cookie-name>FOOAPPID</cookie-name>
</session-descriptor>
In this case, Weblogic Server will not use JSESSIONID and _WL_AUTHCOOKIE_JSESSIONID, but FOOAPPID and _WL_AUTHCOOKIE_FOOAPPID to serve the same purpose, as shown in Table 3-1.