lundi 12 août 2019

Concepts Of SCAN Part1



In Oracle Database 11g, Oracle brought about a lot of features. One of the major change was the implementation of SCAN (Single Client Access Name). So this feature is not understood by many people. So this article will helps you to definitively know what SCAN is.
But before, let us understand how an application connects and works to the Database.

When an application connects to the Oracle Database, it contacts a listener would have to then, get connected to the instance. When a RAC database, for example when you have two nodes, there are two instances running  on two different hosts which have their own respective IP addresses. Additionally, the Clusterware which is the software that manages the cluster would also have something called a Virtual Ip, VIP, that it will assign to both the nodes:




So when one instance goes down, the virtual Ip will fail over to the other node. Thereby, when the request comes to connect to the VIP, It can communicate by saying : That node is down and hence the client can now connect to another node.
 


But how the client will connect to the other node? Let's going back to the client connectivity settings. On the application, you would now have not just a single host name specified, instead you will list all the host name, which are part of the cluster and you will not give the host name, instead you will give the VIP name.


That means, if you have four nodes cluster, you would have four host names for Ip addresses which managed by the operating system. Apart from that, when you create the cluster, you will give 4 VIPs and 4 VIP names or VIP host names, which will be associated with all the 4 nodes.
The host names and the Ips address are managed by the operating system, whereas the VIP and the VIP names are managed by the clusterware.


So, when the node 1 goes down, the VIP will fail over to another node and it will still respond, but you notice that the VIP will take a new connection request when it has failed over. It's only going back to the application to say that : That VIP is down. So in your client, you will list all the VIPs. If it want connect, it can look at any one of the VIPs and get connected. In our case above, it will try the first VIP, if it could connect, it gets connected. If not, it will try the second. If not it will try the third etc. That is how in RAC environment, VIPs come playing with the application. So Application don't necessary need to know which nodes are up. The process of connection will take care of Connect Time Failover. If node one has failed, the VIP on node one will have failed over to area, one of the remaining nodes and when the connection request comes, it will immediately tell the client : "Hey I'm not available, please try other node".
This is what database connectivity was established prior Oracle RAC Database 11g release 2. But from 11g release 2 they brought about SCAN. To understand the SCAN, we need first to understand one or more aspect called SERVER POOLS. This will be the purpose of the next article.








































jeudi 1 août 2019

Configuration et Gestion du Flex Cluster et Flex ASM



Configuration et Gestion du Flex Cluster et Flex ASM
Tuesday, July 30, 2019
4:57 PM
Dans les deux précédents articles, nous avons défini et présenté les fonctionnalités d'Oracle Flex Cluster et Flex ASM, introduites dans la version Oracle Database 12c., ainsi que les avantages qu'ils apportent dans le gestion de "Grands" clusters de bases de données. Dans ce dernier numéro de la série, nous allons présenter comment configurer et gérer un tel environnement.


Configurer Oracle Flex Cluster

Le Clusterware Oracle 12c, à partir de la release 1 contient un nouveau mode de configuration qui permet d'activer les  fonctionnalités d'Oracle Flex Cluster. Par défaut, cette fonctionnalité dans un cluster standard est désactivé. L'utilisateur doit explicitement activer cette fonctionnalité en une ou deux façons:
  • Activer l'option Flex Clusters pendant une nouvelle configuration du cluster
  • Modifier une configuration existante du Cluster Standard au Flex Cluster.


 



 

 


A cet étape, vous devez spécifier les nœuds Hub  et les nœuds Leaf ; Tout dépendra de votre architecture.


 

Dans le cadre de la configuration d'Oracle Flex Cluster, Oracle Flex ASM sera implicitement active. Apres l'installation d'Oracle Grid Infrastructure, vous devriez pouvoir vérifier le cluster dans sa nouvelle configuration:

$crsctl get cluster mode status
Cluster is running in "flex" mode

Note : Vous pouvez modifier une cluster standard en mode Flex Cluster.


Gérer Oracle Flex Cluster

  1. Gérer les rôles des nœuds

$crsctl set node role hub or ($crsctl set node role leaf)

Apres cette action, vous devez redémarrer les services de haute disponibilité sur ce nœud (As root)

#crsctl stop crs
#crsctl start crs -wait

$crsctl get node role config
Node 'srvrac01' configured rile is 'hub'

  1. Changer un nœud Leaf en nœud Hub (Vérifier que VIP existe sur ce nœud; sinon, le rajouter)

$srvctl config vip -n srvrac02
             
         PRKO-2310 : VIP does not exist on node srvrac02

           $srvctl add vip -n srvrac02 -A <IP_Adress/Gateway> -k 1

Ensuite appliquer le 1.

  1. Vérifier la taille du Flex Cluster

$crsctl get cluster hubsize
CRS-4950: Current hubsize parameter value is 32

  1. Vérifier le paramètre misscount des nœuds Hub et des nœuds Leaf

Le CSS (Cluster Synchronization Service) dans un environnement RAC a un paramètre appelle misscount, dont la valeur représente le temps maximal, en secondes pendant lequel la pulsation (hearbeat)  réseau peut être manquante, avant d'entrer dans une configuration d'expulsion du cluster, La valeur par défaut est 30 secondes.

Pour vérifier ce paramètre :

$crsctl get css misscount
CRS-4678: Successful get misscount 30 for Cluster Synchronization Services.

$crsctl get css leafmisscount
CRS-4678: Successful get leafmisscount 30 for Cluster Synchronization Services


Activer Flex Cluster et Flex ASM

Vous pouvez transformer un cluster standard en Flex cluster. Pour cela vous avez besoin de configurer le GNS (Grid Naming Service) Ci-dessous les différentes étapes de configuration:

[root@srvrac01 bin]# ./srvctl status gns
PRCS-1065 : GNS server is not configured.

[root@srvrac01 bin]# ./srvctl add gns -vip 10.149.100.110 -domain localdomain
[root@srvrac01 bin]# ./srvctl status gns
GNS is not running.
GNS is enabled.

[root@srvrac01 bin]# ./srvctl start gns
[root@srvrac01 bin]# ./srvctl status gns
GNS is running on node srvrac01.
GNS is enabled on node srvrac01.

[root@srvrac01 bin]# ./crsctl set cluster mode flex
CRS-4973: Flex ASM must be enabled before switching the cluster mode to 'flex'
CRS-4000: Command Set failed, or completed with errors.

[root@srvrac01 bin]# ./asmcmd showclustermode
Connected to an idle instance.
ASM cluster : Flex mode disabled
./ asmca -silent –convertToFlexASM –asmNetworks eth2/192.168.10.42 -asmListenerPort 1521

#cd $ORACLE_BASE/cfgtoollogs/asmca/scripts
Run converttoFlexASM.sh

[root@srvrac01 bin]# ./asmcmd showclustermode
ASM cluster : Flex mode enabled

[root@srvrac01 bin]# ./crsctl set cluster mode flex
Cluster mode set to "flex"

Redémarrer les nœuds du cluster un par un.

Apres la configuration, vous pouvez une instance supplémentaire créée _APX1, +APX2…sur tous les nœuds du cluster.

 



[oracle@srvrac01 bin]$ ./crsctl get cluster mode status
Cluster is running in "flex" mode

[root@srvrac01 bin]# ./oifcfg getif
eno1 10.149.100.0 global public
eno2 10.149.46.0 global cluster_interconnect
eno3 192.168.10.0 global asm

How to Provision Autonomous Database Service in Oracle Database@Google Cloud

    How to Provision Autonomous Database Service in Oracle Database@Google Cloud   Introduction Provisioning- and basic management fun...