The portable tablespace introduced in Oracle8i provides urgent support for faster cross-database data transmission. With this feature, you can export only the metadata of the tablespace, transfer data files, export the dump files to the target database host, and import metadata to "Insert" the tablespace into the target database. The data in the tablespace is available immediately in the target database. This method solves a very difficult problem that once existed in a data warehouse: Moving data across databases quickly and efficiently.
However, in OLTP databases, this condition is generally impossible, so it is impossible to transmit tablespaces. If the OLTP database is the data source of the data warehouse, you may never be able to load it using the writable tablespace.
In Oracle Database 10g 2nd, You can transmit tablespaces and insert them from another data source (Backup. For example, if you want to transmit the tablespace accdata, you can issue the RMAN command
RMAN> transport tablespace accdata
2> tablespace Destination = '/home/Oracle'
3> auxiliary Destination = '/home/Oracle ';
This command creates a secondary instance in the location/home/Oracle and restores files from the backup. The name of the secondary instance is randomly generated. After an instance is created, this process creates a directory object based on the directory and restores the file of the tablespace accdata (the tablespace we are transferring)-all operations are automatically completed without issuing any command!
The/home/Oracle directory contains all the data files for the tablespace accdata, the dump file for the tablespace metadata, and the script impscrpt. SQL (most important ). This script contains all the commands required to insert the tablespace into the destination tablespace. The tablespace is not transmitted by the impdp command, but by calling the dbms_streams_tablespace_adm.attach_tablespaces package. All necessary commands can be found in the script.
You may ask, what if an error occurs? In this case, diagnosis can be easily performed. First, the secondary instance creates an Alert Log File in $ ORACLE_HOME/rdbms/log so that you can check the log to identify potential problems. Second, when providing the RMAN command, you can redirect the command and output to the log file by issuing the RMAN command (which places all output in the file TTS. Log)
RMAN target =/log = TTS. Log
Then, you can check the file to find out the exact cause of the fault.
Finally, the files will be restored to the/home/Oracle tspitr _ <sourcesid >_< auxsid> directory. For example, if the SID of the primary database is Acct and the SID of the secondary instance created by RMAN is kyed, the directory name is tspitr_acct_kyed. This directory also contains two sub-directories: datafile (for data files) and onlinelog (for redo logs ). Before creating a new tablespace, you can view the directory to see which files have been restored. (These files will be deleted at the end of the process .)
For a long time, DBA has been expecting to create a portable tablespace through RMAN backup. However, note that you are inserting the transferred tablespace from the backup (rather than from the online tablespace. Therefore, it will not be the latest.