CODE
Oracle Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
PSOUG Home Code Snippets Oracle Reference Oracle Functions PSOUG Forum Oracle Blogs Bookmark and Share
 
 Search the Reference Library pages:  

Free
Oracle Magazine
Subscriptions
and Oracle White Papers

Oracle DBMS_TDB
Version 11.1
 
General Information
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, identifyies the condition that prevents database transport
Source {ORACLE_HOME}/rdbms/admin/dbmsplts.sql
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$
DBMS_PLUGTS V$DB_TRANSPORTABLE_PLATFORM
DBMS_SYS_ERROR V$TRANSPORTABLE_PLATFORM
DUAL X$KCVFH
GV$DATABASE X$KTUSUS
GV$DATAFILE X$KTUXE
Exceptions None
Security Model Execute is granted to the DBA role
 
CHECK_DB

Overload 1
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
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
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;
/
 
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);
Creates an ORA-09330
 
Related Topics
DBMS_EXTENDED_TTS_CHECKS
DBMS_TTS
Transportable Tablespaces
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us [111 users online]    © 2010 psoug.org