Unix Technical Forum

Looking into all the tables of a schema

This is a discussion on Looking into all the tables of a schema within the Oracle Database forums, part of the Database Server Software category; --> Hi everybody, Is there any method using which I can search some numbers in all numeric fields in all ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-26-2008, 07:51 AM
Ratan
 
Posts: n/a
Default Looking into all the tables of a schema

Hi everybody,

Is there any method using which I can search some numbers in all
numeric fields in all the tables of a particular schema ????

This is urgent. Thnaks in advance.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-26-2008, 07:51 AM
news.verizon.net
 
Posts: n/a
Default Re: Looking into all the tables of a schema


"Ratan" <ratan.nitrkl@gmail.com> wrote in message
news:d75c8bf5-a9ca-4ee5-9d6b-5e3955b1fc7f@s8g2000prg.googlegroups.com...
> Hi everybody,
>
> Is there any method using which I can search some numbers in all
> numeric fields in all the tables of a particular schema ????
>
> This is urgent. Thnaks in advance.


Use sql to generate sql and run the result.

eg something like:
spool tmp.sql

select 'select * from '||owner||'.'||table_name||' where
'||column_name||'=myvalue;' from dba_tab_columns dtc
where dtc.owner='THESCHEMA' and dtc.column_type='NUMBER' order by
table_name, column_name;

spool off
@tmp.sql

You have to debug the above a little bit, but it gives you the idea.
Jim


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-26-2008, 07:51 AM
Ratan
 
Posts: n/a
Default Re: Looking into all the tables of a schema

On Jan 16, 3:44*pm, "news.verizon.net" <kenned...@verizon.net> wrote:
> "Ratan" <ratan.nit...@gmail.com> wrote in message
>
> news:d75c8bf5-a9ca-4ee5-9d6b-5e3955b1fc7f@s8g2000prg.googlegroups.com...
>
> > Hi everybody,

>
> > Is there any method using which I can search some numbers in all
> > numeric fields in all the tables of a particular schema ????

>
> > This is urgent. Thnaks in advance.

>
> Use sql to generate sql and run the result.
>
> eg something like:
> spool tmp.sql
>
> *select 'select * from '||owner||'.'||table_name||' where
> '||column_name||'=myvalue;' from dba_tab_columns dtc
> where dtc.owner='THESCHEMA' and dtc.column_type='NUMBER' order by
> table_name, column_name;
>
> spool off
> @tmp.sql
>
> You have to debug the above a little bit, but it gives *you the idea.
> Jim



Thanks a lot Jim. I have got my answer.

But the problem is, I have to login as SYSDBA to execute this query.
As an ordinary user, I cant execute, because, then it cant find the
dba_tab_columns table. So, what is the alternative?


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-26-2008, 07:51 AM
gazzag
 
Posts: n/a
Default Re: Looking into all the tables of a schema

On 17 Jan, 07:55, Ratan <ratan.nit...@gmail.com> wrote:
> Thanks a lot Jim. I have got my answer.
>
> But the problem is, I have to login as SYSDBA to execute this query.
> As an ordinary user, I cant execute, because, then it cant find the
> dba_tab_columns table. So, what is the alternative?- Hide quoted text -
>
> - Show quoted text -


You don't have to log in as SYS dba to see the DBA_TAB_COLS view
(note, not DBA_TAB_COLUMNS). SYSTEM can see this view.

Also, as well as the DBA_* views, there are equivalent USER_* and
ALL_* views.

HTH

-g
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-26-2008, 07:51 AM
Ratan
 
Posts: n/a
Default Re: Looking into all the tables of a schema

On Jan 17, 3:35*pm, gazzag <gar...@jamms.org> wrote:
> On 17 Jan, 07:55, Ratan <ratan.nit...@gmail.com> wrote:
>
> > Thanks a lot Jim. I have got my answer.

>
> > But the problem is, I have to login as SYSDBA to execute this query.
> > As an ordinary user, I cant execute, because, then it cant find the
> > dba_tab_columns table. So, what is the alternative?- Hide quoted text -

>
> > - Show quoted text -

>
> You don't have to log in as SYS dba to see the DBA_TAB_COLS view
> (note, not DBA_TAB_COLUMNS). *SYSTEM can see this view.
>
> Also, as well as the DBA_* views, there are equivalent USER_* and
> ALL_* views.
>
> HTH
>
> -g


Thanks a ot. Now its completely working.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:20 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com