Describe the purpose and function of transportable tablespaces in Oracle 19c.
Transportable Tablespaces (TTS) in Oracle 19c are a feature designed to facilitate the rapid movement of large volumes of data between Oracle databases. This feature is particularly useful for applications like data warehousing, data migration, and consolidation projects. Below is a detailed description of the purpose and function of transportable tablespaces:
Purpose of Transportable Tablespaces
Efficient Data Movement:
Transportable tablespaces allow you to move data between Oracle databases without the need for time-consuming export/import operations. Instead of copying individual rows, the entire tablespace data files are transferred.
Cross-Platform Data Transfer:
TTS supports transferring tablespaces between databases running on different operating systems or hardware platforms, provided that the source and target platforms are compatible in terms of endian format.
Data Consolidation:
Facilitates the consolidation of multiple databases by allowing tablespaces from separate databases to be added to a centralized database.
Data Archival and Distribution:
Useful for creating archives or distributing static data, such as historical data or reference datasets, to other databases.
Minimized Downtime:
Since TTS avoids the need to unload and reload data, it reduces downtime significantly during migrations or data movement.
Data Sharing:
Enables sharing large read-only datasets, such as lookup tables or historical data, across different Oracle databases.
Functionality of Transportable Tablespaces
Basic Concept:
The transportable tablespace feature moves tablespace data files and the associated metadata (stored as an export file) to a target database.
Steps to Use Transportable Tablespaces:
Set the Tablespace to READ ONLY:
Before transporting, the tablespace must be set to READ ONLY to ensure data consistency:
ALTER TABLESPACE tablespace_name READ ONLY;
Export Metadata:
Use Oracle's Data Pump Export to extract metadata about the objects in the tablespace (e.g., table definitions, indexes):
Set the Tablespace to READ WRITE:
Once imported, the tablespace can be set to READ WRITE in the target database:
ALTER TABLESPACE tablespace_name READ WRITE;
Cross-Platform Compatibility:
Transportable tablespaces can be moved between platforms with the same or different endian formats.
If the endian formats differ, you must convert the data files using the RMAN CONVERT command:
RMAN> CONVERT DATAFILE '/source/path/datafile.dbf'
FROM PLATFORM 'Source Platform'
FORMAT '/target/path/datafile.dbf';
Metadata Validation:
Oracle validates the metadata during the import process to ensure that the tablespace structure and objects align with the target database schema.
Support for Partitioned Tables:
You can transport specific partitions of a partitioned table by transporting the tablespace containing those partitions.
Advantages of Transportable Tablespaces
Speed:
Moving data files is faster than exporting and importing row-by-row.
Minimized Impact on Production:
Data remains accessible during the process since the tablespace is only temporarily set to READ ONLY.
Reduced Disk I/O:
Bypasses the need to read and write every row during the migration process.
Scalability:
Ideal for handling large databases and massive datasets efficiently.
Flexibility:
Enables both same-platform and cross-platform data transfers.
Cross-Version Compatibility:
Supports transport between databases of different versions, provided the target version is newer than or the same as the source version.
Common Use Cases for Transportable Tablespaces
Data Migration:
Moving large data sets to a new database, such as during hardware or platform upgrades.
Data Warehousing:
Transferring historical or aggregated data from OLTP systems to a data warehouse.
Database Consolidation:
Consolidating multiple databases into a single database instance for better resource management.
Archiving:
Archiving large tablespaces for historical or regulatory purposes.
Distributing Read-Only Data:
Sharing static reference data or lookup tables across multiple databases or environments.
Limitations of Transportable Tablespaces
Tablespace Constraints:
Only tablespaces that are in READ ONLY mode can be transported.
Dependency Handling:
Dependencies on objects in other tablespaces (e.g., foreign keys) need to be resolved before transporting.
Platform Compatibility:
Cross-platform transport requires matching or converting endian formats.
Unsupported Objects:
Certain database objects like materialized views or external tables may not be transportable.
Storage Considerations:
Sufficient storage must be available on the target database to accommodate the data files.
Conclusion
Transportable Tablespaces in Oracle 19c are a robust and efficient way to move large datasets between Oracle databases while minimizing downtime and resource usage. They are particularly well-suited for data warehousing, migration, and sharing scenarios, making them an essential tool for modern database administrators.
When copying large chunks of data from one database to another prior to Oracle, you had to choose among several options,
all of which were time-consuming and required you to create an intermediate file to hold the data. Oracle has introduced a new feature for copying or moving a set of tablespaces from one Oracle database to another, called the transportable tablespace. The transportable tablespace feature makes it as easy to move database data as it is to move a file from one location to another. Some of the uses for this feature are:
Preparing data in one database and then copying the data to several distributed databases
Gathering data into summarized historical tables, then moving the tablespace to your data warehouse
Oracle 19c supports Transporting and cloning of Tablespaces
Oracle 19c** supports both **transporting** and **cloning** of tablespaces. These features are part of Oracle's advanced data movement and management capabilities, designed to facilitate efficient database operations in a variety of scenarios.
Transporting Tablespaces in Oracle 19c**
Transportable tablespaces allow you to move tablespaces (and the data within them) between Oracle databases, even across different platforms.
Key Features:**
Cross-Platform Support:
Oracle 19c supports transportable tablespaces across platforms with compatible or different endian formats. If endian formats differ, the RMAN CONVERT command is used to convert the data files.
Transporting Tablespaces with Data Pump:
Oracle 19c integrates with Oracle Data Pump for exporting and importing metadata during the tablespace transport process.
Sharing static, read-only data across environments.
Archiving large volumes of data.
Cloning Tablespaces in Oracle 19c
Cloning tablespaces allows you to create a copy of a tablespace within the same or a different database.
Key Features:**
Cloning with RMAN:
Oracle 19c allows you to use RMAN (Recovery Manager) to clone a tablespace. This feature is particularly useful for testing, development, or reporting purposes.
Snapshot Copy:
Oracle 19c can create snapshot copies of tablespaces, enabling you to work with a point-in-time copy of the data.
Steps to Clone Tablespaces:
Prepare Source Tablespace:
Ensure the source tablespace is in a consistent state.
Use RMAN to Clone:
Execute commands to duplicate the tablespace.
RMAN> DUPLICATE TABLESPACE tablespace_name TO NEW TABLESPACE new_tablespace_name;
Use Pluggable Databases (PDBs):
In multitenant environments, cloning operations are simplified and can be executed within pluggable databases (PDBs).
Online and Offline Cloning:
Oracle 19c supports online tablespace cloning, allowing the source tablespace to remain available during the cloning process.
Offline cloning requires taking the source tablespace offline before cloning.
Use Cases:
Creating a test or development environment.
Creating backups for reporting and analysis.
Distributing data for parallel processing.
Comparison of Transporting vs. Cloning
Feature
Transporting Tablespaces
Cloning Tablespaces
Purpose
Move data between databases.
Create a duplicate tablespace within the same or another database.
Cross-Platform
Supported with endian format conversion if needed.
Typically for the same platform, unless using PDB cloning.
Online Support
Requires READ ONLY mode for source tablespace.
Can be done online (source remains available).
Dependency Handling
Requires resolving dependencies before transport.
No dependency issues if cloning within the same database.
Use Cases
Data migration, archiving, sharing read-only data.
Testing, development, reporting.
Conclusion
Oracle 19c provides robust support for both transporting and cloning tablespaces. Transportable tablespaces are ideal for moving large datasets between databases or platforms, while tablespace cloning is perfect for creating local copies for testing or analysis. These features enhance Oracle's flexibility and scalability for managing large, complex databases.
The current release of Oracle restricts the transporting and cloning of tablespaces. You can only do this between computers with the same
hardware, database block size, and database character set. This restriction will likely disappear in later releases as well.
Objects in the tablespaces that you wish to transport must not reference any object outside the tablespaces. The tablespaces must be totally
self-contained. For example, let us say you select a tablespace that contains an index. The index is based on a table found in another tablespace.
The initial tablespace cannot be transported by itself because it refers to something outside of itself. You could transport the two tablespaces as a set, however, assuming that the two only
reference each other. Look at the following series of images below to see a demonstration of the steps for transporting a tablespace.
Oracle Transportable Tablespaces
Analyze the following uploaded image. Print off the Oracle code and script in the image.
First step in the process is to change the tablespace you wish to transport into READ ONLY status.
Second step in the process is to export the tablespace. This screen shows the syntax of the command you will use and the actual export command used in our example.
Screen shot of the command line and status feedback that was created when exporting the example tablespace.
The next step is to copy the export file just created and all the data files for the tablespaces to a location that is accessible by the target database
Now use the import utility (IMP) to import the meta-data into the target database. This screen shows the syntax and the exact command for our sample tablespace, WAREHOUSE1.
Here is a screen shot of the command line and status feedback that was created when importing the example tablespace.
You can now modify the tablespace so that it is in a READ WRITE state using the command show here.
The transporting of tablespaces as if they were ordinary files (except for the meta-data, which must be imported) reduces the time it takes to copy or move data from one database to another. In fact, the greater the size of the data files, the more time is saved compared to a "normal" export and import of the data.
Transportable TableSpaces - Exercise
Click the Exercise link below to practice creating a locally managed tablespace and exporting it for transport. Transportable TableSpaces - Exercise
The next lesson looks into new features and enhancements you will use when handling READ ONLY tablespaces.