The procedure or function in this package checks if a are ready to be transported to a target platform.
And if a database has external tables, directories or bfiles. It would use the dbms_output.put_line to
Output the external objects and their owners.
Test:
Declare
b boolean;
Begin
B:= dbms_tdb.check_external;
End
The following directories exist in the database:
sys. AC filter field, sys. ac field, sys. EQUIPTYPE2000, SYS. EQUIPTYPE2500, sys. power system section, sys. pre-station area, Sys. EQUIPTYPE1200, sys. DC field, sys. EQUIPTYPE1000, sys. commutation Square, Sys. EQUIPTYPE1300
The following bfiles exist in the database:
Bh. Bin$k67xgmlmql+/frrmejpthq==$0, BH. Bin$4wdotqffrjgdfxxrx6g41q==$0, BH. Bin$yw203fpntx+dq9iqwcficg==$0, BH. Proj_model_files, BH. Bin$ftxiy5v4rq+usfa4uetbaa==$0, BH. Bin$mj0t31ukt+sh8aueixuong==$0, BH. Model_files, BH. Bin$se6ltgxhtbonipatfi2gpa==$0, BH. Bin$5aczo4eotwiztsmnbhxf9w==$0
Description of Dbms_tdb:
CREATE OR REPLACE Package Dbms_tdb is
--++
--description:this function checks if a
--transported to a target platform. If the database is not
--ready-to-be transported and serveroutput are on, a detailed
--Description of the reason why the database cannot is
--transported and possible ways to fix the problem would be
--displayed
--
--Inputs:target_platform-name of the target platform
--
--Outputs:none
--
--Returns:true If the datababase is ready for be transported.
--FALSE otherwise.
--++
SKIP_NONE constant Number: = 0;
SKIP_INACCESSIBLE constant Number: = 1;
SKIP_OFFLINE constant Number: = 2;
SKIP_READONLY constant Number: = 3;
FUNCTION check_db (
Target_platform_name in Varchar2,
Skip_option in number)
RETURN Boolean;
FUNCTION check_db (
Target_platform_name in VARCHAR2)
RETURN Boolean;
FUNCTION check_db
RETURN Boolean;
--++
--description:this function checks if a database has external tables,
--Directories or bfiles. It would use the dbms_output.put_line to
--Output the external objects and their owners.
--
--Inputs:none
--
--Outputs:none
--
--Returns:true If the datababase has external tables, directories or
--Bfiles. FALSE otherwise.
--++
FUNCTION check_external
RETURN Boolean;
--++
--description:this procedure is used in transport script to throw a SQL
--error So, the transport script can exit.
--
--Inputs:should_exit-whether to exit from transport script
--
--Outputs:none
--
--exceptions:ora-9330
--++
PROCEDURE Exit_transport_script (
Should_exit in VARCHAR2);
END;
OCP questions:
429.Which of the following supplied functions are used to identify external tables, directories, and bfiles?
A. Dbms_tdb. Check_directories
B. Dbms_tdb. Check_external
C. Dbms_tdb. Check_bfile
D. Dbms_tdb. Check_ext
Answer:b
The answer resolves:
Reference: http://docs.oracle.com/cd/E11882_01/appdev.112/e40758/d_tdb.htm#ARPLS68854
the DBMS_TDB
Package reports whether a database can be transported between platforms using the RMAN CONVERT DATABASE
command. The package verifies this databases on the current host platform is of the same endian format as the destination platform , and that the state of the current database does not prevent transport of the database.
Overview
In many cases, Oracle supports transporting databases between platforms which has the same endian format. However, even when the endian formats is the same, a database must undergo a conversion process to move from one platform to another. There is also preconditions required for the process of transporting a database, such as has the database to be TRANSP Orted Open read-only.
The package DBMS_TDB
serves and purposes:
Confirming that Oracle supports transporting a database from a given source platform to a given target platform
Determining whether a database to be transported have been properly prepared for transport, and if not, identifying the con Dition that prevents database transport
The actual conversion is performed using the Recovery Manager CONVERT DATABASE
command. For a all discussion of the requirements for transporting a database, the process of converting a database for TRANSP ORT across platforms, and examples of the use DBMS_TDB
of the subprograms process, see Oracle Database back Up and Recovery User's Guide.
Check_external Function
This function determines whether a database has external tables, directories, or bfiles.
Syntax
Dbms_tdb. Check_external RETURN BOOLEAN;
Return Values
If the database has external tables, directories, or bfiles, return TRUE
. Otherwise, return FALSE
.
Usage Notes
If SERVEROUTPUT
ON
is, then the function would output the names of the external tables, directories, and bfiles in the database .
The database must be open read-write.
Examples
This example illustrates the "with CHECK_EXTERNAL
" a database that has several external tables, directories, and Bfiles:
sql> SET serveroutput onsql> DECLARE external BOOLEAN; BEGIN external: = Dbms_tdb. check_external; END; /the following external tables exist in the database:sh. Sales_transactions_extthe following directories exist in the Database:sys. Media_dir, SYS. Data_file_dir, SYS. Log_file_dir, SYS. Data_pump_dirthe following bfiles exist in the database:pm. Print_media PL/SQL procedure successfully completed.