RMAN Backup Archive log

RMAN Backup Archive log:

RMAN>  backup archivelog all;

Starting backup at 11-AUG-21
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=5 RECID=1 STAMP=1080340278
input archived log thread=1 sequence=6 RECID=2 STAMP=1080340342
input archived log thread=1 sequence=7 RECID=3 STAMP=1080341803
channel ORA_DISK_1: starting piece 1 at 11-AUG-21
channel ORA_DISK_1: finished piece 1 at 11-AUG-21
piece handle=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/0e069d9b_1_1 
tag=TAG20210811T225643 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
Finished backup at 11-AUG-21

Starting Control File and SPFILE Autobackup at 11-AUG-21
piece handle=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/c-1608118455-20210811-05 
comment=NONE
Finished Control File and SPFILE Autobackup at 11-AUG-21

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

If you want to be updated with all our articles send us the Invitation or Follow us:

Ramkumar’s LinkedIn: https://www.linkedin.com/in/ramkumardba/
LinkedIn Group: https://www.linkedin.com/in/ramkumar-m-0061a0204/
Facebook Page: https://www.facebook.com/Oracleagent-344577549964301
Ramkumar’s Twitter: https://twitter.com/ramkuma02877110
Ramkumar’s Telegram: https://t.me/oracleageant
Ramkumar’s Facebook: https://www.facebook.com/ramkumarram8

Block Change Tracking using Rman

Block Change Tracking

Block changing tracking improves the performance of incremental backups. During an incremental backup, instead of scanning all data blocks to identify which blocks have changed, RMAN uses this file to identify the changed blocks that need to be backed up.

You can Enable block change tracking when the database is either open or mounted. This section assumes that you intend to create the block change tracking file as an Oracle Managed File in the database area, which is where the database maintains active database files such as data files, control files, and online redo log files.

Block Change Tracking

SQL> select status from v$block_change_tracking;
STATUS                     FILENAME
----------                  --------------------  
DISABLED
SQL> select name from v$datafile;
NAME
------------------------------------------------------------------
/u01/app/oracle/oradata/TEST/system01.dbf
/u01/app/oracle/oradata/TEST/sysaux01.dbf
/u01/app/oracle/oradata/TEST/undotbs01.dbf
/u01/app/oracle/oradata/TEST/users01.dbf

 DB_CREATE_FILE_DEST

Set the DB_CREATE_FILE_DEST  initialization parameter to specify the location where 
new database files, including the block change tracking file, must be stored. SQL> alter system set DB_CREATE_FILE_DEST = '/u01/app/oracle/oradata'; System altered.

Enable Block Change Tracking for the database

SQL> ALTER DATABASE ENABLE BLOCK CHANGE TRACKING;

Database altered.


SQL>  select status,filename from v$block_change_tracking;

STATUS     FILENAME
---------- ----------------------------------------
ENABLED    /u01/app/oracle/oradata/TEST/changetrack  ing/o1_mf_jl7qx7bp_.chg

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

If you want to be updated with all our articles send us the Invitation or Follow us:

Ramkumar’s LinkedIn: https://www.linkedin.com/in/ramkumardba/
LinkedIn Group: https://www.linkedin.com/in/ramkumar-m-0061a0204/
Facebook Page: https://www.facebook.com/Oracleagent-344577549964301
Ramkumar’s Twitter: https://twitter.com/ramkuma02877110
Ramkumar’s Telegram: https://t.me/oracleageant
Ramkumar’s Facebook: https://www.facebook.com/ramkumarram8

RMAN Full Database Backup

RMAN Full Database Backup:

RMAN> backup database;

Starting backup at 11-AUG-21
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=66 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/ORCL/system01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/ORCL/sysaux01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/ORCL/undotbs01.dbf
input datafile file number=00007 name=/u01/app/oracle/oradata/ORCL/users01.dbf
channel ORA_DISK_1: starting piece 1 at 11-AUG-21
channel ORA_DISK_1: finished piece 1 at 11-AUG-21
piece handle=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/01069bke_1_1 
tag=TAG20210811T222830 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:55
Finished backup at 11-AUG-21

Starting Control File and SPFILE Autobackup at 11-AUG-21
piece handle=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/c-1608118455-20210811-00 
comment=NONE
Finished Control File and SPFILE Autobackup at 11-AUG-21

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

If you want to be updated with all our articles send us the Invitation or Follow us:

Ramkumar’s LinkedIn: https://www.linkedin.com/in/ramkumardba/
LinkedIn Group: https://www.linkedin.com/in/ramkumar-m-0061a0204/
Facebook Page: https://www.facebook.com/Oracleagent-344577549964301
Ramkumar’s Twitter: https://twitter.com/ramkuma02877110
Ramkumar’s Telegram: https://t.me/oracleageant
Ramkumar’s Facebook: https://www.facebook.com/ramkumarram8

RMAN Backup Tablespace

RMAN Backup Tablespace:

RMAN>  backup tablespace users,data;

Starting backup at 11-AUG-21
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00005 name=/u01/app/oracle/oradata/data01.dbf
input datafile file number=00007 name=/u01/app/oracle/oradata/ORCL/users01.dbf
channel ORA_DISK_1: starting piece 1 at 11-AUG-21
channel ORA_DISK_1: finished piece 1 at 11-AUG-21
piece handle=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/0a069cag_1_1 
tag=TAG20210811T224016 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 11-AUG-21

Starting Control File and SPFILE Autobackup at 11-AUG-21
piece handle=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/c-1608118455-20210811-03 
comment=NONE
Finished Control File and SPFILE Autobackup at 11-AUG-21

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

If you want to be updated with all our articles send us the Invitation or Follow us:

Ramkumar’s LinkedIn: https://www.linkedin.com/in/ramkumardba/
LinkedIn Group: https://www.linkedin.com/in/ramkumar-m-0061a0204/
Facebook Page: https://www.facebook.com/Oracleagent-344577549964301
Ramkumar’s Twitter: https://twitter.com/ramkuma02877110
Ramkumar’s Telegram: https://t.me/oracleageant
Ramkumar’s Facebook: https://www.facebook.com/ramkumarram8

Autonomous Health Framework (AHF) – Including TFA and ORAchk/EXAchk (Doc ID 2550798.1)

How to install AHF:

You should install it as root.

To install as root:

  1. Download the appropriate installer from above, copy to a target machine and unzip
  2. Run the TFA & ORAchk/EXAchk install command ./ahf_setup [-ahf_loc install_dir] [-data_dir data_dir]

 

ORAchk/EXAchk compliance check results – To proactively warn you of risks

Trace File Analyzer (TFA) diagnostic collections – Taken automatically on detection of a fault

Once installation is complete TFA will be automatically started.

ORAchk/EXAchk can be started to run automatic compliance checks with the command: orachk -autostart or exachk -autostart

Once autostart has been run ORAchk/EXAchk will perform compliance checks for:

  • The most severe problems at 2am, once a day
  • All known problems once a week at 3am on a Sunday
  • Send an email to the notification addresses, provided during install of any check failures and a diff since the last run

Trace File Analyzer (TFA) will monitor for significant issues.

If any issues are detected TFA will automatically:

  1. Take a diagnostic collection of everything needed to diagnose & resolve (cluster-wide where necessary)
  2. Collocate distributed collections
  3. Analyze collections for known problemsSend an email to the notification addresses, provided during install, containing details of the issues detected, recommended solutions were known, and the location of diagnostic collection(s).

Reference Doc: support.oracle.com

Installation method mentioned below:

[root@oracleagent u01]# ./ahf_setup -data_dir /u01/ahf/output -ahf_loc /u01/ahf

AHF Installer for Platform Linux Architecture x86_64

AHF Installation Log: /tmp/ahf_install_212100_8431_2021_08_30-18_09_41.log

Starting Autonomous Health Framework (AHF) Installation

AHF Version: 21.2.1 Build Date: 202108130422

TFA is already installed at : /u01/app/19.3.0.0/grid/tfa/oracleagent/tfa_home

Installed TFA Version : 181100 Build ID : 20180328025002

AHF Location : /u01/ahf/oracle.ahf

AHF Data Directory : /u01/ahf/output/oracle.ahf/data

Shutting down TFA : /u01/app/19.3.0.0/grid/tfa/oracleagent/tfa_home

Copying TFA Data Files from /u01/app/19.3.0.0/grid/tfa/oracleagent/tfa_home

Uninstalling TFA : /u01/app/19.3.0.0/grid/tfa/oracleagent/tfa_home

Do you want to add AHF Notification Email IDs ? [Y]|N : N

Extracting AHF to /u01/ahf/oracle.ahf

Configuring TFA Services

Copying TFA Data Files to AHF

Discovering Nodes and Oracle Resources

Starting TFA Services

.————————————————————————————————————————.
| Host             | Status of TFA | PID      | Port  | Version     | Build ID                               |
+——————+———————+———-+——–+—————-+————————————-+
| oracleagent | RUNNING      | 12593 | 5000 | 21.2.1.0.0 | 21210020210813042249 |
+——————+———————+———-+——–+—————-+————————————-+

Running TFA Inventory…

Adding default users to TFA Access list…

.———————————————————————————————————–.
| Summary of AHF Configuration                                                                          |
+—————————–+—————————————————————————+
| Parameter                | Value                                                                                  |
+—————————–+—————————————————————————+
| AHF Location          | /u01/ahf/oracle.ahf                                                      |
| TFA Location           | /u01/ahf/oracle.ahf/tfa                                              |
| Orachk Location    | /u01/ahf/oracle.ahf/orachk                                      |
| Data Directory       | /u01/ahf/output/oracle.ahf/data                            |
| Repository              | /u01/ahf/output/oracle.ahf/data/repository       |
| Diag Directory       | /u01/ahf/output/oracle.ahf/data/oracleagent/diag |
‘——————————+—————————————————————————-‘

Starting orachk scheduler from AHF …

Adding rpm Metadata to rpm database on ODA system

RPM File /u01/ahf/oracle.ahf/rpms/oracle-ahf-212100-20210813042249.x86_64.rpm
Preparing… ########################################### [100%]
Using Dummy RPM Installer for oracle-ahf
Tool Install Base /opt/oracle.ahf

1:oracle-ahf ########################################### [100%]
Installing oracle-ahf

AHF binaries are available in /u01/ahf/oracle.ahf/bin

AHF is successfully installed

Do you want AHF to store your My Oracle Support Credentials for Automatic Upload? Y|[N] : N

Moving /tmp/ahf_install_212100_8431_2021_08_30-18_09_41.log to /u01/ahf/output/oracle.ahf/data/oracleagent/diag/ahf/

 

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

If you want to be updated with all our articles send us the Invitation or Follow us:

Ramkumar’s LinkedIn: https://www.linkedin.com/in/ramkumardba/
LinkedIn Group: https://www.linkedin.com/in/ramkumar-m-0061a0204/
Facebook Page: https://www.facebook.com/Oracleagent-344577549964301
Ramkumar’s Twitter: https://twitter.com/ramkuma02877110
Ramkumar’s Telegram: https://t.me/oracleageant
Ramkumar’s Facebook: https://www.facebook.com/ramkumarram8

RMAN Backup Database includes a control file

RMAN Backup Database includes a control file:

RMAN>  backup database include current controlfile;

Starting backup at 11-AUG-21
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/ORCL/system01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/ORCL/sysaux01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/ORCL/undotbs01.dbf
input datafile file number=00007 name=/u01/app/oracle/oradata/ORCL/users01.dbf
channel ORA_DISK_1: starting piece 1 at 11-AUG-21
channel ORA_DISK_1: finished piece 1 at 11-AUG-21
piece handle=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/07069bu9_1_1 
tag=TAG20210811T223345 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 11-AUG-21
channel ORA_DISK_1: finished piece 1 at 11-AUG-21
piece handle=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/08069bvm_1_1 
tag=TAG20210811T223345 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 11-AUG-21

Starting Control File and SPFILE Autobackup at 11-AUG-21
piece handle=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/c-1608118455-20210811-02 
comment=NONE
Finished Control File and SPFILE Autobackup at 11-AUG-21

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

If you want to be updated with all our articles send us the Invitation or Follow us:

Ramkumar’s LinkedIn: https://www.linkedin.com/in/ramkumardba/
LinkedIn Group: https://www.linkedin.com/in/ramkumar-m-0061a0204/
Facebook Page: https://www.facebook.com/Oracleagent-344577549964301
Ramkumar’s Twitter: https://twitter.com/ramkuma02877110
Ramkumar’s Telegram: https://t.me/oracleageant
Ramkumar’s Facebook: https://www.facebook.com/ramkumarram8

RMAN Backup Database plus Archive log

RMAN Backup Database plus Archive log:

RMAN>  backup database plus archivelog;

Starting backup at 11-AUG-21
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=5 RECID=1 STAMP=1080340278
channel ORA_DISK_1: starting piece 1 at 11-AUG-21
channel ORA_DISK_1: finished piece 1 at 11-AUG-21
piece handle=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/03069bpm_1_1 
tag=TAG20210811T223118 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:08
Finished backup at 11-AUG-21

Starting backup at 11-AUG-21
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/ORCL/system01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/ORCL/sysaux01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/ORCL/undotbs01.dbf
input datafile file number=00007 name=/u01/app/oracle/oradata/ORCL/users01.dbf
channel ORA_DISK_1: starting piece 1 at 11-AUG-21
channel ORA_DISK_1: finished piece 1 at 11-AUG-21
piece handle=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/04069bpu_1_1 
tag=TAG20210811T223126 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:55
Finished backup at 11-AUG-21

Starting backup at 11-AUG-21
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=6 RECID=2 STAMP=1080340342
channel ORA_DISK_1: starting piece 1 at 11-AUG-21
channel ORA_DISK_1: finished piece 1 at 11-AUG-21
piece handle=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/05069brm_1_1 
tag=TAG20210811T223222 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 11-AUG-21

Starting Control File and SPFILE Autobackup at 11-AUG-21
piece handle=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/c-1608118455-20210811-01 
comment=NONE
Finished Control File and SPFILE Autobackup at 11-AUG-21


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

If you want to be updated with all our articles send us the Invitation or Follow us:

Ramkumar’s LinkedIn: https://www.linkedin.com/in/ramkumardba/
LinkedIn Group: https://www.linkedin.com/in/ramkumar-m-0061a0204/
Facebook Page: https://www.facebook.com/Oracleagent-344577549964301
Ramkumar’s Twitter: https://twitter.com/ramkuma02877110
Ramkumar’s Telegram: https://t.me/oracleageant
Ramkumar’s Facebook: https://www.facebook.com/ramkumarram8

ORA-27125: unable to create shared memory segment Linux-x86_64 Error: 28: No space left on device

 

When trying to start up an Oracle database, the below errors occur:

ORA-27125: unable to create shared memory segment
Linux-x86_64 Error: 28: No space left on device
Additional information: 3773
Additional information: 3221225472

CAUSE

Kernel parameter kernel.shmall is not set properly.

RESOLUTION

Make sure kernel.shmall is given the appropriate value.

1)  Calculate the value of shmall.

getconf PAGE_SIZE

4096
Shmall=total size of the SGAs /PAGE_SIZE.
If the total SGA size is 480GB, then it would be 1024 * 1024 * 1024 * 32 / 4096 = 8388608  

2) Edit /etc/sysctl.conf
kernel.shmall = 8388608 

3) Apply the change
# sysctl -p  

4) Check shmall value after change.
# sysctl -A | grep shmall

5) Start up database successfully.

 

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

If you want to be updated with all our articles send us the Invitation or Follow us:

Ramkumar’s LinkedIn: https://www.linkedin.com/in/ramkumardba/
LinkedIn Group: https://www.linkedin.com/in/ramkumar-m-0061a0204/
Facebook Page: https://www.facebook.com/Oracleagent-344577549964301
Ramkumar’s Twitter: https://twitter.com/ramkuma02877110
Ramkumar’s Telegram: https://t.me/oracleageant
Ramkumar’s Facebook: https://www.facebook.com/ramkumarram8

RECOVERY CATALOG DATABASE IN RMAN

Restore / Recovery. Recovery Manager (RMAN) Enterprise Manager. Backup. Control file. Reporting REPORT. LIST. Target database. Stored scripts. Catalog Maintenance. Register. Resynchronize. Reset. Change/Delete/Catalog. Backup /Restore/Recover. 

RECOVERY CATALOG DATABASE:

A Recovery catalog creates redundancy for the RMAN repository stored in the control file of each target database.

A recovery catalog centralizes metadata for all your target databases. Storing the metadata in a single place makes reporting and administration tasks easier to perform.

A recovery catalog can store metadata history much longer than the control file. This capability is useful if you must do a recovery that goes further back in time than the history in the control file.

A recovery catalog is required when you use RMAN in a Data Guard environment. By storing backup metadata for all primary and standby databases, the catalog enables you to offload backup tasks to one standby database while enabling you to restore backups on other databases in the environment.

Catalog Database - APPS
Target Database - TEST

Catalog Database Server (192.168.1.101)

[oratest@oracle ~]$ export ORACLE_SID=APPS

[oratest@oracle ~]$ sqlplus / as sysdba

create one New Tablespace and New user in Catalog Database

SQL > create tablespace rmantbs datafile ‘/u01/app/oracle/oradata/rman01.dbf’
size 100m;

Tablespace created.

SQL > create user rman identified by rman123
Default tablespace rmantbs
Temporary tablespace temp
Quota unlimited on rmantbs;

User created.
SQL > grant connect,resource to rman;

Grant succeeded.
SQL > grant recovery_catalog_owner to rman;

Grant succeeded.

SQL > exit

Target database server ( 192.168.1.110 )

[oratest@oracle ~] $ cat >> $ORACLE_HOME/network/admin/tnsnames.ora

Apps123 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.101 )(PORT
= 1521))
(CONNECT_DATA =
 (SERVER = DEDICATED)
(SERVICE_NAME = apps)
    )
  )

[oratest@oracle ~]$ export ORACLE_SID=test

[oratest@oracle ~]$ rman target /

Recovery Manager: Release 19.0.0.0.0 - Production on Wed Aug 18 21:21:57 2021
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

connected to target database: TEST (DBID=2378581000)
RMAN > connect catalog rman/rman123@apps123

RMAN > create catalog;

RMAN > register database;

RMAN > resync catalog;

 

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

If you want to be updated with all our articles send us the Invitation or Follow us:

Ramkumar’s LinkedIn: https://www.linkedin.com/in/ramkumardba/
LinkedIn Group: https://www.linkedin.com/in/ramkumar-m-0061a0204/
Facebook Page: https://www.facebook.com/Oracleagent-344577549964301
Ramkumar’s Twitter: https://twitter.com/ramkuma02877110
Ramkumar’s Telegram: https://t.me/oracleageant
Ramkumar’s Facebook: https://www.facebook.com/ramkumarram8

Backup based Cloning a database using RMAN

RMAN BACKUP BASED DUPLICATION:

High-Level Steps

Creating Directories 

Verifying the RMAN backup database with the control file 

Creating pfile for clone database 

Copying Password file for clone database 

copy paste listener and tns for each other: prod & clone 

Moving backup files to the directories created for the clone database 

Connecting Rman and issue the duplicate command 

Target database : TEST 

Cloned database: TESTDB

Verifying the database name, Backups available in RMAN 

SQL> select name,open_mode from v$database;

NAME      OPEN_MODE
--------- --------------------
TEST      READ WRITE


RMAN> SHOW CONTROLFILE AUTOBACKUP;

using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name TEST are:
CONFIGURE CONTROLFILE AUTOBACKUP ON; # default
RMAN> CROSSCHECK BACKUP OF DATABASE;

using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=70 device type=DISK
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/0106mhr1_1_1 RECID=1 
STAMP=1080772449 crosschecked backup piece: found to be 'AVAILABLE' backup piece handle=/u01/app/oracle/oradata/TEST/backup/090798lu_1_1 RECID=9
STAMP=1081385662 Crosschecked 2 objects
RMAN>  list backup of database;


List of Backup Sets
===================


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
1       Full    1.19G      DISK        00:00:44     16-AUG-21
        BP Key: 1   Status: AVAILABLE  Compressed: NO  Tag: TAG20210816T223409
        Piece Name: /u01/app/oracle/product/19.0.0/dbhome_1/dbs/0106mhr1_1_1
  List of Datafiles in backup set 1
  File LV Type Ckp SCN    Ckp Time  Abs Fuz SCN Sparse Name
  ---- -- ---- ---------- --------- ----------- ------ ----
  1       Full 2351179    16-AUG-21              NO    /u01/app/oracle/oradata/TEST/system01.dbf
  3       Full 2351179    16-AUG-21              NO    /u01/app/oracle/oradata/TEST/sysaux01.dbf
  4       Full 2351179    16-AUG-21              NO    /u01/app/oracle/oradata/TEST/undotbs01.dbf
  7       Full 2351179    16-AUG-21              NO    /u01/app/oracle/oradata/TEST/users01.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
9       Full    1.23G      DISK        00:00:51     24-AUG-21
        BP Key: 9   Status: AVAILABLE  Compressed: NO  Tag: TAG20210824T005422
        Piece Name: /u01/app/oracle/oradata/TEST/backup/090798lu_1_1
  List of Datafiles in backup set 9
  File LV Type Ckp SCN    Ckp Time  Abs Fuz SCN Sparse Name
  ---- -- ---- ---------- --------- ----------- ------ ----
  1       Full 2769124    24-AUG-21              NO    /u01/app/oracle/oradata/TEST/system01.dbf
  3       Full 2769124    24-AUG-21              NO    /u01/app/oracle/oradata/TEST/sysaux01.dbf
  4       Full 2769124    24-AUG-21              NO    /u01/app/oracle/oradata/TEST/undotbs01.dbf
  7       Full 2769124    24-AUG-21              NO    /u01/app/oracle/oradata/TEST/users01.dbf

Creating Pfile for TESTDB

[oratest@oracle dbs]$ vi inittestdb.ora


*.db_name='testdb
*.control_files='/u01/app/oracle/oradata/TESTDB/control04.ctl','/u01/app/oracle/oradata/TESTDB/control05.ctl'
#*.db_recovery_file_dest size=1g
#*.db_recovery_file_dest='/u01/app/oracle/fast_recovery_area'
*.db_file_name_convert='/u01/app/oracle/oradata/TEST/datafile','/u01/app/oracle/oradata/TESTDB'
*.log_file_name_convert='/u01/app/oracle/oracle/oradata/TEST/onlinelog','/u01/app/oracle/oradata/TESTDB'

Copy  Target Database Password File to Auxiliary Database 

[oratest@oracle dbs]$ cp orapwtest orapwtestdb
[oratest@oracle oradata]$ mkdir testdb


[oratest@oracle oradata]$ ls
data01.dbf  ORCL  TEST  testdb

Copying the RMAN backup pieces and control file auto backup to Desired location ‘TESTDB’ 

[oratest@oracle backup]$ cp c-2378581000-20210824/u01/app/oracle/oradata/testdb
[oratest@oracle backup]$ cp c-2378581002021082402/u01/app/oracle/oradata/testdb
[oratest@oracle backup]$ cp 070798lh_1_1 /u01/app/oracle/oradata/testdb
[oratest@oracle backup]$ cp 090798lu_1_1 /u01/app/oracle/oradata/testdb

[oratest@oracle testdb]$ ls -l
total 1319440
-rw-rw----. 1 oratest oratest   10682368 Aug 24 01:01 070798lh_1_1
-rw-rw----. 1 oratest oratest 1318993920 Aug 24 01:02 090798lu_1_1
-rw-rw----. 1 oratest oratest   10715136 Aug 24 01:01 c-2378581000-20210824-01
-rw-rw----. 1 oratest oratest   10715136 Aug 24 01:01 c-2378581000-20210824-02
SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch
Oldest online log sequence     10
Next log sequence to archive   12
Current log sequence           12
[oratest@oracle dbs]$ export ORACLE_SID=testdb
[oratest@oracle dbs]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Tue Aug 24 22:33:36 2021
Version 19.3.0.0.0

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

Connected to an idle instance.

SQL> startup pfile='$ORACLE_HOME/dbs/inittestdb.ora' nomount;
ORACLE instance started.

Total System Global Area  281017392 bytes
Fixed Size                  8895536 bytes
Variable Size             218103808 bytes
Database Buffers           50331648 bytes
Redo Buffers                3686400 bytes

SQL> exit
[oratest@oracle dbs]$ rman target /

Recovery Manager: Release 19.0.0.0.0 - Production on Tue Aug 24 22:54:08 2021
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

connected to target database: TESTDB (not mounted)

RMAN> exit

Verifying Listener and Tns Entries

TESTDB =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.24 )(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = testdb)
      (UR = A)
    )
  )

[oratest@oracle admin]$ rman target sys/oracle@test

Recovery Manager: Release 19.0.0.0.0 - Production on Tue Aug 24 22:55:01 2021
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

connected to target database: TEST (DBID=2378581000)

RMAN>  connect auxiliary sys/oracle@testdb

connected to auxiliary database: TESTDB (not mounted)

Making the clone Database in nomount state to Duplicate the Database

[oratest@oracle dbs]$ export ORACLE_SID=testdb
[oratest@oracle dbs]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Tue Aug 24 23:09:52 2021
Version 19.3.0.0.0

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


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> select status from v$instance;

STATUS
------------
STARTED

[oratest@oracle dbs]$  rman auxiliary /

Recovery Manager: Release 19.0.0.0.0 - Production on Tue Aug 24 23:11:06 2021
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

connected to auxiliary database: TESTDB (not mounted)

RMAN> duplicate target database to testdb backup location
'/u01/app/oracle/oradata/testdb' nofilenamecheck;

Starting Duplicate Db at 24-AUG-21
searching for database ID
found backup of database ID 2378581000

contents of Memory Script:
{
   sql clone "create spfile from memory";
}
executing Memory Script

sql statement: create spfile from memory

contents of Memory Script:
{
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area     281017392 bytes

Fixed Size                     8895536 bytes
Variable Size                218103808 bytes
Database Buffers              50331648 bytes
Redo Buffers                   3686400 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''TEST'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   sql clone "alter system set  db_unique_name =
 ''testdb'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   shutdown clone immediate;
   startup clone force nomount
   restore clone primary controlfile from  '/u01/app/oracle/oradata/testdb/c-2378581000-20210824-04';
   alter clone database mount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''TEST'' comment= ''Modified by RMAN duplicate'' scope=spfile

sql statement: alter system set  db_unique_name =  ''testdb'' comment= ''Modified by RMAN duplicate'' scope=spfile

Oracle instance shut down

Oracle instance started

Total System Global Area     281017392 bytes

Fixed Size                     8895536 bytes
Variable Size                218103808 bytes
Database Buffers              50331648 bytes
Redo Buffers                   3686400 bytes

Starting restore at 24-AUG-21
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=424 device type=DISK

channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/app/oracle/oradata/TESTDB/control07.ctl
output file name=/u01/app/oracle/oradata/TESTDB/control08.ctl
Finished restore at 24-AUG-21

database mounted
released channel: ORA_AUX_DISK_1
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=424 device type=DISK
RMAN-05158: WARNING: auxiliary (bctfile) file name /u01/app/oracle/oradata/TEST/changetracking/o1_mf_jl7qx7bp_.chg conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (logfile) file name /u01/app/oracle/oradata/TEST/redo01.log conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (logfile) file name /u01/app/oracle/oradata/TEST/redo02.log conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (logfile) file name /u01/app/oracle/oradata/TEST/redo03.log conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /u01/app/oracle/oradata/TEST/system01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /u01/app/oracle/oradata/TEST/sysaux01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /u01/app/oracle/oradata/TEST/undotbs01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (datafile) file name /u01/app/oracle/oradata/TEST/users01.dbf conflicts with a file used by the target database
RMAN-05158: WARNING: auxiliary (tempfile) file name /u01/app/oracle/oradata/TEST/temp01.dbf conflicts with a file used by the target database

contents of Memory Script:
{
   set until scn  2841711;
   set newname for datafile  1 to
 "/u01/app/oracle/oradata/TEST/system01.dbf";
   set newname for datafile  3 to
 "/u01/app/oracle/oradata/TEST/sysaux01.dbf";
   set newname for datafile  4 to
 "/u01/app/oracle/oradata/TEST/undotbs01.dbf";
   set newname for datafile  7 to
 "/u01/app/oracle/oradata/TEST/users01.dbf";
   restore
   clone database
   ;
}
executing Memory Script

executing command: SET until clause

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 24-AUG-21
using channel ORA_AUX_DISK_1

database opened 
Cannot remove created server parameter file 
Finished Duplicate Db at 24-AUG-21
 
RMAN> exit 
 
Recovery Manager complete. 
 

Now the database has been successfully cloned we can verify the Database

SQL> select name,open_mode from v$database;
 
NAME         OPEN_MODE
---------  --------------------
TESTDB      READ WRITE
 

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

If you want to be updated with all our articles send us the Invitation or Follow us:

Ramkumar’s LinkedIn: https://www.linkedin.com/in/ramkumardba/
LinkedIn Group: https://www.linkedin.com/in/ramkumar-m-0061a0204/
Facebook Page: https://www.facebook.com/Oracleagent-344577549964301
Ramkumar’s Twitter : https://twitter.com/ramkuma02877110
Ramkumar’s Telegram: https://t.me/oracleageant
Ramkumar’s Facebook: https://www.facebook.com/ramkumarram8