Home » RDBMS Server » Enterprise Manager » oratclsh script answer
oratclsh script answer [message #68768] Fri, 03 September 2004 07:01
Linda
Messages: 22
Registered: July 2000
Junior Member
I have the following script that will be used inside the <NOBR><A class=iAs oncontextmenu="return false;" onmousemove=kwM(64433); onmouseover=kwE(event,64433); style="COLOR: darkgreen; BORDER-BOTTOM: darkgreen 1px solid; BACKGROUND-COLOR: transparent; TEXT-DECORATION: underline" onclick="return kwC();" onmouseout=kwL(event); href="http://www.experts-exchange.com/Databases/Oracle/Q_21117196.html#" target=_blank>Oracle[/url]</NOBR> OEM console for monitoring the detection of the counting of kind of file in the filesystem.
What I want to detect  is if there are files with the extension *.Z in the directory

if {[[file exists "/cognos_data/ORADATA/arc/*.Z"]] } {
puts <oramessage>YES</oramessage>
puts <oraresult>-1</oraresult>
} else {
puts <oramessage>NO</oramessage>
puts <oraresult>2</oraresult>
}

When in the OS I issue the oratclsh command and then issue the above <NOBR><A class=iAs oncontextmenu="return false;" onmousemove=kwM(271142); onmouseover=kwE(event,271142); style="COLOR: darkgreen; BORDER-BOTTOM: darkgreen 1px solid; BACKGROUND-COLOR: transparent; TEXT-DECORATION: underline" onclick="return kwC();" onmouseout=kwL(event); href="http://www.experts-exchange.com/Databases/Oracle/Q_21117196.html#" target=_blank>Solaris[/url]</NOBR> script, it gave me the result of NO, when indeed the directory is filled up with files like this:

arch_mapdev0000006291.arc.Z  arch_mapdev0000006471.arc.Z
arch_mapdev0000006292.arc.Z  arch_mapdev0000006472.arc.Z
arch_mapdev0000006293.arc.Z  arch_mapdev0000006473.arc.Z
arch_mapdev0000006294.arc.Z

When I change the script to the following, it gave me the error "child process exited abnormally:"

oratclsh[[20]]- if {[[ls cognos_data/ORADATA/arc/*.Z  | wc -l > 1]] } {
puts <oramessage>YES</oramessage>
puts <oraresult>-1</oraresult>
} else {
puts <oramessage>NO</oramessage>
puts <oraresult>2</oraresult>
}
child process exited abnormally
oratclsh[[21]]-

Also the same result if I change the first line to this:

if {[[ls cognos_data/ORADATA/arc/*.Z  | wc -l > 1;]] } {

I need help with this.
Previous Topic: How do we find & replace a certain value in the database without even knowing th
Next Topic: How Oracle Text/Oracle Ultra Search Works?
Goto Forum:
  


Current Time: Fri Mar 29 10:18:09 CDT 2024