Posts

LOCKS

########################################################### ---   LOCKS ###########################################################   Run the following query to construct a query that retrieves the row affected by the locked row. Obtain the SID of waiting session from the output of the preceding step.   col SESSIONS format A20 SELECT DECODE(REQUEST,0,'Holder SID: ','Waiter SID: ') || SID SESSIONS, ID1, ID2, LMODE, REQUEST, TYPE FROM V$LOCK WHERE (ID1, ID2, TYPE) IN (SELECT ID1, ID2, TYPE FROM V$LOCK WHERE REQUEST > 0) ORDER BY ID1, REQUEST;     SESSIONS                     ID1         ID2       LMODE     REQUEST TY -------------------- ---------- ---------- ---------- ---------- -- Holder SID: 1             393233     ...

AWR

Image
  ****** AWR ******  Run the following query to display the AWR settings.  By default, the INTERVAL equals to 1 hour and the RETENTION equals to 8 days.    col SNAP_INTERVAL format a20  col RETENTION format a20  col TOPNSQL format a10  SELECT SNAP_INTERVAL, RETENTION, TOPNSQL FROM DBA_HIST_WR_CONTROL;    SNAP_INTERVAL        RETENTION            TOPNSQL -------------------- -------------------- ---------- +00000 01:00:00.0    +00008 00:00:00.0    DEFAULT     Modify the INTERVAL setting to 30 minutes.    BEGIN   DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS(INTERVAL => 30);  END;  /    PL/SQL procedure successfully completed.   SELECT SNAP_INTERVAL, RETENTION, TOPNSQL FROM DBA_HIST_WR_CONTROL;   SNAP_INTERVAL        RETENTION  ...

To change the data directory location for PostgreSQL after installation

 To change the data directory location for PostgreSQL after installation, you'll need to move the existing data to the new location and update PostgreSQL's configuration to use the new directory. Here’s a step-by-step guide to achieve that: 1. Stop PostgreSQL service : First, stop the PostgreSQL service to ensure no data is being accessed or written during the move. sudo systemctl stop postgresql-15 2. Create the new data directory : Create the new directory where you want to move your PostgreSQL data, and set the appropriate permissions for the postgres user. sudo mkdir -p /new/postgres/pg_data sudo chown postgres:postgres /new/postgres/pg_data sudo chmod 700 /new/postgres/pg_data 3. Move the existing data : Move your existing data from the old directory to the new directory. This step will ensure all your current databases and configurations are preserved. sudo rsync -av --progress /var/lib/pgsql/15/data/ /new/postgres/pg_data/ The rsync command helps preserve permission...

DOCKER

Image
Docker : Virtualization splitting  one server into many logical servers with in the limit of server capacity.  Difference between Virtual Machines and Docker Containers (Source: Docker) This makes containers much smaller, faster, and more efficient. While a VM can take about a minute to spin up and can weigh several Gigabytes, a container weighs, on average, 400 to 600mb (the biggest ones). They also take only seconds to spin up. This is mostly because they don't have to spin a whole operating system before running the process. DOCKER  Installation Using username "root". Last login: Wed May 18 16:12:16 2022 from 192.168.2.1 [root@chef-workstation ~]# curl -fsSL https://get.docker.com -o get-docker.sh [root@chef-workstation ~]#  sh get-docker.sh # Executing docker install script, commit: 614d05e0e669a0577500d055677bb6f71e822356 + sh -c 'yum install -y -q yum-utils' Delta RPMs disabled because /usr/bin/applydeltarpm not installed. Warning: RPMDB altered outside of ...