Disclaimer

Thursday, 31 October 2024

cluster resource - script

 

crsctl status res |grep -v "^$"|awk -F "=" 'BEGIN {print " "} {printf("%s",NR%4 ? $2"|" : $2"\n")}'|sed -e 's/  *, /,/g' -e 's/, /,/g'|\
awk -F "|" 'BEGIN { printf "%-40s%-35s%-20s%-50s\n","Resource Name","Resource Type","Target ","State" }{ split ($3,trg,",") split ($4,st,",")}{for (i in trg) {printf "%-40s%-35s%-20s%-50s\n",$1,$2,trg[i],st[i]}}'

validate static connect identifier for all - DG Broker - Switchover - Data-guard

 

DGMGRL> validate static connect identifier for all;

Oracle Clusterware is not configured on database "orcldg".
Connecting to database "orcldg" using static connect identifier "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.202)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=orcldg_DGMGRL.priyadba.com)(INSTANCE_NAME=orcldg)(SERVER=DEDICATED)(STATIC_SERVICE=TRUE)))" ...
Unable to connect to database using (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.202)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=orcldg_DGMGRL.priyadba.com)(INSTANCE_NAME=orcldg)(SERVER=DEDICATED)(STATIC_SERVICE=TRUE)))
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

Failed.

Oracle Clusterware is not configured on database "orcl".
Connecting to database "orcl" using static connect identifier "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rac201.priyadba.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=orcl_DGMGRL.priyadba.com)(INSTANCE_NAME=orcl)(SERVER=DEDICATED)(STATIC_SERVICE=TRUE)))" ...
Unable to connect to database using (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rac201.priyadba.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=orcl_DGMGRL.priyadba.com)(INSTANCE_NAME=orcl)(SERVER=DEDICATED)(STATIC_SERVICE=TRUE)))
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

Failed.



DGMGRL> connect sys/Welcome@orcl
Connected to "orcl"
Connected as SYSDBA.
DGMGRL>
DGMGRL>
DGMGRL>
DGMGRL> EDIT DATABASE orcl SET STATIC_CONNECT_IDENTIFIER='(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.201)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=orcl)))';
EDIT DATABASE orcl SET STATIC_CONNECT_IDENTIFIER='(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.201)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=orcl)))';
                       ^
Syntax error before or at "STATIC_CONNECT_IDENTIFIER"
DGMGRL>



DGMGRL> EDIT DATABASE orcl SET PROPERTY StaticConnectIdentifier='(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.201)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=orcl)))';
Property "staticconnectidentifier" updated
DGMGRL>
DGMGRL>



DGMGRL> EDIT DATABASE orcldg SET PROPERTY StaticConnectIdentifier='(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.202)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=orcldg)))';
Property "staticconnectidentifier" updated
DGMGRL>

DGMGRL>
DGMGRL> validate static connect identifier for all;
Oracle Clusterware is not configured on database "orcldg".
Connecting to database "orcldg" using static connect identifier "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.202)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=orcldg)(STATIC_SERVICE=TRUE)))" ...
Succeeded.
The static connect identifier allows for a connection to database "orcldg".

Oracle Clusterware is not configured on database "orcl".
Connecting to database "orcl" using static connect identifier "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.201)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=orcl)(STATIC_SERVICE=TRUE)))" ...
Succeeded.
The static connect identifier allows for a connection to database "orcl".

DGMGRL>
DGMGRL>
DGMGRL>
DGMGRL> switchover to orcldg;
Performing switchover NOW, please wait...
Operation requires a connection to database "orcldg"
Connecting ...
Connected to "orcldg"
Connected as SYSDBA.
New primary database "orcldg" is opening...
Operation requires start up of instance "orcl" on database "orcl"
Starting instance "orcl"...
Connected to an idle instance.
ORACLE instance started.
Connected to "orcl"
Database mounted.
Switchover succeeded, new primary is "orcldg"
DGMGRL>
DGMGRL>
DGMGRL>



Saturday, 26 October 2024

How to change kernel for boot - Linux

 uname -r ---> will display the version of the Linux kernel currently running on your system.

[root@rac201 ~]# uname -r

5.15.0-101.103.2.1.el8uek.x86_64 ---- default one - we will change Kernel

[root@rac201 ~]#

[root@rac201 ~]#

[root@rac201 ~]# ls -l /boot/vmlinuz-*

-rwxr-xr-x. 1 root root 13484336 Aug 31 09:19 /boot/vmlinuz-0-rescue-acb15413f9ad41d1b3edb1e23d4c616b

-rwxr-xr-x. 1 root root 10843648 May 17  2023 /boot/vmlinuz-4.18.0-477.10.1.el8_8.x86_64

-rwxr-xr-x. 1 root root 13484336 May  2  2023 /boot/vmlinuz-5.15.0-101.103.2.1.el8uek.x86_64


[root@rac201 ~]# grubby --set-default /boot/vmlinuz-4.18.0-477.27.1.el8_8.x86_64

The default is /boot/loader/entries/93eed19701864c2cac4193714f746de8-4.18.0-477.27.1.el8_8.x86_64.conf with index 1 and kernel /boot/vmlinuz-4.18.0-477.27.1.el8_8.x86_64


[root@rac201 ~]# shutdown -Fr now



[root@rac201 ~]# uname -r
4.18.0-477.10.1.el8_8.x86_64




How to recovery PDB when PDB database is dropped in Oracle

  How to recovery PDB when PDB database is dropped :) [oracle@rac01 ~]$ sqlplus '/as sysdba' SQL*Plus: Release 21.0.0.0.0 - Product...