ACE Director Alum Daniel Morgan, founder of Morgan's Library, is scheduling
complimentary technical Workshops on Database Security for the first 30
Oracle Database customers located anywhere in North America, EMEA, LATAM, or
APAC that send an email to
asra_us@oracle.com. Request a Workshop for
your organization today.
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
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.
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.
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.
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;
/
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