Thursday, April 27, 2023

To identify the PeopleSoft Customization

 SELECT A.OBJNAME OBJECT_NAME,(A.DELIVERED+B.CUSTOMIZED) TOTAL_OBJECTS, B.CUSTOMIZED CUSTOMIZED,A.DELIVERED DELIVERED,CASE (A.DELIVERED+B.CUSTOMIZED) WHEN 0 THEN 0 ELSE ROUND(((B.CUSTOMIZED/(A.DELIVERED+B.CUSTOMIZED))*100),2) END CUSTOM_PERCENT FROM (SELECT CASE RECTYPE WHEN 0 THEN 'SQL Record' WHEN 1 THEN 'SQL View' WHEN 2 THEN 'Derived Record' WHEN 3 THEN 'Sub Record' WHEN 4 THEN 'Stored Procedure' WHEN 5 THEN 'Dynamic View' WHEN 6 THEN 'Query View' ELSE 'Temporary Record' END AS OBJNAME,COUNT(*) AS DELIVERED FROM PSRECDEFN WHERE LASTUPDOPRID = 'PPLSOFT' GROUP BY RECTYPE UNION SELECT 'Record Field' AS OBJNAME,COUNT(*) AS DELIVERED FROM PSRECFIELD WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT 'Fields' AS OBJNAME,COUNT(*) AS DELIVERED FROM PSDBFIELD WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT 'Field Format' AS OBJNAME,COUNT(*) AS DELIVERED FROM PSFMTDEFN WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT 'Translates' AS OBJNAME,COUNT(*) AS DELIVERED FROM PSXLATITEM WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT 'Pages' AS OBJNAME,COUNT(*) AS DELIVERED FROM PSPNLDEFN WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT 'Menu' AS OBJNAME,COUNT(*) AS DELIVERED FROM PSMENUDEFN WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT 'Component' AS OBJNAME,COUNT(*) AS DELIVERED FROM PSPNLGRPDEFN WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT 'PeopleCode' AS OBJNAME,COUNT(*) AS DELIVERED FROM PSPCMPROG WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT 'PS Queries' AS OBJNAME,COUNT(*) AS DELIVERED FROM PSQRYDEFN WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT 'Tree Structure' AS OBJNAME,COUNT(*) AS DELIVERED FROM PSTREESTRCT WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT 'Trees' AS OBJNAME,COUNT(*) AS DELIVERED FROM PSTREEDEFN WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT 'Style' AS OBJNAME,COUNT(*) AS DELIVERED FROM PSSTYLEDEFN WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT 'Business Process' AS OBJNAME,COUNT(*) AS DELIVERED FROM PSBUSPROCDEFN WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT 'Activities' AS OBJNAME,COUNT(*) AS DELIVERED FROM PSACTIVITYDEFN WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT 'Process Definition' AS OBJNAME, COUNT(*) AS DELIVERED FROM PS_PRCSDEFN WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT 'Process Server' AS OBJNAME,COUNT(*) AS DELIVERED FROM PS_SERVERDEFN WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT 'Process Types' AS OBJNAME,COUNT(*) AS DELIVERED FROM PS_PRCSTYPEDEFN WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT 'Process Jobs' AS OBJNAME,COUNT(*) AS DELIVERED FROM PS_PRCSJOBDEFN WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT 'Process Recurrances' AS OBJNAME,COUNT(*) AS DELIVERED FROM PS_PRCSRECUR WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT 'Process Control' AS OBJNAME,COUNT(*) AS DELIVERED FROM PS_SCHDLDEFN WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT 'Business Interlinks' AS OBJNAME,COUNT(*) AS DELIVERED FROM PSIODEFN WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT CASE SQLTYPE WHEN '0' THEN 'SQL Object' WHEN '1' THEN 'App. Engine SQL' WHEN '2' THEN 'Record SQL' ELSE 'Transformation SQL' END AS OBJNAME,COUNT(*) AS DELIVERED FROM PSSQLDEFN WHERE LASTUPDOPRID = 'PPLSOFT' GROUP BY SQLTYPE UNION SELECT 'File Layouts' AS OBJNAME,COUNT(*) AS DELIVERED FROM PSFLDDEFN WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT 'Business Components' AS OBJNAME,COUNT(*) AS DELIVERED FROM PSBCDEFN WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT 'Application Engine Program' AS OBJNAME,COUNT(*) AS DELIVERED FROM PSAEAPPLDEFN WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT 'Application Engine Section' AS OBJNAME,COUNT(*) AS DELIVERED FROM PSAESECTDEFN WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT 'Message Nodes' AS OBJNAME,COUNT(*) AS DELIVERED FROM PSMSGNODEDEFN WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT 'Message Channel' AS OBJNAME,COUNT(*) AS DELIVERED FROM PSCHNLDEFN WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT 'Message Definition' AS OBJNAME,COUNT(*) AS DELIVERED FROM PSMSGDEFN WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT 'Approval Rule Set' AS OBJNAME,COUNT(*) AS DELIVERED FROM PS_APPR_RULE_HDR WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT 'Image & HTML Catalog' AS OBJNAME,COUNT(*) AS DELIVERED FROM PSCONTDEFN WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT 'Style Sheets' AS OBJNAME,COUNT(*) AS DELIVERED FROM

PSSTYLSHEETDEFN WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT 'Subscription' AS OBJNAME,COUNT(*) AS DELIVERED FROM PSSUBDEFN WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT 'URL Definition' AS OBJNAME,COUNT(*) AS DELIVERED FROM PSURLDEFN WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT 'Portal Registry' AS OBJNAME,COUNT(*) AS DELIVERED FROM PSPRSMDEFN WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT 'Portal' AS OBJNAME,COUNT(*) AS DELIVERED FROM PSPRDMDEFN WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT 'Application Package' AS OBJNAME,COUNT(*) AS DELIVERED FROM PSPACKAGEDEFN WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT 'Mobile Page' AS OBJNAME,COUNT(*) AS DELIVERED FROM PSMPDEFN WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT 'Problem Definition' AS OBJNAME,COUNT(*) AS DELIVERED FROM PSOPTPRBTYPE WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT 'User Attributes' AS OBJNAME,COUNT(*) AS DELIVERED FROM PSUSERATTR WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT 'Roles' AS OBJNAME,COUNT(*) AS DELIVERED FROM PSROLEDEFN WHERE LASTUPDOPRID = 'PPLSOFT' UNION SELECT 'Permission List' AS OBJNAME,COUNT(*) AS DELIVERED FROM PSCLASSDEFN WHERE LASTUPDOPRID = 'PPLSOFT' ) A, (SELECT CASE RECTYPE WHEN 0 THEN 'SQL Record' WHEN 1 THEN 'SQL View' WHEN 2 THEN 'Derived Record' WHEN 3 THEN 'Sub Record' WHEN 4 THEN 'Stored Procedure' WHEN 5 THEN 'Dynamic View' WHEN 6 THEN 'Query View' ELSE 'Temporary Record' END AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PSRECDEFN WHERE LASTUPDOPRID <> 'PPLSOFT' GROUP BY RECTYPE UNION SELECT 'Record Field' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PSRECFIELD WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT 'Fields' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PSDBFIELD WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT 'Field Format' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PSFMTDEFN WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT 'Translates' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PSXLATITEM WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT 'Pages' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PSPNLDEFN WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT 'Menu' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PSMENUDEFN WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT 'Component' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PSPNLGRPDEFN WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT 'PeopleCode' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PSPCMPROG WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT 'PS Queries' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PSQRYDEFN WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT 'Tree Structure' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PSTREESTRCT WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT 'Trees' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PSTREEDEFN WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT 'Style' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PSSTYLEDEFN WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT 'Business Process' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PSBUSPROCDEFN WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT 'Activities' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PSACTIVITYDEFN WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT 'Process Definition' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PS_PRCSDEFN WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT 'Process Server' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PS_SERVERDEFN WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT 'Process Types' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PS_PRCSTYPEDEFN WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT 'Process Jobs' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PS_PRCSJOBDEFN WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT 'Process Recurrances' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PS_PRCSRECUR WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT 'Process Control' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PS_SCHDLDEFN WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT 'Business Interlinks' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PSIODEFN WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT CASE SQLTYPE WHEN '0' THEN 'SQL Object' WHEN '1' THEN 'App. Engine SQL' WHEN '2' THEN 'Record SQL' ELSE 'Transformation SQL' END AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PSSQLDEFN WHERE LASTUPDOPRID <> 'PPLSOFT' GROUP BY SQLTYPE UNION SELECT 'File Layouts' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PSFLDDEFN WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT 'Business Components' AS

OBJNAME,COUNT(*) AS CUSTOMIZED FROM PSBCDEFN WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT 'Application Engine Program' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PSAEAPPLDEFN WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT 'Application Engine Section' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PSAESECTDEFN WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT 'Message Nodes' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PSMSGNODEDEFN WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT 'Message Channel' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PSCHNLDEFN WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT 'Message Definition' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PSMSGDEFN WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT 'Approval Rule Set' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PS_APPR_RULE_HDR WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT 'Image & HTML Catalog' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PSCONTDEFN WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT 'Style Sheets' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PSSTYLSHEETDEFN WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT 'Subscription' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PSSUBDEFN WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT 'URL Definition' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PSURLDEFN WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT 'Portal Registry' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PSPRSMDEFN WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT 'Portal' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PSPRDMDEFN WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT 'Application Package' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PSPACKAGEDEFN WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT 'Mobile Page' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PSMPDEFN WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT 'Problem Definition' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PSOPTPRBTYPE WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT 'User Attributes' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PSUSERATTR WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT 'Roles' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PSROLEDEFN WHERE LASTUPDOPRID <> 'PPLSOFT' UNION SELECT 'Permission List' AS OBJNAME,COUNT(*) AS CUSTOMIZED FROM PSCLASSDEFN WHERE LASTUPDOPRID <> 'PPLSOFT' ) B WHERE A.OBJNAME = B.OBJNAME ORDER BY A.OBJNAME

Sunday, January 8, 2023

Some important OS Command

 Copy xauthority from home directory.

xauth add $DISPLAY . hexkey

*********************************
DB commands to alter user

ALTER USER sidney IDENTIFIED BY second_2nd_pwd DEFAULT TABLESPACE example;
ALTER USER sh PROFILE new_profile;
ALTER USER sh DEFAULT ROLE ALL EXCEPT dw_manager;
ALTER USER app_user1 IDENTIFIED GLOBALLY AS 'CN=tom,O=oracle,C=US';

**********************************************
DB commands to create/grant roles to users

select * from dba_users where username like '%PATHEESH%';
create user PATHEESH identified by xxxx profile userprofile default tablespace psdefault temporary tablespace pstemp;
grant create session to PATHEESH;
select * from dba_role_privs where GRANTEE='PBHASKARAN';


select NAME,PASSWORD from user$   -- To encrypt oracle  database password


***************************
DB commands to create/delete/verify database links

select * from dba_db_links;
DROP PUBLIC DATABASE LINK FINLINK.ggg.ORG;
CREATE PUBLIC DATABASE LINK FINLINK.ggg.ORG CONNECT TO username IDENTIFIED BY password USING 'FINUPGT';
select * from dual@FINLINK.ggg.ORG;
select * from psdbowner@FINLINK.ggg.ORG;
*****************************

Unix commands

find . -type f -size +100000000c -exec ls -l {} \; - command to list files larger than 100MB. The dot(.) after find represents current working directory. It can be changed to any path.


find . -type f -size +100000000c -exec gzip {} \; - command to compress/zip files larger than 100MB. The dot(.) after find represents current working directory. It can be changed to any path.


find . -type f -size +100000000c -exec rm {} \; - command to delete files larger than 100MB. The dot(.) after find represents current working directory. It can be changed to any path.

find . -type f -mtime +30 -exec ls -l {} \; - command to list files older than 10 days. The dot(.) after find represents current working directory. It can be changed to any path.


find . -type f -mtime +10 -exec gzip {} \; - command to compress/zip files older than 10 days. The dot(.) after find represents current working directory. It can be changed to any path.


find . -type f -mtime +30 -exec rm {} \; - command to delete files older than 10 days. The dot(.) after find represents current working directory. It can be changed to any path.


find . -type d -ctime +30 -exec rm -rf {} \;


find . -type f -exec grep 'String' {} + - command to list all the files that contains a String/String pattern

tar -cvf folder_name.tar folder_name - command to create a tar archive

tar -xvf folder_name.tar - command to de-archive a tar file

gzip file_name - command to zip a file. In unix/linux a folder cannot be zipped directly. A tar file needs to be created for the folder and then the tar file can be zipped.

gunzip file_name.gz - command to unzip a file

free -m - command to find current memory usage

free | grep Mem | awk '{print $3/$2 * 100.0}' - command to find what percentage of memory is in use

free | grep Mem | awk '{print $4/$2 * 100.0}' - command to find what percentage of memory is free

ps -ef - command to list all the processes that are running on the server

ps -ef | grep domain_name - command to list all applicaiton server, process scheduler and web server process running with the domain_name

ps -ef | grep domain_name | grep java - command to list only web server process running with the domain_name

ps -ef | grep domain_name | grep PIA - command to list only PIA process running with the domain_name



Port Ping Test :

nc -v fdev.dfd.org 23093

lsof -i | grep 23093
lsof -i -P |grep http
netstat -na |grep 55555

Change file permissions :


chmod -R g+rwxs /apps/hr/srce
chmod -R g+rwxs /apps/hr/hris_sr
chgrp -R hrdv /apps/hr/srce
chgrp -R hrdv /apps/hr/hris_sr

To find the large files :


du -a /apps/pstools  | sort -n -r | head -n 20
du -a  /apps/ | sort -n -r | head -n 20

du -a  /home  | sort -n -r | head -n 20


du -a  /apps/pstools/hr/appserv/hr/LOGS | sort -n -r | head -n 20



Find and delete the older files /logs :


find /apps/pstools/finpatch/appserv/prcs/finpatch/LOGS -type f -name '*.LOG' -mtime +30 -exec ls -ltr {} \;


find /apps/pstools/finpatch/appserv/prcs/finpatch/LOGS -type f -name '*.LOG' -mtime +30 -exec rm {} \;



find /apps/pstools/hcmtst02/appserv/hcmtst02/LOGS -type f -name '*.LOG' -mtime +30 -exec rm {} \;


find /apps/pstools/hrdev/appserv/prcs/hrdev/LOGS -type f -name '*.LOG' -mtime +30 -exec rm {} \;


find /apps/hrprod/psreports/hrprod -type f -name '*patdupst_*'

find /apps  -type f -name '*finupgt.ggg.org_*'

finesupgt.ddd.org


To Find the CPU utilization :

ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10

du -a  /apps/pstools/finprd/appserv/prcs/finprd/LOGS | sort -n -r | head -n 20


To Find the memory utilization :

ps -o pid,user,%mem,command ax | sort -b -k3 -r


To Setup Password Less Connection :


findv@adfdeed:[/home/findv] > /usr/bin/ssh\-copy\-id -i .ssh/id_rsa.pub hrdv@hrdv.tty.org


To delete old logs files :


find /apps/hrprod/psreports/hrprod -type f -name 'patdupst*' -mtime +30 -exec ls -ltr {} \;

find /apps/hrprod/psreports/hrprod -type f -name 'patdupst_*.PDF'  -exec ls -ltr {} \ ;


find /apps/pstools/finprod/appserv/prcs/finprod/LOGS  -type f -name '*.LOG*' -mtime +120 -exec ls -ltr {} \;


find /apps/pstools/hcmtst02/appserv/hcmtst02/LOGS -type f -name '*.LOG' -mtime +30 -exec rm {} \;


Soft Link Sample :


ln [-sf] [source] [destination]

    By default, the ln command creates a hard link.
    Use the -s option to create a soft (symbolic) link.
    The -f option will force the command to overwrite a file that already exists.
    Source is the file or directory being linked to.
    Destination is the location to save the link – if this is left blank, the symlink is stored in the current working directory.

For example, create a symbolic link with:

ln -s test_file.txt link_file.txt

This creates a symbolic link (link_file.txt) that points to the test_file.txt.

To verify whether the symlink has been created, use the ls command:

ls -l link_file.txt