Oracle DBMS_TDB
Version 12.2.0.1

General Information
Library Note Morgan's Library Page Header
Are you prepared for the release of Oracle Database 18c ... the first autonomous database? We are here at the Library. It is time for DBAs to stop fighting robots with their fingers and losing ... time to start using our intelligence and winning.
Purpose The DBMS_TDB package serves two purposes:
  • Confirms support of transporting a database from a given source platform to a given target platform
  • Determining whether a database to be transported has been properly prepared for transport, and if not, identifies the condition that prevents database transport
AUTHID DEFINER
Constants
Name Data Type Value
SKIP_NONE NUMBER 0
SKIP_INACCESSIBLE NUMBER 1
SKIP_OFFLINE NUMBER 2
SKIP_READONLY NUMBER 3
Dependencies
DBMS_OUTPUT TS$ V$TRANSPORTABLE_PLATFORM
DBMS_PLUGTS V$DATABASE X$KCVFH
DBMS_SYS_ERROR V$DATAFILE X$KTUSUS
DUAL V$DB_TRANSPORTABLE_PLATFORM X$KTUXE
KUPCC    
Documented Yes
First Available Not known
Security Model Owned by SYS with EXECUTE granted to the DBA and SYSBACKUP roles
Source {ORACLE_HOME}/rdbms/admin/dbmsplts.sql
Subprograms
 
CHECK_DB
Checks whether a database can be transported to a target platform

Overload 1

Note: As of version 12.1.0.2 this only works if the entire database has been opened in READ ONLY mode or if working a single PDB that PDB is only in READ ONLY mode which is essentially worthless if anyone cares about high availability. I have an open SR.
dbms_tdb.check_db(
target_platform_name IN VARCHAR2,
skip_option          IN NUMBER)
RETURN BOOLEAN;
SELECT platform_name
FROM gv$transportable_platform
ORDER BY 1;

set serveroutput on

DECLARE
 x BOOLEAN;
BEGIN
  x := dbms_tdb.check_db('Microsoft Windows IA (32-bit)', 0);
  IF x THEN
    dbms_output.put_line('TRUE');
  ELSE
    dbms_output.put_line('FALSE');
  END IF;
END;
/
Overload 2

Note: As of version 12.1.0.2 this only works if the entire database has been opened in READ ONLY mode or if working a single PDB that PDB is only in READ ONLY mode which is essentially worthless if anyone cares about high availability. I have an open SR.
dbms_tdb.check_db(target_platform_name IN VARCHAR2) RETURN BOOLEAN;
SELECT platform_name
FROM gv$transportable_platform
ORDER BY 1;

set serveroutput on

DECLARE
 x BOOLEAN;
BEGIN
  x := dbms_tdb.check_db('Apple Mac OS');
  IF x THEN
    dbms_output.put_line('TRUE');
  ELSE
    dbms_output.put_line('FALSE');
  END IF;
END;
/

DECLARE
 x BOOLEAN;
BEGIN
  x := dbms_tdb.check_db('Linux IA (32-bit)');
  IF x THEN
    dbms_output.put_line('TRUE');
  ELSE
    dbms_output.put_line('FALSE');
  END IF;
END;
/
Overload 3

Note: As of version 12.1.0.2 this only works if the entire database has been opened in READ ONLY mode or if working a single PDB that PDB is only in READ ONLY mode which is essentially worthless if anyone cares about high availability. I have an open SR.
dbms_tdb.check_db RETURN BOOLEAN;
set serveroutput on

DECLARE
 x BOOLEAN;
BEGIN
  x := dbms_tdb.check_db;
  IF x THEN
    dbms_output.put_line('TRUE');
  ELSE
    dbms_output.put_line('FALSE');
  END IF;
END;
/

SHUTDOWN IMMEDIATE;

STARTUP MOUNT;

ALTER DATABASE OPEN READ ONLY;

set serveroutput on

DECLARE
 x BOOLEAN;
BEGIN
  x := dbms_tdb.check_db;
  IF x THEN
    dbms_output.put_line('TRUE');
  ELSE
    dbms_output.put_line('FALSE');
  END IF;
END;
/

SHUTDOWN IMMEDIATE;

STARTUP;
 
CHECK_EXTERNAL
Check if a database has external table, directory or BFILE. Uses  dbms_output.put_line to output the external objects and their owners dbms_tts.check_external RETURN BOOLEAN;
set serveroutput on

DECLARE
 x BOOLEAN;
BEGIN
  x := dbms_tdb.check_external;
  IF x THEN
    dbms_output.put_line('TRUE');
  ELSE
    dbms_output.put_line('FALSE');
  END IF;
END;
/
The following external tables exist in the database:
SYS.OPATCH_XML_INV
The following directories exist in the database:
SYS.ORACLE_HOME, SYS.ORACLE_BASE, SYS.OPATCH_LOG_DIR, SYS.OPATCH_SCRIPT_DIR, SYS.OPATCH_INST_DIR, SYS.DATA_PUMP_DIR,
SYS.XSDDIR, SYS.XMLDIR, SYS.ORACLECLRDIR, SYS.ORACLE_OCM_CONFIG_DIR, SYS.ORACLE_OCM_CONFIG_DIR2
TRUE

PL/SQL procedure successfully completed.
 
EXIT_TRANSPORT_SCRIPT
Internal: Used in transport script to throw a SQL error so that the transport script can exit dbms_tdb.exit_transport_script(should_exit IN VARCHAR2);
Generates an ORA-09330 when run in an independent session

Related Topics
Built-in Functions
Built-in Packages
DataPump Executable
DBMS_CSX_ADMIN
DBMS_CSX_INT
DBMS_DATAPUMP
DBMS_EXTENDED_TTS_CHECKS
DBMS_PLUGTS
DBMS_PLUGTSP
DBMS_TTS
Export
Import
Tablespaces
Transportable Tablespaces
What's New In 12cR1
What's New In 12cR2

Morgan's Library Page Footer
This site is maintained by Dan Morgan. Last Updated: This site is protected by copyright and trademark laws under U.S. and International law. © 1998-2017 Daniel A. Morgan All Rights Reserved