Monday, November 24, 2025


How we do convert the physical standby pdb database into snapshot standby

 

Below are the step-by-step procedures to convert a Physical Standby PDB (in an Oracle Multitenant Data Guard environment) into a Snapshot Standby, and then convert it back.

Important Notes

·       Snapshot standby conversion is done at the CDB level, not at the PDB level.

·       When you convert a standby to snapshot standby, all PDBs in that standby CDB become writable.

·       You cannot convert only a single PDB to snapshot mode.

·       Your Data Guard configuration must be valid, and redo apply must be STOPPED before conversion.

 

Run these commands on the standby database (CDB-level).

SQL> show pdbs

SQL> CON_ID CON_NAME    OPEN_MODE  RESTRICTED

        --------- -------------        ----------------   ------------------

         2       PDB$SEED     READ ONLY  NO

         3       myfirst_pdb     READ ONLY  NO

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

SQL> alter session set container=myfist_pdb ;

SQL>shutdown immediate

SQL>exit

Sqlplus /  as sysdba

SQL> shutdown immediate

SQL> show pdbs

SQL> CON_ID CON_NAME    OPEN_MODE  RESTRICTED

        --------- -------------        ----------------   ------------------

         2       PDB$SEED     MOUNTED     NO

         3       myfirst_pdb     MOUNTED     NO

 

SQL> alter database convert to snapshot standby ;

SQL> select name,open_mode,data_role from v$database ;

      NAME   OPEN_MODE     DATABASE_ROLE

----------------   ------------------     ---------------------------

Myfin          MOUNTED       SNAPSHOT STANDBY

SQL> Alter database open ;

SQL>Show Pdbs

SQL> CON_ID CON_NAME    OPEN_MODE  RESTRICTED

        --------- -------------        ----------------   ------------------

         2       PDB$SEED     READ ONLY       NO

         3       myfirst_pdb     MOUNTED       NO

SQL> alter session set container=myfirst_pdb ;

SQL> alter database open ;

SQL> CON_ID CON_NAME    OPEN_MODE  RESTRICTED

        --------- -------------        ----------------   ----------------

         3       myfirst_pdb     READ WRITE       NO


Thank you to All ....

Thank you for giving your valuable time to read the above information.

 


Friday, May 24, 2024

==============Using Foreign Data Wrappers to access remote PostgreSQL and Oracle databases and other Database ========


A foreign server typically encapsulates connection information that a foreign-data wrapper uses to access an external data resource. Additional user-specific connection information may be specified by means of user mappings. The server name must be unique within the database.

There are many methods for accessing remote tables data—the data present in the tables existing on the remote database—such as PostgreSQL’s inbuilt dblink module. One of the most popular methods is accessing the table with the help of PostgreSQL Foreign Data Wrapper (postgres_fdw). In addition to postgres_fdw there are other Foreign Data Wrappers such as mongo_fdw, hadoop_fdw, and mysql_fdw,oracle_fdw which can be used to access a MongoDB database, the Hadoop Distributed File System, and data present in a MySQL database, respectively.


postgres_fdw  

For remote access to data in an external PostgreSQL server using postgres_fdw, please refer to the following steps:

create the extension 

For remote access to data in an external PostgreSQL server using postgres_fdw, please refer to the following steps:

login the source database server :

postgres=# 

postgres=# \des

       List of foreign servers

 Name | Owner | Foreign-data wrapper 

------+-------+----------------------

(0 rows)


postgres=# 

ds_sapphire=> select current_database() ;

 current_database 

------------------

 fa_saphire

(1 row)


farukh21@host1 ~]$ psql -U fapphire -d fa_sapphire


Step 1 > Create the extension in the source server ("where you want fetch the data of the schema ")


fa_sapphire=# CREATE EXTENSION postgres_fdw;

CREATE EXTENSION

fa_sapphire=# 

fa_sapphire=# \dx

                               List of installed extensions

     Name     | Version |   Schema   |                    Description                     

--------------+---------+------------+----------------------------------------------------

 plpgsql      | 1.0     | pg_catalog | PL/pgSQL procedural language

 postgres_fdw | 1.1     | public     | foreign-data wrapper for remote PostgreSQL servers

(2 rows)


Step 2:  Create a foreign server for each remote database to which the user wants to connect. Please ensure that the remote database cluster has the pg_hba.conf entry corresponding to the database server for which the foreign server has to be created.


fa_sapphire=# 

fa_sapphire=# CREATE SERVER foreign_sapphire FOREIGN DATA WRAPPER postgres_fdw OPTIONS (host '172.XX.XX.X0 /target_IP', port '5432', dbname 'target_dbname');

CREATE SERVER

fa_sapphire=# 

fa_sapphire=# \des

                 List of foreign servers

        Name         |    Owner    | Foreign-data wrapper 

---------------------+-------------+----------------------

 foreign_fapphire | fapphire | postgres_fdw

(1 row)


Step 3 > create the schemas on source side there can map of remote data through the foreign server 

fa_sapphire=# create schema foreign_fapphire authorization fapphire ;

CREATE SCHEMA

fa_sapphire=# 

fa_sapphire=# CREATE USER MAPPING FOR fapphire SERVER foreign_fapphire OPTIONS (user 'XXXXK', password 'fXXX');

CREATE USER MAPPING

fa_sapphire=# 

fa_sapphire=# IMPORT FOREIGN SCHEMA focus from SERVER foreign_fapphire into foreign_fapphire;

IMPORT FOREIGN SCHEMA

fa_sapphire=# 

fa_sapphire=# 

fa_sapphire=# 

fa_sapphire=# select count(*) from foreign_fapphire.cust_lkodba ;

 count  

--------

 884567

(1 row)

fa_sapphire=# 


Thank you to All ....

Thank you for giving your valuable time to read the above information.


Wednesday, January 17, 2024

 

Add the new disk on the servers and How to mount the disk on the server with the new mount point name?

  1. Temporary Mounting
  2. Permanent Mounting

Temporary Mounting 

This type of mounting is used to temporarily mount a disk or pen-drive on the server. Following are the steps to mount the disk on the server.

Step 1: Add disk from the platform
Step 2
: Login into the server using SSH/Putty

Step 3: Now use lsblk command to list the available disks on the server.




Step 4: Create the partition of the disks which is added in to the server from the storage



Step 5: Now create a filesystem on the disk using mkfs command.

Here xfs is a filesystem we can also use other file system( ext4,ext3,etx2) according to our need.

Step 6: If mounting point is not available on the server so create it using mkdir command


Step 7: Now mount the device using mount command 


Here /dev/sdb1 is device name

/GG is directory or mounting point on which you want to mount the device

But the main drawback of temporary mount is after the server reboot mounting is not persistent on the server, so to mitigate this problem we are going to use permanent mount on the server. Please follow the following steps for permanent mount.

Permanent Mounting

Step1: After formatting the disk UUID is assigned to device so to mount the device permanently 

           A UUID is required. For getting UUID of the device use this command

    



copy the UUID

Step2: For permanent mount we need to edit /etc/fstab file

And we have to add the content in following format


Here First field is the device name or UUID of the device. Here we are using UUID but we can also use device name (exp:-/dev/vdb) to mount the device permanently but recommended is to use UUID level to mount the disk.

Second field specifies the mount point 

Third field specifies the file system of the disk

The fourth field specifies the mount point options. We can specify many mount options separated by the commas. Here we are using defaults

The fifth field specifies the dump utility if we use 0 then it means dump utility not backing up the device. IF we are using this option as 1 then the dump utility should backup the device.

The sixth field specifies the fsck it means file system check at boot time if this value is zero it means file system is not checked at boot time and if we use this option as 1 then it means file system will be checked at boot time. The higher value in this field specifies the priority of file system check of devices.

Note: If you are using Micro host console so you cannot copy UUID then you can redirect the output of the command 

 

 

Thank you to All ....

Thank you for giving your valuable time to read the above information.


Monday, January 1, 2024

 

Root.sh || Error ORA-15238: ORA-15238: ORA-15477: || CLSRSC-258: Failed to configure and start ASM

RHEL 7.6 Oracle grid 12.2.0.1

I was getting this below error when I have to run the root.sh script from the first node, error below when performing installation.

I got the wondering solution after more R&D, now I am sharing solution for helping this post to the DBA community . 

 Error :

 [FATAL] [DBT-30002] Disk group OCRVOTE creation failed.

ORA-15018: diskgroup cannot be created

ORA-15238: 12.2.0.1 is not a valid value for attribute compatible.advm

ORA-15477: cannot communicate with the volume driver

2023/12/31 17:32:55 CLSRSC-184: Configuration of ASM failed

2023/12/31 17:33:01 CLSRSC-258: Failed to configure and start ASM

Died at /u01/sw/grid/crs/install/crsinstall.pm line 2091.


Solution :

before run the "/u01/sw/grid/root.sh" script we need to uninstall  "/u01/sw/grid/root.sh" 

[root@node1 lib]#

[root@node1 lib]# /u01/sw/grid/bin/acfsroot uninstall

ACFS-9312: Existing ADVM/ACFS installation detected.

ACFS-9314: Removing previous ADVM/ACFS installation.

ACFS-9315: Previous ADVM/ACFS components successfully removed.

[root@node1 lib]#

[root@node1 lib]# /u01/sw/grid/root.sh  << run this script firstly from the first node than run from second node 

2024/01/02 00:27:15 CLSRSC-325: Configure Oracle Grid Infrastructure for a Cluster ... succeeded  <<< this message received post successfully ran of the  " /u01/sw/grid/root.sh" grid installation 



Thank you to All ....

Thank you for giving your valuable time to read the above information.



Tuesday, December 5, 2023

      

                Step Install and Configure PostgreSQL on Linux

PostgreSQL also called Postgres is a powerful and open-source object-relational database system. It is an enterprise-level database having features such as write-ahead logging for fault tolerance, asynchronous replication, Multi-Version Concurrency Control (MVCC), online/hot backups, point-in-time recovery, query planner/optimizer, tablespaces, nested transactions (savepoints), etc.

Postgres’s latest version 15.2 was released on 9 February 2023 by the PostgreSQL global development group.

Following step are follow for the PostgreSQL installation on Linux “Red Hat Enterprise Linux Server release 7.6 (Maipo)”

Step1 -  Download the required PostgreSQL software from the this link        https://www.postgresql.org/download/linux/redhat/

To use the PostgreSQL Yum Repository, follow these steps:



Step 2 : 

Post-installation

Due to policies for Red Hat family distributions, the PostgreSQL installation will not be enabled for automatic start or have the database initialized automatically. To make your database installation complete, you need to perform the following steps, based on your distribution:

   postgresql-setup --initdb

   systemctl enable postgresql.service

   systemctl start postgresql.service


Validate the Installation :

 



Thank you to All ....

Thank you for giving your valuable time to read the above information.

Sunday, October 1, 2023

 ============== How to Configure SSH for a RAC Installation ==============

This document will explain how to configure SSH, which is required to run a RAC installation. Following the instructions in the installation guide are also correct, but sometimes this will not work, although the reason for that isn't clear. Therefore, after some investigation it seems to be that the steps below will work too.

Starting with 11gR2 the Oracle Universal Installer the SSH can be setup automatically using the ’SSH Connectivity' button.

In this article, we will show you how to set up password-less login on RHEL-based Linux distributions

Step 1

To configure SSH you need to perform the following steps on each node in the cluster.

$ cd $HOME
$ mkdir .ssh
$ chmod 700 .ssh
$ cd .ssh
$ ssh-keygen -t rsa

Now accept the default location for the key file
Enter and confirm a passphrase. (you can also press enter twice).

$ ssh-keygen -t dsa

At the prompts, accept the default location for the key file (press Enter).
Then press "Enter" twice to accept no passphrase.



===============================================

Please note: SSH with passphrase is not supported for Oracle Clusterware 11g release 2 and later releases.

If you provide a passphrase for pre 11.2 release, then you need to do 2 addition steps.

$ exec /usr/bin/ssh-agent $SHELL
$ /usr/bin/ssh-add

These statements will inform the ssh agent to add the keys to the shell used .


=========================================================

Step 2

$ cat *.pub >> authorized_keys.<nodeX> (nodeX could be the nodename to differentiate files later)

Now do the same steps on the other nodes in the cluster.When all those steps are done on the other nodes, start to copy the authorized_keys.<nodeX> to all the nodes into $HOME/.ssh/



For example if you have 4 nodes you will have after the copy in the .ssh 4 files with the name authorized_keys.<nodeX>

Step 3

Then on EACH node continue the configuration of SSH by doing the following:

$ cd $HOME/.ssh
$ cat *.node* >> authorized_keys
$ chmod 600 authorized_keys


NOTE: ALL public keys must appear in ALL authorized_keys files, INCLUDING the LOCAL public key for each node.

To test that everything is working correct now execute the commands

$ ssh <hostnameX> date




Thank you to All ....

Thank you for giving your valuable time to read the above information.





Sunday, September 3, 2023

 ==>>How to configure the DNS server For RAC on the Linux server? <<===


If, are you looking to set up and configure a DNS server in your Linux environment? Look no further! This article will guide you through the process, providing step-by-step instructions to ensure a smooth and successful DNS configuration. Whether you're a beginner or an experienced user, you'll find the information you need right here. Let's find out how to configure DNS in Linux on Vm Machine.

This article shows how to configure DNS on a Linux machine

Step 1, firstly configure the Linux server on the VM machine install.


Step 2 -login on that server you have created for the DNS do the changes on the files accordingly .

[root@dns ~]# cat /etc/named.conf

//
//  named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
// See the BIND Administrator's Reference Manual (ARM) for details about the
// configuration located in /usr/share/doc/bind-{version}/Bv9ARM.html

options {
listen-on port 53 { 127.0.0.1;10.10.1.101; }; =======> IP ADDRESS OF DNS SERVER.
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
recursing-file "/var/named/data/named.recursing";
secroots-file "/var/named/data/named.secroots";
allow-query { localhost;any; }; ==================> MENTION any here.

/*

- If you are building an AUTHORITATIVE DNS server, do NOT enable recursion.
- If you are building a RECURSIVE (caching) DNS server, you need to enable
recursion.
- If your recursive DNS server has a public IP address, you MUST enable access
control to limit queries to your legitimate users. Failing to do so will
cause your server to become part of large scale DNS amplification
attacks. Implementing BCP38 within your network would greatly

reduce such attack surface

*/
recursion yes;
dnssec-enable yes;
dnssec-validation yes;

/* Path to ISC DLV key */

bindkeys-file "/etc/named.root.key";
managed-keys-directory "/var/named/dynamic";
pid-file "/run/named/named.pid";
session-keyfile "/run/named/session.key";

};

logging {
channel default_debug {
file "data/named.run";
severity dynamic;

};

};

zone "." IN {
type hint;
file "named.ca";

};

zone "example.com" IN {
type master;
file "forward.example.com";
allow-update { none; };

};
zone "1.10.10.in-addr.arpa" IN {
type master;
file "reverse.example.com";
allow-update { none; };

};

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

Step -3  This below snap is help to create the forward dns configure .


Step-4    This below snap is help to create the forward dns configure .


Step-5 

MAKE SURE owner and GROUP of above forward and reverse zone should be as follows
owner group
root  named

Step-6

TO VERIFY WHETHER ALL ENTRIES WORKING FINE AND NO SYNTEX ISSUE IN ABOVE FILES. 
=========================================================================
/usr/sbin/named-checkconf /var/named/reverse.example.com
named-checkzone example.com /var/named/forward.example.com
named-checkzone example.com /var/named/reverse.example.com

Step-7  add the DNS server ip in the all node resolv.conf files including the DNS server 

add in all node.
[root@node1 ~]# cat /etc/resolv.conf
# Generated by NetworkManager
search example.com
nameserver 10.10.1.101

Step-8  start the NDS services.

[root@dns named]# systemctl start named

[root@dns named]# systemctl status named






Post DNS configuration Verify the resolve the scan name in my case i kept the scan name "myscan"

DNS server nslookup output 


                                         

Node 1 nslookup myscan output
                                         

Node 2 nslookup myscan output 



                                        




Thank you to All ....

Thank you for giving your valuable time to read the above information.