Wednesday, 31 July 2019

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>