RESTORE CONTROL FILE USING RMAN

 

Check the RMAN configuration and controlfile Auto backup Feature

[oratest@oracle ~]$ export ORACLE_SID=orcl
[oratest@oracle ~]$ rman target /
Recovery Manager: Release 19.0.0.0.0 - Production on Fri Sep 3 04:14:07 2021
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1608118455)

RMAN> show all;

RMAN configuration parameters for database with db_unique_name ORCL
are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK
TO '/u01/app/oracle/oradata/ORCL/backup/%F';
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO
BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; #
default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; #
default
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT
'/u01/app/oracle/oradata/ORCL/backup/%U' MAXPIECESIZE 8 G;
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT'
OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE RMAN OUTPUT TO KEEP FOR 7 DAYS; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO
'/u01/app/oracle/product/19.0.0/dbhome_1/dbs/snapcf_orcl.f'; # default

 Simulate a failure when the Database is Running

[oratest@oracle ~]$ export ORACLE_SID=orcl

[oratest@oracle ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Fri Sep 3 04:21:36 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 open_mode,name from v$database;
OPEN_MODE     NAME
---------   ---------
READ WRITE    ORCL

SQL> select name from v$controlfile;
NAME
-------------------------------------------------------
/u01/app/oracle/oradata/ORCL/control01.ctl
/u01/app/oracle/oradata/ORCL/control02.ctl

DELECT CONTROLFILE MANUALY

[oratest@oracle ~]$ cd /u01/app/oracle/oradata/ORCL/

[oratest@oracle ORCL]$ ls

backup control01.ctl control02.ctl redo01.log redo02.log redo03.log
sysaux01.dbf system01.dbf temp01.dbf undotbs01.dbf users01.dbf

[oratest@oracle ORCL]$ rm -fr control01.ctl

[oratest@oracle ORCL]$ rm -fr control02.ctl

[oratest@oracle ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Fri Sep 3 04:27:01 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> alter tablespace data add datafile
'/u01/app/oracle/oradata/ORCL/test03.dbf' size 100m;
alter tablespace data add datafile '/u01/app/oracle/oradata/ORCL/test03.dbf'
size 100m
*
ERROR at line 1:
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/u01/app/oracle/oradata/ORCL/control01.ctl'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
SQL> select status from v$instance;
STATUS
------------
OPEN

SQL> shut immediate
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/u01/app/oracle/oradata/ORCL/control01.ctl'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3

SQL> shut abort
ORACLE instance shut down.

Keep the Database in NOMOUNT Stage and Restore the control file

SQL> startup 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

 Since we are not using an RMAN catalog we need to set the DBID

[oratest@oracle ~]$ rman target /
Recovery Manager: Release 19.0.0.0.0 - Production on Fri Sep 3 04:32:06 2021
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (not mounted)

RMAN> set dbid=1608118455;
executing command: SET DBID
RMAN> restore controlfile from
"/u01/app/oracle/oradata/ORCL/backup/170840mm_1_1";
Starting restore at 03-SEP-21
using channel ORA_DISK_1
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/app/oracle/oradata/ORCL/control01.ctl
output file name=/u01/app/oracle/oradata/ORCL/control02.ctl
Finished restore at 03-SEP-21

Mount and Recover the database

RMAN> alter database mount;
released channel: ORA_DISK_1
Statement processed
RMAN> restore database;
Starting restore at 03-SEP-21
using channel ORA_DISK_1
RMAN-00571:
===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS
===============
RMAN-00571:
===========================================================

starting media Recovery

archived log for thread 1 with sequence 19 is already on disk as file
/u01/app/oracle/oradata/ORCL/redo01.log
archived log file name=/u01/app/oracle/oradata/ORCL/redo01.log thread=1
sequence=19
media recovery complete, elapsed time: 00:00:00
Finished recover at 03-SEP-21
Statement processed
Use RESETLOGS after incomplete recovery (when the entire redo stream
wasn’t applied). RESETLOGS will initialize the logs, reset your log sequence
number, and start a new “incarnation” of the database.
RMAN> alter database open resetlogs;
Statement processed

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

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

END-OF-FILE ERROR

Error code – ORA-03113

Solution

ORACLE_SID = orcl
The Oracle base remains unchanged with value /u01/app/oracle
[oratest@oracle ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Sep 8 23:53:19 2021
Version 19.3.0.0.0

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

Connected to an idle instance.

SQL> startup
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
Database mounted.
ORA-03113: end-of-file on communication channel
Process ID: 4097
Session ID: 390 Serial number: 53661

SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 -
Production Version 19.3.0.0.0 [oracle@oracle ~]$ sqlplus / as sysdba Connected to an idle instance. SQL> startup 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> alter database mount;

Database altered.



SQL> alter database clear unarchived logfile group 2;

Database altered.


SQL> shutdown immediate
ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.
[oratest@oracle ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Thu Sep 9 00:14:39 2021
Version 19.3.0.0.0

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

Connected to an idle instance.

SQL> startup
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
Database mounted.
Database opened.

SQL> select name,open_mode from v$database;

NAME      OPEN_MODE
--------- --------------------
ORCL      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

Backup based Cloning a database using RMAN

1)Creating Directories

2)Verifying the RMAN backup database with control file

3)Creating pfile for clone database

4)Copying Password file for clone database

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

6)Moving backup files to the directories which created for clone database

7)Connecting Rman and issue duplicate command

Target database: TEST

Cloned database: TESTDB

STEP – 1

Verifying the database name, Backups available in RMAN(Target Database)

SQL> select name,open_mode from v$database;

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

Verifying the database name, Backups available in RMAN(Target DB)

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;
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=79 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 1 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

Step 2

Creating Pfile for TESTDB (Source DB)

*.audit_file_dest='/u01/app/oracle/admin/testdb/adump'
*.audit_trail='db'
*.compatible='19.0.0'
*.control_files='/u01/app/oracle/oradata/TESTDB/control07.ctl','/u01/app/oracle/oradata/TESTDB/control08.ctl'
*.db_block_size=8192
*.db_name='testdb'
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=testdbXDB)'
#*.memory_target=1024m
*.nls_language='AMERICAN'
*.nls_territory='AMERICA'
*.open_cursors=300
*.processes=300
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'
#*.db_recovery_file_dest size=2g
#*.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'

 

Step 3

Copy target database password file to Source database

[oratest@oracle ~] cp orapwtest orapwtestdb

[oratest@oracle ~] mkdir testdb

Step 4

Copying the RMAN backup pieces and control file auto backup to desired location ‘TESTDB’(source DB)

[oratest@oracle backup]$ cp c-8581000-20210824 /u01/app/oracle/oradata/testdb
[oratest@oracle backup]$ cp c-581000-20210824-02
 /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

Step 5

Verifying Listener and tns entries in Source DB Entry.

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)

Step 6

Making the clone Database in nomount state to duplicate the Database(source db)

[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/test' 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.

Step 7

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

RMAN Backup particular Datafile

RMAN Backup particular Datafile:

SQL> select tablespace_name, file_id from dba_data_files;

TABLESPACE_NAME               FILE_ID
------------------            ----------
USERS                             7
UNDOTBS1                          4
SYSTEM                            1
SYSAUX                            3
DATA                              5

RMAN>  backup datafile 1,3,5;

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=00005 name=/u01/app/oracle/oradata/data01.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/0c069cs6_1_1 
tag=TAG20210811T224942 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:46
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-04 
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 Archive log until SCN

RMAN Backup Archive logs until SCN:

SQL> select current_scn from v$database;

CURRENT_SCN
-----------
    2161903
RMAN>  backup archivelog until scn  2161903  delete input;

Starting backup at 12-AUG-21
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=60 device type=DISK
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=9 RECID=5 STAMP=1080341951
input archived log thread=1 sequence=10 RECID=6 STAMP=1080425353
channel ORA_DISK_1: starting piece 1 at 12-AUG-21
channel ORA_DISK_1: finished piece 1 at 12-AUG-21
piece handle=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/0q06buvj_1_1 
tag=TAG20210812T221059 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
channel ORA_DISK_1: deleting archived log(s)
archived log file 
name=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_9_1080337722.dbf RECID=5 
STAMP=1080341951
archived log file 
name=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_10_1080337722.dbf RECID=6 
STAMP=1080425353
Finished backup at 12-AUG-21

Starting Control File and SPFILE Autobackup at 12-AUG-21
piece handle=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/c-1608118455-20210812-00 
comment=NONE
Finished Control File and SPFILE Autobackup at 12-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 archive log all and skip Inaccessible

RMAN Backup archive logs all and skip Inaccessible:

RMAN> backup archivelog all skip inaccessible;

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=9 RECID=5 STAMP=1080341951
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/0i069ddv_1_1 
tag=TAG20210811T225911 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-07 
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 archive log and All Delete input

RMAN Backup archive log and All Delete input:

RMAN>  backup archivelog all delete input;

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
input archived log thread=1 sequence=8 RECID=4 STAMP=1080341856
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/0g069db0_1_1 
tag=TAG20210811T225736 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
channel ORA_DISK_1: deleting archived log(s)
archived log file 
name=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_5_1080337722.dbf 
RECID=1 STAMP=1080340278 archived log file 
name=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_6_1080337722.dbf 
RECID=2 STAMP=1080340342 archived log file 
name=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_7_1080337722.dbf 
RECID=3 STAMP=1080341803 archived log file 
name=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_8_1080337722.dbf 
RECID=4 STAMP=1080341856
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-06 
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 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