????????????????SQL??????????????????????????SQL??????????????????????????????????????oracle??????????????????
sys@ORCL> conn /as sysdba
???????
sys@ORCL> grant read??write on directory exp_dir to u2;
????????
sys@ORCL> grant read??write on directory exp_dir to u1;
????????
sys@ORCL> grant dba to u2;
sys@ORCL> grant dba to u1;
????????
????directory???????????????????????u1??u2?????????u1??u2??????dba????
sys@ORCL> conn u2/u2
???????
u2@ORCL> select count(*) from t;
COUNT(*)
----------
1
u2@ORCL> conn u1/u1
???????
u1@ORCL> select count(*) from t;
select count(*) from t
*
?? 1 ?г??????:
ORA-00942: ????????????
???????????u1??????????????t?????????????????u2????????sql????????u1??????
??????
u2@ORCL> conn u2/u2
???????
u2@ORCL> declare mycase clob;
2  begin
dbms_sqldiag.export_sql_testcase(directory => 'EXP_DIR'??sql_text => 'select count(*) from t'??user_name => 'U2'??exportData => true??testcase => mycase);
4  end;
5  /
PL/SQL ??????????ɡ?