Posts

Postgres: Role and group memberships

Role and Group Memberships Since users often inherit permissions from groups (roles), use this to see what roles they belong to:     SELECT r.rolname as username,         ARRAY(SELECT b.rolname               FROM pg_catalog.pg_auth_members m               JOIN pg_catalog.pg_roles b ON (m.roleid = b.oid)               WHERE m.member = r.oid) as member_of FROM pg_catalog.pg_roles r WHERE r.rolname = 'edduser';  Understanding Privilege Abbreviations When using commands like \dp, you will see a string of letters like arwdDxt. These correspond to: r: SELECT (read) w: UPDATE (write) a: INSERT (append) d: DELETE D: TRUNCATE x: REFERENCES t: TRIGGER U: USAGE (for schemas/sequences) C: CREATE (for databases/schemas) c: CONNECT (for databases) 

Postgres: To see every table a specific user has been granted access to

 SELECT grantee, privilege_type, table_name  FROM information_schema.role_table_grants  WHERE grantee = 'YOUR_USER_NAME'; -- WHERE grantee = 'edduser' -- order by table_name;
TABLES:-   SELECT table_schema, table_name, table_type FROM information_schema.tables ORDER BY table_schema, table_name; FUNCTIONS: SELECT routine_schema, routine_name FROM information_schema.routines WHERE routine_type = 'FUNCTION' ORDER BY routine_schema, routine_name; ALL OBJECTS SELECT n.nspname as schema_name,        c.relname as object_name,        CASE c.relkind          WHEN 'r' THEN 'table'          WHEN 'v' THEN 'view'          WHEN 'm' THEN 'materialized view'          WHEN 'i' THEN 'index'          WHEN 'S' THEN 'sequence'          WHEN 't' THEN 'TOAST table'          WHEN 'f' THEN 'foreign table'          WHEN 'p' THEN 'partitioned table'          WHEN 'I' THEN 'partitioned index'     ...

Postgres: To gernerate list of schemas

  select distinct table_schema from information_schema . tables ORDER BY table_schema ;

Oracle: Check Patching backup files

  Hello How to check the patching backup files Check what patches OPatch thinks are installed:   $ORACLE_HOME /OPatch/opatch lsinventory $ORACLE_HOME /OPatch/opatch lsinventory  -detail   Oracle documents  lsinventory  as the standard way to verify applied patches and Oracle home inventory state. Check whether rollback files exist under  .patch_storage :   cd   $ORACLE_HOME ls   -ld  .patch_storage find  .patch_storage  -maxdepth   2   -type  d |  sort du  -sh  .patch_storage   If the patch was applied normally, you should see patch-related content there, because OPatch saves the replaced files in  $ORACLE_HOME/.patch_storage  during installation. Check OPatch logs and history:   ls   -ltr   $ORACLE_HOME /cfgtoollogs/opatch tail  -100   $ORACLE_HOME /cfgtoollogs/opatch/history.txt   Regards Martin Gomez 

Oracle: Check patches applied

  select ACTION,ACTION_TIME,PATCH_ID,PATCH_UID,STATUS,DESCRIPTION from dba_registry_sqlpatch order by 2;   I also check for INVALIDs:-   select COMP_ID, COMP_NAME, VERSION, STATUS from dba_registry; select OWNER, OBJECT_NAME, OBJECT_TYPE, STATUS from dba_objects where STATUS = 'INVALID';  

PeopleSoft: PGP / SSH / cryto - cipher

 Legacy comunication mode - crpto - PGP rhel 5 ,  backward compatibility