Posts

Showing posts from July, 2025

Postgres: To View what is running on the database

 SELECT * FROM pg_stat_activity where state <> 'idle';

Unix: When AD authorization is not working

 [root@db2tst601 ~]# systemctl status sssd ● sssd.service - System Security Services Daemon    Loaded: loaded (/usr/lib/systemd/system/sssd.service; enabled; vendor preset: enabled)    Active: failed (R esult: exit-code) since Tue 2025-07-15 17:30:04 CDT; 2h 22min ago   Process: 49817 ExecStart=/usr/sbin/sssd -i ${DEBUG_LOGGER} (code=exited, status=1/FAILURE)  Main PID: 49817 (code=exited, status=1/FAILURE) Jul 15 17:28:26 db2tst601 sssd_nss[1663851]: Starting up Jul 15 17:28:27 db2tst601 sssd[49817]: Child [49890] ('TMW.COM':'%BE_TMW.COM') was terminated by own WATCHDOG. Consult corresponding logs to figure out the reason. Jul 15 17:28:27 db2tst601 sssd_be[1664041]: Starting up Jul 15 17:28:29 db2tst601 sssd_nss[1664043]: Starting up Jul 15 17:28:33 db2tst601 sssd[49817]: Exiting the SSSD. Could not restart critical service [nss]. Jul 15 17:29:42 db2tst601 sssd_be[1664041]: Shutting down (status = 0) Jul 15 17:29:43 db2tst601 sssd_pam[857047]: Shuttin...

Unix: To check if all the ports are opened

 [root@db2tst601 ~]# iptables -L

Unix: To uncompress a TAR

 tar -xvzf cb.tar.gz

Postgres: To grant access to database objects

1. Grant Access to All Tables in a Schema To grant access to all tables in a specific schema, you can use the following command: Copy the code GRANT SELECT , INSERT , UPDATE , DELETE ON ALL TABLES IN SCHEMA   To ensure the user gets access to future tables created in the schema, use: Copy the code ALTER DEFAULT PRIVILEGES IN SCHEMA schema_name GRANT SELECT , INSERT , UPDATE , DELETE ON TABLES TO user_name; 2. Grant Access to Specific Tables If you want to grant access to specific tables, use: Copy the code GRANT SELECT , INSERT , UPDATE , DELETE ON table_name TO user_name; Replace  table_name  with the name of the table. 3. Grant Read-Only Access For read-only access to all tables in a schema: Copy the code GRANT SELECT ON ALL TABLES IN SCHEMA schema_name TO user_name; And for future tables: Copy the code ALTER DEFAULT PRIVILEGES IN SCHEMA schema_name GRANT SELECT ON TABLES TO user_name; 4. Using Predefined Roles (PostgreSQ...