How to find a specific string in Entire database?

Well i know this question is posted numerous times here but i m complete noob understanding the solution given on the net.
Let me introduce the entire scenario .
We have an application, which keeps on sending emails from an X employees account.
We are using Oracle 11g as database .But the problem is we don't know which table to search for the value.
All we have is Database credentials and x employee's name.
Is there any way we can find out which table contains the name so that we can change it accordingly.
I m using plsql developer to connect to the database.
One solution that we got from internet goes as below.
Ref:
[http://www.club-oracle.com/articles/oracle-find-all-tables-with-column-value-154/ |http://www.club-oracle.com/articles/oracle-find-all-tables-with-column-value-154/ ]
As per the solution i had to create a procedure as below .
create or replace
procedure find_string( p_str in varchar2 )
authid current_user
as
l_query long;
l_case long;
l_runquery boolean;
l_tname varchar2(30);
l_cname varchar2(30);
type rc is ref cursor;
l_cursor rc;
begin
dbms_application_info.set_client_info( '%' || upper(p_str) || '%' );
for x in (select * from user_tables )
loop
l_query := 'select distinct ''' || x.table_name || ''', $$
from ' || x.table_name || '
where ( 1=0 ';
l_runquery := FALSE;
l_case := NULL;
for y in ( select *
from user_tab_columns
where table_name = x.table_name
and data_type in ( 'VARCHAR2', 'CHAR' )
loop
l_runquery := TRUE;
l_query := l_query || ' or upper(' || y.column_name ||
') like userenv(''client_info'') ';
l_case := l_case || '||'' ''|| case when upper(' || y.column_name ||
') like userenv(''client_info'') then ''' ||
y.column_name || ''' else NULL end';
end loop;
if ( l_runquery )
then
l_query := replace( l_query, '$$', substr(l_case,8) ) || ')';
begin
open l_cursor for l_query;
loop
fetch l_cursor into l_tname, l_cname;
exit when l_cursor%notfound;
dbms_output.put_line
( 'Found in ' || l_tname || '.' || l_cname );
end loop;
close l_cursor;
end;
end if;
end loop;
end;
Well i have copied the code to sql window in plsql and executed .But whenever i compile the procedure it says there is an error .
Not sure what kind of error hidden in the procedure.
If any 1 has any better idea please share.
Edited by: Milind on Apr 12, 2012 8:45 PM

Girish Sharma wrote:
Milind,
I am not sure what / which error about your talking, but there is no error/issue at my end when I ran your procedure code :
1.I just pasted the code in sqlplus window, it showed me Procedure created. message.
2.I just checked with show errors command, it showed me No errors.
3.I just tried to run it with :
SQL> SET SERVEROUTPUT ON;
SQL> exec find_string('SCOTT');
Found in EMP.ENAMENo issue error.
But whenever i compile the procedure it says there is an error .
SQL> alter procedure find_string compile;
Procedure altered.
SQL> exec find_string('SCOTT');
PL/SQL procedure successfully completed.
SQL> set serveroutput on;
SQL> exec find_string('SCOTT');
Found in EMP.ENAME
PL/SQL procedure successfully completed.
SQL>So, there is no error at my end 11.2.0.1 windows box.
Regards
Girish Sharma
Edited by: Girish Sharma on Apr 13, 2012 11:20 AMThanks it worked for me.

Similar Messages

  • How to find a specific word in sentence in each line?

    How to find a specific word in sentence in each line and output will show start from the beginning from specific word plus with small description from each sentence?
    For example: I need to find a "+Wednesday+" and "+Thursday+" word in each sentence by line by line from "myfile.txt".
    Go ballet class next Wednesday.
    On the Wednesday is going to swim class.
    We have a meeting on Thursday at Panda's.
    Then it will show the output:
    Wednesday : ballet class
    Wednesday : swim class
    Thursday: meeting at Panda's
    I am going to figure out in Java console to read from a file for specific word from each line and how to make it output in correct way. I know already to make input/file codes.

    I got it and understand much better. Thank you very much. There is a problem with it because I knew how to make
    a specific word in sentence but how I should make Output for specific word and some words from sentence.
    For example:
    Input:
    +"On Thursday go to ballet class"+
    +"Swim class on Friday one time a month at 2 p.m."+
    I used the codes for that:
    class FindSchedule{
         String firstline = "On Thursday go to ballet class ";
         String secondline = "Swim class on Friday one time a month ";
         FindSchedule(){
              System.out.println(firstline + findTheIndex("Thursday", firstline));
              System.out.println(secondline + findTheIndex("Friday", secondline));
         public int findTheIndex(String word, String sentence){
              int index;
              index = sentence.indexOf(word);
              return index;
         public static void main (String[] args){
              new FindSchedule();
    }The output will be:
    Thursday: ballet class
    Friday: 14:00 swim class one time a week
    Notice that time is changing in output complete different from input.
    I need to find out how to extract some words from each sentence for output. Do you know how to do it?

  • Hi, I don't know how to find a specific security patch to apply to my Oracle database version to fix a vulnerability

    Hi, I don't know how to find a specific security patch to apply to my Oracle database version 11.2.0.2.0 (on windows server 2003 32 bits) to fix the following vulnerability:
    Risk: High
    Application: oracle_tnslsnr
    Port: 1521
    Protocol: tcp
    Synopsis:
    It is possible to register with a remote Oracle TNS listener.
    Description:
    The remote Oracle TNS listener allows service registration from a remote host. An attacker can exploit this issue to divert data from a
    legitimate database server or client to an attacker-specified system.
    Successful exploits will allow the attacker to manipulate database instances, potentially facilitating man-in-the-middle, sessionhijacking,
    or denial of service attacks on a legitimate database server.
    Solution:
    Apply the work-around in Oracle's advisory.
    Thank you for your help

    2835604 wrote:
    Hi, I don't know how to find a specific security patch to apply to my Oracle database version 11.2.0.2.0 (on windows server 2003 32 bits) to fix the following vulnerability:
    Risk: High
    Application: oracle_tnslsnr
    Port: 1521
    Protocol: tcp
    Synopsis:
    It is possible to register with a remote Oracle TNS listener.
    Description:
    The remote Oracle TNS listener allows service registration from a remote host. An attacker can exploit this issue to divert data from a
    legitimate database server or client to an attacker-specified system.
    Successful exploits will allow the attacker to manipulate database instances, potentially facilitating man-in-the-middle, sessionhijacking,
    or denial of service attacks on a legitimate database server.
    Solution:
    Apply the work-around in Oracle's advisory.
    Thank you for your help
    that sounds like the "tns poison" vulnerability.  CVE 2012-1675 - Oracle Security Alert CVE-2012-1675
    See MOS note 134083.1  and 1453883.1

  • How to find a specific song?

    I am looking for the song "To Sir With Love" by Lulu with the group The Mindbenders. My problem is that apparently there are two versions? And when I listen to the samples I can't tell if it's has the lyrics I'm looking for. I want the version which is sung in the movie which includes the line Those awkward years... Does anyone know how to find a specific version of a song? Thank you in advance for your help.

    Search the iTunes Store for "to sir, with love"
    One of the songs will contain in the title (from the Columbia movie.....
    No guarantee but I would guess that's the one you are looking for.
    http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?i=193322123&id=19332 1271&s=143441

  • How to find the specific build of  Oracle9i Jdeveloper??

    Hi All
    I am quite new to OAF, Please help How to find the specific build of Oracle9i Jdeveloper that corresponds to the specific OA Framework release installed in the runtime environment. I would like to know two things here.. how to find 1)what is the patchset installed in environment 2) which Jdeveloper ARU corresponds to that.
    Thanks in Advance !
    Savitha

    Pl see MOS Doc 416708.1 (How to find the correct version of JDeveloper to use with eBusiness Suite 11i or Release 12.x)
    HTH
    Srini

  • How to find the CONNECTION STRING

    how to find the connection string through SQL Statement?
    salahuddin/salahuddin@CONNECTION_STRING
    Below is all about my sql version:
    DEFINE SQLPLUSRELEASE = "800060000" (CHAR)
    DEFINE _EDITOR         = "Notepad" (CHAR)
    DEFINE OVERSION = "Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options" (CHAR)
    DEFINE ORELEASE = "1002000100" (CHAR)

    In windows XP plateform your can find from the ServicesHow can you do that using SQL statement? Plus connect strings are not available in Services. In post 9i SQL*Plus we can do it in SQL statement like this
    SELECT '&&_CONNECT_IDENTIFIER'
    FROM dual;
    Note: This will work only in SQL*Plus.

  • How to find encrypted columns in oracle 10g database

    Hi,
    How to find encrypted columns in oracle 10g database? We can see using view dba_encrypted_columns or all_encrypted_columns .
    my question is apart from this is there anyother views or tables?
    Thanks..

    user602872 wrote:
    Hi,
    How to find encrypted columns in oracle 10g database? We can see using view dba_encrypted_columns or all_encrypted_columns .
    my question is apart from this is there anyother views or tables?Hmm not which I could find,
    SQL> select * from dict where lower(table_name) like '%encrypted%';
    TABLE_NAME
    COMMENTS
    DBA_ENCRYPTED_COLUMNS
    Encryption information on columns in the database
    ALL_ENCRYPTED_COLUMNS
    Encryption information on all accessible columns
    USER_ENCRYPTED_COLUMNS
    Encryption information on columns of tables owned by the user
    SQL>HTH
    Aman....

  • How to find the structure fields data in database tables?

    how to find the structure fields data in database tables?

    Your question doesn't appear to be Web Dynpro ABAP related. Please only post questions in this forum if they are directly Web Dynpro ABAP related.  There are several other more general ABAP related forums.

  • How to find the temporary tablespace of the database?

    How to find the temporary tablespace of the database?

    noooo I don't want to try it myself without a GURU telling if it can be done.
    i'd rather spend an hour posting on the forum and waiting for a response then
    spend 30seconds logging in to my database and running an SQL query.

  • How to find a specific text(string) in a list (100) programs

    Dear All,
    Wish tou a very happy new year 2009!!!
    please let me know how we can find a specific word(eg: "barrel") in a list of programs/reports/bdc/user exits/field exits/function modules.
    Thanks in advance.
    Kumar.

    hi kumar,
    open EWK1 transaction and search for the word or string according to your requirement.
    Cheers
    Gautham

  • How to find a specific activity done by a particular user in the database

    How to find who (a specific user) does what (activities) on a specific date/time to certain Objects in a database instance. If similar posting and/or resources are available, please advise.
    Thanks.

    I have got the same problem. My operation steps is below:
    1. create one dictory
    mkdir /usr/local/dbs
    chown oracle:oinstall /usr/local/dbs
    2. modify the paramter
    alter system set utl_file_dir='/usr/local/dbs' scope=spfile;
    3. restart database
    4. create the logmnr file:
    BEGIN
    dbms_logmnr_d.build(
    dictionary_filename => 'logminer_dict.dat',
    dictionary_location => '/usr/local/dbs');
    END;
    5. add the online redo log file:
    execute dbms_logmnr.add_logfile(options =>dbms_logmnr.new,logfilename =>'/u01/app/oracle/oradata/orcl/redo01.log');
    execute dbms_logmnr.add_logfile(options =>dbms_logmnr.addfile,logfilename =>'/u01/app/oracle/oradata/orcl/redo02.log');
    execute dbms_logmnr.add_logfile(options =>dbms_logmnr.addfile,logfilename =>'/u01/app/oracle/oradata/orcl/redo03.log');
    6. start logmnr
    BEGIN
    dbms_logmnr.start_logmnr(
    dictfilename => '/usr/local/dbs/logminer_dict.dat');
    END;
    7. check the result
    select sql_redo FROM v$logmnr_contents;
    I got error message at the step:
    ORA-01306:dbms_logmnr.start_logmnr() must be invoked before selecting from v$logmnr_contents
    Could anyone help about this?

  • How to find the specifed user-exit

    Hi, experts. i am first time to do enchancement. can anyone tell me how to find specifed user-exit. for example, how to find MV45AFZZ?  Also, what i should pay attention to when doing enhancment works? thanks.

    Hi Jrockman,
    There are many things associated to user exit.
    a) Tcode- CMOD.    here you can find
    b)  USER-EXIT triggering points ->
    Go to se93 and give the tcode to find the main program associated to it.
    Go to se38 and give the main program.
    Find the package associated to it.Go to->Object Directory Entry.
    Go to smod transaction.
    Press f4.
    Press Information System Button.
    Give the Project(Dev Class).
    Press enter.
    Find the enhancements associated
    c) Check the code posted by me ,to get the list of User exits and Badi for a particular tcode in the link mentioned below.
    Re: User Exit for IW22 - to populate custom fields
    d) few useful links to understand User exits.
    http://www.sapdevelopment.co.uk/enhance/enhancehome.htm
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    http://www.sapgenie.com/abap/code/abap26.htm
    http://www.sap-img.com/abap/what-is-user-exits.htm
    http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction
    http://www.easymarketplace.de/userexit.php
    http://www.sappoint.com/abap/userexit.pdf
    ABAP Enhancements and Modifications - General
    https://www.sdn.sap.com/irj/sdn/developerareas/abap?rid=/webcontent/uuid/2342e1f3-0b01-0010-a186-fdd404884050
    Menu Exit
    http://sap.ittoolbox.com/groups/technical-functional/sap-r3-dev/menu-exits-72696#
    Screen Exit
    http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction
    Hope it helps.
    Manish

  • How to find Length of String

    Hi
    how to find length of a string.. i have a requirement that user cannot add more than 9 digits in a string.. i am new to WD Abap..
    Regards,
    Puneet

    Hi,
    You can use STRLEN command for your requirement.
    First read your input field using code wizard.
    Then using STRLEN command you can find the length of the Input field.
    For Example :
    Here input is your input field.
    data :    length type i.
    length = strlen(input).
    If length < 9.
    raise error msg.
    endif.
    Edited by: Viji on Mar 26, 2008 11:30 AM

  • How to find a specific function's description?

    Hi,
    I'm now looking at xperf stack trace, I would like to know the description of a specific function. For example, I don't know what does RtlUserThreadStart() function do. How to find such information. I tried to search the function name on MSDN, but nothing
    came up.
    thank you!
    Ah_Chao|| MCSE,VCP,EMCSAe

    could anyone show me some lights on this?
    thanks in advanced!
    Ah_Chao|| MCSE,VCP,EMCSAe

  • How to find a specific APP

    How do you find a specific free App once you sign in the Apple Store?

    The term Apple Store refers specifically to the physical Apple Stores located in various cities in countries around the world, the Apple online store at www.store.apple.com and the Apple telestore at 1-800-MY-APPLE. The Apple Store does not sell internet downloadable software apps or games. It sells a limited stock of boxed software.
    Apple sells apps & games through the Mac App Store accessed through an app on an Intel-based Macintosh computer running OS X Snow Leopard 10.6.8 or newer.
    Apple sells apps & games for iOS devices; iPhones, iPads and iPods Touch through the iTunes App Store which can be access through the iTunes app on a Mac or PC or the App Store app on an iOS device.
    Please use this exact terminology when seeking help so that we know exactly which store you are trying to use.
    Are you using the Mac App Store app referred to by seventy one in his post? Or are you looking for apps somewhere else?

Maybe you are looking for

  • Port Forwarding not working on new Home Hub 4

    Hi all, I'm trying to get port forwarding going on a new Home Hub 4, specifically so I can access my Netgear Stora through its web interface on my LAN. I've set the rules in port forwarding for the following ports: Port 80 is HTTP Server Port 443 is

  • UNCAUGHT_EXCEPTION during Transaction SPROXY

    Hi , while exectuing sproxy transaction its giving a short dump. please see the dump below. Runtime Errors         UNCAUGHT_EXCEPTION                                                                  Except.                CX_SRAPI_PRECONDITION_VIOLAT

  • Setting up wireless printer with Time Capsule

    I've just replaced my original Time Capsule after it had a terminal power failure. The replacement Time Capsule is working okay as a backup and I have set up my wireless network again, but now I can't print using my Canon MX860 printer, which had bee

  • Tool to generate SAP Developer key (exists)

    Dear Experts, I have incident here from our consultant who got a proper SAP Developer key. After few questions, we found out he got it via a tool which can generate a proper SAP developer key. I have checked in Marketplace SCCR, there was no record f

  • Where is the hard drive located on the 15"? Possible problem.

    I just got a 15" MBP refurb and have noticed that when I open the lid, from it being in sleep mode, I have about 2-4 seconds of "muffeled clacking". It sounds like it is coming from under the Return key. I thought it was the optical drive, but I'm wo