I have a doubt that whether External tables(Oracle) can be used in my application without actually creating a real table in Database. What I intend to do is that I have a .txt(around 25 GB) file and I want to run SQL queries directly on my .txt file without creating and loading the data in an actual Database table. So, my question is whether this is possible and if yes, then what are the drawbacks and benefits in doing so. Any help is highly appreciated.
2 Answers
It's possible, but the main drawback of external tables is that you can't create any index on such tables, so selecting data can be rather slow. Read this.
4 Comments
You can apply parallel query, but of course cannot create indexes or modify the data, or gather a full set of statistics on it (you can collect some statistics using DBMS_STATS.GATHER_TABLE_STATS, which may help Oracle determine the best join strategy).
If the file was logically split into multiple files such that you could tell that data for January was in a particular file, then you could certainly have multiple external tables and possibly something fancy to emulate partitioned views, but it would be a pain.
Really you should load the data. If performance of that is a concern then use a direct path nologging load with indexes already defined on the table -- in case of media failure you can still reload the data so the logging is optional.