Practice: Parallelizing TTS Metadata Operations

Overview

The practice shows how to parallelize export and import operations for Transportable Tablespace (TTS) metadata.

Before starting any new practice, refer to the Practices Environment recommendations.

Step 1 : Prepare the tablespace to be exported

  • In PDB21, set the USERS tablespace to read only. If the tablespace does not exist, create it.

    
    $ sqlplus sysPDB21 AS SYSDBA                   
    
    Enter password:
    
    Connected to:
    SQL> CREATE TABLESPACE users;
    
    Tablespace created.
    
    SQL> ALTER TABLESPACE users READ ONLY;
    
    Tablespace altered.
    
    SQL> EXIT
    $ 

Step 2 : Perform the TTS in parallel

  • Perform the TTS in parallel against PDB21.

    
    $ expdp \"sys@PDB21 AS SYSDBA\" dumpfile=PDB21.dmp TRANSPORT_TABLESPACES=users TRANSPORT_FULL_CHECK=YES LOGFILE=tts.log REUSE_DUMPFILES=YES PARALLEL=2
    
    Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.
    Password:
    
    Starting "SYS"."SYS_EXPORT_TRANSPORTABLE_02":  "sys/********@PDB21 AS SYSDBA" dumpfile=PDB21.dmp TRANSPORT_TABLESPACES=users TRANSPORT_FULL_CHECK=YES LOGFILE=tts.log REUSE_DUMPFILES=YES PARALLEL=2
    ORA-39396: Warning: exporting encrypted data using transportable option without password
    
    ORA-39396: Warning: exporting encrypted data using transportable option without password
    
    Processing object type TRANSPORTABLE_EXPORT/INDEX/STATISTICS/INDEX_STATISTICS
    Processing object type TRANSPORTABLE_EXPORT/INDEX/STATISTICS/BITMAP_INDEX/INDEX_STATISTICS
    Processing object type TRANSPORTABLE_EXPORT/STATISTICS/TABLE_STATISTICS
    Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
    Processing object type TRANSPORTABLE_EXPORT/STATISTICS/MARKER
    Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
    Processing object type TRANSPORTABLE_EXPORT/TABLE
    Processing object type TRANSPORTABLE_EXPORT/INDEX/INDEX
    Processing object type TRANSPORTABLE_EXPORT/COMMENT
    Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/CONSTRAINT
    Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/REF_CONSTRAINT
    Processing object type TRANSPORTABLE_EXPORT/TRIGGER
    Processing object type TRANSPORTABLE_EXPORT/INDEX/BITMAP_INDEX/INDEX
    Processing object type TRANSPORTABLE_EXPORT/INDEX/DOMAIN_INDEX/SECONDARY_TABLE/INDEX/INDEX
    Processing object type TRANSPORTABLE_EXPORT/INDEX/DOMAIN_INDEX/SECONDARY_TABLE/TABLE
    Processing object type TRANSPORTABLE_EXPORT/INDEX/DOMAIN_INDEX/SECONDARY_TABLE/CONSTRAINT
    Processing object type TRANSPORTABLE_EXPORT/INDEX/DOMAIN_INDEX/INDEX
    Processing object type TRANSPORTABLE_EXPORT/MATERIALIZED_VIEW
    Master table "SYS"."SYS_EXPORT_TRANSPORTABLE_02" successfully loaded/unloaded
    ******************************************************************************
    Dump file set for SYS.SYS_EXPORT_TRANSPORTABLE_02 is:
      /u01/app/oracle/admin/ORCL/dpdump/B33495ED418D1C83E0538705F40AD599/PDB21.dmp
    ******************************************************************************
    Datafiles required for transportable tablespace USERS:
      /u02/app/oracle/oradata/CDB21_fra1xn/CDB21_FRA1XN/B33495ED418D1C83E0538705F40AD599/datafile/o1_mf_users_hx3vo2r5_.dbf
    Job "SYS"."SYS_EXPORT_TRANSPORTABLE_02" completed with 2 error(s) at Tue Dec 15 08:15:16 2020 elapsed 0 00:02:32
    $ 

    Observe the two ORA-39396 messages during the export operation. This means that the two parallel operations encountered the same warning message.

Step 3 : Set the tablespace back to read write

  • Use the ALTER TABLESPACE command to set the tablespace back to read write.

    
    $ sqlplus sys@PDB21 AS SYSDBA                   
    
    Copyright (c) 1982, 2019, Oracle.  All rights reserved.
    
    Enter password:
    
    Connected to:
    
    SQL> ALTER TABLESPACE users READ WRITE;
    
    Tablespace altered.
    
    SQL> EXIT
    $