Here are some popular commands to use in Oracle Database.
If some of these don’t work, it is most likely permission issues.
Session Wait Events
V$SESSION
V$SESSION_WAIT
V$SESSION_EVENT
V$SESS_TIME_MODEL
Long Running Queries
Session Counters
When you change a field’s size (delivered or custom), you can use the following script to ensure you have all the necessary tables, views, and temporary tables in your project.
A quick trick too: You can mark the records objects as “Do Not Upgrade” in the App Designer project. This allows the “Project” to have a reference for the tables, views, and temporary tables for a quick “Build Project” actions, but doesn’t actually migrate the record definitions. You only need to migrate the Field with the “Upgrade Flag” on, then Build the Project on the target (Alter Tables and Create Views).
Just change the Fieldname in the following SQL.
select DISTINCT R.RECNAME
, case R.RECTYPE when 0 then 'Record' when 1 then 'View' else 'Temp Table' end "RecType Descr"
from PSRECDEFN R, PSRECFIELDALL F
where R.RECNAME = F.RECNAME
AND R.RECTYPE in (0,1,7) --0 is Record, 1 is View, 7 Temp Tables
AND F.FIELDNAME IN ('ITEM_FIELD_C30_A')
ORDER BY 1;
Once you have an App Designer Project in place, you can run the following SQL to find which record definitions are missing from your project.
Change the Fieldname and Project name:
select DISTINCT R.RECNAME
, case R.RECTYPE when 0 then 'Record' when 1 then 'View' else 'Temp Table' end "RecType Descr"
from PSRECDEFN R, PSRECFIELDALL F
where R.RECNAME = F.RECNAME
AND R.RECTYPE in (0,1,7) --0 is Record, 1 is View, 7 Temp Tables
AND F.FIELDNAME IN ('ITEM_FIELD_C30_A')
and NOT exists (select 'x' from PSPROJECTITEM P
WHERE P.OBJECTTYPE = 0 AND P.OBJECTID1 = 1
AND P.OBJECTVALUE1 = R.RECNAME
AND P.PROJECTNAME LIKE '%1047_EXTEND%')
ORDER BY 1;
This SQL is useful if you want to know which processes a user has recently run.
It shows the Process Name and Type, the Process Description, their Run Control ID, the number of runs, and a min/max on the Run date.
Note: This SQL may have limited data if the process request table gets purged often.
In this SQL, we chose to use the PS_PMN_PRCSLIST view. We also use a process to pull the description from the Process Defn or the Job Defn table (see alias C).
SELECT P.PRCSNAME, P.PRCSTYPE
, C.DESCR "Process Description"
, P.RUNCNTLID
, COUNT(*) "Number of Runs"
, MIN(P.RUNDTTM) "First Ran"
, MAX(P.RUNDTTM) "Last Ran"
FROM PS_PMN_PRCSLIST P
, (SELECT PRCSTYPE, PRCSNAME, DESCR FROM PS_PRCSDEFN UNION SELECT 'PSJob', PRCSJOBNAME, DESCR FROM PS_PRCSJOBDEFN) C
WHERE P.PRCSTYPE = C.PRCSTYPE
AND P.PRCSNAME = C.PRCSNAME
AND P.OPRID = 'VP1'
AND P.RUNDTTM > '07/01/2015'
--AND P.PRCSNAME <> 'FS_STREAMLN'
GROUP BY P.PRCSTYPE, P.PRCSNAME, P.RUNCNTLID, C.DESCR
ORDER BY 1,2,3,4
Here are two tricks to get the translate values and the prompt table, from App Designer, without logging into App Designer.
Trick #1
A lot of times, the values you are searching for are in a table called Translates (PSXLATITEM). Most of these are delivered by PeopleSoft. Note that the table is effective dated, but you usually can get by without the effective dated logic. Also, note that the table does not start with PS_, but PS (no underscore). That means it is a tools table, not an application table. Also, use the FIELDVALUE field to link to the actual field. Also, you don’t usually need to outer join this, but for the LEDGER_KK and this field (KK_BUDG_TRANS_TYPE), you should, since only the budget rows use the table.
SELECT * FROM PSXLATITEM
WHERE FIELDNAME = 'KK_BUDG_TRANS_TYPE'
Trick #2
If you can’t find the fieldname in translate table, here is another trick.
Sometimes a field is tied to a prompt table and not the translate table. The developer (on the record definition) will sometimes store the prompt table. The below SQL lets you see what is on the App Designer (without having to log into App Designer). Note: If the prompt value starts with %EditTable, then that means the prompt table is dynamic and a developer will have to find this value for you, in the code.
SELECT RD.RECNAME, RD.RECTYPE, RD.RECDESCR, RI.FIELDNUM, RI.FIELDNAME, RI.RECNAME_PARENT, RI.EDITTABLE
FROM PSRECDEFN RD, PSRECFIELDDB RI
WHERE RD.RECNAME = RI.RECNAME
AND RD.RECNAME = 'LEDGER_KK'
ORDER BY RI.FIELDNUM
Enjoy.
This script will list all of the recent projects in a non-production environment, that may need to be backed up before a refresh.
If your development environment is about to be refreshed with a copy of production, you may have the same nagging feeling I get: what if I have a development project that I forgot to back up. True, you can have your admin dba backup development before the refresh, but restoring the backup may not be time well spent for your admin dba.
I built the following script to show all project definitions, in descending order of last touched, to show me which projects I may want to backup on my own. It also has the last target database that was used. If this field is blank (Last Target DB), and the project name is important work, you will want to pay close attention to these.
SELECT P.LASTUPDDTTM, P.PROJECTNAME, P.PROJECTDESCR, P.LASTUPDOPRID, O.OPRDEFNDESC, P.TGTDBNAME "Last Target DB", COUNT(*) "Count of Project Items"
FROM PSPROJECTDEFN P LEFT OUTER JOIN PSOPRDEFN O ON O.OPRID = P.LASTUPDOPRID, PSPROJECTITEM I
WHERE P.PROJECTNAME = I.PROJECTNAME
AND P.LASTUPDDTTM >= '04/20/2016'
GROUP BY P.LASTUPDDTTM, P.PROJECTNAME, P.PROJECTDESCR, P.LASTUPDOPRID, O.OPRDEFNDESC, P.TGTDBNAME
ORDER BY P.LASTUPDDTTM DESC
How to Extract PeopleSoft Trees into a CSV format.
If you have the need to pull tree information into Excel, use the following SQL to easily get the Tree info in a tree level style. The SQL will also pull Leaf information if the tree has leafs.
This SQL only works on trees with 10 or fewer levels..
You will need to change the setid, tree_name and effdt. Also, these fields are found twice in the SQL.
Oracle DB
SELECT SETID, TREE_NAME, EFFDT
, decode(TREE_LEVEL_NUM, 0, TREE_NODE, 1, TREE_NODE, '') "TN1"
, decode(TREE_LEVEL_NUM, 2, TREE_NODE, '') "TN2"
, decode(TREE_LEVEL_NUM, 3, TREE_NODE, '') "TN3"
, decode(TREE_LEVEL_NUM, 4, TREE_NODE, '') "TN4"
, decode(TREE_LEVEL_NUM, 5, TREE_NODE, '') "TN5"
, decode(TREE_LEVEL_NUM, 6, TREE_NODE, '') "TN6"
, decode(TREE_LEVEL_NUM, 7, TREE_NODE, '') "TN7"
, decode(TREE_LEVEL_NUM, 8, TREE_NODE, '') "TN8"
, decode(TREE_LEVEL_NUM, 9, TREE_NODE, '') "TN9"
, decode(TREE_LEVEL_NUM, 10, TREE_NODE, '') "TN10"
, '' "Range"
, TREE_NODE_NUM "Sort Field"
FROM PSTREENODE N
WHERE N.SETID = 'SHARE'
AND N.TREE_NAME = 'DEPT_SECURITY'
AND N.EFFDT = '01-JAN-2011'
UNION
SELECT L.SETID, L.TREE_NAME, L.EFFDT
, '', '', '', '', '', '', '', '', '', ''
, decode(l.dynamic_range, 'Y', '%', decode(L.RANGE_FROM, L.RANGE_TO, L.RANGE_FROM, L.RANGE_FROM || ' to ' || L.RANGE_TO))
, L.TREE_NODE_NUM + .1
FROM PSTREELEAF L, PSTREENODE N
WHERE N.SETID = 'SHARE'
AND N.TREE_NAME = 'DEPT_SECURITY'
AND N.EFFDT = '01-JAN-2011'
AND N.SETID = L.SETID AND N.SETCNTRLVALUE = L.SETCNTRLVALUE AND N.TREE_NAME = L.TREE_NAME AND N.EFFDT = L.EFFDT AND N.TREE_NODE_NUM = L.TREE_NODE_NUM
ORDER BY 15, 14;
MS SQL Server DB
SELECT SETID, TREE_NAME, EFFDT
, CASE TREE_LEVEL_NUM WHEN '0' THEN TREE_NODE WHEN '1' THEN TREE_NODE ELSE '' END AS "TN1"
, CASE TREE_LEVEL_NUM WHEN '2' THEN TREE_NODE ELSE '' END AS "TN2"
, CASE TREE_LEVEL_NUM WHEN '3' THEN TREE_NODE ELSE '' END AS "TN3"
, CASE TREE_LEVEL_NUM WHEN '4' THEN TREE_NODE ELSE '' END AS "TN4"
, CASE TREE_LEVEL_NUM WHEN '5' THEN TREE_NODE ELSE '' END AS "TN5"
, CASE TREE_LEVEL_NUM WHEN '6' THEN TREE_NODE ELSE '' END AS "TN6"
, CASE TREE_LEVEL_NUM WHEN '7' THEN TREE_NODE ELSE '' END AS "TN7"
, CASE TREE_LEVEL_NUM WHEN '8' THEN TREE_NODE ELSE '' END AS "TN8"
, CASE TREE_LEVEL_NUM WHEN '9' THEN TREE_NODE ELSE '' END AS "TN9"
, CASE TREE_LEVEL_NUM WHEN '10' THEN TREE_NODE ELSE '' END AS "TN10"
, '' "Range"
, TREE_NODE_NUM "Sort Field"
FROM PSTREENODE N
WHERE N.SETID = 'SHARE'
AND N.TREE_NAME = 'ACCOUNTS'
AND N.EFFDT = '01-JAN-1901'
UNION
SELECT L.SETID, L.TREE_NAME, L.EFFDT
, '', '', '', '', '', '', '', '', '', ''
, CASE L.DYNAMIC_RANGE WHEN 'Y' THEN '%' ELSE CASE L.RANGE_FROM WHEN L.RANGE_TO THEN RTRIM(L.RANGE_FROM) ELSE RTRIM(L.RANGE_FROM) + ' to ' + RTRIM(L.RANGE_TO) END END
, L.TREE_NODE_NUM + .1
FROM PSTREELEAF L, PSTREENODE N
WHERE N.SETID = 'SHARE'
AND N.TREE_NAME = 'ACCOUNTS'
AND N.EFFDT = '01-JAN-1901'
AND N.SETID = L.SETID AND N.SETCNTRLVALUE = L.SETCNTRLVALUE AND N.TREE_NAME = L.TREE_NAME AND N.EFFDT = L.EFFDT AND N.TREE_NODE_NUM = L.TREE_NODE_NUM
ORDER BY 15, 14
During the upgrade, a large portion of the time is dealt in the Data Conversion area. This is where PeopleSoft executes several Application Engines programs.
More data on how this is constructed will be added soon.
The below SQLs can be used to see how the Data Conversion is progressing.
SELECT RUN_STATUS_FLAG, COUNT(*) from PS_EOUF_DATACONV
WHERE UPG_PATH = 'HC89'
GROUP BY RUN_STATUS_FLAG
-- Value Translation N = Not run, R = Running, Y = Already Run
This next SQL shows what is running. By default, there could be up to three processes running at once.
SELECT A.AE_APPLID, AE_SECTION, A.* from PS_EOUF_RUNSTATUS A
This SQL shows all of the steps that will be run:
SELECT * from PS_EOUF_DATACONV
WHERE UPG_PATH = 'HC89'