Monday 27 August 2007

PeopleSoft Flashback…

Flashback query has been a boon from Oracle since its introduction in 9i. In a PeopleSoft environment there are many areas a DBA can utilize this feature. The commands are straightforward and will make your life easier if you remember them.
Consider a scenario where you are doing a data fix in production database. You have been extremely busy today and swamped with 4 high priority problem tickets. You maintain your composure and use your multitasking skills.
The Functional Consultant gave you the below SQL to perform the data fix.
DELETE FROM PS_ABC_VCH_APPR WHERE VOUCHER_ID IN (‘7865419’,’7865438’,’7865428’) AND ENTRY_STATUS IN (‘P’,’X’);
It will delete 12 rows and you confirm the same. You issue commit, close the problem ticket and start working on the next high priority ticket. Phew, one down and 3 more to go…
You get a phone call from the functional consultant 15 mins after you closed the data fix problem ticket. He wants to re-open the problem ticket and request a restore. The fix did not work and they have identified a workaround that can be performed online. He thanks you for taking care of this so quickly and requests you to call him when the data is restored. As you hang up, you begin to feel a little bit of nervousness. Did you or did you not take a backup? Then it strikes you that you forgot to take the backup in your rush to execute the ticket and assuming that the functional team rarely request restore!! Hmm…
In these scenarios, the below SQL will be a life saver!
INSERT INTO PS_ABC_VCH_APPR SELECT * FROM PS_ABC_VCH_APPR AS OF TIMESTAMP (SYSTIMESTAMP – INTERVAL ‘20’ MINUTE) WHERE VOUCHER_ID IN (‘7865419’,’7865438’,’7865428’) AND ENTRY_STATUS IN (‘P’,’X’)
The SQL above will insert into PS_ABC_VCH_APPR all rows that existed for the above criteria 20 minutes ago.
Or
INSERT INTO PS_ABC_VCH_APPR SELECT * FROM PS_ABC_VCH_APPR AS OF TIMESTAMP TO_TIMESTAMP(‘24-aug-07 14:35:00′,’DD-MON-YY HH24: MI: SS’)WHERE VOUCHER_ID IN (‘7865419’,’7865438’,’7865428’) AND ENTRY_STATUS IN (‘P’,’X’)
The SQL above will insert into PS_ABC_VCH_APPR all rows that existed for the above criteria at the date and time mentioned.
þ You get a call at 4am from the Help Desk, an incomplete migration yesterday evening has resulted in messing up the data after the custom SQR process ran and failed, the functional analyst is requesting an emergency restore of the database. He wants the database to be restored to a point in time just prior to running the SQR process, and complete the migration. Why does this always happen when you are on-call??
You know that restoring the database is going to take 3-4 hours and keep your finger crossed (hoping the hot backup and archive logs are valid).
Instead, you call the functional analyst, check out the custom SQR process and determine that the batch job only impacts 12 tables. You tell him that it is not too late and you will use the flashback feature to get back the data in those 12 tables to a state prior to execution of the batch job!! This has saved your client 3+hrs of downtime and we all know that time is $$$.
Note 1 – It is not recommended to use the flashback feature as a backup policy but as an option in emergency scenarios where you forgot to take a backup or the backup got corrupted.
Note 2 – Do not forget to read about the limitations. You can only flashback if your UNDO segments have this information. This is driven by the parameter UNDO_RETENTION and the fact that Oracle can only honor if enough undo space is available for active transactions.
Summary – Though we still do not have the capability to flashback in our real life (oh we wish we could go back in time and correct that one mistake we made in our life) but there are many scenarios in a real world PeopleSoft environment which can utilize the flashback feature. We just have to keep our mind open to the possibilities that this feature provides.

Thursday 23 August 2007

How do you determine PeopleSoft Portal Navigation?

I was composing this post when there was a comment from “Spamboy” for my previous post where he provided the SQL to identify the portal navigation. Thanks for your comments!!
In this post I will share the SQL I use when I want to determine the portal navigation. Here it is …
SELECT LPAD(‘–’,2*(LEVEL-1)) || PORTAL_LABEL “NAVIGATION”
FROM (SELECT PORTAL_LABEL, PORTAL_PRNTOBJNAME, PORTAL_OBJNAME, PORTAL_URI_SEG2 FROM PSPRSMDEFN A
WHERE PORTAL_NAME = ‘EMPLOYEE’ ) B
WHERE B.PORTAL_PRNTOBJNAME != ‘ ‘
START WITH (B.PORTAL_URI_SEG2 IN
(SELECT D.PNLGRPNAME
FROM PSMENUITEM A, PSMENUDEFN B, PS_PRCSDEFNPNL C, PSPNLGROUP D
WHERE A.MENUNAME=B.MENUNAME
AND A.PNLGRPNAME = C.PNLGRPNAME
AND A.PNLGRPNAME = D.PNLGRPNAME
AND PRCSNAME LIKE UPPER(‘&PRCSNAME’))
)
CONNECT BY PRIOR B.PORTAL_PRNTOBJNAME = B.PORTAL_OBJNAME;
NAVIGATION
———————————-
Load Transactions into AM
–Load Transactions
–Send/Receive Information
–Asset Management
Also, if you have built the search index (PeopleTools > Portal > Build Registry Search Index) and know the component name. You can directly enter the component name in the search box. Here is what you get.
Portal_search_2 
Read More about  Peoplesoft

Tuesday 21 August 2007

How to determine the PeopleSoft navigation?

While working on my previous projects, I had some difficulties identifying the menu navigation for a process or report in PeopleSoft. So I developed this SQL that will help determine the navigation.
select distinct b.menugroup||’ > ‘ ||b.menulabel||
‘ > ‘||barlabel||’ > ‘||a.itemlabel||’ > ‘
||d.pnlgrpname||’ – ‘||prcstype||’ – ‘||prcsname“Navigation”
from psmenuitem a, psmenudefn b, ps_prcsdefnpnl c, pspnlgroup d
where a.menuname=b.menuname
and a.pnlgrpname = c.pnlgrpname
and a.pnlgrpname = d.pnlgrpname
and prcsname like upper(‘&prcsname’)
group by b.menuname, b.menugroup, b.menulabel, barlabel, a.itemlabel,
d.pnlgrpname, prcstype, prcsname
/
Navigation
—————————————————————————-
Mana&ge Assets > &Interface Asset Information > &Process > &Transaction Loader > RUN_AMIF1000 – Application Engine – AMIF1000

Read More about Peoplesoft Navigation

Friday 17 August 2007

Adding HINT to PeopleSoft Query using Query Manager

As an Oracle DBA administering a PeopleSoft database, we would like to ensure that all PeopleSoft queries (PRIVATE or PUBLIC) are optimized. There is always a possibility of introducing a HINT to tune the SQL generated by PeopleSoft in Query Manager. Here are the steps to add the HINT.
1. Create a new expression
2. Click“Add Field” and select the first field that is used in the query
Hint1_3
3. Add your HINT before the field name in the expression
Hint2_2
4. Click Ok
5. Select the Expression as a field in the query and move it as the first column
6. Deselect the first field A.SETID that has now moved to be the second column
Hint3
7. Now, you have a query ready with your chosen HINT
Hint4
Scenario with DISTINCTIf you have chosen DISTINCT in the query properties then your SQL will appear as shown below.
Hint5
Oracle will ignore the HINT in this case because the DISTINCT precedes the HINT. To correct this behavior follow the below steps.
1. From the query properties uncheck “DISTINCT”
Hint6
2. Edit the expression holding the HINT and add DISTINCT as shown below.
Hint7
3. Now the query SQL will appear corrected.
Hint8 
Read More about  Peoplesoft

Monday 13 August 2007

Demystifying PSPROJECTITEM -Part 2

Continuing from my previous post, here are the steps to load the upg.sqc data relevant for our manipulation into the Oracle database.
1. Create record HX_COMP_TBL in App Designer as shown below.
Recdefn_3
2. Build/create the table
3. Add it to Query Security if you need to access it using PeopleSoft Query Manager.
4. Create Download upg_sqc.txt file
5. Create SQL*Loader control file as shown below.
load data
infile ‘/export/home/npai/psprojectitem/upg_sqc.txt’
into table PS_HX_CMP_TBL
fields terminated by ” ” optionally enclosed by ‘”‘
(OBJ_DESCR2, OBJNAME, VAL1)
6. Execute sqlldr command to load the file
sqlldr sysadm/sysadm@ftest control=sqlld.ctl
7. Use it in query through Query Manager or SQLPLUS
Read More about  Peoplesoft

Thursday 9 August 2007

Demystifying PSPROJECTITEM – Part 1


As a DBA, I do not always trust Application Designer when it comes to following tasks.
  • Merging projects – typical example is migration of 2 or more bundles using a merged project.
  • Quickly changing the update flags based on KEEP/DROP decisions on a huge project
  • Any other manipulations
Interpreting Data in PSPROJECTITEM can help you get one step closer to sailing through some of the above mentioned problems.
The following columns provided me with significant information to understand the data in PSPROJECTITEM table.
Column Name
PROJECTNAME
OBJECTTYPE
OBJECTVALUE1
OBJECTVALUE2
OBJECTVALUE3
OBJECTVALUE4
SOURCESTATUS
TARGETSTATUS
UPGRADEACTION
TAKEACTION
COPYDONE
The translation for OBJECTTYPE, SOURCESTATUS, TARGETSTATUS, and UPGRADEACTION are not present in the PeopleSoft database (unlike application translates which are available in PSXLATITEM). The translation for these columns exists in delivered upg.sqc.
In my next post, I will share with you a technique I use to quickly decode the data instead of having to refer back to upg.sqc.