Thursday, December 30, 2021

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

                              How To Clone A Pluggable Database Of Existing PDB 

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

Here, we will Clone a Pluggable database from existing PDBS  "FINUAT1", residing in the same container on same database server .

Step 1 

[oracle@nvihfludcont01 ~]$ sqlplus / as sysdba


SQL*Plus: Release 12.2.0.1.0 Production on Thu Dec 30 16:17:10 2021

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

Connected to:

Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> show pdbs

  CON_ID CON_NAME                       OPEN MODE  RESTRICTED

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

         3 FINUAT1                                     READ WRITE NO

SQL>

Step 2 

First We need to start the PDB in read only , which need to be cloned.


SQL>

SQL> shutdown immediate ;

Pluggable Database closed.

SQL> select name,open_mode from v$pdbs;


NAME                                     OPEN_MODE

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

FINUAT1                                  MOUNTED


SQL> startup open read only ;



SQL> show pdbs


    CON_ID CON_NAME                       OPEN MODE  RESTRICTED

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

         2 PDB$SEED                       READ ONLY  NO

         3 FINUAT1                        READ ONLY  NO

SQL>

SQL>


Step 3   Than we need connect to the CDB

SQL> show con_name

CON_NAME

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

CDB$ROOT

Step 4  Please set the desire datafile location for new PDB

SQL> ALTER SYSTEM SET DB_CREATE_FILE_DEST = '+DATA';

System altered.

SQL> show parameter DB_CREATE_FILE_DEST


NAME                                 TYPE        VALUE

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

db_create_file_dest                  string      +DATA

SQL>

SQL>


Step 5 


SQL> set timing on ;

SQL> set time on

17:42:47 SQL> create pluggable database FINUAT3 from FINUAT1 ;

Pluggable database created.

Elapsed: 00:40:14.69

Step 6   After the PDB Cloned We need to validate 

SQL> show pdbs

   CON_ID CON_NAME                       OPEN MODE  RESTRICTED

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

         2 PDB$SEED                       READ ONLY  NO

         3 FINUAT1                        READ ONLY  NO

         4 FINUAT3                        MOUNTED

SQL> alter database open ;

Database altered.


SQL> show pdbs


    CON_ID CON_NAME                       OPEN MODE  RESTRICTED

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

         4 FINUAT3                        READ WRITE NO

SQL>


Thank you to All ....


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

Wednesday, December 29, 2021

 


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

                                            Cloning of  the Oracle Home 

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


>>>Here I am Going to clone oracle home on standalone database server  .

The oracle clone functionality seems to be one of the best kept secrets around - its incredibly easy to use, saves hours of installation times. Makes all software installs the same. There doesn't seem to be a downside!

Get an existing home you know works, tar/zip it up and copy this to another host /New server 

untar it ( "on target server anywhere you like - does not have to be same directory structure as source" )


So here goes:

Step -1 

First up we tar up an existing GI install that we know works ok (it doesn't need to be stopped)

tar -cvf /tmp/ORACLE_HOME.tar /Oracle/Ora12c/Sw/

Step -2 

untar the tar file on target server 

tar -xvf /oracle/product/12.1.0/ORACLE_HOME.tar

Step -3 

cd to new ORACLE_HOME/clone/bin

Note :- in my case new location on target server 

cd /u01/Oracle/Ora12c/Sw/clone/bin

Step -4 Run the below following : 

[oracle@farukh01 bin]$  ./clone.pl ORACLE_HOME=/u01/Oracle/Ora12c/Sw/ ORACLE_HOME_NAME=ORA12c ORACLE_BASE=/u01/Oracle/Ora12c/

Starting Oracle Universal Installer...

Checking Temp space: must be greater than 500 MB.   Actual 5065 MB    Passed

Checking swap space: must be greater than 500 MB.   Actual 65219 MB    Passed

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2021-12-29_01-36-06PM. Please wait ...You can find the log of this install session at:

 /u01/app/oraInventory/logs/cloneActions2021-12-29_01-36-06PM.log

..................................................   5% Done.

..................................................   10% Done.

..................................................   15% Done.

..................................................   20% Done.

..................................................   25% Done.

..................................................   30% Done.

..................................................   35% Done.

..................................................   40% Done.

..................................................   45% Done.

..................................................   50% Done.

..................................................   55% Done.

..................................................   60% Done.

..................................................   65% Done.

..................................................   70% Done.

..................................................   75% Done.

..................................................   80% Done.

..................................................   85% Done.

..........

Copy files in progress.

Copy files successful.

Link binaries in progress.

Link binaries successful.

Setup files in progress.

Setup files successful.

Setup Inventory in progress.

Setup Inventory successful.

Finish Setup successful.

The cloning of ORA12c was successful.

Please check '/u01/app/oraInventory/logs/cloneActions2021-12-29_01-36-06PM.log' for more details.

Setup Oracle Base in progress.

Setup Oracle Base successful.

..................................................   95% Done.

As a root user, execute the following script(s):

        1. /u01/Oracle/Ora12c/Sw//root.sh

..................................................   100% Done.

Step 5 

As a root user, execute the following script(s):

        1. /u01/Oracle/Ora12c/Sw//root.sh

[root@farukh01 oracle]# /u01/Oracle/Ora12c/Sw//root.sh

Check /u01/Oracle/Ora12c/Sw//install/root_farukh01_2021-12-29_13-38-36-543740549.log for the output of root script

[root@farukh01 oracle]# more /u01/Oracle/Ora12c/Sw//install/root_farukh01_2021-12-29_13-38-36-543740549.log

Performing root user operation.

The following environment variables are set as:

    ORACLE_OWNER= oracle

    ORACLE_HOME=  /u01/Oracle/Ora12c/Sw/

   Copying dbhome to /usr/local/bin ...

   Copying oraenv to /usr/local/bin ...

   Copying coraenv to /usr/local/bin ...


Entries will be added to the /etc/oratab file as needed by

Database Configuration Assistant when a database is created

Finished running generic part of root script.

Now product-specific root actions will be performed.

Oracle Trace File Analyzer (TFA) is available at : /u01/Oracle/Ora12c/Sw//suptools/tfa/release/tfa_home/bin/tfactl

[root@farukh01 oracle]#


Thank you to All ....

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

Saturday, December 25, 2021

  >>CLONING A 12CR2 STANDALON GRID INFRASTRUCTURE SOURCE To TARGET (NEW SEVRER )<<

Here we are using the Oracle perl utility for Grid Cloning 

Oracle provided perl utility is seemingly one of the most useful features that oracle provide for the Cloning .

Let Start :- 

Step -1 


First up we tar up an existing GI install that we know works ok (it doesn't need to be stopped) .

tar -cvpf /Dump/grid_HOME.tar /Grid

We then copy that tar file to the destination server using whatever tool you see fit scp/sftp etc. 

Step  -2 

We then untar in my case (you could have used zip earlier) that file into the destination directory - iused the same path as the original server but as with the database software this shouldn't matter

tar -xvf  grid_HOME.tar 

Step -3   This below command run grid owner  -

Parameters Description :-

ORACLE_BASE=ORACLE_BASE  \\The complete path to the Oracle base to be cloned. If you specify an invalid path, then the script exits. This parameter is required.

ORACLE_HOME=GRID_HOME    \\The complete path to the Grid Infrastructure home for cloning. If you specify an invalid path, then the script exits. This parameter is required.

ORACLE_HOME_NAME=Oracle_home_name (or) -defaultHomeName The Oracle home name of the home to be cloned. Optionally, you can specify the -defaultHomeName flag. This parameter is not required.

cd /Grid/Ora12c/Sw/clone/bin/clone.pl


[oracle@farukh01 bin]$ ./clone.pl ORACLE_HOME=/u01/Grid/Ora12c/Sw ORACLE_HOME_NAME=GI12c ORACLE_BASE=/u01/Grid/Ora12c/

Starting Oracle Universal Installer...


Checking Temp space: must be greater than 500 MB.   Actual 5065 MB    Passed

Checking swap space: must be greater than 500 MB.   Actual 65227 MB    Passed

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2021-12-25_10-38-27AM. Please wait ...[WARNING] [INS-32029] The Installer has detected that the Oracle Base location is not empty.

   ACTION: Oracle recommends that the Oracle Base location is empty.

You can find the log of this install session at:

 /u01/app/oraInventory/logs/cloneActions2021-12-25_10-38-27AM.log

..................................................   5% Done.

..................................................   10% Done.

..................................................   15% Done.

..................................................   20% Done.

..................................................   25% Done.

..................................................   30% Done.

..................................................   35% Done.

..................................................   40% Done.

..................................................   45% Done.

..................................................   50% Done.

..................................................   55% Done.

..................................................   60% Done.

..................................................   65% Done.

..................................................   70% Done.

..................................................   75% Done.

..................................................   80% Done.

..................................................   85% Done.

..........

Copy files in progress.


Copy files successful.


Link binaries in progress.


Link binaries successful.


Setup files in progress.


Setup files successful.


Setup Inventory in progress.


Setup Inventory successful.


Finish Setup successful.

The cloning of GI12c was successful.

Please check '/u01/app/oraInventory/logs/cloneActions2021-12-25_10-38-27AM.log' for more details.


Setup Oracle Base in progress.


Setup Oracle Base successful.

..................................................   95% Done.


As a root user, execute the following script(s):

        1. /u01/app/oraInventory/orainstRoot.sh

        2. /u01/Grid/Ora12c/Sw/root.sh




..................................................   100% Done.


Step -4 


[root@farukh01 oracle]#

[root@farukh01 oracle]#

[root@farukh01 oracle]# /u01/app/oraInventory/orainstRoot.sh

Changing permissions of /u01/app/oraInventory.

Adding read,write permissions for group.

Removing read,write,execute permissions for world.


Changing groupname of /u01/app/oraInventory to oinstall.

The execution of the script is complete.

[root@farukh01 oracle]# /u01/Grid/Ora12c/Sw/root.sh

Check /u01/Grid/Ora12c/Sw/install/root_farukh01_2021-12-25_10-54-02-611889450.log for the output of root script

[root@farukh01 oracle]# more /u01/Grid/Ora12c/Sw/install/root_farukh01_2021-12-25_10-54-02-611889450.log

Performing root user operation.


The following environment variables are set as:

    ORACLE_OWNER= oracle

    ORACLE_HOME=  /u01/Grid/Ora12c/Sw

   Copying dbhome to /usr/local/bin ...

   Copying oraenv to /usr/local/bin ...

   Copying coraenv to /usr/local/bin ...



Creating /etc/oratab file...

Entries will be added to the /etc/oratab file as needed by

Database Configuration Assistant when a database is created

Finished running generic part of root script.

Now product-specific root actions will be performed.


To configure Grid Infrastructure for a Cluster or Grid Infrastructure for a Stand-Alone Server execute the following command as oracle user:

/u01/Grid/Ora12c/Sw/gridSetup.sh

This command launches the Grid Infrastructure Setup Wizard. The wizard also supports silent operation, and the parameters can be passed through the response file that i

s available in the installation media.


[root@farukh01 oracle]#


Step - 5 


[root@farukh01 install]# /u01/Grid/Ora12c/Sw/perl/bin/perl -I /u01/Grid/Ora12c/Sw/perl/lib -I /u01/Grid/Ora12c/Sw/crs/install /u01/Grid/Ora12c/Sw/crs/install/roothas.pl

Using configuration parameter file: /u01/Grid/Ora12c/Sw/crs/install/crsconfig_params

The log of current session can be found at:

  /u01/Grid/Ora12c/crsdata/farukh01/crsconfig/roothas_2021-12-25_12-45-42AM.log

LOCAL ADD MODE

Creating OCR keys for user 'oracle', privgrp 'oinstall'..

Operation successful.

LOCAL ONLY MODE

Successfully accumulated necessary OCR keys.

Creating OCR keys for user 'root', privgrp 'root'..

Operation successful.

CRS-4664: Node farukh01 successfully pinned.

2021/12/25 12:45:51 CLSRSC-330: Adding Clusterware entries to file 'oracle-ohasd.service'


CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'farukh01'

CRS-2673: Attempting to stop 'ora.evmd' on 'farukh01'

CRS-2677: Stop of 'ora.evmd' on 'farukh01' succeeded

CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'farukh01' has completed

CRS-4133: Oracle High Availability Services has been stopped.

CRS-4123: Oracle High Availability Services has been started.


farukh01     2021/12/25 12:49:47     /u01/Grid/Ora12c/Sw/cdata/farukh01/backup_20211225_124947.olr     3518739597

2021/12/25 12:49:47 CLSRSC-327: Successfully configured Oracle Restart for a standalone server

[root@farukh01 install]#



Step - 6 Run this below command Grid owner 


[oracle@farukh01 bin]$ ./runInstaller -updateNodeList ORACLE_HOME=/u01/Grid/Ora12c/Sw -defaultHomeName CLUSTER_NODES= CRS=TRUE

Starting Oracle Universal Installer...


Checking swap space: must be greater than 500 MB.   Actual 65227 MB    Passed

The inventory pointer is located at /etc/oraInst.loc

'UpdateNodeList' was successful.

[oracle@farukh01 bin]$ pwd

/u01/Grid/Ora12c/Sw/oui/bin

[oracle@farukh01 bin]$


Step - 7 with the help of below command we are creating the asm disk group .


cd /u01/Grid/Ora12c/Sw/bin


[oracle@farukh01 bin]$  ./asmca -silent -configureASM -diskString '/dev/oracleasm/disks/*' -sysAsmPassword Grid#123 -asmsnmpPassword Grid#123  -diskGroupName DATA -diskList /dev/oracleasm/disks/DATA1 -redundancy EXTERNAL


Disk groups created successfully. Check /u01/Grid/Ora12c/cfgtoollogs/asmca/asmca-211225PM084751.log for details.


Step -8 login with root user and check the resources using the below command .


cd /u01/Grid/Ora12c/Sw/bin

 

[root@farukh01 bin]# ./crsctl stat res -t

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

Name           Target  State        Server                   State details

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

Local Resources

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

ora.ARCHIVE.dg

               ONLINE  ONLINE       farukh01           STABLE

ora.CONTROLE.dg

               ONLINE  ONLINE       farukh01           STABLE

ora.DATA.dg

               ONLINE  ONLINE       farukh01           STABLE

ora.REDO.dg

               ONLINE  ONLINE       farukh01           STABLE

ora.asm

               ONLINE  ONLINE       farukh01           Started,STABLE

ora.ons

               OFFLINE OFFLINE      farukh01           STABLE

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

Cluster Resources

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

ora.cssd

      1        ONLINE  ONLINE       farukh01           STABLE

ora.diskmon

      1        OFFLINE OFFLINE                               STABLE

ora.evmd

      1        ONLINE  ONLINE       farukh01           STABLE

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

[root@farukh01 bin]#


Step -9 


[oracle@farukh01 bin]$ ps -ef|grep pmon

oracle    70533      1  0 20:49 ?        00:00:00 asm_pmon_+ASM

oracle    93797  52656  0 22:13 pts/0    00:00:00 grep --color=auto pmon

[oracle@farukh01 bin]$ sqlplus / 


SQL*Plus: Release 12.2.0.1.0 Production on Sat Dec 25 22:14:08 2021


Copyright (c) 1982, 2016, Oracle.  All rights reserved.



Connected to:

Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production


SQL> select name,total_mb/1024,free_mb/1024 from v$asm_diskgroup ;


NAME                           TOTAL_MB/1024 FREE_MB/1024

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

DATA                              2047.99805   2047.90137

CONTROLE                          49.9990234   49.9462891

REDO                              49.9990234   49.9462891

ARCHIVE                           199.999023   199.944336


SQL>



Thank you to All ....

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


Tuesday, December 14, 2021

 OPERATING SYSTEM FUNCTIONALITY

1. Whenever user sends a request, primary search for the data will be done in RAM. If the

information is available, it will be given to the user

2. Otherwise, secondary search will be done in hard disk and copy of that info will be placed in

RAM before giving that to the user

3. The request and response between RAM and hard disk is called I/O operation

4. Files with more size will be fitted into RAM using swapping (flushing old data – Least Recently

Used algorithm)

Questions:

1. Why to copy data to RAM?

a. It will give benefit for next users who are requesting for same data. Accessing

information from memory is always faster than accessing it from disk

2. What happens if data size is more than RAM size?

a. Data will be splitted based on the RAM size and swapping will takes place (In windows,

this is called paging)

3. How the data will be managed in RAM?

a. Using Least Recently Used (LRU) algorithm

Note: The primary goal of DBA is to reduce response time there by increasing performance and also

avoiding I/O (all these 3 are interlinked)

Note: Any request and response between memory and disk is called I/O

USER

RAM

HARD DISK