Page 1 of 1

Creating a Test case for Oracle

Posted: Tue Dec 22, 2009 11:13 pm
by bgrenn
If you are using 11.x and you open up a ticket with oracle , they are now asking for a 'test case" when you report your issue.. it is easy to upload, and here is an example of how to upload the test case for

"select x from dual" run as app_user.. make sure you've created the directory "TMP_DIR" !

create or replace package define_vars is
sql_stmt1 varchar2(2000) := q'# SELECT x from dual #';
end;
/

set serveroutput on
declare
tco clob;
begin
-- Export test case
dbms_sqldiag.export_sql_testcase
(
directory => 'TMP_DIR',
sql_text => define_vars.sql_stmt1,
user_name => 'APP_USER',
exportData => FALSE,
testcase => tco
);
end;
/

Also see

http://optimizermagic.blogspot.com/2008 ... y-tar.html

Posted: Wed Dec 23, 2009 12:30 am
by bgrenn
And if that doesn't work (because it produces the error you are trying to send the test case for), and you have views.. this nifty script will pull all table definitions for the views.

set pagesize 0
set linesize 120
select DBMS_METADATA.get_ddl ('TABLE',referenced_name,referenced_owner) from dba_dependencies
where  name in ('V_VIEW1','V_VIEW2') and referenced_type='TABLE';