Wednesday, 31 July 2019

Catalog Database - Using RMAN Stored Scripts

We can create two type script one for local database and another for global database which is used for multiple database .
Below script example is for local script database.

[oracle@srv1 admin]$ rman target / catalog rcowner@smr2

Recovery Manager: Release 12.1.0.2.0 - Production on Wed Jul 31 17:38:18 2019

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

connected to target database: RAC (DBID=2599942250)
recovery catalog database Password:
connected to recovery catalog database

RMAN> CREATE SCRIPT FULL_DB_SCRIPT
{
BACKUP DATABASE PLUS ARCHIVELOG TAG 'FULL_DB';
}2> 3> 4>

created script FULL_DB_SCRIPT

RMAN> PRINT SCRIPT FULL_DB_SCRIPT;

printing stored script: FULL_DB_SCRIPT
{
BACKUP DATABASE PLUS ARCHIVELOG TAG 'FULL_DB';
}

RMAN> run { execute script FULL_DB_SCRIPT;}

executing script: FULL_DB_SCRIPT


Starting backup at 31-JUL-19
current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=61 instance=rac1 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=364 RECID=637 STAMP=1014903677
input archived log thread=2 sequence=281 RECID=639 STAMP=1014903722
input archived log thread=1 sequence=365 RECID=638 STAMP=1014903697
input archived log thread=1 sequence=366 RECID=640 STAMP=1014903723
input archived log thread=1 sequence=367 RECID=641 STAMP=1014903754
input archived log thread=2 sequence=282 RECID=644 STAMP=1014903873
input archived log thread=1 sequence=368 RECID=642 STAMP=1014903844
input archived log thread=1 sequence=369 RECID=643 STAMP=1014903871
input archived log thread=1 sequence=370 RECID=645 STAMP=1014903890
input archived log thread=2 sequence=283 RECID=648 STAMP=1014903948
input archived log thread=1 sequence=371 RECID=646 STAMP=1014903919
input archived log thread=1 sequence=372 RECID=647 STAMP=1014903939
input archived log thread=1 sequence=373 RECID=649 STAMP=1014903961
input archived log thread=2 sequence=284 RECID=652 STAMP=1014904043
input archived log thread=1 sequence=374 RECID=650 STAMP=1014903985
input archived log thread=1 sequence=375 RECID=651 STAMP=1014904041
input archived log thread=1 sequence=376 RECID=653 STAMP=1014904141
input archived log thread=2 sequence=285 RECID=656 STAMP=1014904224
input archived log thread=1 sequence=377 RECID=654 STAMP=1014904182
input archived log thread=1 sequence=378 RECID=655 STAMP=1014904223
input archived log thread=1 sequence=379 RECID=657 STAMP=1014904253
input archived log thread=2 sequence=286 RECID=660 STAMP=1014904350
input archived log thread=1 sequence=380 RECID=658 STAMP=1014904304
input archived log thread=1 sequence=381 RECID=659 STAMP=1014904345
input archived log thread=1 sequence=382 RECID=661 STAMP=1014904424
input archived log thread=2 sequence=287 RECID=664 STAMP=1014905565
input archived log thread=1 sequence=383 RECID=662 STAMP=1014905456
input archived log thread=1 sequence=384 RECID=663 STAMP=1014905565
input archived log thread=1 sequence=385 RECID=665 STAMP=1014906442
input archived log thread=2 sequence=288 RECID=668 STAMP=1014906956
input archived log thread=1 sequence=386 RECID=666 STAMP=1014906537
input archived log thread=1 sequence=387 RECID=667 STAMP=1014906954
input archived log thread=1 sequence=388 RECID=669 STAMP=1014907047
input archived log thread=2 sequence=289 RECID=670 STAMP=1014909100
input archived log thread=1 sequence=389 RECID=672 STAMP=1014909233
input archived log thread=2 sequence=290 RECID=671 STAMP=1014909104
input archived log thread=1 sequence=390 RECID=673 STAMP=1014910300
input archived log thread=1 sequence=391 RECID=674 STAMP=1014910305
input archived log thread=2 sequence=291 RECID=677 STAMP=1014916816
input archived log thread=1 sequence=392 RECID=675 STAMP=1014910319
input archived log thread=1 sequence=393 RECID=676 STAMP=1014916806
input archived log thread=2 sequence=292 RECID=678 STAMP=1014916819
input archived log thread=1 sequence=394 RECID=681 STAMP=1014933890
input archived log thread=2 sequence=293 RECID=679 STAMP=1014933730
input archived log thread=2 sequence=294 RECID=680 STAMP=1014933888
input archived log thread=2 sequence=295 RECID=682 STAMP=1014934263
input archived log thread=1 sequence=395 RECID=685 STAMP=1014934508
input archived log thread=2 sequence=296 RECID=683 STAMP=1014934384
channel ORA_DISK_1: starting piece 1 at 31-JUL-19
channel ORA_DISK_1: finished piece 1 at 31-JUL-19
piece handle=/u01/Backup/ora_df1015094778_s185_s1 tag=FULL_DB comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:02:06
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=338 RECID=599 STAMP=1014901090
input archived log thread=1 sequence=339 RECID=600 STAMP=1014901094
input archived log thread=2 sequence=269 RECID=602 STAMP=1014901108
input archived log thread=1 sequence=340 RECID=601 STAMP=1014901107
input archived log thread=1 sequence=341 RECID=603 STAMP=1014901109
input archived log thread=2 sequence=270 RECID=605 STAMP=1014902881
input archived log thread=1 sequence=342 RECID=604 STAMP=1014901924
input archived log thread=1 sequence=343 RECID=606 STAMP=1014902911
input archived log thread=2 sequence=271 RECID=607 STAMP=1014902946
input archived log thread=1 sequence=344 RECID=610 STAMP=1014903008
input archived log thread=2 sequence=272 RECID=608 STAMP=1014902979
input archived log thread=2 sequence=273 RECID=609 STAMP=1014903001
input archived log thread=2 sequence=274 RECID=611 STAMP=1014903030
input archived log thread=1 sequence=345 RECID=612 STAMP=1014903103
input archived log thread=2 sequence=275 RECID=616 STAMP=1014903324
input archived log thread=1 sequence=346 RECID=613 STAMP=1014903192
input archived log thread=1 sequence=347 RECID=614 STAMP=1014903254
input archived log thread=1 sequence=348 RECID=615 STAMP=1014903321
input archived log thread=1 sequence=349 RECID=617 STAMP=1014903344
input archived log thread=2 sequence=276 RECID=620 STAMP=1014903413
input archived log thread=1 sequence=350 RECID=618 STAMP=1014903376
input archived log thread=1 sequence=351 RECID=619 STAMP=1014903407
input archived log thread=1 sequence=352 RECID=621 STAMP=1014903425
input archived log thread=2 sequence=277 RECID=624 STAMP=1014903465
input archived log thread=1 sequence=353 RECID=622 STAMP=1014903439
input archived log thread=1 sequence=354 RECID=623 STAMP=1014903463
input archived log thread=1 sequence=355 RECID=625 STAMP=1014903491
input archived log thread=2 sequence=278 RECID=628 STAMP=1014903538
input archived log thread=1 sequence=356 RECID=626 STAMP=1014903516
input archived log thread=1 sequence=357 RECID=627 STAMP=1014903536
input archived log thread=1 sequence=358 RECID=629 STAMP=1014903555
input archived log thread=2 sequence=279 RECID=632 STAMP=1014903597
input archived log thread=1 sequence=359 RECID=630 STAMP=1014903575
input archived log thread=1 sequence=360 RECID=631 STAMP=1014903597
input archived log thread=1 sequence=361 RECID=633 STAMP=1014903616
input archived log thread=2 sequence=280 RECID=636 STAMP=1014903658
input archived log thread=1 sequence=362 RECID=634 STAMP=1014903634
input archived log thread=1 sequence=363 RECID=635 STAMP=1014903656
channel ORA_DISK_1: starting piece 1 at 31-JUL-19
channel ORA_DISK_1: finished piece 1 at 31-JUL-19
piece handle=/u01/Backup/ora_df1015094906_s186_s1 tag=FULL_DB comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:55
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=2 sequence=297 RECID=684 STAMP=1014934508
input archived log thread=2 sequence=298 RECID=686 STAMP=1014934542
input archived log thread=1 sequence=396 RECID=687 STAMP=1014961778
input archived log thread=2 sequence=299 RECID=689 STAMP=1014964614
input archived log thread=1 sequence=397 RECID=688 STAMP=1014961803
input archived log thread=1 sequence=398 RECID=690 STAMP=1014981565
input archived log thread=2 sequence=300 RECID=692 STAMP=1014992440
input archived log thread=1 sequence=399 RECID=691 STAMP=1014992440
input archived log thread=1 sequence=400 RECID=693 STAMP=1014992441
input archived log thread=2 sequence=301 RECID=695 STAMP=1015020068
input archived log thread=1 sequence=401 RECID=694 STAMP=1015014608
input archived log thread=1 sequence=402 RECID=698 STAMP=1015029032
input archived log thread=2 sequence=302 RECID=696 STAMP=1015020181
input archived log thread=2 sequence=303 RECID=697 STAMP=1015029030
input archived log thread=2 sequence=304 RECID=701 STAMP=1015060459
input archived log thread=1 sequence=403 RECID=699 STAMP=1015047883
input archived log thread=1 sequence=404 RECID=700 STAMP=1015060457
input archived log thread=1 sequence=405 RECID=702 STAMP=1015070508
input archived log thread=2 sequence=305 RECID=703 STAMP=1015070515
input archived log thread=2 sequence=306 RECID=704 STAMP=1015070519
input archived log thread=1 sequence=406 RECID=705 STAMP=1015071464
input archived log thread=2 sequence=307 RECID=707 STAMP=1015083977
input archived log thread=1 sequence=407 RECID=706 STAMP=1015071465
input archived log thread=2 sequence=308 RECID=708 STAMP=1015084005
input archived log thread=2 sequence=309 RECID=709 STAMP=1015084033
input archived log thread=2 sequence=310 RECID=710 STAMP=1015084060
input archived log thread=2 sequence=311 RECID=711 STAMP=1015084083
input archived log thread=2 sequence=312 RECID=712 STAMP=1015084117
input archived log thread=2 sequence=313 RECID=713 STAMP=1015084141
input archived log thread=2 sequence=314 RECID=714 STAMP=1015084165
input archived log thread=2 sequence=315 RECID=715 STAMP=1015084187
input archived log thread=2 sequence=316 RECID=716 STAMP=1015084208
input archived log thread=2 sequence=317 RECID=717 STAMP=1015084230
input archived log thread=2 sequence=318 RECID=718 STAMP=1015084243
input archived log thread=2 sequence=319 RECID=719 STAMP=1015084330
input archived log thread=2 sequence=320 RECID=721 STAMP=1015089192
input archived log thread=1 sequence=408 RECID=720 STAMP=1015089186
input archived log thread=1 sequence=409 RECID=723 STAMP=1015090785
input archived log thread=2 sequence=321 RECID=722 STAMP=1015090782
input archived log thread=2 sequence=322 RECID=724 STAMP=1015094276
input archived log thread=1 sequence=410 RECID=725 STAMP=1015094276
input archived log thread=2 sequence=323 RECID=727 STAMP=1015094769
input archived log thread=1 sequence=411 RECID=726 STAMP=1015094767
channel ORA_DISK_1: starting piece 1 at 31-JUL-19
channel ORA_DISK_1: finished piece 1 at 31-JUL-19
piece handle=/u01/Backup/ora_df1015095022_s187_s1 tag=FULL_DB comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:02:15
Finished backup at 31-JUL-19

Starting backup at 31-JUL-19
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=00002 name=+DATA/RAC/DATAFILE/idata.269.1014653909
input datafile file number=00003 name=+DATA/RAC/DATAFILE/sysaux.257.1011959959
input datafile file number=00009 name=+DATA/RAC/DATAFILE/soetbs.273.1015005687
input datafile file number=00001 name=+DATA/RAC/DATAFILE/system.258.1011960053
input datafile file number=00004 name=+DATA/RAC/DATAFILE/undotbs1.260.1011960171
input datafile file number=00005 name=+DATA/RAC/DATAFILE/undotbs2.265.1011960859
input datafile file number=00007 name=+DATA/RAC/DATAFILE/indx.270.1014656575
input datafile file number=00008 name=+DATA/RAC/DATAFILE/ilog.271.1014656841
input datafile file number=00006 name=+DATA/RAC/DATAFILE/users.259.1011960169
channel ORA_DISK_1: starting piece 1 at 31-JUL-19

channel ORA_DISK_1: finished piece 1 at 31-JUL-19
piece handle=/u01/Backup/ora_df1015095163_s188_s1 tag=TAG20190731T185241 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:10:55
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
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 31-JUL-19
channel ORA_DISK_1: finished piece 1 at 31-JUL-19
piece handle=/u01/Backup/ora_df1015095819_s189_s1 tag=TAG20190731T185241 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 31-JUL-19

Starting backup at 31-JUL-19
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=412 RECID=729 STAMP=1015095829
input archived log thread=2 sequence=324 RECID=728 STAMP=1015095829
channel ORA_DISK_1: starting piece 1 at 31-JUL-19
channel ORA_DISK_1: finished piece 1 at 31-JUL-19
piece handle=/u01/Backup/ora_df1015095835_s190_s1 tag=FULL_DB comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 31-JUL-19

RMAN>


IMPDP ERROR : ORA-39142: incompatible version number 5.1 in dump file

[oracle@srv2 Backup]$ impdp schemas=soe directory=expdpacfs dumpfile=soe.dmp logfile=soe_1.log

Import: Release 12.1.0.2.0 - Production on Wed Jul 31 13:44:23 2019

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

Username: / as sysdba

Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Advanced Analytics and Real Application Testing options
ORA-39001: invalid argument value
ORA-39000: bad dump file specification
ORA-39142: incompatible version number 5.1 in dump file "/u01/Backup/soe.dmp"


[oracle@srv2 Backup]$
C:\Users\varunyadav>expdp directory=testdir dumpfile=soe12_1.dmp logfile=soe12_1.log version=12.1 schemas=soe

Export: Release 12.2.0.1.0 - Production on Wed Jul 31 13:31:58 2019

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

Username: / as sysdba

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

Warning: Oracle Data Pump is exporting from a database that supports long identifiers to a version that does not support long identifiers.

Starting "SYS"."SYS_EXPORT_SCHEMA_01":  /******** AS SYSDBA directory=testdir dumpfile=soe12_1.dmp logfile=soe12_1.log version=12.1 schemas=soe

Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Processing object type SCHEMA_EXPORT/PACKAGE/PACKAGE_BODY
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/FUNCTIONAL_INDEX/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/BITMAP_INDEX/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type SCHEMA_EXPORT/STATISTICS/MARKER
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/SEQUENCE/SEQUENCE
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/IDENTITY_COLUMN
Processing object type SCHEMA_EXPORT/PACKAGE/PACKAGE_SPEC
Processing object type SCHEMA_EXPORT/FUNCTION/FUNCTION
Processing object type SCHEMA_EXPORT/PROCEDURE/PROCEDURE
Processing object type SCHEMA_EXPORT/PACKAGE/COMPILE_PACKAGE/PACKAGE_SPEC/ALTER_PACKAGE_SPEC
Processing object type SCHEMA_EXPORT/FUNCTION/ALTER_FUNCTION
Processing object type SCHEMA_EXPORT/PROCEDURE/ALTER_PROCEDURE
Processing object type SCHEMA_EXPORT/VIEW/VIEW
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/INDEX/FUNCTIONAL_INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/BITMAP_INDEX/INDEX
. . exported "SOE"."ORDER_ITEMS"                         170.4 MB 3735896 rows
. . exported "SOE"."ORDERS"                              114.9 MB 1352070 rows
. . exported "SOE"."INVENTORIES"                         15.27 MB  902171 rows
. . exported "SOE"."LOGON"                               9.065 MB  442208 rows
. . exported "SOE"."CUSTOMERS"                           4.983 MB   45703 rows
. . exported "SOE"."ADDRESSES"                           4.084 MB   55703 rows
. . exported "SOE"."CARD_DETAILS"                        2.402 MB   55703 rows
. . exported "SOE"."PRODUCT_DESCRIPTIONS"                224.1 KB    1000 rows
. . exported "SOE"."PRODUCT_INFORMATION"                 186.4 KB    1000 rows
. . exported "SOE"."EMP"                                 51.39 KB     879 rows
. . exported "SOE"."WAREHOUSES"                          36.03 KB    1000 rows
. . exported "SOE"."JOB_HISTORY"                         14.60 KB     246 rows
. . exported "SOE"."JOBS"                                5.976 KB      23 rows
. . exported "SOE"."ORDERENTRY_METADATA"                 5.609 KB       4 rows
. . exported "SOE"."DEPT"                                5.632 KB       7 rows
. . exported "SOE"."V"                                       0 KB       0 rows
Master table "SYS"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYS.SYS_EXPORT_SCHEMA_01 is:
  C:\DRILL_BACKUP\SOE12_1.DMP
Job "SYS"."SYS_EXPORT_SCHEMA_01" successfully completed at Wed Jul 31 13:33:22 2019 elapsed 0 00:01:20

C:\Users\varunyadav>


[oracle@srv2 Backup]$ impdp schemas=soe directory=expdpacfs dumpfile=SOE12_1.DMP logfile=soe_1.log

Import: Release 12.1.0.2.0 - Production on Wed Jul 31 15:45:21 2019

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

Username: / as sysdba

Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Advanced Analytics and Real Application Testing options
Master table "SYS"."SYS_IMPORT_SCHEMA_01" successfully loaded/unloaded
Starting "SYS"."SYS_IMPORT_SCHEMA_01":  /******** AS SYSDBA schemas=soe directory=expdpacfs dumpfile=SOE12_1.DMP logfile=soe_1.log
Processing object type SCHEMA_EXPORT/USER
ORA-31684: Object type USER:"SOE" already exists
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/SEQUENCE/SEQUENCE
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
. . imported "SOE"."ORDER_ITEMS"                         170.4 MB 3735896 rows
. . imported "SOE"."ORDERS"                              114.9 MB 1352070 rows
. . imported "SOE"."INVENTORIES"                         15.27 MB  902171 rows
. . imported "SOE"."LOGON"                               9.065 MB  442208 rows
. . imported "SOE"."CUSTOMERS"                           4.983 MB   45703 rows
. . imported "SOE"."ADDRESSES"                           4.084 MB   55703 rows
. . imported "SOE"."CARD_DETAILS"                        2.402 MB   55703 rows
. . imported "SOE"."PRODUCT_DESCRIPTIONS"                224.1 KB    1000 rows
. . imported "SOE"."PRODUCT_INFORMATION"                 186.4 KB    1000 rows
. . imported "SOE"."EMP"                                 51.39 KB     879 rows
. . imported "SOE"."WAREHOUSES"                          36.03 KB    1000 rows
. . imported "SOE"."JOB_HISTORY"                         14.60 KB     246 rows
. . imported "SOE"."JOBS"                                5.976 KB      23 rows
. . imported "SOE"."ORDERENTRY_METADATA"                 5.609 KB       4 rows
. . imported "SOE"."DEPT"                                5.632 KB       7 rows
. . imported "SOE"."V"                                       0 KB       0 rows
Processing object type SCHEMA_EXPORT/TABLE/IDENTITY_COLUMN
Processing object type SCHEMA_EXPORT/PACKAGE/PACKAGE_SPEC
Processing object type SCHEMA_EXPORT/FUNCTION/FUNCTION
Processing object type SCHEMA_EXPORT/PROCEDURE/PROCEDURE
Processing object type SCHEMA_EXPORT/PACKAGE/COMPILE_PACKAGE/PACKAGE_SPEC/ALTER_PACKAGE_SPEC
Processing object type SCHEMA_EXPORT/FUNCTION/ALTER_FUNCTION
Processing object type SCHEMA_EXPORT/PROCEDURE/ALTER_PROCEDURE
Processing object type SCHEMA_EXPORT/VIEW/VIEW
Processing object type SCHEMA_EXPORT/PACKAGE/PACKAGE_BODY
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/INDEX/FUNCTIONAL_INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/FUNCTIONAL_INDEX/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/BITMAP_INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/BITMAP_INDEX/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type SCHEMA_EXPORT/STATISTICS/MARKER
ORA-39367: Statistcis are being skipped.  Cannot locate the time zone version 26 file.
ORA-39082: Object type PACKAGE BODY:"SOE"."ORDERENTRY" created with compilation warnings
Job "SYS"."SYS_IMPORT_SCHEMA_01" completed with 3 error(s) at Wed Jul 31 15:54:36 2019 elapsed 0 00:09:05

[oracle@srv2 Backup]$
[oracle@srv2 Backup]$

SQL> exec dbms_stats.gather_schema_stats('SOE',cascade => TRUE,estimate_percent =>30);

PL/SQL procedure successfully completed.

SQL> EXEC DBMS_UTILITY.COMPILE_SCHEMA(schema=>'SOE');

PL/SQL procedure successfully completed.

SQL> SELECT count(*),object_type,STATUS from dba_objects WHERE OWNER='SOE' group by object_type,status;

  COUNT(*) OBJECT_TYPE             STATUS
---------- ----------------------- -------
         1 FUNCTION                VALID
         1 PACKAGE                 VALID
         7 SEQUENCE                VALID
         1 PACKAGE BODY            VALID
        16 TABLE                   VALID
        33 INDEX                   VALID
         1 PROCEDURE               VALID
         2 VIEW                    VALID

8 rows selected.

SQL>


voting disk backup 12c R1

From 12c R1c ocr automatically cover voting disk backup

[root@srv1 ~]# crsctl query css votedisk
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   191100f424684fb8bf5a3aec36212cf8 (/dev/oracleasm/disks/CRS1) [CRS]
 2. ONLINE   a877e9df84674f1cbfa51de258e3c9b4 (/dev/oracleasm/disks/CRS2) [CRS]
 3. ONLINE   b1090b725a014f28bf1b30b7bc122076 (/dev/oracleasm/disks/CRS3) [CRS]
Located 3 voting disk(s).
[root@srv1 ~]#


[root@srv1 ~]# dd if=/dev/oracleasm/disks/CRS1 of=/u01/voting.dmp bs=1k count=500k
512000+0 records in
512000+0 records out
524288000 bytes (524 MB) copied, 19.3217 s, 27.1 MB/s
[root@srv1 ~]#

Enable Block Change Tracking

SQL> select status,filename from v$block_change_tracking;

STATUS     FILENAME
---------- ----------------------------------------
DISABLED



SQL> alter database enable block change tracking;

Database altered.

SQL> select status,filename from v$block_change_tracking;

STATUS     FILENAME
---------- ----------------------------------------
ENABLED    +DATA/RAC/CHANGETRACKING/ctf.272.1014664
           987



RMAN> backup incremental level 1 database tag "bkplvl1_BCT";


RMAN> SELECT USED_CHANGE_TRACKING, FILE#, AVG(DATAFILE_BLOCKS), AVG(BLOCKS_READ) FROM   V$BACKUP_DATAFILE WHERE  INCREMENTAL_LEVEL > 0  GROUP  BY USED_CHANGE_TRACKING, FILE# ORDER BY 1;

USE      FILE# AVG(DATAFILE_BLOCKS) AVG(BLOCKS_READ)
--- ---------- -------------------- ----------------
NO           1               111360           102400
NO           2               307200           288896
NO           3               189440           179776
NO           4                25600 4693.33333333333
NO           5                25600 2453.33333333333
NO           6                  640              256
NO           7                12800              128
NO           8                12800              832

8 rows selected

RMAN>


RMAN Backup with Multisection Option

RMAN> report schema;

Report of database schema for database with db_unique_name RAC

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    880      SYSTEM               YES     +DATA/RAC/DATAFILE/system.258.1011960053
2    2400     IDATA                NO      +DATA/RAC/DATAFILE/idata.269.1014653909
3    1480     SYSAUX               NO      +DATA/RAC/DATAFILE/sysaux.257.1011959959
4    200      UNDOTBS1             YES     +DATA/RAC/DATAFILE/undotbs1.260.1011960171
5    200      UNDOTBS2             YES     +DATA/RAC/DATAFILE/undotbs2.265.1011960859
6    5        USERS                NO      +DATA/RAC/DATAFILE/users.259.1011960169
7    100      INDX                 NO      +DATA/RAC/DATAFILE/indx.270.1014656575
8    100      ILOG                 NO      +DATA/RAC/DATAFILE/ilog.271.1014656841

List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    214      TEMP                 32767       +DATA/RAC/TEMPFILE/temp.264.1011960267

RMAN> RUN
{
ALLOCATE CHANNEL c1 DEVICE TYPE DISK;
ALLOCATE CHANNEL c2 DEVICE TYPE DISK;
BACKUP TABLESPACE IDATA TAG 'IDATA_MULTIS' SECTION SIZE 1200M;
}2> 3> 4> 5> 6>

allocated channel: c1
channel c1: SID=84 instance=rac1 device type=DISK

allocated channel: c2
channel c2: SID=59 instance=rac1 device type=DISK

Starting backup at 30-JUL-19
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00002 name=+DATA/RAC/DATAFILE/idata.269.1014653909
backing up blocks 1 through 153600
channel c1: starting piece 1 at 30-JUL-19
channel c2: starting full datafile backup set
channel c2: specifying datafile(s) in backup set
input datafile file number=00002 name=+DATA/RAC/DATAFILE/idata.269.1014653909
backing up blocks 153601 through 307200
channel c2: starting piece 2 at 30-JUL-19

channel c1: finished piece 1 at 30-JUL-19
piece handle=+FRA/RAC/BACKUPSET/2019_07_30/nnndf0_idata_multis_0.417.1014989245 tag=IDATA_MULTIS comment=NONE
channel c1: backup set complete, elapsed time: 00:03:45
channel c2: finished piece 2 at 30-JUL-19
piece handle=+FRA/RAC/BACKUPSET/2019_07_30/nnndf0_idata_multis_0.420.1014989247 tag=IDATA_MULTIS comment=NONE
channel c2: backup set complete, elapsed time: 00:03:45
Finished backup at 30-JUL-19

Starting Control File and SPFILE Autobackup at 30-JUL-19
piece handle=+FRA/RAC/AUTOBACKUP/2019_07_30/s_1014989470.419.1014989473 comment=NONE
Finished Control File and SPFILE Autobackup at 30-JUL-19
released channel: c1
released channel: c2

RMAN>
RMAN> list backupset TAG 'IDATA_MULTIS';


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


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
128     Full    2.14G      DISK        00:03:40     30-JUL-19
  List of Datafiles in backup set 128
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  2       Full 13961427   30-JUL-19 +DATA/RAC/DATAFILE/idata.269.1014653909

  Backup Set Copy #1 of backup set 128
  Device Type Elapsed Time Completion Time Compressed Tag
  ----------- ------------ --------------- ---------- ---
  DISK        00:03:40     30-JUL-19       NO         IDATA_MULTIS

    List of Backup Pieces for backup set 128 Copy #1
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    129     1   AVAILABLE   +FRA/RAC/BACKUPSET/2019_07_30/nnndf0_idata_multis_0.417.1014989245
    128     2   AVAILABLE   +FRA/RAC/BACKUPSET/2019_07_30/nnndf0_idata_multis_0.420.1014989247

RMAN>

Tuesday, 30 July 2019

Configuring Backup Retention Policy

RMAN> show retention policy;

RMAN configuration parameters for database with db_unique_name RAC are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default

RMAN> CONFIGURE RETENTION POLICY TO REDUNDANCY 2;

new RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
new RMAN configuration parameters are successfully stored

RMAN> BACKUP TABLESPACE USERS TAG 'USERS_TBS' ;

Starting backup at 29-JUL-19
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=40 instance=rac1 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=00006 name=+DATA/RAC/DATAFILE/users.259.1011960169
channel ORA_DISK_1: starting piece 1 at 29-JUL-19
channel ORA_DISK_1: finished piece 1 at 29-JUL-19
piece handle=/u01/Backup/ora_df1014911059_s152_s1 tag=USERS_TBS comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:04
Finished backup at 29-JUL-19

Starting Control File and SPFILE Autobackup at 29-JUL-19
piece handle=+FRA/RAC/AUTOBACKUP/2019_07_29/s_1014911063.334.1014911067 comment=NONE
Finished Control File and SPFILE Autobackup at 29-JUL-19

RMAN> BACKUP TABLESPACE USERS TAG 'USERS_TBS' ;

Starting backup at 29-JUL-19
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=00006 name=+DATA/RAC/DATAFILE/users.259.1011960169
channel ORA_DISK_1: starting piece 1 at 29-JUL-19
channel ORA_DISK_1: finished piece 1 at 29-JUL-19
piece handle=/u01/Backup/ora_df1014911110_s154_s1 tag=USERS_TBS comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 29-JUL-19

Starting Control File and SPFILE Autobackup at 29-JUL-19
piece handle=+FRA/RAC/AUTOBACKUP/2019_07_29/s_1014911114.333.1014911119 comment=NONE
Finished Control File and SPFILE Autobackup at 29-JUL-19

RMAN> BACKUP TABLESPACE USERS TAG 'USERS_TBS' ;

Starting backup at 29-JUL-19
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=00006 name=+DATA/RAC/DATAFILE/users.259.1011960169
channel ORA_DISK_1: starting piece 1 at 29-JUL-19
channel ORA_DISK_1: finished piece 1 at 29-JUL-19
piece handle=/u01/Backup/ora_df1014911129_s156_s1 tag=USERS_TBS comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 29-JUL-19

Starting Control File and SPFILE Autobackup at 29-JUL-19
piece handle=+FRA/RAC/AUTOBACKUP/2019_07_29/s_1014911132.323.1014911135 comment=NONE
Finished Control File and SPFILE Autobackup at 29-JUL-19

RMAN> list backup of tablespace users;


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


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
118     Full    1.61M      DISK        00:00:02     29-JUL-19
        BP Key: 118   Status: AVAILABLE  Compressed: NO  Tag: USERS_TBS
        Piece Name: /u01/Backup/ora_df1014911059_s152_s1
  List of Datafiles in backup set 118
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  6       Full 13631389   29-JUL-19 +DATA/RAC/DATAFILE/users.259.1011960169

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
120     Full    1.61M      DISK        00:00:01     29-JUL-19
        BP Key: 120   Status: AVAILABLE  Compressed: NO  Tag: USERS_TBS
        Piece Name: /u01/Backup/ora_df1014911110_s154_s1
  List of Datafiles in backup set 120
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  6       Full 13631449   29-JUL-19 +DATA/RAC/DATAFILE/users.259.1011960169

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
122     Full    1.61M      DISK        00:00:02     29-JUL-19
        BP Key: 122   Status: AVAILABLE  Compressed: NO  Tag: USERS_TBS
        Piece Name: /u01/Backup/ora_df1014911129_s156_s1
  List of Datafiles in backup set 122
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  6       Full 13631487   29-JUL-19 +DATA/RAC/DATAFILE/users.259.1011960169

RMAN> BACKUP TABLESPACE USERS TAG 'USERS_TBS' ;

Starting backup at 29-JUL-19
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=00006 name=+DATA/RAC/DATAFILE/users.259.1011960169
channel ORA_DISK_1: starting piece 1 at 29-JUL-19
channel ORA_DISK_1: finished piece 1 at 29-JUL-19
piece handle=/u01/Backup/ora_df1014911194_s158_s1 tag=USERS_TBS comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 29-JUL-19

Starting Control File and SPFILE Autobackup at 29-JUL-19
piece handle=+FRA/RAC/AUTOBACKUP/2019_07_29/s_1014911197.406.1014911201 comment=NONE
Finished Control File and SPFILE Autobackup at 29-JUL-19

RMAN> list backup of tablespace users;


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


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
118     Full    1.61M      DISK        00:00:02     29-JUL-19
        BP Key: 118   Status: AVAILABLE  Compressed: NO  Tag: USERS_TBS
        Piece Name: /u01/Backup/ora_df1014911059_s152_s1
  List of Datafiles in backup set 118
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  6       Full 13631389   29-JUL-19 +DATA/RAC/DATAFILE/users.259.1011960169

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
120     Full    1.61M      DISK        00:00:01     29-JUL-19
        BP Key: 120   Status: AVAILABLE  Compressed: NO  Tag: USERS_TBS
        Piece Name: /u01/Backup/ora_df1014911110_s154_s1
  List of Datafiles in backup set 120
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  6       Full 13631449   29-JUL-19 +DATA/RAC/DATAFILE/users.259.1011960169

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
122     Full    1.61M      DISK        00:00:02     29-JUL-19
        BP Key: 122   Status: AVAILABLE  Compressed: NO  Tag: USERS_TBS
        Piece Name: /u01/Backup/ora_df1014911129_s156_s1
  List of Datafiles in backup set 122
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  6       Full 13631487   29-JUL-19 +DATA/RAC/DATAFILE/users.259.1011960169

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
124     Full    1.61M      DISK        00:00:01     29-JUL-19
        BP Key: 124   Status: AVAILABLE  Compressed: NO  Tag: USERS_TBS
        Piece Name: /u01/Backup/ora_df1014911194_s158_s1
  List of Datafiles in backup set 124
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  6       Full 13633045   29-JUL-19 +DATA/RAC/DATAFILE/users.259.1011960169

RMAN> report obsolete;

RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 2
Report of obsolete backups and copies
Type                 Key    Completion Time    Filename/Handle
-------------------- ------ ------------------ --------------------
Control File Copy     1      04-JUL-19          /u01/Backup/control01_cf_D-RAC_id-2599942250_0du5r0t3.bak
Control File Copy     2      04-JUL-19          /u01/Backup/control01_cf_D-RAC_id-2599942250_10u5r2a2.bak
Control File Copy     7      05-JUL-19          /u01/Backup/control01_cf_D-RAC_id-2599942250_2gu5thq7.bak
Datafile Copy        24     26-JUL-19          /u01/Backup/ora_df1014666451_s150_s1
Backup Set           117    26-JUL-19
  Backup Piece       117    26-JUL-19          +FRA/RAC/AUTOBACKUP/2019_07_26/s_1014666455.283.1014666457
Backup Set           118    29-JUL-19
  Backup Piece       118    29-JUL-19          /u01/Backup/ora_df1014911059_s152_s1
Backup Set           119    29-JUL-19
  Backup Piece       119    29-JUL-19          +FRA/RAC/AUTOBACKUP/2019_07_29/s_1014911063.334.1014911067
Backup Set           120    29-JUL-19
  Backup Piece       120    29-JUL-19          /u01/Backup/ora_df1014911110_s154_s1
Backup Set           121    29-JUL-19
  Backup Piece       121    29-JUL-19          +FRA/RAC/AUTOBACKUP/2019_07_29/s_1014911114.333.1014911119

RMAN> delete obsolete;

RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 2
using channel ORA_DISK_1
Deleting the following obsolete backups and copies:
Type                 Key    Completion Time    Filename/Handle
-------------------- ------ ------------------ --------------------
Control File Copy     1      04-JUL-19          /u01/Backup/control01_cf_D-RAC_id-2599942250_0du5r0t3.bak
Control File Copy     2      04-JUL-19          /u01/Backup/control01_cf_D-RAC_id-2599942250_10u5r2a2.bak
Control File Copy     7      05-JUL-19          /u01/Backup/control01_cf_D-RAC_id-2599942250_2gu5thq7.bak
Datafile Copy        24     26-JUL-19          /u01/Backup/ora_df1014666451_s150_s1
Backup Set           117    26-JUL-19
  Backup Piece       117    26-JUL-19          +FRA/RAC/AUTOBACKUP/2019_07_26/s_1014666455.283.1014666457
Backup Set           118    29-JUL-19
  Backup Piece       118    29-JUL-19          /u01/Backup/ora_df1014911059_s152_s1
Backup Set           119    29-JUL-19
  Backup Piece       119    29-JUL-19          +FRA/RAC/AUTOBACKUP/2019_07_29/s_1014911063.334.1014911067
Backup Set           120    29-JUL-19
  Backup Piece       120    29-JUL-19          /u01/Backup/ora_df1014911110_s154_s1
Backup Set           121    29-JUL-19
  Backup Piece       121    29-JUL-19          +FRA/RAC/AUTOBACKUP/2019_07_29/s_1014911114.333.1014911119

Do you really want to delete the above objects (enter YES or NO)? yes
deleted backup piece
backup piece handle=+FRA/RAC/AUTOBACKUP/2019_07_26/s_1014666455.283.1014666457 RECID=117 STAMP=1014666456
deleted backup piece
backup piece handle=/u01/Backup/ora_df1014911059_s152_s1 RECID=118 STAMP=1014911061
deleted backup piece
backup piece handle=+FRA/RAC/AUTOBACKUP/2019_07_29/s_1014911063.334.1014911067 RECID=119 STAMP=1014911067
deleted backup piece
backup piece handle=/u01/Backup/ora_df1014911110_s154_s1 RECID=120 STAMP=1014911111
deleted backup piece
backup piece handle=+FRA/RAC/AUTOBACKUP/2019_07_29/s_1014911114.333.1014911119 RECID=121 STAMP=1014911119
Deleted 5 objects

RMAN-06207: WARNING: 4 objects could not be deleted for DISK channel(s) due
RMAN-06208:          to mismatched status.  Use CROSSCHECK command to fix status
RMAN-06210: List of Mismatched objects
RMAN-06211: ==========================
RMAN-06212:   Object Type   Filename/Handle
RMAN-06213: --------------- ---------------------------------------------------
RMAN-06214: Control File Copy /u01/Backup/control01_cf_D-RAC_id-2599942250_0du5r0t3.bak
RMAN-06214: Control File Copy /u01/Backup/control01_cf_D-RAC_id-2599942250_10u5r2a2.bak
RMAN-06214: Control File Copy /u01/Backup/control01_cf_D-RAC_id-2599942250_2gu5thq7.bak
RMAN-06214: Datafile Copy   /u01/Backup/ora_df1014666451_s150_s1


RMAN>

Enabling Block Compression BASIC | LOW | MEDIUM | HIGH

BASIC -  standard license 

LOW, MEDIUM,HIGH - Oracle Advanced Compression license 

RMAN> show compression algorithm;

RMAN configuration parameters for database with db_unique_name RAC are:
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default



RMAN> show all;

RMAN configuration parameters for database with db_unique_name RAC are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
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/Backup/ora_df%t_s%s_s%p';
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 21 DAYS;
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '+FRA/RAC/CONTROLFILE/snapcf_rac1.f';


RMAN> configure COMPRESSION ALGORITHM 'MEDIUM';

new RMAN configuration parameters:
CONFIGURE COMPRESSION ALGORITHM 'MEDIUM' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE;
new RMAN configuration parameters are successfully stored


RMAN> configure COMPRESSION ALGORITHM 'HIGH';

old RMAN configuration parameters:
CONFIGURE COMPRESSION ALGORITHM 'MEDIUM' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE;
new RMAN configuration parameters:
CONFIGURE COMPRESSION ALGORITHM 'HIGH' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE;
new RMAN configuration parameters are successfully stored


RMAN> configure COMPRESSION ALGORITHM 'LOW';

old RMAN configuration parameters:
CONFIGURE COMPRESSION ALGORITHM 'HIGH' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE;
new RMAN configuration parameters:
CONFIGURE COMPRESSION ALGORITHM 'LOW' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE;
new RMAN configuration parameters are successfully stored


RMAN> CONFIGURE COMPRESSION ALGORITHM 'BASIC' OPTIMIZE FOR LOAD FALSE;

old RMAN configuration parameters:
CONFIGURE COMPRESSION ALGORITHM 'LOW' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE;
new RMAN configuration parameters:
CONFIGURE COMPRESSION ALGORITHM 'BASIC' OPTIMIZE FOR LOAD FALSE AS OF RELEASE 'DEFAULT';
new RMAN configuration parameters are successfully stored

RMAN>



Friday, 26 July 2019

Rman Backup database plus archivelog sequences Execution


The execution will be as follows:

1. Run an ALTER SYSTEM ARCHIVE LOG CURRENT statement

2. Run the BACKUP ARCHIVELOG ALL command

3. Back up the files specified in the BACKUPcommand

4. Run an ALTER SYSTEM ARCHIVE LOG CURRENT statement

5. Back up any remaining archived redo log files


RMAN> backup database plus archivelog;


Starting backup at 26-JUL-19
current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=86 instance=rac1 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=2 sequence=171 RECID=344 STAMP=1013984588
input archived log thread=1 sequence=179 RECID=342 STAMP=1013984560
input archived log thread=1 sequence=180 RECID=343 STAMP=1013984587
input archived log thread=1 sequence=181 RECID=345 STAMP=1013988631
input archived log thread=2 sequence=172 RECID=346 STAMP=1014018988
input archived log thread=1 sequence=182 RECID=347 STAMP=1014024631
input archived log thread=2 sequence=173 RECID=348 STAMP=1014057043
input archived log thread=1 sequence=183 RECID=349 STAMP=1014060610
input archived log thread=2 sequence=174 RECID=350 STAMP=1014069771
input archived log thread=1 sequence=184 RECID=351 STAMP=1014071046
input archived log thread=2 sequence=175 RECID=353 STAMP=1014078641
input archived log thread=1 sequence=185 RECID=352 STAMP=1014075035
input archived log thread=1 sequence=186 RECID=356 STAMP=1014104600
input archived log thread=2 sequence=176 RECID=354 STAMP=1014098518
input archived log thread=2 sequence=177 RECID=355 STAMP=1014104598
input archived log thread=2 sequence=178 RECID=357 STAMP=1014118213
input archived log thread=1 sequence=187 RECID=359 STAMP=1014139825
input archived log thread=2 sequence=179 RECID=358 STAMP=1014127420
input archived log thread=2 sequence=180 RECID=360 STAMP=1014141828
input archived log thread=1 sequence=188 RECID=362 STAMP=1014157547
input archived log thread=2 sequence=181 RECID=361 STAMP=1014156252
input archived log thread=2 sequence=182 RECID=364 STAMP=1014179432
input archived log thread=1 sequence=189 RECID=363 STAMP=1014161450
input archived log thread=1 sequence=190 RECID=366 STAMP=1014197456
input archived log thread=2 sequence=183 RECID=365 STAMP=1014184966
input archived log thread=2 sequence=184 RECID=367 STAMP=1014199604
input archived log thread=1 sequence=191 RECID=370 STAMP=1014228510
channel ORA_DISK_1: starting piece 1 at 26-JUL-19
channel ORA_DISK_1: finished piece 1 at 26-JUL-19
piece handle=/u01/Backup/ora_df1014640728_s121_s1 tag=TAG20190726T123846 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:16
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=2 sequence=185 RECID=368 STAMP=1014214097
input archived log thread=2 sequence=186 RECID=369 STAMP=1014228507
input archived log thread=2 sequence=187 RECID=371 STAMP=1014242973
input archived log thread=1 sequence=192 RECID=373 STAMP=1014260983
input archived log thread=2 sequence=188 RECID=372 STAMP=1014255018
input archived log thread=2 sequence=189 RECID=374 STAMP=1014291025
input archived log thread=1 sequence=193 RECID=375 STAMP=1014296469
input archived log thread=2 sequence=190 RECID=376 STAMP=1014306867
input archived log thread=1 sequence=194 RECID=377 STAMP=1014306868
input archived log thread=1 sequence=195 RECID=378 STAMP=1014307115
input archived log thread=2 sequence=191 RECID=379 STAMP=1014307116
input archived log thread=2 sequence=192 RECID=380 STAMP=1014307117
input archived log thread=1 sequence=196 RECID=381 STAMP=1014307123
input archived log thread=2 sequence=193 RECID=382 STAMP=1014307125
input archived log thread=2 sequence=194 RECID=383 STAMP=1014307126
input archived log thread=1 sequence=197 RECID=384 STAMP=1014310985
input archived log thread=2 sequence=195 RECID=385 STAMP=1014313363
input archived log thread=1 sequence=198 RECID=387 STAMP=1014313375
input archived log thread=2 sequence=196 RECID=386 STAMP=1014313370
input archived log thread=1 sequence=199 RECID=389 STAMP=1014315028
input archived log thread=2 sequence=197 RECID=388 STAMP=1014315028
input archived log thread=2 sequence=198 RECID=390 STAMP=1014316005
input archived log thread=1 sequence=200 RECID=391 STAMP=1014316010
input archived log thread=1 sequence=201 RECID=393 STAMP=1014321086
input archived log thread=2 sequence=199 RECID=392 STAMP=1014321085
input archived log thread=2 sequence=200 RECID=394 STAMP=1014321094
input archived log thread=1 sequence=202 RECID=395 STAMP=1014321095
input archived log thread=1 sequence=203 RECID=396 STAMP=1014321790
input archived log thread=2 sequence=201 RECID=398 STAMP=1014376807
input archived log thread=1 sequence=204 RECID=397 STAMP=1014376802
input archived log thread=2 sequence=202 RECID=399 STAMP=1014376811
input archived log thread=1 sequence=205 RECID=401 STAMP=1014376824
input archived log thread=2 sequence=203 RECID=400 STAMP=1014376823
input archived log thread=2 sequence=204 RECID=402 STAMP=1014376826
input archived log thread=1 sequence=206 RECID=403 STAMP=1014377286
input archived log thread=1 sequence=207 RECID=404 STAMP=1014409819
input archived log thread=1 sequence=208 RECID=405 STAMP=1014415384
input archived log thread=1 sequence=209 RECID=406 STAMP=1014435037
input archived log thread=1 sequence=210 RECID=407 STAMP=1014469488
input archived log thread=1 sequence=211 RECID=408 STAMP=1014483011
input archived log thread=2 sequence=205 RECID=410 STAMP=1014483020
input archived log thread=1 sequence=212 RECID=409 STAMP=1014483015
input archived log thread=2 sequence=206 RECID=411 STAMP=1014483780
input archived log thread=2 sequence=207 RECID=412 STAMP=1014483784
input archived log thread=1 sequence=213 RECID=414 STAMP=1014483796
input archived log thread=2 sequence=208 RECID=413 STAMP=1014483795
input archived log thread=2 sequence=209 RECID=415 STAMP=1014483797
input archived log thread=1 sequence=214 RECID=416 STAMP=1014487307
input archived log thread=2 sequence=210 RECID=417 STAMP=1014487314
input archived log thread=1 sequence=215 RECID=418 STAMP=1014487316
input archived log thread=2 sequence=211 RECID=419 STAMP=1014491334
input archived log thread=1 sequence=216 RECID=420 STAMP=1014491339
input archived log thread=1 sequence=217 RECID=422 STAMP=1014491348
input archived log thread=2 sequence=212 RECID=421 STAMP=1014491346
input archived log thread=2 sequence=213 RECID=423 STAMP=1014501726
input archived log thread=1 sequence=218 RECID=425 STAMP=1014525034
input archived log thread=2 sequence=214 RECID=424 STAMP=1014503924
input archived log thread=2 sequence=215 RECID=426 STAMP=1014539421
input archived log thread=1 sequence=219 RECID=427 STAMP=1014563397
input archived log thread=2 sequence=216 RECID=428 STAMP=1014563406
input archived log thread=2 sequence=217 RECID=429 STAMP=1014563411
input archived log thread=1 sequence=220 RECID=430 STAMP=1014563412
input archived log thread=1 sequence=221 RECID=432 STAMP=1014577234
input archived log thread=2 sequence=218 RECID=431 STAMP=1014574197
channel ORA_DISK_1: starting piece 1 at 26-JUL-19
channel ORA_DISK_1: finished piece 1 at 26-JUL-19
piece handle=/u01/Backup/ora_df1014640805_s122_s1 tag=TAG20190726T123846 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:55
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=2 sequence=219 RECID=435 STAMP=1014588134
input archived log thread=1 sequence=222 RECID=433 STAMP=1014577239
input archived log thread=1 sequence=223 RECID=434 STAMP=1014588132
input archived log thread=1 sequence=224 RECID=436 STAMP=1014588320
input archived log thread=2 sequence=220 RECID=437 STAMP=1014615026
input archived log thread=1 sequence=225 RECID=438 STAMP=1014622210
input archived log thread=2 sequence=221 RECID=440 STAMP=1014640268
input archived log thread=1 sequence=226 RECID=439 STAMP=1014640265
input archived log thread=1 sequence=227 RECID=442 STAMP=1014640378
input archived log thread=2 sequence=222 RECID=441 STAMP=1014640375
input archived log thread=2 sequence=223 RECID=444 STAMP=1014640403
input archived log thread=1 sequence=228 RECID=443 STAMP=1014640399
input archived log thread=1 sequence=229 RECID=446 STAMP=1014640411
input archived log thread=2 sequence=224 RECID=445 STAMP=1014640409
input archived log thread=2 sequence=225 RECID=448 STAMP=1014640425
input archived log thread=1 sequence=230 RECID=447 STAMP=1014640423
input archived log thread=1 sequence=231 RECID=449 STAMP=1014640436
input archived log thread=2 sequence=226 RECID=450 STAMP=1014640437
input archived log thread=1 sequence=232 RECID=452 STAMP=1014640646
input archived log thread=2 sequence=227 RECID=451 STAMP=1014640645
input archived log thread=2 sequence=228 RECID=453 STAMP=1014640719
input archived log thread=1 sequence=233 RECID=454 STAMP=1014640721
channel ORA_DISK_1: starting piece 1 at 26-JUL-19
channel ORA_DISK_1: finished piece 1 at 26-JUL-19
piece handle=/u01/Backup/ora_df1014640863_s123_s1 tag=TAG20190726T123846 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:25
Finished backup at 26-JUL-19

Starting backup at 26-JUL-19
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=00003 name=+DATA/RAC/DATAFILE/sysaux.257.1011959959
input datafile file number=00001 name=+DATA/RAC/DATAFILE/system.258.1011960053
input datafile file number=00004 name=+DATA/RAC/DATAFILE/undotbs1.260.1011960171
input datafile file number=00005 name=+DATA/RAC/DATAFILE/undotbs2.265.1011960859
input datafile file number=00006 name=+DATA/RAC/DATAFILE/users.259.1011960169
channel ORA_DISK_1: starting piece 1 at 26-JUL-19
channel ORA_DISK_1: finished piece 1 at 26-JUL-19
piece handle=/u01/Backup/ora_df1014640890_s124_s1 tag=TAG20190726T124129 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:03:46
Finished backup at 26-JUL-19

Starting backup at 26-JUL-19
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=2 sequence=229 RECID=456 STAMP=1014641118
input archived log thread=1 sequence=234 RECID=455 STAMP=1014641117
channel ORA_DISK_1: starting piece 1 at 26-JUL-19
channel ORA_DISK_1: finished piece 1 at 26-JUL-19
piece handle=/u01/Backup/ora_df1014641121_s125_s1 tag=TAG20190726T124521 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 26-JUL-19

Starting Control File and SPFILE Autobackup at 26-JUL-19
piece handle=+FRA/RAC/AUTOBACKUP/2019_07_26/s_1014641124.322.1014641127 comment=NONE
Finished Control File and SPFILE Autobackup at 26-JUL-19

RMAN>

Backing Up Control Files

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;

old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored

RMAN> BACKUP TABLESPACE users INCLUDE CURRENT CONTROLFILE;

Starting backup at 25-JUL-19
using channel ORA_DISK_1
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 25-JUL-19
channel ORA_DISK_1: finished piece 1 at 25-JUL-19
piece handle=+FRA/RAC/BACKUPSET/2019_07_25/ncnnf0_tag20190725t192423_0.401.1014578667 tag=TAG20190725T192423 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:04
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00006 name=+DATA/RAC/DATAFILE/users.259.1011960169
channel ORA_DISK_1: starting piece 1 at 25-JUL-19
channel ORA_DISK_1: finished piece 1 at 25-JUL-19
piece handle=+FRA/RAC/BACKUPSET/2019_07_25/nnndf0_tag20190725t192423_0.325.1014578671 tag=TAG20190725T192423 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 25-JUL-19

Starting Control File and SPFILE Autobackup at 25-JUL-19
piece handle=+FRA/RAC/AUTOBACKUP/2019_07_25/s_1014578672.326.1014578675 comment=NONE
Finished Control File and SPFILE Autobackup at 25-JUL-19

RMAN> BACKUP CURRENT CONTROLFILE;

Starting backup at 25-JUL-19
using channel ORA_DISK_1
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 25-JUL-19
channel ORA_DISK_1: finished piece 1 at 25-JUL-19
piece handle=+FRA/RAC/BACKUPSET/2019_07_25/ncnnf0_tag20190725t194446_0.327.1014579891 tag=TAG20190725T194446 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:04
Finished backup at 25-JUL-19

Starting Control File and SPFILE Autobackup at 25-JUL-19
piece handle=+FRA/RAC/AUTOBACKUP/2019_07_25/s_1014579893.328.1014579895 comment=NONE
Finished Control File and SPFILE Autobackup at 25-JUL-19



RMAN> BACKUP AS COPY CURRENT CONTROLFILE FORMAT '/u01/Backup/control.bk';

Starting backup at 25-JUL-19
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=/u01/Backup/control.bk tag=TAG20190725T194626 RECID=11 STAMP=1014579993
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
Finished backup at 25-JUL-19

Starting Control File and SPFILE Autobackup at 25-JUL-19
piece handle=+FRA/RAC/AUTOBACKUP/2019_07_25/s_1014579997.331.1014579999 comment=NONE
Finished Control File and SPFILE Autobackup at 25-JUL-19

RMAN>

####################### Snapshot Controlfile #####################



RMAN> SHOW SNAPSHOT CONTROLFILE NAME;

RMAN configuration parameters for database with db_unique_name RAC are:
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '+FRA/RAC/CONTROLFILE/snapcf_rac1.f';

RMAN>

################  Backing Up the Control File to a Trace File ###########################

SQL> alter database backup controlfile to trace;

Database altered.

SQL>
SQL> sho parameter dump

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
background_core_dump                 string      partial
background_dump_dest                 string      /u01/app/oracle/product/12.1.0
                                                 /dbhome_2/rdbms/log
core_dump_dest                       string      /u01/app/oracle/diag/rdbms/rac
                                                 /rac1/cdump
max_dump_file_size                   string      unlimited
shadow_core_dump                     string      partial
user_dump_dest                       string      /u01/app/oracle/product/12.1.0
                                                 /dbhome_2/rdbms/log
SQL>
[oracle@srv1 trace]$ cat rac1_ora_22067.trc
Trace file /u01/app/oracle/diag/rdbms/rac/rac1/trace/rac1_ora_22067.trc
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Advanced Analytics and Real Application Testing options
ORACLE_HOME = /u01/app/oracle/product/12.1.0/dbhome_2
System name:    Linux
Node name:      srv1.example.com
Release:        3.8.13-68.3.4.el6uek.x86_64
Version:        #2 SMP Tue Jul 14 15:03:36 PDT 2015
Machine:        x86_64
Instance name: rac1
Redo thread mounted by this instance: 1
Oracle process number: 39
Unix process pid: 22067, image: oracle@srv1.example.com (TNS V1-V3)


*** 2019-07-25 19:53:18.714
*** SESSION ID:(94.33629) 2019-07-25 19:53:18.714
*** CLIENT ID:() 2019-07-25 19:53:18.714
*** SERVICE NAME:(SYS$USERS) 2019-07-25 19:53:18.714
*** MODULE NAME:(sqlplus@srv1.example.com (TNS V1-V3)) 2019-07-25 19:53:18.714
*** CLIENT DRIVER:(SQL*PLUS) 2019-07-25 19:53:18.714
*** ACTION NAME:() 2019-07-25 19:53:18.714

-- The following are current System-scope REDO Log Archival related
-- parameters and can be included in the database initialization file.
--
-- LOG_ARCHIVE_DEST=''
-- LOG_ARCHIVE_DUPLEX_DEST=''
--
-- LOG_ARCHIVE_FORMAT=%t_%s_%r.dbf
--
-- DB_UNIQUE_NAME="rac"
--
-- LOG_ARCHIVE_CONFIG='SEND, RECEIVE, NODG_CONFIG'
-- LOG_ARCHIVE_MAX_PROCESSES=4
-- STANDBY_FILE_MANAGEMENT=MANUAL
-- STANDBY_ARCHIVE_DEST=?/dbs/arch
-- FAL_CLIENT=''
-- FAL_SERVER=''
--
-- LOG_ARCHIVE_DEST_1='LOCATION=USE_DB_RECOVERY_FILE_DEST'
-- LOG_ARCHIVE_DEST_1='MANDATORY REOPEN=300 NODELAY'
-- LOG_ARCHIVE_DEST_1='ARCH NOAFFIRM NOVERIFY SYNC'
-- LOG_ARCHIVE_DEST_1='NOREGISTER NOALTERNATE NODEPENDENCY'
-- LOG_ARCHIVE_DEST_1='NOMAX_FAILURE NOQUOTA_SIZE NOQUOTA_USED NODB_UNIQUE_NAME'
-- LOG_ARCHIVE_DEST_1='VALID_FOR=(PRIMARY_ROLE,ONLINE_LOGFILES)'
-- LOG_ARCHIVE_DEST_STATE_1=ENABLE
--
-- Below are two sets of SQL statements, each of which creates a new
-- control file and uses it to open the database. The first set opens
-- the database with the NORESETLOGS option and should be used only if
-- the current versions of all online logs are available. The second
-- set opens the database with the RESETLOGS option and should be used
-- if online logs are unavailable.
-- The appropriate set of statements can be copied from the trace into
-- a script file, edited as necessary, and executed when there is a
-- need to re-create the control file.
--
--     Set #1. NORESETLOGS case
--
-- The following commands will create a new control file and use it
-- to open the database.
-- Data used by Recovery Manager will be lost.
-- Additional logs may be required for media recovery of offline
-- Use this only if the current versions of all online logs are
-- available.
-- After mounting the created controlfile, the following SQL
-- statement will place the database in the appropriate
-- protection mode:
--  ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "RAC" NORESETLOGS  ARCHIVELOG
    MAXLOGFILES 192
    MAXLOGMEMBERS 3
    MAXDATAFILES 1024
    MAXINSTANCES 32
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 (
    '+DATA/RAC/ONLINELOG/group_1.262.1011960239',
    '+FRA/RAC/ONLINELOG/group_1.257.1011960241'
  ) SIZE 50M BLOCKSIZE 512,
  GROUP 2 (
    '+DATA/RAC/ONLINELOG/group_2.263.1011960241',
    '+FRA/RAC/ONLINELOG/group_2.258.1011960245'
  ) SIZE 50M BLOCKSIZE 512,
  GROUP 3 (
    '+DATA/RAC/ONLINELOG/group_3.266.1011961119',
    '+FRA/RAC/ONLINELOG/group_3.259.1011961121'
  ) SIZE 50M BLOCKSIZE 512,
  GROUP 4 (
    '+DATA/RAC/ONLINELOG/group_4.267.1011961123',
    '+FRA/RAC/ONLINELOG/group_4.260.1011961125'
  ) SIZE 50M BLOCKSIZE 512
-- STANDBY LOGFILE
DATAFILE
  '+DATA/RAC/DATAFILE/system.258.1011960053',
  '+DATA/RAC/DATAFILE/sysaux.257.1011959959',
  '+DATA/RAC/DATAFILE/undotbs1.260.1011960171',
  '+DATA/RAC/DATAFILE/undotbs2.265.1011960859',
  '+DATA/RAC/DATAFILE/users.259.1011960169'
CHARACTER SET AL32UTF8
;
-- Configure snapshot controlfile filename
EXECUTE SYS.DBMS_BACKUP_RESTORE.CFILESETSNAPSHOTNAME('+FRA/RAC/CONTROLFILE/snapcf_rac1.f');
-- Configure RMAN configuration record 1
VARIABLE RECNO NUMBER;
EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('SNAPSHOT CONTROLFILE NAME','TO ''+FRA/RAC/CONTROLFILE/snapcf_rac1.f''');
-- Configure RMAN configuration record 2
VARIABLE RECNO NUMBER;
EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('RMAN OUTPUT','TO KEEP FOR 21 DAYS');
-- Configure RMAN configuration record 3
VARIABLE RECNO NUMBER;
EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('CONTROLFILE AUTOBACKUP','ON');
-- Commands to re-create incarnation table
-- Below log names MUST be changed to existing filenames on
-- disk. Any one log file from each branch can be used to
-- re-create incarnation records.
-- ALTER DATABASE REGISTER LOGFILE '+FRA';
-- ALTER DATABASE REGISTER LOGFILE '+FRA';
-- Recovery is required if any of the datafiles are restored backups,
-- or if the last shutdown was not normal or immediate.
RECOVER DATABASE
-- All logs need archiving and a log switch is needed.
ALTER SYSTEM ARCHIVE LOG ALL;
-- Database can now be opened normally.
ALTER DATABASE OPEN;
-- Commands to add tempfiles to temporary tablespaces.
-- Online tempfiles have complete space information.
-- Other tempfiles may require adjustment.
ALTER TABLESPACE TEMP ADD TEMPFILE '+DATA/RAC/TEMPFILE/temp.264.1011960267'
     SIZE 224395264  REUSE AUTOEXTEND ON NEXT 655360  MAXSIZE 32767M;
-- End of tempfile additions.
--
--     Set #2. RESETLOGS case
--
-- The following commands will create a new control file and use it
-- to open the database.
-- Data used by Recovery Manager will be lost.
-- The contents of online logs will be lost and all backups will
-- be invalidated. Use this only if online logs are damaged.
-- After mounting the created controlfile, the following SQL
-- statement will place the database in the appropriate
-- protection mode:
--  ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "RAC" RESETLOGS  ARCHIVELOG
    MAXLOGFILES 192
    MAXLOGMEMBERS 3
    MAXDATAFILES 1024
    MAXINSTANCES 32
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 (
    '+DATA/RAC/ONLINELOG/group_1.262.1011960239',
    '+FRA/RAC/ONLINELOG/group_1.257.1011960241'
  ) SIZE 50M BLOCKSIZE 512,
  GROUP 2 (
    '+DATA/RAC/ONLINELOG/group_2.263.1011960241',
    '+FRA/RAC/ONLINELOG/group_2.258.1011960245'
  ) SIZE 50M BLOCKSIZE 512
-- STANDBY LOGFILE
DATAFILE
  '+DATA/RAC/DATAFILE/system.258.1011960053',
  '+DATA/RAC/DATAFILE/sysaux.257.1011959959',
  '+DATA/RAC/DATAFILE/undotbs1.260.1011960171',
  '+DATA/RAC/DATAFILE/undotbs2.265.1011960859',
  '+DATA/RAC/DATAFILE/users.259.1011960169'
CHARACTER SET AL32UTF8
;
-- Configure snapshot controlfile filename
EXECUTE SYS.DBMS_BACKUP_RESTORE.CFILESETSNAPSHOTNAME('+FRA/RAC/CONTROLFILE/snapcf_rac1.f');
-- Configure RMAN configuration record 1
VARIABLE RECNO NUMBER;
EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('SNAPSHOT CONTROLFILE NAME','TO ''+FRA/RAC/CONTROLFILE/snapcf_rac1.f''');
-- Configure RMAN configuration record 2
VARIABLE RECNO NUMBER;
EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('RMAN OUTPUT','TO KEEP FOR 21 DAYS');
-- Configure RMAN configuration record 3
VARIABLE RECNO NUMBER;
EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('CONTROLFILE AUTOBACKUP','ON');
-- Commands to re-create incarnation table
-- Below log names MUST be changed to existing filenames on
-- disk. Any one log file from each branch can be used to
-- re-create incarnation records.
-- ALTER DATABASE REGISTER LOGFILE '+FRA';
-- ALTER DATABASE REGISTER LOGFILE '+FRA';
-- Recovery is required if any of the datafiles are restored backups,
-- or if the last shutdown was not normal or immediate.
RECOVER DATABASE USING BACKUP CONTROLFILE
-- Create log files for threads other than thread one.
ALTER DATABASE ADD LOGFILE THREAD 2
  GROUP 3 (
    '+DATA/RAC/ONLINELOG/group_3.266.1011961119',
    '+FRA/RAC/ONLINELOG/group_3.259.1011961121'
  ) SIZE 50M BLOCKSIZE 512 REUSE,
  GROUP 4 (
    '+DATA/RAC/ONLINELOG/group_4.267.1011961123',
    '+FRA/RAC/ONLINELOG/group_4.260.1011961125'
  ) SIZE 50M BLOCKSIZE 512 REUSE;
-- Database can now be opened zeroing the online logs.
ALTER DATABASE OPEN RESETLOGS;
-- Commands to add tempfiles to temporary tablespaces.
-- Online tempfiles have complete space information.
-- Other tempfiles may require adjustment.
ALTER TABLESPACE TEMP ADD TEMPFILE '+DATA/RAC/TEMPFILE/temp.264.1011960267'
     SIZE 224395264  REUSE AUTOEXTEND ON NEXT 655360  MAXSIZE 32767M;
-- End of tempfile additions.
--
[oracle@srv1 trace]$



Tuesday, 23 July 2019

Linux TO Window Restoration using RMAN Backup 12c (Doc ID 2003327.1)

Hi All we are performing rman full backup restoration on window machine.  As i have faced issue as while performing restoration using inconsistent backup using rman we can not recover using archivelog  for media recovery process on window machine case. As per oracle docs media recovery is not possible in cross platform case.
Redo application is not supported between Linux and Windows except with a standby database.



C:\Users\plmadmin>sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Tue Jul 23 11:38:07 2019

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

Connected to an idle instance.

SQL> startup nomount;
ORACLE instance started.

Total System Global Area 8.2678E+10 bytes
Fixed Size                  7774968 bytes
Variable Size            1.3422E+10 bytes
Database Buffers         6.8988E+10 bytes
Redo Buffers              260657152 bytes
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

C:\Users\plmadmin>rman target /

Recovery Manager: Release 12.1.0.2.0 - Production on Tue Jul 23 11:39:28 2019

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

connected to target database: SMRPRODB (not mounted)

RMAN>

RMAN> restore controlfile from 'D:\rman_backup_smrprodb\control_63_SMRPRODB_20190723_cf_D-SMRPRODB_id-3201394995_geu7c65j.bak';

Starting restore at 23-JUL-19
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=430 device type=DISK

channel ORA_DISK_1: copied control file copy
output file name=D:\APP\PLMADMIN\ORADATA\SMRPRODB\CONTROL01.CTL
output file name=D:\APP\PLMADMIN\FAST_RECOVERY_AREA\SMRPRODB\CONTROL02.CTL
Finished restore at 23-JUL-19

RMAN> alter database mount;

Statement processed
released channel: ORA_DISK_1

RMAN> select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------

/u04/MasterDB/oradata/SMRPRODB/redo01a.log


/u04/MasterDB/oradata/SMRPRODB/redo02a.log


/u04/MasterDB/oradata/SMRPRODB/redo03a.log


/u04/MasterDB/oradata/SMRPRODB/redo04.log


/u04/MasterDB/oradata/SMRPRODB/redo_05.log


/u04/MasterDB/oradata/SMRPRODB/redo_06.log


/u04/MasterDB/oradata/SMRPRODB/redo_07.log


/u04/MasterDB/oradata/SMRPRODB/redo/redo01b.log


/u04/MasterDB/oradata/SMRPRODB/redo/redo01c.log


/u04/MasterDB/oradata/SMRPRODB/redo/redo02b.log


/u04/MasterDB/oradata/SMRPRODB/redo/redo02c.log


/u04/MasterDB/oradata/SMRPRODB/redo/redo03b.log


/u04/MasterDB/oradata/SMRPRODB/redo/redo03c.log


13 rows selected

RMAN>

RMAN> SQL "ALTER DATABASE RENAME FILE ''/u04/MasterDB/oradata/SMRPRODB/redo01a.log''  to  ''D:\app\plmadmin\oradata\smrprodb\redo01a.log'' ";

sql statement: ALTER DATABASE RENAME FILE ''/u04/MasterDB/oradata/SMRPRODB/redo01a.log''  to  ''D:\app\plmadmin\oradata\smrprodb\redo01a.log''

RMAN> SQL "ALTER DATABASE RENAME FILE ''/u04/MasterDB/oradata/SMRPRODB/redo02a.log''  to  ''D:\app\plmadmin\oradata\smrprodb\redo02a.log'' ";

sql statement: ALTER DATABASE RENAME FILE ''/u04/MasterDB/oradata/SMRPRODB/redo02a.log''  to  ''D:\app\plmadmin\oradata\smrprodb\redo02a.log''

RMAN> SQL "ALTER DATABASE RENAME FILE ''/u04/MasterDB/oradata/SMRPRODB/redo03a.log''  to  ''D:\app\plmadmin\oradata\smrprodb\redo03a.log'' ";

sql statement: ALTER DATABASE RENAME FILE ''/u04/MasterDB/oradata/SMRPRODB/redo03a.log''  to  ''D:\app\plmadmin\oradata\smrprodb\redo03a.log''

RMAN> SQL "ALTER DATABASE RENAME FILE ''/u04/MasterDB/oradata/SMRPRODB/redo04.log''  to  ''D:\app\plmadmin\oradata\smrprodb\redo04.log'' ";

sql statement: ALTER DATABASE RENAME FILE ''/u04/MasterDB/oradata/SMRPRODB/redo04.log''  to  ''D:\app\plmadmin\oradata\smrprodb\redo04.log''

RMAN> SQL "ALTER DATABASE RENAME FILE ''/u04/MasterDB/oradata/SMRPRODB/redo_05.log''  to  ''D:\app\plmadmin\oradata\smrprodb\redo_05.log'' ";

sql statement: ALTER DATABASE RENAME FILE ''/u04/MasterDB/oradata/SMRPRODB/redo_05.log''  to  ''D:\app\plmadmin\oradata\smrprodb\redo_05.log''

RMAN> SQL "ALTER DATABASE RENAME FILE ''/u04/MasterDB/oradata/SMRPRODB/redo_06.log''  to  ''D:\app\plmadmin\oradata\smrprodb\redo_06.log'' ";

sql statement: ALTER DATABASE RENAME FILE ''/u04/MasterDB/oradata/SMRPRODB/redo_06.log''  to  ''D:\app\plmadmin\oradata\smrprodb\redo_06.log''

RMAN> SQL "ALTER DATABASE RENAME FILE ''/u04/MasterDB/oradata/SMRPRODB/redo_07.log''  to  ''D:\app\plmadmin\oradata\smrprodb\redo_07.log'' ";

sql statement: ALTER DATABASE RENAME FILE ''/u04/MasterDB/oradata/SMRPRODB/redo_07.log''  to  ''D:\app\plmadmin\oradata\smrprodb\redo_07.log''

RMAN> SQL "ALTER DATABASE RENAME FILE ''/u04/MasterDB/oradata/SMRPRODB/redo/redo01b.log''  to  ''D:\app\plmadmin\oradata\smrprodb\redo01b.log'' ";

sql statement: ALTER DATABASE RENAME FILE ''/u04/MasterDB/oradata/SMRPRODB/redo/redo01b.log''  to  ''D:\app\plmadmin\oradata\smrprodb\redo01b.log''

RMAN> SQL "ALTER DATABASE RENAME FILE ''/u04/MasterDB/oradata/SMRPRODB/redo/redo01c.log''  to  ''D:\app\plmadmin\oradata\smrprodb\redo01c.log'' ";

sql statement: ALTER DATABASE RENAME FILE ''/u04/MasterDB/oradata/SMRPRODB/redo/redo01c.log''  to  ''D:\app\plmadmin\oradata\smrprodb\redo01c.log''

RMAN> SQL "ALTER DATABASE RENAME FILE ''/u04/MasterDB/oradata/SMRPRODB/redo/redo02b.log''  to  ''D:\app\plmadmin\oradata\smrprodb\redo02b.log'' ";

sql statement: ALTER DATABASE RENAME FILE ''/u04/MasterDB/oradata/SMRPRODB/redo/redo02b.log''  to  ''D:\app\plmadmin\oradata\smrprodb\redo02b.log''

RMAN> SQL "ALTER DATABASE RENAME FILE ''/u04/MasterDB/oradata/SMRPRODB/redo/redo02c.log''  to  ''D:\app\plmadmin\oradata\smrprodb\redo02c.log'' ";

sql statement: ALTER DATABASE RENAME FILE ''/u04/MasterDB/oradata/SMRPRODB/redo/redo02c.log''  to  ''D:\app\plmadmin\oradata\smrprodb\redo02c.log''

RMAN> SQL "ALTER DATABASE RENAME FILE ''/u04/MasterDB/oradata/SMRPRODB/redo/redo03b.log''  to  ''D:\app\plmadmin\oradata\smrprodb\redo03b.log'' ";

sql statement: ALTER DATABASE RENAME FILE ''/u04/MasterDB/oradata/SMRPRODB/redo/redo03b.log''  to  ''D:\app\plmadmin\oradata\smrprodb\redo03b.log''

RMAN> SQL "ALTER DATABASE RENAME FILE ''/u04/MasterDB/oradata/SMRPRODB/redo/redo03c.log''  to  ''D:\app\plmadmin\oradata\smrprodb\redo03c.log'' ";

sql statement: ALTER DATABASE RENAME FILE ''/u04/MasterDB/oradata/SMRPRODB/redo/redo03c.log''  to  ''D:\app\plmadmin\oradata\smrprodb\redo03c.log''

RMAN>

RMAN>

RMAN>

RMAN>

RMAN> select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------

D:\APP\PLMADMIN\ORADATA\SMRPRODB\REDO01A.LOG


D:\APP\PLMADMIN\ORADATA\SMRPRODB\REDO02A.LOG


D:\APP\PLMADMIN\ORADATA\SMRPRODB\REDO03A.LOG


D:\APP\PLMADMIN\ORADATA\SMRPRODB\REDO04.LOG


D:\APP\PLMADMIN\ORADATA\SMRPRODB\REDO_05.LOG


D:\APP\PLMADMIN\ORADATA\SMRPRODB\REDO_06.LOG


D:\APP\PLMADMIN\ORADATA\SMRPRODB\REDO_07.LOG


D:\APP\PLMADMIN\ORADATA\SMRPRODB\REDO01B.LOG


D:\APP\PLMADMIN\ORADATA\SMRPRODB\REDO01C.LOG


D:\APP\PLMADMIN\ORADATA\SMRPRODB\REDO02B.LOG


D:\APP\PLMADMIN\ORADATA\SMRPRODB\REDO02C.LOG


D:\APP\PLMADMIN\ORADATA\SMRPRODB\REDO03B.LOG


D:\APP\PLMADMIN\ORADATA\SMRPRODB\REDO03C.LOG


13 rows selected

RMAN> catalog start with 'D:\rman_backup_smrprodb\';

Starting implicit crosscheck backup at 23-JUL-19
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=430 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=456 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=469 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=482 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=495 device type=DISK
allocated channel: ORA_DISK_6
channel ORA_DISK_6: SID=508 device type=DISK
allocated channel: ORA_DISK_7
channel ORA_DISK_7: SID=521 device type=DISK
allocated channel: ORA_DISK_8
channel ORA_DISK_8: SID=534 device type=DISK
allocated channel: ORA_DISK_9
channel ORA_DISK_9: SID=547 device type=DISK
allocated channel: ORA_DISK_10
channel ORA_DISK_10: SID=560 device type=DISK
allocated channel: ORA_DISK_11
channel ORA_DISK_11: SID=573 device type=DISK
allocated channel: ORA_DISK_12
channel ORA_DISK_12: SID=586 device type=DISK
allocated channel: ORA_DISK_13
channel ORA_DISK_13: SID=599 device type=DISK
allocated channel: ORA_DISK_14
channel ORA_DISK_14: SID=612 device type=DISK
allocated channel: ORA_DISK_15
channel ORA_DISK_15: SID=625 device type=DISK
allocated channel: ORA_DISK_16
channel ORA_DISK_16: SID=638 device type=DISK
allocated channel: ORA_DISK_17
channel ORA_DISK_17: SID=651 device type=DISK
allocated channel: ORA_DISK_18
channel ORA_DISK_18: SID=664 device type=DISK
allocated channel: ORA_DISK_19
channel ORA_DISK_19: SID=677 device type=DISK
allocated channel: ORA_DISK_20
channel ORA_DISK_20: SID=690 device type=DISK
Crosschecked 33 objects
Finished implicit crosscheck backup at 23-JUL-19

Starting implicit crosscheck copy at 23-JUL-19
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5
using channel ORA_DISK_6
using channel ORA_DISK_7
using channel ORA_DISK_8
using channel ORA_DISK_9
using channel ORA_DISK_10
using channel ORA_DISK_11
using channel ORA_DISK_12
using channel ORA_DISK_13
using channel ORA_DISK_14
using channel ORA_DISK_15
using channel ORA_DISK_16
using channel ORA_DISK_17
using channel ORA_DISK_18
using channel ORA_DISK_19
using channel ORA_DISK_20
Crosschecked 2 objects
Finished implicit crosscheck copy at 23-JUL-19

searching for all files in the recovery area
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: D:\APP\PLMADMIN\FAST_RECOVERY_AREA\SMRPRODB\ARCHIVELOG\2019_04_05\O1_MF_1_13_GBGGMS1R_.ARC
File Name: D:\APP\PLMADMIN\FAST_RECOVERY_AREA\SMRPRODB\ARCHIVELOG\2019_04_05\O1_MF_1_14_GBGGMS83_.ARC
File Name: D:\APP\PLMADMIN\FAST_RECOVERY_AREA\SMRPRODB\ARCHIVELOG\2019_04_05\O1_MF_1_15_GBGGN5CL_.ARC
File Name: D:\APP\PLMADMIN\FAST_RECOVERY_AREA\SMRPRODB\ARCHIVELOG\2019_04_05\O1_MF_1_16_GBGNCNB6_.ARC
File Name: D:\APP\PLMADMIN\FAST_RECOVERY_AREA\SMRPRODB\ARCHIVELOG\2019_04_15\1_10_1005460847.ARC
File Name: D:\APP\PLMADMIN\FAST_RECOVERY_AREA\SMRPRODB\ARCHIVELOG\2019_04_15\1_11_1005460847.ARC
File Name: D:\APP\PLMADMIN\FAST_RECOVERY_AREA\SMRPRODB\ARCHIVELOG\2019_04_15\1_12_1005460847.ARC
File Name: D:\APP\PLMADMIN\FAST_RECOVERY_AREA\SMRPRODB\ARCHIVELOG\2019_04_15\1_13_1005460847.ARC
File Name: D:\APP\PLMADMIN\FAST_RECOVERY_AREA\SMRPRODB\ARCHIVELOG\2019_04_15\1_14_1005460847.ARC
File Name: D:\APP\PLMADMIN\FAST_RECOVERY_AREA\SMRPRODB\ARCHIVELOG\2019_04_15\1_15_1005460847.ARC
File Name: D:\APP\PLMADMIN\FAST_RECOVERY_AREA\SMRPRODB\ARCHIVELOG\2019_04_15\1_16_1005460847.ARC
File Name: D:\APP\PLMADMIN\FAST_RECOVERY_AREA\SMRPRODB\ARCHIVELOG\2019_04_15\1_17_1005460847.ARC
File Name: D:\APP\PLMADMIN\FAST_RECOVERY_AREA\SMRPRODB\ARCHIVELOG\2019_04_15\1_18_1005460847.ARC
File Name: D:\APP\PLMADMIN\FAST_RECOVERY_AREA\SMRPRODB\ARCHIVELOG\2019_04_15\1_19_1005460847.ARC
File Name: D:\APP\PLMADMIN\FAST_RECOVERY_AREA\SMRPRODB\ARCHIVELOG\2019_04_15\1_1_1005460847.ARC
File Name: D:\APP\PLMADMIN\FAST_RECOVERY_AREA\SMRPRODB\ARCHIVELOG\2019_04_15\1_20_1005460847.ARC
File Name: D:\APP\PLMADMIN\FAST_RECOVERY_AREA\SMRPRODB\ARCHIVELOG\2019_04_15\1_21_1005460847.ARC
File Name: D:\APP\PLMADMIN\FAST_RECOVERY_AREA\SMRPRODB\ARCHIVELOG\2019_04_15\1_22_1005460847.ARC
File Name: D:\APP\PLMADMIN\FAST_RECOVERY_AREA\SMRPRODB\ARCHIVELOG\2019_04_15\1_23_1005460847.ARC
File Name: D:\APP\PLMADMIN\FAST_RECOVERY_AREA\SMRPRODB\ARCHIVELOG\2019_04_15\1_24_1005460847.ARC
File Name: D:\APP\PLMADMIN\FAST_RECOVERY_AREA\SMRPRODB\ARCHIVELOG\2019_04_15\1_25_1005460847.ARC
File Name: D:\APP\PLMADMIN\FAST_RECOVERY_AREA\SMRPRODB\ARCHIVELOG\2019_04_15\1_26_1005460847.ARC
File Name: D:\APP\PLMADMIN\FAST_RECOVERY_AREA\SMRPRODB\ARCHIVELOG\2019_04_15\1_27_1005460847.ARC
File Name: D:\APP\PLMADMIN\FAST_RECOVERY_AREA\SMRPRODB\ARCHIVELOG\2019_04_15\1_28_1005460847.ARC
File Name: D:\APP\PLMADMIN\FAST_RECOVERY_AREA\SMRPRODB\ARCHIVELOG\2019_04_15\1_29_1005460847.ARC
File Name: D:\APP\PLMADMIN\FAST_RECOVERY_AREA\SMRPRODB\ARCHIVELOG\2019_04_15\1_2_1005460847.ARC
File Name: D:\APP\PLMADMIN\FAST_RECOVERY_AREA\SMRPRODB\ARCHIVELOG\2019_04_15\1_3_1005460847.ARC
File Name: D:\APP\PLMADMIN\FAST_RECOVERY_AREA\SMRPRODB\ARCHIVELOG\2019_04_15\1_4_1005460847.ARC
File Name: D:\APP\PLMADMIN\FAST_RECOVERY_AREA\SMRPRODB\ARCHIVELOG\2019_04_15\1_5_1005460847.ARC
File Name: D:\APP\PLMADMIN\FAST_RECOVERY_AREA\SMRPRODB\ARCHIVELOG\2019_04_15\1_6_1005460847.ARC
File Name: D:\APP\PLMADMIN\FAST_RECOVERY_AREA\SMRPRODB\ARCHIVELOG\2019_04_15\1_7_1005460847.ARC
File Name: D:\APP\PLMADMIN\FAST_RECOVERY_AREA\SMRPRODB\ARCHIVELOG\2019_04_15\1_8_1005460847.ARC
File Name: D:\APP\PLMADMIN\FAST_RECOVERY_AREA\SMRPRODB\ARCHIVELOG\2019_04_15\1_9_1005460847.ARC

searching for all files that match the pattern D:\rman_backup_smrprodb\

List of Files Unknown to the Database
=====================================
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000004601_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000004733_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000004752_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000004833_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000004834_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000004835_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000004836_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000004838_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000004839_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000004842_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000004843_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000004854_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000004885_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000004898_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000004919_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000004951_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000004981_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000004984_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000005007_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000005031_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000005039_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000005062_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000005069_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000005083_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000005095_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\BACKUP_SMRPRODB_DB_G2U7C64V_9730_1_20190723
File Name: D:\RMAN_BACKUP_SMRPRODB\BACKUP_SMRPRODB_DB_G3U7C64V_9731_1_20190723
File Name: D:\RMAN_BACKUP_SMRPRODB\BACKUP_SMRPRODB_DB_G4U7C64V_9732_1_20190723
File Name: D:\RMAN_BACKUP_SMRPRODB\BACKUP_SMRPRODB_DB_G5U7C64V_9733_1_20190723
File Name: D:\RMAN_BACKUP_SMRPRODB\BACKUP_SMRPRODB_DB_G6U7C650_9734_1_20190723
File Name: D:\RMAN_BACKUP_SMRPRODB\BACKUP_SMRPRODB_DB_GDU7C65I_9741_1_20190723
File Name: D:\RMAN_BACKUP_SMRPRODB\CONTROL_63_SMRPRODB_20190723_CF_D-SMRPRODB_ID-3201394995_GEU7C65J.BAK
File Name: D:\RMAN_BACKUP_SMRPRODB\RMAN_SMRPRODB_FULL.LOG
File Name: D:\RMAN_BACKUP_SMRPRODB\SMRPRODB_G7U7C651_1_1.BCKP
File Name: D:\RMAN_BACKUP_SMRPRODB\SMRPRODB_G8U7C652_1_1.BCKP
File Name: D:\RMAN_BACKUP_SMRPRODB\SMRPRODB_G9U7C652_1_1.BCKP
File Name: D:\RMAN_BACKUP_SMRPRODB\SMRPRODB_GAU7C652_1_1.BCKP
File Name: D:\RMAN_BACKUP_SMRPRODB\SMRPRODB_GBU7C653_1_1.BCKP
File Name: D:\RMAN_BACKUP_SMRPRODB\SMRPRODB_GCU7C653_1_1.BCKP
File Name: D:\RMAN_BACKUP_SMRPRODB\STANDBYCONTROL_SMRPRODB_20190723_GFU7C65K_1_1.CTL

Do you really want to catalog the above files (enter YES or NO)? yes
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000004601_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000004733_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000004752_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000004833_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000004834_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000004835_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000004836_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000004838_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000004839_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000004842_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000004843_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000004854_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000004885_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000004898_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000004919_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000004951_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000004981_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000004984_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000005007_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000005031_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000005039_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000005062_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000005069_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000005083_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000005095_1010514318.0001
File Name: D:\RMAN_BACKUP_SMRPRODB\BACKUP_SMRPRODB_DB_G2U7C64V_9730_1_20190723
File Name: D:\RMAN_BACKUP_SMRPRODB\BACKUP_SMRPRODB_DB_G3U7C64V_9731_1_20190723
File Name: D:\RMAN_BACKUP_SMRPRODB\BACKUP_SMRPRODB_DB_G4U7C64V_9732_1_20190723
File Name: D:\RMAN_BACKUP_SMRPRODB\BACKUP_SMRPRODB_DB_G5U7C64V_9733_1_20190723
File Name: D:\RMAN_BACKUP_SMRPRODB\BACKUP_SMRPRODB_DB_G6U7C650_9734_1_20190723
File Name: D:\RMAN_BACKUP_SMRPRODB\BACKUP_SMRPRODB_DB_GDU7C65I_9741_1_20190723
File Name: D:\RMAN_BACKUP_SMRPRODB\CONTROL_63_SMRPRODB_20190723_CF_D-SMRPRODB_ID-3201394995_GEU7C65J.BAK
File Name: D:\RMAN_BACKUP_SMRPRODB\SMRPRODB_G7U7C651_1_1.BCKP
File Name: D:\RMAN_BACKUP_SMRPRODB\SMRPRODB_G8U7C652_1_1.BCKP
File Name: D:\RMAN_BACKUP_SMRPRODB\SMRPRODB_G9U7C652_1_1.BCKP
File Name: D:\RMAN_BACKUP_SMRPRODB\SMRPRODB_GAU7C652_1_1.BCKP
File Name: D:\RMAN_BACKUP_SMRPRODB\SMRPRODB_GBU7C653_1_1.BCKP
File Name: D:\RMAN_BACKUP_SMRPRODB\SMRPRODB_GCU7C653_1_1.BCKP
File Name: D:\RMAN_BACKUP_SMRPRODB\STANDBYCONTROL_SMRPRODB_20190723_GFU7C65K_1_1.CTL

List of Files Which Were Not Cataloged
=======================================
File Name: D:\RMAN_BACKUP_SMRPRODB\RMAN_SMRPRODB_FULL.LOG
  RMAN-07517: Reason: The file header is corrupted

RMAN> RUN
2> {
3> set newname for datafile 1 to "D:\app\plmadmin\oradata\smrprodb\system01.dbf";
4> set newname for datafile 2 to "D:\app\plmadmin\oradata\smrprodb\sysaux01.dbf";
5> set newname for datafile 3 to "D:\app\plmadmin\oradata\smrprodb\undotbs01.dbf";
6> set newname for datafile 4 to "D:\app\plmadmin\oradata\smrprodb\idata01.dbf";
7> set newname for datafile 5 to "D:\app\plmadmin\oradata\smrprodb\ilog01.dbf";
8> set newname for datafile 6 to "D:\app\plmadmin\oradata\smrprodb\indx01.dbf";
9> set newname for datafile 7 to "D:\app\plmadmin\oradata\smrprodb\idata02.dbf";
10> set newname for tempfile 1 to "D:\app\plmadmin\oradata\smrprodb\temp01.dbf";
11> set newname for tempfile 2 to "D:\app\plmadmin\oradata\smrprodb\temp02.dbf";
12> RESTORE DATABASE;
13> SWITCH DATAFILE ALL;
14> SWITCH TEMPFILE ALL;
15> }

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 23-JUL-19
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5
using channel ORA_DISK_6
using channel ORA_DISK_7
using channel ORA_DISK_8
using channel ORA_DISK_9
using channel ORA_DISK_10
using channel ORA_DISK_11
using channel ORA_DISK_12
using channel ORA_DISK_13
using channel ORA_DISK_14
using channel ORA_DISK_15
using channel ORA_DISK_16
using channel ORA_DISK_17
using channel ORA_DISK_18
using channel ORA_DISK_19
using channel ORA_DISK_20

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00003 to D:\app\plmadmin\oradata\smrprodb\undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00006 to D:\app\plmadmin\oradata\smrprodb\indx01.dbf
channel ORA_DISK_1: reading from backup piece D:\RMAN_BACKUP_SMRPRODB\SMRPRODB_GAU7C652_1_1.BCKP
channel ORA_DISK_2: starting datafile backup set restore
channel ORA_DISK_2: specifying datafile(s) to restore from backup set
channel ORA_DISK_2: restoring datafile 00001 to D:\app\plmadmin\oradata\smrprodb\system01.dbf
channel ORA_DISK_2: restoring datafile 00005 to D:\app\plmadmin\oradata\smrprodb\ilog01.dbf
channel ORA_DISK_2: reading from backup piece D:\RMAN_BACKUP_SMRPRODB\SMRPRODB_G8U7C652_1_1.BCKP
channel ORA_DISK_3: starting datafile backup set restore
channel ORA_DISK_3: specifying datafile(s) to restore from backup set
channel ORA_DISK_3: restoring datafile 00002 to D:\app\plmadmin\oradata\smrprodb\sysaux01.dbf
channel ORA_DISK_3: restoring datafile 00007 to D:\app\plmadmin\oradata\smrprodb\idata02.dbf
channel ORA_DISK_3: reading from backup piece D:\RMAN_BACKUP_SMRPRODB\SMRPRODB_G9U7C652_1_1.BCKP
channel ORA_DISK_4: starting datafile backup set restore
channel ORA_DISK_4: specifying datafile(s) to restore from backup set
channel ORA_DISK_4: restoring datafile 00004 to D:\app\plmadmin\oradata\smrprodb\idata01.dbf
channel ORA_DISK_4: reading from backup piece D:\RMAN_BACKUP_SMRPRODB\SMRPRODB_G7U7C651_1_1.BCKP
channel ORA_DISK_1: piece handle=D:\RMAN_BACKUP_SMRPRODB\SMRPRODB_GAU7C652_1_1.BCKP tag=TAG20190723T100833
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:35
channel ORA_DISK_2: piece handle=D:\RMAN_BACKUP_SMRPRODB\SMRPRODB_G8U7C652_1_1.BCKP tag=TAG20190723T100833
channel ORA_DISK_2: restored backup piece 1
channel ORA_DISK_2: restore complete, elapsed time: 00:00:46
channel ORA_DISK_3: piece handle=D:\RMAN_BACKUP_SMRPRODB\SMRPRODB_G9U7C652_1_1.BCKP tag=TAG20190723T100833
channel ORA_DISK_3: restored backup piece 1
channel ORA_DISK_3: restore complete, elapsed time: 00:00:46
channel ORA_DISK_4: piece handle=D:\RMAN_BACKUP_SMRPRODB\SMRPRODB_G7U7C651_1_1.BCKP tag=TAG20190723T100833
channel ORA_DISK_4: restored backup piece 1
channel ORA_DISK_4: restore complete, elapsed time: 00:01:16
Finished restore at 23-JUL-19

datafile 1 switched to datafile copy
input datafile copy RECID=653 STAMP=1014378450 file name=D:\APP\PLMADMIN\ORADATA\SMRPRODB\SYSTEM01.DBF
datafile 2 switched to datafile copy
input datafile copy RECID=654 STAMP=1014378450 file name=D:\APP\PLMADMIN\ORADATA\SMRPRODB\SYSAUX01.DBF
datafile 3 switched to datafile copy
input datafile copy RECID=655 STAMP=1014378450 file name=D:\APP\PLMADMIN\ORADATA\SMRPRODB\UNDOTBS01.DBF
datafile 4 switched to datafile copy
input datafile copy RECID=656 STAMP=1014378450 file name=D:\APP\PLMADMIN\ORADATA\SMRPRODB\IDATA01.DBF
datafile 5 switched to datafile copy
input datafile copy RECID=657 STAMP=1014378450 file name=D:\APP\PLMADMIN\ORADATA\SMRPRODB\ILOG01.DBF
datafile 6 switched to datafile copy
input datafile copy RECID=658 STAMP=1014378450 file name=D:\APP\PLMADMIN\ORADATA\SMRPRODB\INDX01.DBF
datafile 7 switched to datafile copy
input datafile copy RECID=659 STAMP=1014378450 file name=D:\APP\PLMADMIN\ORADATA\SMRPRODB\IDATA02.DBF

renamed tempfile 1 to D:\app\plmadmin\oradata\smrprodb\temp01.dbf in control file
renamed tempfile 2 to D:\app\plmadmin\oradata\smrprodb\temp02.dbf in control file

RMAN> alter database open resetlogs;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of sql statement command at 07/23/2019 11:47:55
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: 'D:\APP\PLMADMIN\ORADATA\SMRPRODB\SYSTEM01.DBF'

RMAN> recover database;

Starting recover at 23-JUL-19
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5
using channel ORA_DISK_6
using channel ORA_DISK_7
using channel ORA_DISK_8
using channel ORA_DISK_9
using channel ORA_DISK_10
using channel ORA_DISK_11
using channel ORA_DISK_12
using channel ORA_DISK_13
using channel ORA_DISK_14
using channel ORA_DISK_15
using channel ORA_DISK_16
using channel ORA_DISK_17
using channel ORA_DISK_18
using channel ORA_DISK_19
using channel ORA_DISK_20

starting media recovery

channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=5139
channel ORA_DISK_1: reading from backup piece D:\RMAN_BACKUP_SMRPRODB\BACKUP_SMRPRODB_DB_GDU7C65I_9741_1_20190723
channel ORA_DISK_1: piece handle=D:\RMAN_BACKUP_SMRPRODB\BACKUP_SMRPRODB_DB_GDU7C65I_9741_1_20190723 tag=TAG20190723T100850
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=D:\RMAN_BACKUP_SMRPRODB\28_APRIL_2019\ARCHIVE_LOG\ARC0000005139_1010514318.0001 thread=1 sequence=5139
unable to find archived log
archived log thread=1 sequence=5140
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 07/23/2019 11:48:12
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 5140 and starting SCN of 507051307

RMAN> alter database open resetlogs;

Statement processed

RMAN> select name,open_mode,databse_role from v$database;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of sql statement command at 07/23/2019 11:49:32
ORA-00904: "DATABSE_ROLE": invalid identifier

RMAN> select name,open_mode,database_role from v$database;

NAME      OPEN_MODE            DATABASE_ROLE
--------- -------------------- ----------------
SMRPRODB  READ WRITE           PRIMARY

RMAN>