header

Commands to test COBOL server express

$PS_HOME/bin> ./ptpdbtst
$PS_HOME/bin> cobrun
$PS_HOME/bin> cob -v
$PS_HOME/bin> cob -V
$PS_HOME/bin> ls -l PSRUN*

Oracle cold backup database refresh

1.  Prepare controlfile creation script.  This can be done by
alter database backup controlfile to trace as '/export/home/oracle/ctlfile.sql';
2.  View the edit ctlfile.sql, so that it should contain the following
CREATE CONTROLFILE SET DATABASE "UATDB" RESETLOGS NOARCHIVELOG
  MAXLOGFILES 16
  MAXLOGMEMBERS 3
  MAXDATAFILES 100
  MAXINSTANCES 1
  MAXLOGHISTORY 453
LOGFILE
  GROUP 1 '/u01/oradata/UATDB/redo01.log' SIZE 200M,
  GROUP 2 '/u02/oradata/UATDB/redo02.log' SIZE 200M,
  GROUP 3 '/u03/oradata/UATDB/redo03.log' SIZE 200M
-- STANDBY LOGFILE
DATAFILE
  '/u01/oradata/UATDB/system01.dbf',
  '/u01/oradata/UATDB/undotbs01.dbf',
  '/u01/oradata/UATDB/users01.dbf',
  '/u01/oradata/UATDB/data01.dbf',
  '/u01/oradata/UATDB/tools01.dbf',
  '/u01/oradata/UATDB/perfstat01.dbf',
  '/u01/oradata/UATDB/sysaux01.dbf'
CHARACTER SET WE8ISO8859P1
;
3. Gernerate script to create TEMP tablespace
set long 2000
select DBMS_METADATA.GET_DDL('TABLESPACE','TEMP') from dual;
4. Shutdown UATDB cleanly
shutdown immediate
5. Copy the cold backup files from production to UAT box.
6. Start the database in nomount state

startup nomount
7. Run the create control file script
@/export/home/oracle/ctlfile.sql
8. Open the database with resetlogs
alter database open resetlogs;
9. Create temp tablespace from the script generated from step 3:
CREATE TEMPORARY TABLESPACE "TEMP1" TEMPFILE
'/u01/oradata/UATDB/TEMP01.dbf' SIZE 5242880000
EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1048576

PeopleSoft database refresh steps

Below are steps can we followed for pre and post refresh of PeopleSoft application environment.Please also  copy the SQR,COBOL,Crystal for file object refresh.


  1. Export any security that you need to preserve from the target database to a flat file. Data Mover is a nice tool to use for this since you can qualify each table with a list of operator ID's to export. The tables you should consider exporting for specific users are PSOPRDEFN, PSOPRALIAS, PSROLEUSER, PSUSERATTR, PSUSEREMAIL, PSUSERPRSNLOPTN, PS_ROLEXLATOPR and PS_RTE_CNTL_RUSER.
  2. Stop the target application environment, including application servers and process schedulers. Stopping the web server is optional since it doesn't connect directly to the database. Be sure to clear cache.
  3. Overlay the target database with a recent backup of the Production database. The exact process will differ for your database platform, but your DBA should be able to do this with minimal direction.
  4. After the database comes back on-line, set DBNAME in PSDBOWNER back to the target database name.
  5. Set GUID to ' ' in the PSOPTIONS table. This will cause PeopleSoft to generate a new GUID so that change assistant can track it separately from the source database.
  6. Delete the data from the reporting tables, process scheduler tables and application messaging tables since this data isn't relevant in the target database. Run prcsclr.dms, rptclr.dms and appmsgpurgeall.dms. In addition, I also delete from the report manager tables PSRF_RATTR_TBL; PSRF_RSCRTY_TBL; PSRF_RINFO_TBL; and delete from PSRF_FINFO_TBL where PSRF_PRNT_FLDR_ID <> 0;
  7. If you have a script to reset everyone's e-mail address to a pre-defined value so that workflow messages from the Test environment don't get sent to real users, run it now. It should update the PSUSEREMAIL and PS_ROLEXLATOPR tables.
  8. Log on to the target database with data mover and run the following command to set the SYSADM password and any other back to it's pre-refreshed value:
    -- Author: Brent Martin, ERP Associates Inc.
    -- Date: February 10, 2006
    -- Purpose: Reset application passwords and purge PeopleTools tables after a database refresh so that
    -- the application can be started with minimal reconfiguration.
    -- Compatibility: This works with PeopleTools 8.4x releases
    -- Notice: This script modifies data in your PeopleSoft database. It changes account passwords, and
    -- it deletes data from process scheduler, report repository and integration broker tables.
    -- It as provided for reference purposes only. Use it at your own risk.

    set log c:\temp\dbrefresh.log;

    -- Change Access Password (SYSADM)
    CHANGE_ACCESS_PASSWORD SYSADM1 CHANGEME1;

    -- Change Application Password (PSAPPS)
    update psoprdefn set OPERPSWD = 'changeme1', encrypted = 0 where oprid = 'PSAPPS';
    encrypt_password PSAPPS;

    -- Set GUID to blank so PSEMAgent and Change Assistant doesn't get confused
    update psoptions set guid = ' ';

    -- Purge Process Scheduler
    RUN h:\fdmo881\scripts\PRCSCLR.DMS;

    -- Purge Report Repository Tables
    RUN h:\fdmo881\scripts\RPTCLR.DMS;

    -- Purge Application Messaging RUN h:\fdmo881\scripts\APPMSGPURGEALL.DMS;
  9. Import the security that you exported in step 1.
  10. While you're in data mover, change the user passwords that are configured in your application server, process scheduler, and integration broker configurations back to the pre-refresh values:
    update psoprdefn set OPERPSWD = 'devpswd', encrypted = 0 where oprid = ('PSAPPS');
    encrypt_password PSAPPS;
    update psoprdefn set OPERPSWD = 'devpswd', encrypted = 0 where oprid = ('PTWEBSERVER');
    encrypt_password PTWEBSERVER;
  11. Clear application server, web server and process scheduler cache if you haven't already done it. Start the target application environment.
  12. Log on through the web front end.
  13. Update the Report Node configuration and verify your Process Scheduler Servers are using the correct configuration. Make any Web Profile changes if needed.
  14. Navigate to PeopleTools > Utilities > Options and update the database name and description.
  15. Change password rules as appropriate for a development environment.
  16. Change your default local node if it should be named differently than the default local node from the source database. If it's not named differently, you may be at risk for a single sign-on vulnerability.
  17. Reconfigure attachment servers (if used)
  18. Reconfigure REN servers and clusters if the application server didn't configure it correctly at startup.
  19. Make sure you copy all of the batch objects (SQR's, Crystal Reports, COBOL programs, etc.) from your source to your target environment to keep the environment in synch. Don't forget to do this on both UNIX and Windows servers.
  20. Perform some sanity checks to make sure the environment is behaving itself before you let users back into it. At a minimum you should verify you can log on and run a report. Verify the report runs to completion, posts, and allows you to view the report without having to sign in a second time.

Windows COBOL compilation(Net Express)

Below are the commands to compile cobol on windows.The .gnt files - executable version of cobol will be generated after compilation and copied to CBLBINU for unicode version and CBLBIN for non unicode . Adjust the paths as necessary.


set PS_HOME=c:\pshome\hcm90

set PATH=%ps_home%\src\cbl\win32;%path%

set COBROOT="c:\program files\micro focus\net express\base"

cd %PS_HOME%\setup

cblbld c: \temp\compile

(make sure you have a space between the c: and the \temp\compile)

Here is the output:

ASCII Cobol Compilations Proceeding

Creating Directory c:\temp\compile

Logging progress to file c:\temp\compile\CBLBLD.LOG

COBOL compiler found in “c:\program files\micro focus\net express\base”  -- note the " and space

The system cannot find the path specified.

Target directory (c:\pshome\hcm90\CBLBINA) exists and is writable



Copying source files …

useful EXCEL formula to generate SQL DDL/grant scripts

TO generate update script:

---------------------------
Enter the formula as below to generate the multiple statement and drag colums to generate DDL statements
=CONCATENATE($E$3,A2,"';")
Where
$E$3 Excel cell -->update psoprdefn set operpswd = ' ' where oprid='  (or similar insert statement)
A2 Excel  cell --> list table names or user name
“’;” --> is a string


To Generate role and permision and grants
----------------------------------------------
="grant select, update, delete, insert on " & A1 & " to user_role;"
="create public synonym " & A1 & " for sysadm." & A1 & ";"


Where
& A1 & Excel column  contains the table list

Purging Web Server Cache with out shutdown

We'll be using the "Purge" servlet directive to make it happen.
To set up your system for servlet directives you need to specify a password in your web profile. So open your web profile (PeopleTools > Web Profile > Web Profile Configuration), navigate to the Custom Properties tab, and look for a property called auditPWD. It should be set to a string, and the property value should be whatever password you want to set. The default is "dayoff". If you make any changes, you'll have to bounce your web server for it to take effect.
Once the auditPWD property is in place, you can simply call the psp servlet with the purge command, and your web server cache will be purged. The syntax of the URL is: http://[server]/psp/[site]/?cmd=purge&pwd=[password]
For example: http://psoft.rajpandian.com:6500/psp/HDEV/?cmd=purge&pwd=dayoff.
Anyway, update the URL with your specific info, paste it into your browser, and the web server cache will be cleared without a web server bounce.
As always, make sure you test these techniques in a non-production database, and use at your own risk! I hope you find them helpful.

PeopleSoft troubleshooting and tracing

Application Engine
Tracing
Use the -TRACE option to trace the SQL executed by an application engine program. You can do this either through the command line debugger or in the override parameters of the process definition.

To trace the PeopleCode executed by an application engine program use the -TOOLSTRACEPC option.

These are the various tracing options and what they do. Like all other PeopleSoft trace flags these are bit fields so if you want trace values 1, 2 and 4, you would set the trace to 1 + 2 + 4 = 7 (-TRACE 7).

Value Trace Setting
0 Disables tracing.
1 Initiates the Application Engine step trace.
2 Initiates the Application Engine SQL trace.
4 Initiates the trace for dedicated temporary table allocation to an Application Engine trace (AET) file. You can trace how the system allocates, locks, and releases temporary tables during program runs.
128 Initiates the statement timings trace to a file, which is similar to the COBOL timings trace to a file.
256 Initiates the PeopleCode detail to the file for the timings trace.
1024 Initiates the statement timings trace, but stores the results in the PS_BAT_TIMINGS_LOG and PS_BAT_TIMINGS_DTL tables.
2048 Requests a database optimizer trace file.
4096 Requests a database optimizer to be inserted in the Explain Plan table of the current database.
8192 Sets a trace for PeopleSoft Integration Broker transform programs.

Note that output from the -TRACE flag goes to the application engine trace (.AET) file. Output from the -TOOLSTRACEPC output goes to the PeopleTools trace file (.TRC).

Command Line Debugging
To run application engine in debug mode, run the following from the command line of %PS_HOME%/bin/client/winx86. You may need to install peopletools locally first.

psae.exe -CT DatabaseType -CD DatabaseInstance -CO OperatorID -CP OperatorPassword
-R RunControl -I ProcessInstance -AI ApplicationEngineProgramName -DEBUG Y

The app engine will log into the database and present you with the following prompt:

PeopleTools 8.48.12 - Application Engine
Copyright (c) 1988-2007 PeopleSoft, Inc.
All Rights Reserved

Application Engine Debugger - enter command or type ? for help.

{APPENGINENAME}.{SECTION}.{FIRST_STEP}>

Note if you get an error about the environment variable PS_SERVER_CFG not being set, you will need to set up the following environment variables:

PS_SERVDIR pointing to your process scheduler location (e.g. %PS_HOME%\appserv\prcs\CS90)
PS_SERVER_CFG pointing to your process scheduler configuration file (e.g. %PS_SERVDIR%\psprcs.cfg)
You can view the current values in the state record, step into code - which will take you into app designer if it is a PeopleCode step. But the best feature is that it allows you to modify the contents of a state record.

Note that the following commands are available in the debugger:

Debug Commands:

(Q)uit Rollback work and end program
E(X)it Commit work and end program (valid between steps)
(C)ommit Commit work (valid between steps)
(B)reak Set or remove a break point
(L)ook Examine state record fields
(M)odify Change a state record field
(W)atch Set or remove a watch field
(S)tep over Execute current step or action and stop
Step (I)nto Go inside current step or called section and stop
Step (O)ut of Execute rest of step or called section and stop
(G)o Resume execution
(R)un to commit Resume execution and stop after next commit




COBOL
This article on COBOL SQL Tracing explains how to enable tracing on a COBOL process definition.

PeopleCode
Tracing PeopleCode
In the set trace flags on the signon page use Each Statement or through PeopleTools -> Utilities -> Debug -> Trace PeopleCode use Show Each to log all the PeopleCode that fires during your trace. This will tell you what PeopleCode and events are firing (and what is not firing) and is usually enough to give you an idea of what is going on. The best thing is that this trace produces a much smaller log file than selecting most of the other PeopleCode trace settings, making the PeopleCode trace manageable!

Writing to a log file
Here's a simple example of how to log to a file. Obivously its not a good idea to use hardcoded absolute paths so adjust this code accordingly.

&fileLog = GetFile("C:\temp\LOGFILE.log", "w", "a", %FilePath_Absolute);
&fileLog.WriteLine("Begin");
&fileLog.WriteLine("End");
&fileLog.Close();

PeopleTools security records

A summary of the main PeopleTools security records.

Operators
Record Description
PSOPRDEFN
Stores all operators (users) in the PeopleSoft system. Also stores their employee ID (EMPLID), encrypted password, primary permission list, default navigator home page, process profile permission list and row security permission list.

PSROLEUSER
The highest level of security access is defined by roles (think of them as groups). This table stores the roles the user belongs to.
PSOPRCLS Roles link together permission lists which are the security objects that define access to components, pages, and other areas of the system. This view returns the permission lists that a user has access to via their roles. Note that prior to PeopleTools 8, permission lists were synonymous with classes and most of the security tables still use this convention.

PSOPRALIAS
Aliases can be mapped to a particular operator ID (user). The obvious alias is employee ID (EMPLID) but others include external organisation ID (EXT_ORG_ID) and customer ID (CUST_ID). All ways of referring to the same entity.

PSOPRALIASTYPE
This is the setup table for operator aliases

PSOPRALIASFIELD
This is the setup table that maps operator aliases to records & fields

PSUSERATTR
User attributes store the a hint password question & response for a user (if this is enabled)

PSUSEREMAIL Email addresses for users.

Roles
======
Record Description
PSROLEDEFN
Stores roles and their properties. Roles can be assigned dynamically through Query, PeopleCode or LDAP. Roles are also used in conjunction with Workflow and routing.
PSROLECLASS
Roles are made of up of one or permission lists, and this table links the two together. Very handy.

Permission Lists
=================
Record Description
PSCLASSDEFN
Permission lists are where the security really happens. They provide access to menus, components and pages and a host of other security including PeopleTools, Process security, Component Interfaces, Web Libraries, Web Services, Personalisations, Query and Mass Change.
PSAUTHITEM
The link between permission lists and menus
PSAUTHBUSCOMP The link between permission lists and component interfaces and their methods
PSAUTHOPTN The link between permission lists and personalisations
PSAUTHPRCS The link between permission lists and process groups
PSAUTHSIGNON The link between permission lists and signon times
PSAUTHWEBLIBVW A view linking permission lists and access to web libraries (really just Menus in PSAUTHITEM that begin with WEBLIB_).
PSAUTHWS The link between permission lists and web services (service operations)
PS_SCRTY_ACC_GRP The link between permission lists, trees and query access groups
PS_MC_OPR_SECURITY The link between permission lists and mass change templates. This is an odd table, it uses the field OPRID but really it links permission lists

Check out this forum post for details about how to check which users have access to PeopleTools.

Portal
The PeopleSoft Enterprise Portal basically refers to the navigation system that links menus and components to the PeopleSoft online interface, navigation and search functionality. Access to anything in the online application is handled through portal security. The records associated with this include:

Record Description
PSPRSMDEFN Stores the structure of the portal registry. This data is stored in a hierarchical (tree) structure within the table. The field PORTAL_URI_SEG1 is the menu, PORTAL_URI_SEG2 is the component, and PORTAL_URI_SEG3 is the market.
PSPRSMPERM Stores permission lists associated with access to everything within the portal registry

which users have access to a particular page

Find out which users (and from what permission lists) have access to a particular page:

select distinct OPRID, OPRCLASS
from PSOPRCLS
where OPRCLASS in (
select distinct CLASSID
from sysadm.PSAUTHITEM
where PNLITEMNAME = ''
);

Query to find processes by process status

The following query will give you a summary of the requested processes by process status.

select
RQST.RUNSTATUS,
RQST.PRCSTYPE,
(
select XLAT.XLATLONGNAME
from PSXLATITEM XLAT
where XLAT.EFFDT = (
select max(XLAT_ED.EFFDT)
from PSXLATITEM XLAT_ED
where XLAT_ED.FIELDNAME = XLAT.FIELDNAME
and XLAT_ED.FIELDVALUE = XLAT.FIELDVALUE
) and XLAT.FIELDNAME = 'RUNSTATUS'
and XLAT.FIELDVALUE = RQST.RUNSTATUS
) as RUNSTATUS_XLAT,
count(RQST.PRCSINSTANCE) as TOTAL_PROCESSES,
min(RUNDTTM) as FIRST_OCCURRED,
max(RUNDTTM) as LAST_OCCURRED
from PSPRCSRQST RQST
group by RQST.RUNSTATUS, RQST.PRCSTYPE
order by RUNSTATUS_XLAT, RQST.PRCSTYPE

Application Engine programs only stuck at queued

You may find that only application engine programs are stuck at queued while other processes (SQRs, crystals etc) run to success. This typically happens due to processes blocking the process scheduler queue. Check the process scheduler/master process scheduler logs. You might see something like this:

Checking Process cancels...
(NET.113): Client ChkAeStatus3 service request succeeded
Process 2319373 is still running as Session ID 19955
(NET.113): Client ChkAeStatus1 service request succeeded
Process 2319395 is still running as Session ID 19946
(NET.113): Client ChkAeStatus2 service request succeeded
Process 2319404 is still running as Session ID 19950
Application Engine : 3:3
Requests found in Process Request table 3

This indicates that the three process instances, 2319373, 2319395 and 2319404 are all running. As there is a maximum of 3 application engine programs that can run at any one time and there are currently 3 running, all other application engine programs requested will remained at queued. However, the three process instances may not actually be running. If this is the case, these will need to be manually stopped, for example with a process scheduler restart and perhaps by manually killing the processes on the process scheduler server if required.

Process run status

In the PeopleTools 8.4x look at the translates on the field RUNSTATUS or use the query.

select FIELDVALUE, XLATLONGNAME
from PSXLATITEM
where FIELDNAME = 'RUNSTATUS'

Here's a summary of the run status translates (from PeopleTools 8.49). Note that not all of these are active.

Value Status
1 Cancel
2 Delete
3 Error
4 Hold
5 Queued
6 Initiated
7 Processing
8 Cancelled
9 Success
10 Not Successful
11 Posted
12 Unable to Post
13 resend
14 Posting
15 Content Generated
16 Pending
17 Success with Warning
18 Blocked
19 Restart

The following query will give you a summary of the process run statuses in your process request table:

select
RUNSTATUS,
(
select XLATSHORTNAME
from PSXLATITEM
where FIELDNAME = 'RUNSTATUS'
and FIELDVALUE = RUNSTATUS
) as RUNSTATUS_DESCR,
count(PRCSINSTANCE)
from
PSPRCSRQST
group by
RUNSTATUS
order by
RUNSTATUS;

Processes stuck at Queued

There are a number of reasons why a process might be stuck at queued. The most obvious is that the process scheduler is down (check the Servers tab in the process monitor). Beyond this, there are some useful troubleshooting that apply:

Check the following tables:

PSPRCSRQST
PSPRCSQUE
PSPRCSPARMS

The row count should be the same in both tables. If one is out of sync with the other, then it can help to remove orphaned instances in of the tables. Restarting the process scheduler and clearing the process scheduler cache will also fix a number of issues.

EMI calculation using Excel

I mentioned the formula used to calculate an EMI, but putting values in the formula and calculating it is a cumbersome task. So I did some research in Microsoft Excel and found out that it can done quite easily in excel.
EMI calculation in Excel
Step 1: Open the excel sheet and locate the fx button

Step 2: In the pop-up menu, click on Financial Catergory

Step 3: In the Function Name click 'PMT'

Step 4: A box will appear as shown, fill in the values mentioned and you get the EMI.

Good Amazon deals site

I found this site has good one to buy from Amazon

www.deal4low.com

நிழல்

வெயிலின் சோர்வுக்கு
நிழல் தேடினார்
மரம் வெட்டி!

வாழ்க்கை கணக்கு

வாழ்க்கையில்,
அன்பை கூட்டிக்கொள்!
அறிவை பெருக்கிக்கொள்!
இனிமையை
தனிமையால் வகுத்துக்கொள்!
பாவத்தைக் கழித்துக் கொள்!
பிறருடன் சமமாக
வாழ கற்றுக் கொள்...!

Cloning PeopleSoft Database

Overview

This document describes the steps required to create a clone of the PeopleSoft production database. This is the most common task of a PeopleSoft Administrator / in any PeopleSoft upgrade project.

Here are some of the steps that need to be consider when creating a Development or Test environment from a production database on PeopleTools 8.4X.


Steps

1. Create a backup of the production database. (This is your source database)

2. Stop the Target Application Environment. (If application environment is running)



Application Servers
Process Schedulers
Web Servers

3. Overlay the target database with a recent backup of the production database.

4. Start the database

5. Set DBNAME in PSDBOWNER back to the target database name.

UPDATE PSDBOWNER SET DBOWNER = 'Database Name';


6. Set GUID to ' ' in PSOPTIONS table.

UPDATE PSOPTIONS SET GUID = ' ';

This will cause PeopleSoft to generate a new GUID so that change assistant can track it separately from the source database.

7. Delete the data from

Reporting tables
Process scheduler tables
Application messaging tables

This data isn't relevant in the target database.
Below DMS scripts are provided by PeopleSoft. Use these scripts to clean the above tables.
prcsclr.dms (Process Scheduler Tables)
rptclr.dms (Reporting Tables)
appmsgpurgeall.dms (Application Messaging Tables)

8. Reset email address to blank or predefined value.


Since you are creating a clone of the production database you will have actual email address of all the employees. Email address is a very critical data. Reset everyone's e-mail address to a pre-defined value so that workflow messages from the Test environment don't get sent to real users.

Some of the common tables of PeopleSoft ERP are as follows

PSOPRDEFN
PS_ROLEXLATOPR
PSUSEREMAIL


You need to take care of Application specific tables. You can find out these tables by using below script.


SELECT RECNAME
FROM PSRECFIELD B
WHERE EXISTS (SELECT 'X' FROM PSRECDEFN A WHERE RECTYPE = 0 AND A.RECNAME = B.RECNAME)
AND B.FIELDNAME = 'EMAILID'


8. Change application password (VP1)

Logon to PeopleSoft data mover script and execute the below scripts if you want to chage the application password.

UPDATE PSOPRDEFN SET OPERPSWD = 'PASSWORD', ENCRYPTED = 0 WHERE OPRID = VP1;
ENCRYPT_PASSWORD VP1;

Oracle Enqueues

A Latch as used in Oracle is a low-level mechanism for serializing concurrent access to memory structures such as cache buffer headers. A latch is a simple memory structure that averages 100 to 200 bytes in size (actual size is dependent upong the version of Oracle, Operating System and hardware platform). Latches are contained in a state object structure and reside in either fixed SGA (parent latches) or the shared pool. They are set via the hardware-atomic compare-and-swap (CAS) instructions – LOCK CMPXCHG for Intel. Latches can be shared and are used for some AQ operations.

Latch Contention occurs when a process attempts to get a latch but fails because another process already has control of it. If the attempt (get) was issue with in no-wait mode, then return to the calling process with a failure result. If the get was issued in a willing-to-wait mode then continue attempting to obtain the latch until x number of tries is reached.

The term to describe a get that is executed in a willing-to-wait mode that tries repeatedly without acquiring the latch is spinning – the process issues the get, if the latch is already held then the process will sleep, wake up after x amount of time expires and attempts to acquire the latch again.

The process attempting to acquire a latch may be waken by the process that releases the latch but this method isn’t used for all latches.

The following views are used to troubleshoot contention issues:

v$session_event
v$session_wait
v$latchholder
Troubleshooting latch contention consists of first identifying the session(s) that are currently experiencing problems and then identify the latch the session is waiting for and determine if the wait time is significant enough to warrant attention. Identifying the child latch that is involved will help determine if the contention is concentrated on a particular child latch or are many child latches involved.

As of Oracle 10.2 KGX Mutexes replace latches (Kernel Generic MuteX – KGX). Mutexes resemble latches (a physical allocation of memory) only they are lighter weight and consume less memory space. They can also be embedded inside other structures, they have flexible spin/yield/wait strategies defined by the client process and they do not factor into the accounting for GETS,SPINS or YIELDS, only WAITS.

Keep in mind that KGX mutexes are not OS mutexes.

In 11g+ mutexes are used instead of library cache latches. The default for pinning library cache cursors and parent examination for 10.2.0.2+ is mutexes – _kks_use_mutex_pin=true.

Some known mutex types in 11g:

Cursor Parent
Cursor Pin
Cursor Stat
Library Cache
hash table
Mutex Troubleshooting – involves querying the views: v$session_wait, v$mutex_sleep and v$mutex_sleep_history among others. The mutex sleeps are well instrumented in the wait interface and the P1, P2, P3 values contain the hash value of the library cache objects experiencing contention, the session holding the mutex, etc. The views v$event_name and v$session_wait “text” columns document the meaning of P1, P2 and P3. The v$mutex_sleep view shows the wait time and the number of sleeps for each combination of mutex type and location while the v$mutex_sleep_history view shows the last individual occurences of mutex sleeps based on a circular buffer and this view contains the highest level of detail.

Enqueues – Terminology and Views

Locks are called enqueues because the locking mechanism implements an ordered queuing structure for lock waiters. Latches and mutexes do not have sophisticated queuing mechanisms.

Enqueue Resources – v$resource(X$KSQRS)

Enqueue Locks – v$lock(X$KSQEQ)

Enqueue resource types – v$lock_type has two meanings – ID1 and ID2

Slots in a hash table identify a resource. Resources are not locks, they are placeholders that reference the object that can be locked. The unique identifier (primarykey) for a resource will consists of the following:

Resource type (TM, TX, MR, …)
Resource identifier 1 (ID1)
Resource identified 2 (ID2)
Example:
TM-XXXXXXXX-XXXXXXXX
The resource identifiers are used to break down a resource class into individual objects. An example of this would be two tables that both have a TM resource allocated to them in memory. The ID1 specifies the object_id of the table (v$lock_type which contains the meaning of ID1/2 for each resource type).

Locks – provide the link between the resource locked and the holder of that resource. If there are many lock holders on a single resource (assuming compatible mode) then it follows that there will be multiple lock structures pointing to that one resource.

What Character Set Supports Which Language

Overview
This list identifies which Oracle ISO or MSWIN character sets contains which supported language(s). All of these character sets contain the 7-bit ASCII English characters and numerals. Oracle lists both the ISO and MSWIN characteristics and their recommendation is to use the MSWIN database character sets instead of the ISO versions, even if all of your clients are not Windows based. This is simply because the MSWIN database character sets are more comprehensive and support more characters than the ISO database character sets.

There are no problems using a MSWIN database character set on a non-Windows/Unix platform.

You can determine what the current value for your database character set is by executing the following statement:

select value from NLS_DATABASE_PARAMETERS where parameter=’NLS_CHARACTERSET’;

To determine the client setting use ‘NLS_LANG’ instead of ‘NLS_CHARACTERSET’ and see note below.

Character Sets
WE8ISO8859P15 (ISO 8859-15), WE8MSWIN1252 : Albanian, Basque, Breton, Catalan, Cornish, Danish, Dutch, Finnish, French, Frisian, Galician, German, Greenlandic, Irish Gaelic, Italian, Luxembourgish, Norwegian, Portuguese, Rhaeto-Romanic, Scottish Gaelic, Spanish, Swedish and the Euro symbol

EE8ISO8859P2 (ISO 8859-2), EE8MSWIN1250 : Albanian, Croatian, Czech, German, Hungarian, Polish, Slovak, Slovenian, Sorbian

NEE8ISO8859P4 (ISO 8859-4), BLT8MSWIN1257 : Danish, Estonian, Finnish, German, Greenlandic, Latvian, Lithuanian, Norwegian, Sami, Slovenian, Swedish

CL8ISO8859P5 (ISO 8859-5), CL8MSWIN1251 : Bulgarian, Byelorussian, Slavic Macedonian, Russian, Sebian, Ukrainian

AR8ISO8859P6 (ISO 8859-6), AR8MSWIN1256 : Arabic

EL8ISO8859P7 (ISO 8859-7), EL8MSWIN1253 : Greek (monitoniko orthography)

IW8ISO8859P8 (ISO 8859-8), IW8MSWIN1255 : Hebrew

VN8MSWIN1258 : Vietnamese

TH8TISASCII : Thai

JA16SJIS : Japanese

ZHS16GBK : Simplified Chinese

KO16MSWIN949 : Korean

ZHT16HKSCS and ZHT16HKSCS31 : Traditional Chinese (Taiwan)

ZHT16HKSCS and ZHT16HKSCS31 : Traditional Chinese (Hong Kong)

WE8ISO8859P2 (ISO 8859-1) : Albanian, Basque, Breton, Catalan, Cornish, Danish, Dutch, Faroese, French, Finnish, Frisian, Galician, German, Greenlandic, Icelandic, Irish Gaelic (new orthography), Italian, Luxemburgish, Norwegian, Portugese, Rhaeto-Romanic, Scottish Gaelic, Spanish, Swedish

SE8ISO8859P3 (ISO 8859-3) : Esperanto, French, German, Italian, Maltese, Portugese, Turkish

WE8ISO8859P9 (ISO 8859-9) : Albanian, Basque, Breton, Catalan, Cornish, Danish, Dutch, Finnish, French, Galician, German, Greenlandic, Irish Gaelic (new orthography), Italian, Luxemburgish, Norwegian, Portugese, Rhaeto-Romanic, Scottish Gaelic, Spanish, Swedish, Turkish

NE8ISO8859P10 (ISO 8859-10) : Dannish, Estonian, Faroese, Finnish, German, Greenlandic, Icelandic, Irish Gaelic (new orthography), Lithuanian, Norwegian, Sami, Slovenian, Swedish

Notes:
An external resource http://www.eki.ee/letter allows you to choose a language and then it displays an overview of all the charactersets that contain all the letters.

RMAN script

Scripting Oracle RMAN Commands

Two ways to script RMAN, use a command file which is a text file residing in the file system and use a stored script which is stored in the RMAN catalog database and executed from the RMAN command prompt.

Command file to backup the USERS tablespace:

connect target /

connect catalog rman/secretpass@rmancat

run { allocate channel c1 type disk format ‘/orabak/%U’;

backup tablespace users;

}

RMAN> @backup_ts_users.rman

rman @backup_ts_users.rman

rman cmdfile=backup_ts_users.rman

rman target=/ catalog=

rman/secretpass@rmancat

Note that the CONNECT clauses are inside the backup_ts_users.rman command file, so there is no reason to provide the password in the command line – meaning you can eliminate the risk of accidental exposure of the password. Had we not included the password of the catalog user rman inside the command file, we would have had to call the Oracle RMAN executable like above.

To use a command file parameter-driven approach like the following where instead of actual values, the new command file includes the parameters (also known as placeholders or substitution variables) &1 and &2 which with a parameter-driven command file you define any number of parameters in this manner and pass the values at runtime.

connect target /

connect catalog rman/secretpass@rmancat

run { allocate channel c1 type disk format ‘&1/%U’;

backup tablespace &2;

}

A shell script, named backup_ts_generic.sh calls the backup_ts_generic.rman command file with the values /tmp as the backup location for parameter &1 and USERS as the tablespace name for parameter &2:

$ORACLE_HOME/bin/rman <
@backup_ts_generic.rman “/tmp” USERS

EOF

You can make this shell script even more generic so that the parameters are passed from the command line of the file system itself. For example, if you modify the second line in the backup_ts_generic.sh shell script to read:

@backup_ts_generic.rman “/tmp” $1

you will be able to call the backup_ts_generic.rman command file, provide /tmp as the backup location, and pass the tablespace name in the command line. For instance, if you want to backup the MYTS1 tablespace, you can issue the command:

backup_ts_generic.rman MYTS1

To log RMAN scripts via an automated mechanism such as cron in UNIX or Scheduler in Windows, you are not physically watching the command window, so how do you know the output of the Oracle RMAN commands? To capture the output, you can use the log parameter in the Oracle RMAN command line:

rman cmdfile=backup_ts_users.rman log=backup_ts_users.log

Stored Scripts – although command files work pretty well in most cases, they have one huge drawback – a command file should be available on the server where the Oracle RMAN backup is to be run. Otherwise, from within the command file, you have to connect from the Oracle RMAN client to the server by using a connect string:

connect target sys/oracle123@remotedb

There are several problems with this setup. First, the modified command file needs to store the password of SYS or some other user with SYSDBA privilege. In a security-conscious environment that may not be acceptable. Second, the Oracle RMAN client may not be compatible with the Oracle Database release. Finally, for performance reasons, you may very well want to run the Oracle RMAN client on the same server as the database itself. But what if you have databases on different servers? You will have to replicate a command file script to all servers. And when you modify the script you will have to make sure it is copied to all those servers again.

The solution use Oracle RMAN stored scripts, you can create scripts that are stored inside the Oracle RMAN catalog and not on the server itself. Because it is stored inside the Oracle RMAN catalog, you will need to connect to the catalog first, as shown below. To execute this script, al you have to do is call it with the execute command from the Oracle RMAN prompt:

RMAN> run { execute script backup_ts_users; }

Stored script for backing up USERS tablespace:

rman

RMAN> connect target /

RMAN> connect catalog rman/secretpass@rmancat

RMAN> create script backup_ts_users

command ‘Tablespace USERS Backup’

{

allocate channel c1 type disk format ‘c:\temp\%U’;

backup tablespace users;

}

The backup_ts_users stored script created above is available only to the target database to which it is currently connected. It is a local stored script, and you can’t execute a local script for one database in another. To execute a script in multiple databases, create a global stored script by using the keyword GLOBAL between CREATE and SCRIPT. For instance, to create a global script for the one above, replace:

create script backup_ts_users

with

create global script backup_ts_users

Once created, this global stored script can be executed in any database connected to this catalog. If you need to modify the script, there is no need to copy it to all servers or databases; it’s automatically available for execution to all databases connecting to the catalog.

If the global stored script already exists and you want to update it, replace CREATE with REPLACE:

replace global script backup_ts_users

- and include the updated script text.

Parameterization: This backup_ts_users stored script has a very specific purpose – backing up the USERS tablespace. What if you want to backup a different tablespace? Rather than creating multiple scripts, you can create a generic stored script to backup any tablespace.

A stored script merely asks for a value; it does not store the value you used in the script itself:

RMAN> create script backup_ts_any

comment ‘Any Tablespace Backup’

{

allocate channel c1 type disk format ‘c:\temp\%U’;

backup tablespace &1;

}

With the parameterized stored script created, pass the value of the parameter via a USING clause. For example, to backup the SYSTEM tablespace by using this backup_ts_any stored script, use the following Oracle RMAN command:

run { execute script

backup_ts_any using ‘SYSTEM’; }

To display the list of stored scripts:

RMAN> list script names;

RMAN> list global script names;

RMAN> print global script backup_ts_level1_any;

RMAN> delete global script backup_ts_level1_any;

RMAN> create script backup_ts_users

from file ‘backup_ts_users.rman’;

RMAN> print script backup_ts_users to file ‘backup_ts_users.rman’;

Creation of Demo and System PeopleSoft Databases

A PeopleSoft Demo database contains all the data of the System database (tools and application) and demo data needed for testing or demonstration.

If you create the database manually, without using the Database Configuration Wizard, one of the main steps is to create the Data Mover script to import the system/demo data from the *.db files.

After you log in Data Mover (Bootstrap mode) and open the menu File > Database Setup, here are some things to consider:

1. In the second panel of the wizard, in the Database Type frame, you have to select what kind of application to create:
- choose Demo to have your core application along with demo data
- choose System if you don’t need the demo application data

2. Add the PeopleSoft application you want to create along with all the languages you need, no matter if you create a Demo or a System environment.

3. DO NOT ADD the PeopleTools System Database. This is used only if you want to create from scratch a custom application outside the delivered PeopleSoft applications.

4. When you finish this wizard, Data Mover will create a DMS file that will import data from the PS_HOME\data\*.db files according to your previous selections.

According to the PeopleSoft application, the .db files are named as follows:
hcengs.db, hcengl.db, etc. for HRMS
crengs.db, crengl.db, etc. for CRM
epengs.db, epengl.db, etc. for FSCM
lmengs.db, lmengl.db, etc. for ELM
etc.

Replace further xx with hc, cr, ep, lm, etc. according to your application.

The xxengs.db file will create all the Application and PeopleTools tables, and will import the system data. This file needs to be present in the dms script for both the Demo and System environments.

The xxengl.db file will import Application sample data in existing tables. This file needs to be present only in the script for the Demo environment.

The xxfraa.db, xxitaa.db, xxduta.db, etc. files will import language related data in existing tables. These files are needed for both the Demo and System environments.

The ptengs.db is used ONLY if you want to create from scratch a custom application outside the delivered PeopleSoft applications.

5. The logs of the Data Mover import will be found in the path set in Configuration Manager > Profile > Default > Edit > Common > Log Directory. They are in the format xxengs.log, xxengl.log, xxfraa.log, etc. and can be open to see what data has been imported from every *.db file.

How to Hide the New Window, Help, Customize Page and HTTP

To Hide the "New Window" link – uncheck ‘Enable New Window’ on web profile (General tab): PeopleTools > Web Profile > Web Profile Configuration

• To Hide the "Help" link – blank out Help URL on web profile (General tab): PeopleTools > Web Profile > Web Profile Configuration
• To Hide the "Customize Page" link – set the Option Default Value of the User Option CUSTOMPGSET to ‘No’ in Personalization Options : PeopleTools > Personalization > Personalization Options (PPTL option level category)

• To Hide the "HTTP" link – there is currently no delivered method to globally force the removal of the copy URL link which displays as "HTTP". It can be removed on a per-component basis by either un-checking the pagebar or the Copy URL feature in the Application Designer definition. Additionally, Peoplecode could also be customized via the CopyURLLink Page class property. Further customization could also take the path of opening the HTML object PORTAL_UNIHEADER_NNS within Application Designer and customizing the header to remove the links as desired. There are no open enhancement requests to deliver this feature.

Of course all of these items can be removed on a per-component basis by either removing the individual link or disabling the entire Pagebar within Application Designer. This can be access in Application Designer, by right clicking on a Component to access the Component Properties and then navigating to the Internet tab.

Java Script

Script tag is the primary tag which identifies javascript. Any javascript code should be written in between the script tag.



Here the attribute language defines the language used.
For VBscript user it will be vbscript.
The script tag can be written anywhere inside head or body tag of html.

Example:




Alert or Popup:

The in built function alert can be used for creating a alert or popup message.
Use the function with any string as argument.

Example:

vi editor sting search and replace

/string        search forward for string (end with Enter)
     ?string        search backward for string (end with Enter)
     n              repeat the last search (``next search'')
          :s/s1/s2       replace (``substitute'') (the first) s1 in this line by s2
     :lr/s/s1/s2/g  replace all instances of s1 in the line range lr by s2                     (lr is of form `a,b', where a and b are either explicit

pidof COMMAND:

pidof COMMAND:
pidof linux command is used to find the process ID of a running program.

SYNTAX:
The Syntax is
pidof [options..] program

OPTIONS:
-sSingle shot - this instructs the program to only return one pid.
-xScripts too - this causes the program to also return process id's of shells running the named scripts.
-oTells pidof to omit processes with that process id. The special pid %PPID can be used to name the parent process of the pidof program, in other words the calling shell or shell script.


EXAMPLE:
  1. To find a process id of a particular console:
    pidof -s console

    This command prints the process id of the console.

    3189

chown COMMAND:


chown COMMAND:
chown command is used to change the owner / user of the file or directory. This is an admin command, root user only can change the owner of a file or directory.

SYNTAX:
The Syntax is
chown [options] newowner filename/directoryname

OPTIONS:
-RChange the permission on files that are in the subdirectories of the directory that you are currently in.
-cChange the permission for each file.
-fPrevents chown from displaying error messages when it is unable to change the ownership of a file.


EXAMPLE:
  1. chown hiox test.txt

    The owner of the 'test.txt' file is root, Change to new user hiox.

  2. chown -R hiox test

    The owner of the 'test' directory is root, With -R option the files and subdirectories user also gets changed.

  3. chown -c hiox calc.txt

    Here change the owner for the specific 'calc.txt' file only

find COMMAND

find COMMAND:
find command finds one or more files assuming that you know their approximate filenames.

SYNTAX:
The Syntax is
find path [options]

OPTIONS:
-nameIt search for the given file, in the current directory or any other subdirectory.
-atime nTrue if the file was accessed n days ago. The access time of directories in path is changed by find itself.
-ctime nTrue if the file's status was changed n days ago.
-group gnameTrue if the file belongs to the group gname. If gname is numeric and does not appear in the /etc/group file, it is taken as a group ID.
-mtime nTrue if the file's data was modified n days ago.
-size n[c]True if the file is n blocks long (512 bytes per block). If n is followed by a c, the size is in bytes.


EXAMPLE:
  1. find -name 'cal.txt'

    The system would search for any file named 'cal.txt' in the current directory and any subdirectory.

  2. find / -name 'cal.txt'

    The system would search for any file named 'cal.txt' on the root and all subdirectories from the root.

  3. find -name '*' -size +1000k

    The system would search for any file in the list that is larger than 1000k.


ifconfig COMMAND

ifconfig COMMAND:
ifconfig command displays information about the network interfaces attached to the system and also used to configure the network interface.

SYNTAX:
The Syntax is
ifconfig [options]

OPTIONS:
-adispalys information about both active and inactive Interface
[interface-name]dispalys information about interface
[interface-name] upActivates the interface
[interface-name] downInactivates the interface
[interface-name] [IP Address] upAssigns IP address to the interface and activates it



EXAMPLE:
  1. To get information of active network-interfaces:
    ifconfig

    The sample output of above command:

    eth0
    Link encap:Ethernet HWaddr 00:14:85:9C:CC:55
    inet addr:192.168.0.12 Bcast:192.168.0.255 Mask:255.255.255.0
    inet6 addr: fe80::214:85ff:fe9c:cc55/64 Scope:Link
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:7856 errors:0 dropped:0 overruns:0 frame:0
    TX packets:7856 errors:0 dropped:0 overruns:0 carrier:0
    RX bytes:492016 (480.4 KiB) TX bytes:398 (398.0 b)
    Interrupt:201 Memory:e1000000-0
    lo
    Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0
    inet6 addr: ::1/128 Scope:Host
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:1455 errors:0 dropped:0 overruns:0 frame:0
    TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
    RX bytes:1917382 (1.8 MiB) TX bytes:1917382 (1.8 MiB)
    In above output:
    Link encap:Ethernet-Specifies the type Interface
    HWaddr 00:14:85:9C:CC:55-Specifies the Hardware or MAC address
    inet addr:192.168.0.12-Specifies the IP address assigend to network-interface

  2. To Assign IP address to Network Interface[Ethernet Card]:
    ifconfig eth0 192.168.0.12 up
    The above command will Assign IP address 192.168.0.12 to Ethernet card with name eth0.
  3. To inactivate the Network Interface[Ethernet Card]:
    ifconfig eth0 down
    The above command inactivates the ethernet card.

Tar command

tar COMMAND:
tar command is used to create archive and extract the archive files.

SYNTAX:
The Syntax is
tar [options] [archive-file] [File or directory to be archived]

OPTIONS:

-cCreates Archive
-xExtract the archive
-fcreates archive with give filename
-tdisplays or lists files in archived file
-uarchives and adds to an existing archive file
-vDisplays Verbose Information
-AConcatenates the archive files



EXAMPLE:
  1. To archive a directory or file :
    tar -cvf backup.tar /etc

    This command creates a tarfile called backup.tar which is the archive of /etc directory.

    Where,
    backup.tar- Is a tar file created
    /etc- Is a directory archived

  2. To archive a directory or file and store it in a storage device:
    tar -cvf /dev/fd0 /home/user1/HGB

    This command will archive /etc directory and store it in floppy-disk.

    Where,
    /dev/fd0- Is a floppy-disk name where the archive is stored
    /home/user1/HGB- Is a directory archived

  3. To Extract the archive:
    tar -xvf backup.tar

    This command will extract the backup.tar file

  4. To List The File In An Archive:
    tar -tvf backup.tar

    The above command will display the files and directories that archived in backup.tar.


fgrep COMMAND

fgrep COMMAND:
fgrep command is used to search one or more files for lines that match the given string or word. fgrep is faster than grep search, but less flexible: it can only find fixed text, not regular expressions.

SYNTAX:
The Syntax is
fgrep [options] pattern [file]

OPTIONS:
-aDon't suppress output lines with binary data, treat as text.
-bPrint the byte offset of input file before each line of output.
-cPrint's the count of line matched.
-hPrint matched lines but not filenames.
-iIgnore changes in case; consider upper- and lower-case letters equivalent.
-nPrint line and line number.
-qPrints in quite mode, prints nothing.
-rRecursively read all files in directories and in subdirectories found.
-vPrints all the lines that do not match.
-VPrint Version.
-wMatch on whole word only.



EXAMPLE:
Lets assume that we have a file file1.txt and it has the following data.
ask your technical solution in our forum

  1. To search and print the lines containing forum :
    fgrep 'forum' file1.txt
    fgrep command prints the output as.
    ask your technical solution in our forum