Home » Infrastructure » Unix » Command to search for a table name in Unix
Command to search for a table name in Unix [message #436438] Wed, 23 December 2009 10:48 Go to next message
californiagirl
Messages: 79
Registered: May 2007
Member
Hi,

I want to know what would be the unix command to look for a specific table name in a unix directory. I'm trying to find a specific table within a unix directory that has over hundreds of different files or should I say programs..and I want to see what programs or code is using a certain table.

Thanks
Re: Command to search for a table name in Unix [message #436439 is a reply to message #436438] Wed, 23 December 2009 10:53 Go to previous messageGo to next message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Are you sure this is related with Oracle?
There is no file dedicated to a table in Oracle.

Regards
Michel
Re: Command to search for a table name in Unix [message #436440 is a reply to message #436438] Wed, 23 December 2009 10:54 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10708
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
grep.
But Unix does not care whether searched keyword is a table/view whatever.

Kaapi:ora magvivek$ grep "scott" *
one.lst:scott@chum > exec test3
one.lst:scott@chum > spool off
somescript:sqlplus -s scott/tiger@chum <<EOF
Re: Command to search for a table name in Unix [message #436441 is a reply to message #436439] Wed, 23 December 2009 10:56 Go to previous messageGo to next message
californiagirl
Messages: 79
Registered: May 2007
Member
Let me be more specific..there are Oracle programs stored on Unix servers.I need to find a table name within a directory related to an Oracle program/code..would grep be what I need to use?


Re: Command to search for a table name in Unix [message #436442 is a reply to message #436441] Wed, 23 December 2009 11:03 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10708
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Again.
OS does not CARE for tableName/ViewName etc.
You can just search for the keyword.
It can be anything. All occurances of the keyword (whether it a tablenName or just a string or comment) will be displayed.
In my example, I grepped for "scott". It was found in two files (one.lst and somescript).
Maybe if your program has some coding standards,
search for schema_name.table_name.
Re: Command to search for a table name in Unix [message #436443 is a reply to message #436441] Wed, 23 December 2009 11:03 Go to previous message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
This is NOT because you put "Oracle" or "Oracle related" in your question that it makes it related to oracle in anyway.
Replace Oracle by Sybase in your question and post it in a Sybase forum.

Topic is locked.
Regards
Michel
Previous Topic: SP2-0310: unable to open file
Next Topic: Editor to execute unix commands
Goto Forum:
  


Current Time: Mon Dec 02 06:17:18 CST 2024