Posts

Showing posts from April, 2011

Function to find specific value in any table any column

Steps to use the following function: Replace the string highlighted in bold/red , with the string you want to search. Note: the following function is tested & working fine in Oracle DB. declare cursor c1 is select column_name , table_name from user_tab_columns where data_type = 'VARCHAR2';-- and table_name = 'REV_DIM_ATTRIBUTES_B' ; vSQL varchar2(32676) := null; vParam varchar2(100) := '10.184.75.23' ; vcnt number; begin for x in c1 loop begin vSQL := 'select count(*) from '||x.table_name||' where '||x.column_name||' like '||chr(39)||'%'||vparam||'%'||chr(39); execute immediate vSQL into vcnt; if vcnt > 0 then dbms_output.put_line('Found in '||x.table_name||' '||x.column_name); end if; exception when others then dbms_output.put_line('Problem in '||vSQL);

List all the files from directory and sub directories

Execute the command in root directory dir /s/p/w/b /S Displays files in specified directory and all subdirectories. /P Pauses after each screenful of information. /W Uses wide list format. /B Uses bare format (no heading information or summary).

Recursively delete files not folder structure

del /s/q *.doc - Delete only .doc files and not folder structure del /s/q *.* - Delete all files and not folder structure /S Delete specified files from all subdirectories. /Q Quiet mode, do not ask if ok to delete on global wildcard.

Oracle to Excel via Sqlplus

Try this on scott schema SET TERMOUT OFF SET FEEDBACK OFF SPOOL current_employees.xls SELECT ename||' '||ename AS "Employee Name", sal, hiredate, NVL(TO_CHAR(comm),'No Commission') AS "Commission", job FROM emp; OR Select * from emp; SPOOL OFF EXIT;

Installation may fail due to ULIMIT settings on LINUX

ULIMIT settings need to be verified before any installation on LINUX Default settings would be 1024 for bot ulimit -Hn & ulimit -Sn

Check whether UNIX OS is 32 or 64 bit

Following are the options to check OS 32 or 64 bit 1) # getconf LONG_BIT 2) # uname -a 3) # cat /proc/cpuinfo

Check if any executable file is 32 or 64 bit on any of UNIX flavours

Following is command to know whether the executable file is 32 or 64 bit $ file #filename# Note: Remove # on both sides when you execute command eg: $ file libcpptrippledes.so