Skip to main content

Posts

Showing posts with the label Oracle

Load CSV file data in Oracle table using ODI

Let us see how to transfer CSV file data in an Oracle database table. A   CSV (Comma-separated value)   file basically stores tabular data (numbers and text) in plain-text form. It is a common and simple file format used by many applications. Pre-requisites : Oracle database 10g Express Edition with *SQLPlus, Oracle Data Integrator (build version 11.1.1.0.7) First, you need to create your  .csv  file. Open  notepad  and write the following! EMPLOYEE_ID,FIRSTNAME,LASTNAME 1 ,Dean,Winchester 2 ,John,Winchester 3 ,Sam,Winchester Save the file with filename as  employee.csv Next we need to create a corresponding table in Oracle to store this information. Open *SQLPlus and login with your credentials. Create table using following command! create table csv_test(empid int primary key, firstname varchar( 30 ), lastname varchar( 30 )); The data in this table will come from the  .csv  file that we will load usin...

When your oracle query takes too long ...

What to do when your query is too slow? First of all, you have to know why it is slow. What is the real cause of your problem. If the reason why is not known, suggesting to rewrite the query, or hinting the query, suggesting parallellization et cetera is not very productive. Once in a while you may get lucky. But even then you have to realize that if your problem seems "solved", but you don't know why, nothing guarantees you that the problem won't come back tomorrow. So the first step should always be to investigate the root cause . The tools at your disposal are, among more: - dbms_profiler - explain plan - SQL*Trace / tkprof - statspack Use dbms_profiler if you want to know where time is being spent in PL/SQL code. Statspack is a must if you are a dba and want to know what is going on in your entire database. For a single query or a small process, explain plan and SQL*Trace and tkprof are your tools. explain plan in SQL*Plus you have to type...