Search all Database to find a word

Hello all,
I want a pl sql query to find a word like "book" in all oracle database, in all tables and their contents.
Thanks in advance
Arvin

A couple of solutions from Michaels...
michaels>  var val varchar2(5)
michaels>  exec :val := 'as'
PL/SQL procedure successfully completed.
michaels>  select distinct substr (:val, 1, 11) "Searchword",
                substr (table_name, 1, 14) "Table",
                substr (t.column_value.getstringval (), 1, 50) "Column/Value"
           from cols,
                table
                   (xmlsequence
                       (dbms_xmlgen.getxmltype ('select ' || column_name
                                                || ' from ' || table_name
                                                || ' where upper('
                                                || column_name
                                                || ') like upper(''%' || :val
                                                || '%'')'
                                               ).extract ('ROWSET/ROW/*')
                   ) t
--        where table_name in ('EMPLOYEES', 'JOB_HISTORY', 'DEPARTMENTS')
       order by "Table"or
SQL> select table_name,
       column_name,
       :search_string search_string,
       result
  from cols,
       xmltable(('ora:view("'||table_name||'")/ROW/'||column_name||'[ora:contains(text(),"%'|| :search_string || '%") > 0]')
       columns result varchar2(10) path '.'
where table_name in ('EMP', 'DEPT')
TABLE_NAME           COLUMN_NAME          SEARCH_STRING        RESULT   
DEPT                 DNAME                ES                   RESEARCH 
DEPT                 DNAME                ES                   SALES    
EMP                  ENAME                ES                   JONES    
EMP                  ENAME                ES                   JAMES    
EMP                  JOB                  ES                   SALESMAN 
EMP                  JOB                  ES                   SALESMAN 
EMP                  JOB                  ES                   SALESMAN 
EMP                  JOB                  ES                   PRESIDENT
EMP                  JOB                  ES                   SALESMAN 
9 rows selected.Of course these could also have been found by doing a search on the forums or using google.

Similar Messages

  • Photos missing but when searching all photos in finder they are there

    Not long ago i noticed that all my photos after july 20th were missing. The next thing that was there was an update i did just 2 days ago which was the end of august at the time. So almost 1 month was missing out of my iphotos photos. I didnt know what to do and 1 day my wife was searching for a photo that did not show up in iphoto but in the finder under all photos its there. The data file the original and the modified photo full size are all there. in the folder date they should be in.
    I have tried rebuilding the iphoto database and nothing changes. I can open these photos in preview just fine i can email them to people i just can not see them in iphoto.
    I deleted my entire ilife 08 and reinstalled it from the DVD. that did not change anything
    I dont want to lose these photos but i cant figure out why they do not show in iphoto yet they are in the iphoto folder where they should be.

    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto (iPhoto.Library for iPhoto 5 and earlier) database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've created an Automator workflow application (requires Tiger or later), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 6 and 7 libraries and Tiger and Leopard. Just put the application in the Dock and click on it whenever you want to backup the dB file. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.
    Note: There's now an Automator backup application for iPhoto 5 that will work with Tiger or Leopard.

  • The word app has disappeared from my desktop computer and can't be found on finder or search. All documents I created on word will now not open unless in "TextEdit" format which I don't use. Any ideas please? Thanks

    The word app has disappeared from my desktop computer and can't be found on finder or search. All documents I created on word will now not open unless in "TextEdit" format which I don't use. Any ideas please? Thanks

    Did you recently erase and/or reinstall the OS?
    And, some details are needed: model/year Mac, Mac OS version running now and which version originally).

  • Is there a way to search for a specific keyword within the sites to which the bookmarks are linked? I need to search all linked sites in the bookmark folder without having to open each page and "find" manually.

    Currently, I must browse through 50 or so bookmarked pages to see if a specific topic is covered. I would like to be able to search all bookmarked pages at once for a specific keyword. For example, if I have 50 news sites bookmarked and I would like to see which pages have the word "tuna" in them, I would need to open each page individually and do a "find". If I could search all of those pages at once, then I would save an immense amount of time. I have looked on the add-ons and found nothing...

    1. Create a smart album and in the drop down in the top right corner select file status
    2. Check mark the file status box and select 'Offline'
    Now you should have all your 'Offline' (Yellow Exclamation and/or Red Slash) files.
    To reconnect..
    1. Select the missing files.
    2. Go to File and scroll to Manage Referenced Files
    The dialog box will have one of the photos selected
    3. Select the drive and folder that contains the referenced file and select it
    4. Click 'Reconnect All'
    This might not reconnect all of them, but the dialog box will still be open and you can reconnect the ones left.
    Narvon
    Message was edited by: Narvon

  • How to search all columns of all tables in a database for a keyword?

    Dear Team,
    i have an requirement that : i want to search all the columns of all the tables in the particular database based on the specific key word or an free text.
    example :
    table 1: columns data
    empname sam
    empid 01
    table 2 columns data
    deptname sam
    departmentid 10
    table 3 columns data
    organization name sam
    organization id 1
    when i search for text " SAM"
    it should search me from the entire database, all tables and columns of it and display the result
    output : tablename cloumn value
    table1 empname sam
    table2 deptname sam
    table3 organizationame sam
    the example is just an sample not the real data .
    please help me with sample code or any link related to it .
    thanks in advance

    Hi justin , thanx for the reply
    the basic requirement that we required is ,
    the user will just type the keyword( value in the coumn) he required and it should search all the tables and columns of the table in the database and i have to show this in the front ent in the table format. here the user will analyse the information based on the search .
    it is just like the google search we does( type the keyword in free text) it will display the result.
    so for that i have to search entire table and columns in the whole database.
    please if any one provides me the solution it will be help full for me.
    thanx in advance

  • When looking at my "About This Mac" it says that I have 60gb of space left on my hard drive, but when I go into finder to find all of these files there is not 300gb worth in anything I search, even searching, "All files on the Mac". Help!?

    When looking at my "About This Mac" it says that I have 60gb of space left on my hard drive, but when I go into finder to find all of these files there is not 300gb worth in anything I search, even searching, "All files on the Mac". Help!?
    It says I have over 150 gigs of video on my hard drive. But I have gone through and deleted almost all of what shows up, still it says there is roughly the same amount on the hard drive. Where are these files? I want to delete them so I can have my hard drive clear.
    Thanks for your help guys!

    Quote from the article.
    Time Machine in OS X Lion includes a new feature called "local snapshots" that keeps copies of files you create, modify or delete on your internal disk. Local snapshots compliment regular Time Machine backups (that are stored on your external disk or Time Capsule) giving you a "safety net" for times when you might be away from your external backup disk or Time Capsule and accidentally delete a file.
    So what makes a notebook any different then a desktop, other then with a desktop you might have your tm backup drive connected all the time.
    The object here is to not indiscriminately delete files you need or want to keep. I personally have never deleted a file I wanted to keep.
    In essence a backup is for catastrophic failure of your system. So it can be restored once that failure has been fixed. Not because you go in willy nilly and start deleting files.

  • I would like to add to the Safari toolbar on my ipad 5 IOS 6  machine. I have searched the web and find some instructions to do this but the words and pictures do not match what I can see. I am beginning to think this is not a capabilty of the ipad 5

    I would like to add to the Safari toolbar on my ipad 5 IOS 6  machine. I have searched the web and find some instructions to do this but the words and pictures do not match what I can see. I am beginning to think this is not a capabilty of the ipad 5 but perhaps for a Mac computer running Safari. Does anyone know if it is possible to add tools to the toolbar on the latest version of iPad OS & Safari Browser? If so please tell me how. Thanks

    You cannot customize the Safari toolbar on the iPad.
    What you can do on the iPad is go to Settings>Safari>Always show Bookmarks Bar>On and that will add a bookmarks bar on to the Safari browser.

  • How to search this value in oracle database to find out the table

    Hi expert,
    I know there is a value in oracle database, please show me how to search this value in oracle database to find out the table holding this value.
    Many Thanks,

    918440 wrote:
    Hi friends,
    this question is really practical, I already know there is value from application saved in database, I want to search the whole database to figure out which table the value is contained.write SQL that writes SQL to query every table.
    Handle:     918440
    Status Level:     Newbie
    Registered:     Mar 2, 2012
    Total Posts:     20
    Total Questions:     10 (10 unresolved)
    why do you waste time here when you NEVER get any answer to any question you post?

  • How to search all columns of all tables in a database

    i need to search all columns of all tables in a database , i already write the code below , but i've got the error message below when run this script
    DECLARE
    cnt number;
    v_data VARCHAR2(20);
    BEGIN
    v_data :='5C4CA98EAC4C';
    FOR t1 IN (SELECT table_name, column_name FROM all_tab_cols where owner='admin' and DATA_TYPE='VARCHAR2') LOOP
    EXECUTE IMMEDIATE 'SELECT COUNT(*) FROM ' ||t1.table_name|| ' WHERE ' ||t1.column_name || ' = :1' INTO cnt USING v_data;
    IF cnt > 0 THEN
    dbms_output.put_line( t1.table_name ||' '||t1.column_name||' '||cnt );
    END IF;
    END LOOP;
    END;
    Error report:
    ORA-00933: SQL command not properly ended
    ORA-06512: at line 7
    00933. 00000 - "SQL command not properly ended"
    *Cause:   
    *Action:
    Any help please

    SQL solutions by Michaels
    michaels>  var val varchar2(5)
    michaels>  exec :val := 'as'
    PL/SQL procedure successfully completed.
    michaels>  select distinct substr (:val, 1, 11) "Searchword",
                    substr (table_name, 1, 14) "Table",
                    substr (t.column_value.getstringval (), 1, 50) "Column/Value"
               from cols,
                    table
                       (xmlsequence
                           (dbms_xmlgen.getxmltype ('select ' || column_name
                                                    || ' from ' || table_name
                                                    || ' where upper('
                                                    || column_name
                                                    || ') like upper(''%' || :val
                                                    || '%'')'
                                                   ).extract ('ROWSET/ROW/*')
                       ) t
    --        where table_name in ('EMPLOYEES', 'JOB_HISTORY', 'DEPARTMENTS')
           order by "Table"or
    11g upwards
    SQL> select table_name,
           column_name,
           :search_string search_string,
           result
      from (select column_name,
                   table_name,
                   'ora:view("' || table_name || '")/ROW/' || column_name || '[ora:contains(text(),"%' || :search_string || '%") > 0]' str
              from cols
             where table_name in ('EMP', 'DEPT')),
           xmltable (str columns result varchar2(10) path '.')
    TABLE_NAME                     COLUMN_NAME                    SEARCH_STRING                    RESULT   
    DEPT                           DNAME                          es                               RESEARCH 
    EMP                            ENAME                          es                               JAMES    
    EMP                            JOB                            es                               SALESMAN 
    EMP                            JOB                            es                               SALESMAN 
    4 rows selected.

  • How do find all database slog size and mdf file size ?

    hi experts,
    could you share query to find all databases log file size and mdf file (includes ndf files ) and total db size ? in MB and GB
    I have a task to kae the dbs size  around 300 dbs
    ========               ============     =============        = ===        =====
    DB_Name    Log_file_size           mdf_file_size         Total_db_size           MB              
    GB
    =========              ===========               ============       ============     
    Thanks,
    Vijay

    Use this ViJay
    set nocount on
    Declare @Counter int
    Declare @Sql nvarchar(1000)
    Declare @DB varchar(100)
    Declare @Status varchar(25)
    Declare @CaptureDate datetime
    Set @Status = ''
    Set @Counter = 1
    Set @CaptureDate = getdate()
    Create Table #Size
    SizeId int identity,
    Name varchar(100),
    Size int,
    FileName varchar(1000),
    FileSizeMB numeric(14,4),
    UsedSpaceMB numeric(14,4),
    UnusedSpaceMB numeric(14,4)
    Create Table #DB
    Dbid int identity,
    Name varchar(100)
    Create Table #Status
    (status sql_Variant)
    Insert Into #DB
    Select Name
    From Sys.Databases
    While @Counter <=(Select Max(dbid) From #Db)
    Begin
    Set @DB =
    Select Name
    From #Db
    Where @Counter = DbId
    Set @Sql = 'SELECT DATABASEPROPERTYEX('''+@DB+''', ''Status'')'
    Insert Into #Status
    Exec (@sql)
    Set @Status = (Select convert(varchar(25),status) From #Status)
    If (@Status)= 'ONLINE'
    Begin
    Set @Sql =
    'Use ['+@DB+']
    Insert Into #Size
    Select '''+@DB+''',size, FileName ,
    convert(numeric(10,2),round(size/128.,2)),
    convert(numeric(10,2),round(fileproperty( name,''SpaceUsed'')/128.,2)),
    convert(numeric(10,2),round((size-fileproperty( name,''SpaceUsed''))/128.,2))
    From sysfiles'
    Exec (@Sql)
    End
    Else
    Begin
    Set @SQL =
    'Insert Into #Size (Name, FileName)
    select '''+@DB+''','+''''+@Status+''''
    Exec(@SQL)
    End
    Delete From #Status
    Set @Counter = @Counter +1
    Continue
    End
    Select Name, Size, FileName, FileSizeMB, UsedSpaceMB, UnUsedSpaceMB,right(rtrim(filename),3) as type, @CaptureDate as Capturedate
    From #Size
    drop table #db
    drop table #status
    drop table #size
    set nocount off
    Andre Porter

  • Searching Calendar fails to find all events

    First, this program is no longer called iCal. I understand the change, but others may be confused.
    Second, when searching for all events with a certain word, it is clear that not all events are being returned.
    I'm using Calendar under OS-X 10.9.2 and the calendars are iCloud based.
    There seems to be no logic to the events that ought to be caught by the search but that are omitted. I'm estimating only about a third of events matching my search criteria (just a word, like "Volunteer") are being returned. I can see all the events with that word in the calendar but they don't all turn up in a search.
    I tried re-indexing with mdimport to no avail. This makes Calendar nearly useless, if search is not reliable.

    Hi, I also had the same issue with VSC 6.0 where the SVM was not being displayed. Here is the solution that worked for me:Check there is a domain-tunnel created for you vserver. EG cluster1>domain-tunnel show If your vserver is not displayed in the output then create a domain-tunnel. EG cluster1>domain-tunnel create -vserver vserver1 /matt

  • My calendar disappeared W/the latest update. I have searched ALL the menus & cannot find it. HELP!

    My calendar disappeared W/the latest Firefox update on July 24 or 25. I have searched ALL the menus & cannot find it. HELP!

    Hi MaryBThigpen,
    I would like to confirm with you where the Mozilla is? There is a calendar add on called Lightning that can be added to Mozilla Thunderbird, the email client. Was there an email associated with the calendar, it may be on the service provider's website.
    Xpi extentions are install packages that bundle an installation folder for a program for many operating systems [https://developer.mozilla.org/en-US/docs/XPI More on XPI here if you are curious]
    I am hoping that this is not [https://wiki.mozilla.org/Calendar:Deprecated:XPI_Support] what you are affected by. As the support for xpi calendars managed by seamonkey has be depreciated. Is this the case?

  • IPad (1) bluetooth only "searches".. doesn't find. All works on my IPhone 4, but the IPad can't "find" the devices. Using Motorola behind the head and Rocketfish behind the head headphones.

    I have both Motorola and Rocketfish behind-the-head earphones.  Both work fine on my IPhone 4.  But the bluetooth setting on my IPad only "searches" and doesn't find the devices.  Any ideas? (Using Latest OS for IPad

    I had the same problem for the last 2 weeks and today it just started working with nothing changing.  I've also read reports of others having it just start working today.  Give it a shot again.  I think it was a problem that AT&T sorted out.

  • How to find a word written with two fonts...?

    Hi,
    I have a 200+ pages document that contains some words with the first letter in Times regular and the rest in Times italic. Is there any way to find those words in the document?
    Thanks

    Ooooo, Dave ....
    Annabelle, a non scripting solution is the following.
    You cannot search for words with multiple fonts. However, since you can search for words in one font, you can exclude 'good' ones.
    I will be assuming you have a regular document, with just black text ...
    In Search & Replace, GREP, search for "\b\w+\b" with a font style of "Regular" and replace with formatting: text color red. Be sure not to accidentally put anything in the replace text field -- it should be entirely empty. Now all entirely Regular words are red.
    Repeat with the font style "Italic". Now all words that are entirely Regular or Italic are in red.
    Search for "\b\w+\b" with a text color of Black. This will find all words that are neither entirely in Italic nor entirely in Regular.
    In case you never used it before, the GREP expression means "a word boundary -- one or more word characters -- a word boundary". Essentially, it does a 'Find entire word' for any length of words.
    Note that if you have words in, say, bold, bold italic, or 46 Light Italic, you will have to mark these as well with the check colour, or else you'll also find them 'bad'.
    You might want to create a new swatch for marking, so you can delete it afterwards, replacing with Black again.
    ... Are you familiar with how to use scripts? It might be a bit easier if I wrote a tiny script, although my method will find all rogue formatted text.

  • Finding a word within a string

    Hey everyone,
    Just having a little trouble with something.
    I'm trying to find a word -- that is, not a substring, an actual word as defined by the english language -- within a string.
    For example I don't want "hell" to be found in "hello".. only "hello" to be found.
    Currently i've got two strings, one is the sentance (String input), and one is the word to be found in the sentance (String word). I need the program to find the WORD, and then go back and search for the word again and again and again until it reaches the end of the string.
    This is what I've got thus far:
              for(i = 0; i < input.length(); i++)
                   // This statement checks the string "input" for the string "word" starting at offset 0 (as this is what the variable was first defined as)
                   if(input.indexOf(word, offset) >= 0)
                        // If it finds the word at all, this line increases the offset ahead of this word so it doesn't simply find the same word again
                        offset = offset + (input.indexOf(word)) + (word.length());
                        times++;
              }At the moment this searches for the sub-string, not the WORD which is what I would like it to do.
    What's the easiest way of going about this? I've been fiddling around trying to add extra sections to the if statement, for example
    if((input.indexOf(word, offset) >= 0) && (input.charAt(offset +1) == 32))(32 as in the ASCII character for a space, which would do what I wanted it to do)
    But I eventually get errors because at some stage or another the charAt is going to be higher than the actual length of the String. Plus, this only looks if there's a space next to the word - a word can be valid if it has a ! next to it for example, or a comma...
    Thanks for any help :)
    viddy

    I think there's a word boundary marker in regex. So it'd be "\\w+hello\\w+" or whatever the marker is, to be used with a Pattern instance.

Maybe you are looking for