Posts

Showing posts from 2012

Linux | File_Combiner4Hadoop

File_Combiner4Hadoop This shell script can be used to combine a set of small files into one or more big file. This script is very useful when working with hadoop( at least it did for me). With Hadoop the overhead involved in processing small files is very high. So it is better to combine all the small files and make one or more big files and use those big files for hadoop processing. At the same time if the "big/combined file" is more than the block size( by default it is 64MB) in hadoop, there is a possibility for the file to get split during the hadoop process( i.e one half of the file will be processed by one node and another half on another node). If you dont want the files to be split, then this is one of the easiest solution - combine the small files into one or more big files and make sure the big file's size does go above the hadoop block size ( in my case it is 64MB). This shell script has a parameter "-size" where you can specify the maximum all

Ora | dba_source - Extended

Image
dba_source - Extended This utility extends the default DBA_SOURCE view and gives the below additional details as separate columns. TEXT column for uncommented code name of the procedure, function and cursor name defined within a package/procedure/function. sub procedure / function name i.e procedures and functions defined within a another procedure/function. Download the Source Code TYPE  - typ_uc_dba_source_rec.sql TYPE - typ_uc_dba_source_tab.sql FUNCTION - uc_dba_source_fun.sql VIEW - uc_dba_source_v.sql Installation Steps Download the sqls from the above links. Run them in the same order. Usage Notes select * from uc_dba_source_v where owner = '[schema name]' and object_name = '[procedure/function/package name]' Example Here is the source code of the package body, taken for our example CREATE OR REPLACE PACKAGE BODY VSUBR.my_test IS /* this package is the test package to show how the DBA_source -extention wor

Ora | HTML eMail Util

HTML eMail Utility This Package/function is useful for sending emails from your pl/sql Code. It send out emails with simple HMTL tags, which can used for neatly formatting your emails.  Download the Source Code Package_spec - PKG_HTML_eMAIL_spec.sql Package_body -PKG_HTML_eMAIL_body.sql Installation Steps Download the package spec and the body from the above links. Run the downloaded script and ensure you have a valid PKG_HTML_eMAIL package. Usage Notes **************************** * Example-1 : Simple Email **************************** DECLARE a NUMBER; BEGIN a := PKG_HTML_eMAIL.sendSimpleEmail('test@domain.com', 'testing', ' Testing HTML body R1 - C1 R1 - C2 R1 - C3 R2 - C1 R2 - C2 R2 - C3 '); IF

Ora | getNext

Get_Next This function is useful for extracting the values from a comma separated values. Parameters   pv_in_string      is the delmited string      pn_in_pos     position of the value that is required      pv_in_delimiter      single delimiter char      pv_in_endofstr      If this string is set to 'Y' then it will return a string like $$END$$ when the    requested position(pn_in_no) is greater than the maximum position available    within that string. i.e if the position is beyond the end of the string. This might    be useful to decide when to EXIT when the we are writing a LOOP logic on a    comma delimted string. Normally we exit when we get a NULL value for a    position.  Function create or replace CREATE OR REPLACE FUNCTION VSUBR.getNext( pv_in_string IN VARCHAR2, pn_in_pos IN NUMBER, pv_in_delimiter IN VARCHAR2 DEFAULT ',', pv_in_endofstr IN VARCHAR2 DEFAU