Wednesday, March 20, 2024

RDS Oracle Switchover Activity

 









Thursday, March 14, 2024

ERROR: Unable to verify the graphical display setup. This application requires X display. Make sure that xdpyinfo exist under PATH variable.

 


RPM required to enable X11 display on Linux
---------------------------------------------


yum install  xorg-x11-server-Xorg xorg-x11-xauth xorg-x11-apps -y

Enabling SSH login as root user on Red Hat Enterprise Linux 9 - AWS EC2

Enabling SSH login as root user on Red Hat Enterprise Linux 9 (AWS EC2)


login as root user 


cd /etc/ssh/sshd_config.d


[root@ip-110.1.1.1.1 sshd_config.d]# ls -lrt

total 8

-rw-------. 1 root root 719 Jan  8 12:31 50-redhat.conf

-rw-------. 1 root root  27 Mar 14 16:19 50-cloud-init.conf

[root@ip-110.1.1.1.1 sshd_config.d]#

[root@ip-110.1.1.1.1 sshd_config.d]#

[root@ip-110.1.1.1.1 sshd_config.d]#

[root@ip-110.1.1.1.1 sshd_config.d]# vi 50-cloud-init.conf

[root@ip-110.1.1.1.1 sshd_config.d]#

[root@ip-110.1.1.1.1 sshd_config.d]#

[root@ip-110.1.1.1.1 sshd_config.d]#

[root@ip-110.1.1.1.1 sshd_config.d]#

[root@ip-110.1.1.1.1 sshd_config.d]#

[root@ip-110.1.1.1.1 sshd_config.d]# systemctl status sshd

● sshd.service - OpenSSH server daemon

     Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; preset: enabled)

     Active: active (running) since Thu 2024-03-14 16:17:41 UTC; 1min 49s ago

       Docs: man:sshd(8)

             man:sshd_config(5)

   Main PID: 1301 (sshd)

      Tasks: 1 (limit: 50306)

     Memory: 1.4M

        CPU: 39ms

     CGroup: /system.slice/sshd.service

             └─1301 "sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups"


Mar 14 16:17:41 ip-110.1.1.1.1.ec2.internal systemd[1]: Starting OpenSSH server daemon...

Mar 14 16:17:41 ip-110.1.1.1.1.ec2.internal sshd[1301]: Server listening on 0.0.0.0 port 22.

Mar 14 16:17:41 ip-110.1.1.1.1.ec2.internal sshd[1301]: Server listening on :: port 22.

Mar 14 16:17:41 ip-110.1.1.1.1.ec2.internal systemd[1]: Started OpenSSH server daemon.

Mar 14 16:17:51 ip-110.1.1.1.1.ec2.internal sshd[1302]: error: Received disconnect from 150.242.66.235 port 9857:14: No supp>

Mar 14 16:17:51 ip-110.1.1.1.1.ec2.internal sshd[1302]: Disconnected from authenticating user oracle 150.242.66.235 port 985>

[root@ip-110.1.1.1.1 sshd_config.d]#

[root@ip-110.1.1.1.1 sshd_config.d]#

[root@ip-110.1.1.1.1 sshd_config.d]# systemctl stop sshd

[root@ip-110.1.1.1.1 sshd_config.d]#

[root@ip-110.1.1.1.1 sshd_config.d]#

[root@ip-110.1.1.1.1 sshd_config.d]#

[root@ip-110.1.1.1.1 sshd_config.d]# systemctl status sshd

○ sshd.service - OpenSSH server daemon

     Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; preset: enabled)

     Active: inactive (dead) since Thu 2024-03-14 16:19:45 UTC; 2s ago

   Duration: 2min 3.674s

       Docs: man:sshd(8)

             man:sshd_config(5)

    Process: 1301 ExecStart=/usr/sbin/sshd -D $OPTIONS (code=exited, status=0/SUCCESS)

   Main PID: 1301 (code=exited, status=0/SUCCESS)

        CPU: 41ms


Mar 14 16:17:41 ip-110.1.1.1.1.ec2.internal systemd[1]: Starting OpenSSH server daemon...

Mar 14 16:17:41 ip-110.1.1.1.1.ec2.internal sshd[1301]: Server listening on 0.0.0.0 port 22.

Mar 14 16:17:41 ip-110.1.1.1.1.ec2.internal sshd[1301]: Server listening on :: port 22.

Mar 14 16:17:41 ip-110.1.1.1.1.ec2.internal systemd[1]: Started OpenSSH server daemon.

Mar 14 16:17:51 ip-110.1.1.1.1.ec2.internal sshd[1302]: error: Received disconnect from 150.242.66.235 port 9857:14: No supp>

Mar 14 16:17:51 ip-110.1.1.1.1.ec2.internal sshd[1302]: Disconnected from authenticating user oracle 150.242.66.235 port 985>

Mar 14 16:19:45 ip-110.1.1.1.1.ec2.internal sshd[1301]: Received signal 15; terminating.

Mar 14 16:19:45 ip-110.1.1.1.1.ec2.internal systemd[1]: Stopping OpenSSH server daemon...

Mar 14 16:19:45 ip-110.1.1.1.1.ec2.internal systemd[1]: sshd.service: Deactivated successfully.

Mar 14 16:19:45 ip-110.1.1.1.1.ec2.internal systemd[1]: Stopped OpenSSH server daemon.

[root@ip-110.1.1.1.1 sshd_config.d]#

[root@ip-110.1.1.1.1 sshd_config.d]#

[root@ip-110.1.1.1.1 sshd_config.d]# systemctl start sshd

[root@ip-110.1.1.1.1 sshd_config.d]#

[root@ip-110.1.1.1.1 sshd_config.d]#

[root@ip-110.1.1.1.1 sshd_config.d]#

[root@ip-110.1.1.1.1 sshd_config.d]#

[root@ip-110.1.1.1.1 sshd_config.d]# systemctl status sshd

● sshd.service - OpenSSH server daemon

     Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; preset: enabled)

     Active: active (running) since Thu 2024-03-14 16:19:58 UTC; 3s ago

       Docs: man:sshd(8)

             man:sshd_config(5)

   Main PID: 1327 (sshd)

      Tasks: 1 (limit: 50306)

     Memory: 1.3M

        CPU: 11ms

     CGroup: /system.slice/sshd.service

             └─1327 "sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups"


Mar 14 16:19:58 ip-110.1.1.1.1.ec2.internal systemd[1]: Starting OpenSSH server daemon...

Mar 14 16:19:58 ip-110.1.1.1.1.ec2.internal sshd[1327]: Server listening on 0.0.0.0 port 22.

Mar 14 16:19:58 ip-110.1.1.1.1.ec2.internal sshd[1327]: Server listening on :: port 22.

Mar 14 16:19:58 ip-110.1.1.1.1.ec2.internal systemd[1]: Started OpenSSH server daemon.

[root@ip-110.1.1.1.1 sshd_config.d]#

[root@ip-110.1.1.1.1 sshd_config.d]#

[root@ip-110.1.1.1.1 sshd_config.d]#

[root@ip-110.1.1.1.1 sshd_config.d]#


Oracle SHMMAX and SHMALL parameters

SHMMAX and SHMALL parameters


QUESTION 1

===========

What is the maximum value of SHMMAX for a 32-bit (x86) Linux system?


Oracle Global Customer Support officially recommends a " maximum" for SHMMAX of just less than 4Gb, or 4294967295.


The maximum size of a shared memory segment is limited by the size of the available user address space. On 32-bit systems, this is a theoretical 4GB. The maximum possible value for SHMMAX is just less than 4Gb, or 4294967295. Setting SHMMAX to 4GB exactly will give you 0 bytes as max, as this value is interpreted as a 32-bit number and it wraps around.




QUESTION 2

===========

What is the maximum value of SHMMAX for a 64-bit (x86-64) Linux system?


Oracle Global Customer Support officially recommends a " maximum" for SHMMAX of "1/2 of physical RAM".




System Parameters


SHMMAX - kernel parameter controlling maximum size of one shared memory segment


SHMMNI - kernel parameter controlling maximum number of shared memory segments in the system


SHMSEG - kernel parameter controlling maximum number of shared memory segments a process can attach


SEMMNS - kernel parameter controlling maximum number of semaphores in the system


SEMMNI - kernel parameter controlling maximum number of semaphore sets. Semaphores in Unix are allocated in sets of 1 to SEMMSL.


SEMMSL - kernel parameter controlling maximum number of semaphores in a semaphore set.


SHMLBA - kernel parameter controlling alignment of shared memory segments; all segments must be attached at multiples of this value.

Typically, non-tunable.



SHMMAX is the maximum size of a single shared memory segment set in "bytes"


[root@ip-10.1.1.1.1 ~]# cat /proc/sys/kernel/shmmax

18446744073692774399

[root@ip-10.1.1.1.1 ~]#


SHMALL is the total size of Shared Memory Segments System wide set in "pages".

[root@ip-10.1.1.1.1 ~]#  cat /proc/sys/kernel/shmall

18446744073692774399

[root@ip-10.1.1.1.1 ~]#


The key thing to note here is the value of SHMMAX is set in “bytes” but the value of SHMMALL is set in “pages”.



As SHMALL is the total size of Shard Memory Segments System wide, it should always be less than the Physical Memory on the System and should be greater than sum of SGA’s of all the oracle databases on the server. Once this value (sum of SGA’s) hit the limit, i.e. the value of shmall, then any attempt to start a new database (or even an existing database with a resized SGA) will result in an “out of memory” error (below). This is because there won’t be any more shared memory segments that Linux can allocate for SGA.


ORA-27102: out of memory

Linux-x86_64 Error: 28: No space left on device.


Setting the value for SHMALL to optimal is straight forward. All you want to know is how much “Physical Memory” (excluding Cache/Swap) you have on the system and how much of it should be set aside for Linux Kernel and to be dedicated to Oracle Databases




example 


[root@ip-10.1.1.1.1 ~]# free -g

               total        used        free      shared  buff/cache   available

Mem:               7           0           5           0           1           7

Swap:              0           0           0

[root@ip-10.1.1.1.1 ~]#



 Let say the Physical Memory of a system is 7GB, out of which you want to set aside 2GB for Linux Kernel for OS Operations and dedicate the rest of 5GB to Oracle Databases. Then here’s how you will get the value for SHMALL.

 


[root@ip-10.1.1.1.1 ~]# getconf PAGE_SIZE

4096

[root@ip-10.1.1.1.1 ~]#


or


[root@ip-10.1.1.1.1 ~]# cat /proc/sys/kernel/shmmni

4096

[root@ip-10.1.1.1.1 ~]#


Convert 5GB into bytes and divide by page size


 5gb = 5*1024*1024*1024 =  5,368,709,120 bytes /4096

 

 = 1310720

 






[root@ip-10.1.1.1.1 ~]# ipcs -lm


------ Shared Memory Limits --------

max number of segments = 4096

max seg size (kbytes) = 18014398509465599

max total shared memory (kbytes) = 18446744073709551612

min seg size (bytes) = 1






What’s the optimal value for SHMMAX?


Oracle makes use of one of the 3 memory management models to create the SGA during database startup and it does this in following sequence. First Oracle attempts to use the one-segment model and if this fails, it proceeds with the next one which’s the contiguous multi-segment model and if that fails too, it goes with the last option which is the non-contiguous multi-segment model.


So let’s say if you know the max size of SGA of any database on the server stays below 2GB, you can set shmmax to 2 GB. But say if you have SGA sizes for different databases spread between 512MB to 5GB, then set shmmax to 5Gigs and so on.



Half the size of physical memory in bytes



SHMMNI: parameter recommended as 4096.


SHMALL: parameter recommended as %40 size of physical memory in pages.