Monday, July 7, 2014

Genating DDL from export dump file or check expdp dumpfile is corruped or not

- We can generate DDL from export dump file using below command, it won't import the data into DB, it generate the DDLs and save into the file.
- What does this sqlfile do?
- Here we have used sqlfile option, which will not import any data into the database.
- This will write all DDL statements (which will be executed if a import is performed) into the file which we mentioned in the command.
- So this will read the entire DATAPUMP Export dump file and will report if a corruption is detected
 nohup impdp / dumpfile=expdp_hsdv04_maximo7_2Jul2014.dmp logfile=Impdp_maximo7_into_hsdv01_07Jul14.log schemas=MAXIMO7 directory=dumpdir REMAP_TABLESPACE=MAXTEMP:TEMP sqlfile=Impdp_dump_file_corruption_check.sql &

Friday, July 4, 2014

Tracing Remote Session and tkprof

Methods to set Event 10046:
==========================

Method 1 :
syntax: exedc dbms_system.set_ev(l_sid,l_serial#,10046,l_level,'');
SQL > execute dbms_system.set_ev(10,224,10046,8,'');

Method 2:SQL> oradebug unlimit
SQL> oradebug setospid 10927
SQL> oradebug event 10046 trace name context forever, level 8                 ------- this is to turn on
SQL> oradebug event 10046 trace name context off                             


TKPROF:
tkprof clndv10_ora_21234002.trc clndv10_ora_21234002.txt table=system.plan_table explain=system/manager sys=no waits=yes sort=prsela, exeela, fchela
Note: in the tkprof sys=no means it won't show the sqls belongs to sys user.