Tuesday, September 20, 2016

Important Database monitor commands

How to find SQL,SQL_ID history on Oracle

Session related Queries

Last/Latest Running SQL
-----------------------
set pages 50000 lines 32767
col "Last SQL" for 100
SELECT t.inst_id,s.username, s.sid, s.serial#,t.sql_id,t.sql_text "Last SQL"
FROM gv$session s, gv$sqlarea t
WHERE s.sql_address =t.address AND
s.sql_hash_value =t.hash_value
/

Current Running SQLs
--------------------
set pages 50000 lines 32767
col HOST_NAME for a20
col EVENT for a40
col MACHINE for a30
col SQL_TEXT for a50
col USERNAME for a15

select sid,serial#,a.sql_id,a.SQL_TEXT,S.USERNAME,i.host_name,machine,S.event,S.seconds_in_wait sec_wait,
to_char(logon_time,'DD-MON-RR HH24:MI') login
from gv$session S,gV$SQLAREA A,gv$instance i
where S.username is not null
--  and S.status='ACTIVE'
AND S.sql_address=A.address
and s.inst_id=a.inst_id and i.inst_id = a.inst_id
and sql_text not like 'select S.USERNAME,S.seconds_in_wait%'
/

Current Running SQLs
--------------------
set pages 50000 lines 32767
col program format a20
col sql_text format a50

select b.sid,b.status,b.last_call_et,b.program,c.sql_id,c.sql_text
from v$session b,v$sqlarea c
where b.sql_id=c.sql_id
/

Last/Latest Running SQL
-----------------------
set pages 50000 lines 32767
select inst_id,sample_time,session_id,session_serial#,sql_id from gv$active_session_history
where sql_id is not null
order by 1 desc
/

SQLs Running from longtime
--------------------------
alter session set nls_date_format = 'dd/mm/yyyy hh24:mi';
set pages 50000 lines 32767
col target format a25
col opname format a40
select sid
      ,opname
      ,target
      ,round(sofar/totalwork*100,2)   as percent_done
      ,start_time
      ,last_update_time
      ,time_remaining
from
       v$session_longops
/

Active Sessions running for more than 1 hour
---------------------------------------------
set pages 50000 lines 32767
col USERNAME for a10
col MACHINE for a15
col PROGRAM for a40

SELECT USERNAME,machine,inst_id,sid,serial#,PROGRAM,
to_char(logon_time,'dd-mm-yy hh:mi:ss AM')"Logon Time",
ROUND((SYSDATE-LOGON_TIME)*(24*60),1) as MINUTES_LOGGED_ON,
ROUND(LAST_CALL_ET/60,1) as Minutes_FOR_CURRENT_SQL
From gv$session
WHERE STATUS='ACTIVE'
AND USERNAME IS NOT NULL and ROUND((SYSDATE-LOGON_TIME)*(24*60),1) > 60
ORDER BY MINUTES_LOGGED_ON DESC;

Session details associated with SID and Event waiting for
---------------------------------------------------------
set pages 50000 lines 32767
col EVENT for a40

select a.sid, a.serial#, a.status, a.program, b.event,to_char(a.logon_time, 'dd-mon-yy hh24:mi') LOGON_TIME,to_char(Sysdate, 'dd-mon-yy-hh24:mi') CURRENT_TIME, (a.last_call_et/3600) "Hrs connected" from v$session a,v$session_wait b where a.sid in(&SIDs) and a.sid=b.sid order by 8;

Session details associated with Oracle SID
-------------------------------------------
set head off
set verify off
set echo off
set pages 1500
set linesize 100
set lines 120
prompt
prompt Details of SID / SPID / Client PID
prompt ==================================
select /*+ CHOOSE*/
'Session  Id.............................................: '||s.sid,
'Serial Num..............................................: '||s.serial#,
'User Name ..............................................: '||s.username,
'Session Status .........................................: '||s.status,
'Client Process Id on Client Machine ....................: '||'*'||s.process||'*'  Client,
'Server Process ID ......................................: '||p.spid Server,
'Sql_Address ............................................: '||s.sql_address,
'Sql_hash_value .........................................: '||s.sql_hash_value,
'Schema Name ..... ......................................: '||s.SCHEMANAME,
'Program  ...............................................: '||s.program,
'Module .................................................: '|| s.module,
'Action .................................................: '||s.action,
'Terminal ...............................................: '||s.terminal,
'Client Machine .........................................: '||s.machine,
'LAST_CALL_ET ...........................................: '||s.last_call_et,
'S.LAST_CALL_ET/3600 ....................................: '||s.last_call_et/3600
from v$session s, v$process p
where p.addr=s.paddr and
s.sid=nvl('&sid',s.sid)
/
set head on

Checking for Active Transactions SID
------------------------------------
select username,t.used_ublk,t.used_urec from v$transaction t,v$session s where t.addr=s.taddr;

Session details from Session longops
-------------------------------------
select inst_id,SID,SERIAL#,OPNAME,SOFAR,TOTALWORK,START_TIME,LAST_UPDATE_TIME, username from gv$session_longops;


Session details with SPID
-------------------------
select sid, serial#, USERNAME, STATUS, OSUSER, PROCESS,
MACHINE, MODULE, ACTION, to_char(LOGON_TIME,'yyyy-mm-dd hh24:mi:ss')
from v$session where paddr in (select addr from v$process where spid = '&spid')
/
To find Undo Generated For a given session
------------------------------------------
select  username,
t.used_ublk ,t.used_urec
from    gv$transaction t,gv$session s
where   t.addr=s.taddr and
s.sid='&sid';

To list count of connections from other machines
------------------------------------------------
select count(1),machine from gv$session where inst_id='&inst_id' group by machine;

To get total count of sessions and processes
--------------------------------------------
select count(*) from v$session;

select count(*) from v$process;

select (select count(*) from v$session) sessions, (select count(*) from v$process) processes from dual;

To find sqltext thru sqladdress
-------------------------------
select sql_address from v$session where sid=1999;

select sql_text from v$sqltext where ADDRESS='C00000027FF00AF0' order by PIECE;

To find sqltext for different sql hashvalue
-------------------------------------------
select hash_value,sql_text from v$sql where hash_value in (1937378691,1564286875,
248741712,2235840973,2787402785)

To list long running forms user sessions
----------------------------------------
select s.sid,s.process,p.spid,s.status ,s.action,s.module, (s.last_call_et/3600) from
v$session s, v$process p where round(last_call_et/3600) >4 and action like '%FRM%' and
p.addr=s.paddr ;

To list inactive Sessions respective username
---------------------------------------------
SELECT username,count(*) num_inv_sess
FROM v$session
where last_call_et > 3600
and username is not null
AND STATUS='INACTIVE'
group by username
order by num_inv_sess DESC;

SELECT count(*) FROM v$session where last_call_et > 43200 and username is not null AND
STATUS='INACTIVE';
SELECT count(*) FROM v$session where last_call_et > 3600 and username is not null AND
STATUS='INACTIVE';

To find session id with set of SPIDs
------------------------------------
select sid from v$session, v$process where addr=paddr and spid in ('11555','26265','11533');

To find Sql Text given SQLHASH & SQLADDR
----------------------------------------
select piece,sql_text from v$sqltext where HASH_VALUE = &hash and ADDRESS ='&addr' order by piece;
select piece,sql_text from v$sqltext where  ADDRESS ='&addr' order by piece;

SES Crawler failed with error java.sql.SQLException ORA-06550: line 1, column 14: 2016-08-31 09:05:54.419 NOTIFICATION monitor EQG-30249 Crawler process aborted

SES Crawler failed issue :

Round Trip test logs :


Ping Test Result: Success. Oracle Secure Enterprise Search Admin Service Version 11.2.2.2.0
---------------------------------------------------------------------------------------------
Undeploying. Cleaning up any data previous run
Undeploy completed
---------------------------------------------------------------------------------------------
Deploying search definition
Deployment Complete
---------------------------------------------------------------------------------------------
Starting Crawl
SES crawler status : Launching , time elapsed 10 sec, next check after 10 sec
SES crawler status : Launching , time elapsed 20 sec, next check after 10 sec
SES crawler status : Executing , time elapsed 30 sec, next check after 10 sec
SES crawler status : Executing , time elapsed 40 sec, next check after 10 sec
SES crawler status : Executing , time elapsed 50 sec, next check after 10 sec
SES crawler status : Executing , time elapsed 61 sec, next check after 10 sec
SES crawler status : Executing , time elapsed 71 sec, next check after 10 sec
SES crawler status : Executing , time elapsed 81 sec, next check after 10 sec
SES crawler status : Executing , time elapsed 91 sec, next check after 10 sec
Crawl Failed. Crawler status failed



 Crawler logs :

/*********************************************************************************************************/
"EQG-30102 Unable to execute SQL response hook: java.sql.SQLException ORA-06550: line 1, column 14:
2016-08-31 09:05:54.419 NOTIFICATION monitor EQG-30249 Crawler process aborted
/**********************************************************************************************************/

Solution :

1) From PeopleSoft, please un-deploy all/any index you may have.
2) Delete the current SES instance, as unfortunately we do not have any workaround from development on how to fix the above ORA error at all.
3) Install a fresh SES instance using option 1 as you normally did before.
4) Now please do the following step, before upgrading your Oracle on the SES to 12c:

Please apply BP5 and the post installation steps mentioned in

PeopleTools Certifications - Mandatory Fixes SES 11.2.2.2 PT 8.55 ( Doc ID 2081577.1 )

Please DO NOT apply BP6 now.

Please do not ignore this step.

5) If you wish, please upgrade your Oracle SES to 12c guided by the below solution:

E-SES: Steps for manual upgrade of Oracle SES database from 11.2.0.3/11.2.0.4 to Oracle database 12c on Linux and Windows ( Doc ID 2084851.1 )

6) After you upgrade the database, please don't proceed to applying BP6 now. Do the following:

- Please apply BP5 again now.
- Please confirm that you have performed the post installation steps as explained earlier.
- Please confirm you have applied the CTX patches as advised in our solutions and any other database patches. This is very important.

7) After you confirmed that BP5 and all its post installation steps have been applied, you can now proceed to:

- Apply BP6 first 
- and then BP6+

Very important point : While applying the BP5,BP6 and BP6+ the post patch script should run from this location $SES_MIDTIER_HOME/search/admin/scripts/
or invoke sqlplus from above mention location and then run @eq11222bp.sql. This is to make sure all sub procedure compile and executed other scripts successfully.

Tuesday, September 6, 2016

Record name to find the PeopleSoft Update Image level

Table to find the update image level

SQL> desc PS_UPG_IMAGE_TBL;
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 UPGIMAGENUM                               NOT NULL NUMBER(38)

SQL> select * from PS_UPG_IMAGE_TBL;

UPGIMAGENUM
-----------
         19



Here 19 refer to PUM19

Monday, August 8, 2016

Query to find the Peoplesoft Bundles and Tax Update


How to identify bundles that have been applied?

Bundles Query:

SELECT A.UPDATE_ID, A.DESCR, A.DTTM_IMPORTED, A.FIXOPRID, A.APPLYOPRID, A.PRODUCT_LINE, A.RELEASEDTTM, A.RELEASELABEL, A.MAINTLOGTYPE, A.DESCRLONG FROM PS_MAINTENANCE_LOG A WHERE upper(A.DESCRLONG) like '%BUNDLE%' ORDER BY 2 DESC

Tax Update Query:

SELECT A.UPDATE_ID, A.DESCR, A.DTTM_IMPORTED, A.FIXOPRID, A.APPLYOPRID, A.PRODUCT_LINE, A.RELEASEDTTM, A.RELEASELABEL, A.MAINTLOGTYPE, A.DESCRLONG FROM PS_MAINTENANCE_LOG A WHERE upper(A.DESCRLONG) like '%TAX UPDATE%' ORDER BY 2 DESC

SES Integration with SSL enabled Local Gateway Peoplesoft


Open the People soft URL



1.    Export all SSL certificates from PS URL . Save in notepad. Now open one single notepad & paste all certificate in sequnctial order starting from fi92u.****.eduàCOMODORSADomainValidationSecureServerCA  -à COMODORSACertificationAuthority à AddTrustExternalCARoot 


and save with any filename with extenstion *.cer

PeopleSoft Test Framework Allow Untrusted SSL URL

Apply Below Solution


The PT 8.53.14 PRODUCT PATCH 'ReadMe' file reads.
------------------
From this patch onwards, the 'Allow Untrusted SSL' flag will not be used. If the administrator wants to allow the PTF client access to a server with invalid certificates, it will be necessary to set to active the service operation 'PTTST_CONFIG_NO_SSL'
Set the FLAG for pttst_invaild_ssl to 'Y' in the PSPTTSTCONFIG table.
------------------

1. Navigate to 'PeopleTools -> Integration Broker -> Integration Setup -> Service Operations'

2. Look for the Service Operation 'PTTST_CONFIG_NO_SSL'

3. Check the 'Active' checkbox and save the component.
------------------

Solution for PeopleTools 8.55
PTTST_INVALID_SSL is no longer in PSPTTSTCONFIG in PT 8.55.
The solution in PT 8.55 to allow Untrusted SSL is to activate service operation PTTST_CONFIG_NO_SSL.

Friday, June 17, 2016

PeopleSoft Application Upgrade Techical Overview

PeopleSoft Application Upgrade Technical Architecture Diagram:


                                                              
Technical Summary of the steps involved: 

·        Prepare the Database: We shall ensure the functional and Technical integrity of database, with the help of respective Audit Reports delivered in the certified path. 

·        Apply People Tools Changes: This activity involves the execution of Rel (New Release) scripts so as to perform tools upgrade to 8.54, Analyze the customization if any in the People Tools objects. 

 ·        Run and Review Compare Reports: Generate the Compare report to analyze the customization in the retired object definitions or modified objects definitions and map the requirements feasibility to newly added objects, also Identify the bolt on Objects so as to retain them as is in New Release. 

·        Apply Application Changes: Copy the set of 9.0 Object definitions to Target i.e. Copy of production database. Apply the Upgrade Bundles for Data conversion and Perform Data Conversion for the certified path. 

·        Finalizing the Database Structure: Execute the Scripts to Load Application Data, Run the Final Audit Reports to Ensure Integrity in the Upgraded instance. 

·       Complete Database Changes: Configure the Application server and Web server for the Upgraded instance and setup the PIA. Setup and Synchronize the Security. 

·     Testing the Upgraded Instance: In order to ensure a quality implementation, testing needs to be performed to validate the new system. During this stage conversion, functional, integration, user acceptance, volume/performance and parallel testing will be performed. Parallel testing is optional and will be determined as part of the engagement.

Test Type
Description
Resources
Unit Testing
Unit Testing is the testing of a specific customization, interface, report or configuration within a specific module. 
Typically conducted by developers and those who have configured apiece of functionality. Team leads.
System Testing
System testing is end to end testing. It involves the entire process of a piece of functionality as it moves throughout a module. Also involves testing a specific business process end to end as designed including those outside of the software.
Typically conducted by project team leads.
Integration Testing
Integration testing is the testing of data and processes from end to end across all business areas. Integration testing ensures that the individual modules have been configured appropriately to work together and data flows and resources down the process flow understand how to execute.
Typically conducted by project team leads.
Performance Testing
Performance testing is technical infrastructure testing designed to ensure that positive response times will be achieved while simulating the anticipated stresses and strains on the production system.
Typically conducted by the technical project team.
User Testing
User testing is the end users testing the system which the project team has designed. It is a combination of unit testing, system testing and integration testing.
Typically conducted by the end users of the system.