AW: UNIX : script help/input
Hi Speaking of Perl, ... maybe somebody (Jared) can help out with some Perl / Windows problems: I'm using ActiveState 5.6 with DBI module, which works fine. Now, since I basically work within a CygWin environment on my laptop, I installed perl there, but there are no DBI modules. The basic problem is, that in order to get the DBI stuff compiled within cygwin, you would need a unix/cygwin wrapper for the OCI dlls, which are common windows dlls coming with the Oracle client (9.2.0.4) in order to import OCI stuff correctly, which is needed by DBI (at least I think so). The dlltool doesn't really help me here, since the dlls supplied by Oracle seem to be stripped (at least, dlltool can't find any symbols). If I try: $ nm oci.dll | grep ' T _' | sed 's/.* T _//' oci.def I only get: nm: oci.dll: no symbols Does anybody have an idea how to use the windows oci (or any other Oracle dll) from cygwin ? Otherwise I can also go ahead and toss out cygwin, since accessing Oracle is basically all I need it for. Regards, Stefan -Ursprüngliche Nachricht- Von: Jared Still [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 2. Oktober 2003 00:29 An: Multiple recipients of list ORACLE-L Betreff: RE: UNIX : script help/input Good! The more the merrier! Welcome to the club. Oh most definitely. As I just finished writing a prototype package for assigning MAC addresses ( we make network stuff - that's a technical term ), I have endured the agonies of doing hex math in PL/SQL. I finally bit the bullet and used string manipulation to convert hex to decimal and do what I needed that way. Couldn't get BITAND to work properly on very large integers. Besides, doing XOR with BITAND in PL/SQL is very painful. UTL_RAW has an XOR, but it requires RAW values and I didn't feel like messing with it. This is all very simple in Perl. Given a MAC of 5AA, with a fixed portion of 500, it is very easy to determine the variable portion of the address via $x = 0x5AA ^ 500. Not quite so simple in PL/SQL. Jared On Wed, 2003-10-01 at 14:44, Mladen Gogala wrote: On Wed, 2003-10-01 at 14:34, Jamadagni, Rajendra wrote: Funny .. I am currently sitting in a Perl class, so I can actually read what MG has written. I'll be soon Perl-literate ... Raj Note: This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. Wang Trading LLC and any of its subsidiaries each reserve the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of any such entity. -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Mladen Gogala INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Jared Still INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Stefan Jahnke INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L
RE: UNIX : script help/input
Title: RE: UNIX : script help/input XOR that gives me some painful memories in recent days ... xor is possible in pl/sql but needs a little work. I migrated a C encryption code to pl/sql and then use utl_tcp to sent it to our router which feeds the modem banks. This is how I worked on it ... but I was working on character by character ... xor(a,b) is r_a := utl_raw.cast_to_raw(chr(a)); r_b := utl_raw.cast_to_raw(chr(b)); n_xor := to_number(utl_raw.bit_xor(r_a,r_b),''); Of course the manual doesn't tell you this ... Raj Rajendra dot Jamadagni at nospamespn dot com All Views expressed in this email are strictly personal. QOTD: Any clod can have facts, having an opinion is an art ! -Original Message- From: Jared Still [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 01, 2003 6:29 PM To: Multiple recipients of list ORACLE-L Subject: RE: UNIX : script help/input Good! The more the merrier! Welcome to the club. Oh most definitely. As I just finished writing a prototype package for assigning MAC addresses ( we make network stuff - that's a technical term ), I have endured the agonies of doing hex math in PL/SQL. I finally bit the bullet and used string manipulation to convert hex to decimal and do what I needed that way. Couldn't get BITAND to work properly on very large integers. Besides, doing XOR with BITAND in PL/SQL is very painful. UTL_RAW has an XOR, but it requires RAW values and I didn't feel like messing with it. This is all very simple in Perl. Given a MAC of 5AA, with a fixed portion of 500, it is very easy to determine the variable portion of the address via $x = 0x5AA ^ 500. Not quite so simple in PL/SQL. Jared This e-mail message is confidential, intended only for the named recipient(s) above and may contain information that is privileged, attorney work product or exempt from disclosure under applicable law. If you have received this message in error, or are not the named recipient(s), please immediately notify corporate MIS at (860) 766-2000 and delete this e-mail message from your computer, Thank you.*2
RE: UNIX : script help/input
Note: This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. Wang Trading LLC and any of its subsidiaries each reserve the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of any such entity. It looks like this would make a *great* example for the Stupid Email Disclaimers site http://www.goldmark.org/jeff/stupid-disclaimers/list.html. -- My employers like me, but not enough to let me speak for them. Greg Norris Sprint LTD Database Administration -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Norris, Gregory T [ITS] INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: UNIX : script help/input
Johan: Please see the attachment file, which is my script for everyday web server log file and uses nslookup to process the results. Hope that it is helpful. Don Johan Muller wrote: Anybody with a quick and dirty (elegant would be nice too), to munge output from a nslookup output file to a delimited file? 'File content: Server: dns1.mci.com Address: 199.249.19.1 Name:WCOM-4NXZGAPWY5.mcilink.com Address: 166.50.73.209 Delimited file should have the following line(s); (using | or whatever as delimiter): '166.50.73.209'|'4NXZGAPWY5.mcilink.com'. Required for both single and multiple records. TIA #! /bin/ksh # file name: log_file_parsing # Date: March 6,2003; Mar 7,2003; Mar 10,2003; Mar 13,2003; May 7,2003; 12 May,2003; May 15,2003; # May 20,2003; May 30,2003 # # Author: Don Y. # Desc: an example of parsing netTracker related web access from web server (www.welch.jhu.edu) access # log file. Extract client IP, access date, and host IP. This script also transfer client IP # with alphabet into digital one by issuing nslookup command call. Finally make nslookup work # for it outputs a few lines instead of one line. # # define output file WORKING_DIR=$1 OUTPUT_FILE=$WORKING_DIR/log_file_parsing_output.temp INPUT_FILE=$WORKING_DIR/$2 TEMP_NAME=$3 SCRIPT_HOME=/export/users/dony/report # check input access log file exists or not under $WORKING_DIR if [ ! -f $WORKING_DIR/$2 ] then echo input access log file doesn't exist at working directory! exit 1 fi # check output file under working directory exist or not : $WORKING_DIR/log_file_parsing_output.temp if [ ! -f $WORKING_DIR/log_file_parsing_output.temp ] then touch $WORKING_DIR/log_file_parsing_output.temp chown dony:staff $WORKING_DIR/log_file_parsing_output.temp fi # check all temporary files exist or not if [ -f $WORKING_DIR/log_file_parsing_temp01.temp ] then rm $WORKING_DIR/log_file_parsing_temp01.temp else # create an empty file with owner status: dony:staff touch $WORKING_DIR/log_file_parsing_temp01.temp chown dony:staff $WORKING_DIR/log_file_parsing_temp01.temp fi if [ -f $WORKING_DIR/log_file_parsing_temp02.temp ] then rm $WORKING_DIR/log_file_parsing_temp02.temp else touch $WORKING_DIR/log_file_parsing_temp02.temp chown dony:staff $WORKING_DIR/log_file_parsing_temp02.temp fi # file parsing for NetTracker associated lines success=0 cat $INPUT_FILE | grep /cgi-bin/ntlinktrack.cgi | awk '{print $1,substr($4,2,11),$7}' | sed 's/\/cgi-bin\/ntlinktrack.cgi?//' $WORKING_DIR/log_file_parsing_temp01.temp let success=success+$? sed 's/http:\/\/www.welch.jhu.edu\/cgi-bin\/ntlinktrack.cgi?//' $WORKING_DIR/log_file_parsing_temp01.temp $WORKING_DIR/log_file_parsing_temp02.temp let success=success+$? # get start line number here whole_parsing_start_line=`cat $OUTPUT_FILE | wc -l` # change the date format for arg_each_line in `cat $WORKING_DIR/log_file_parsing_temp02.temp | awk '{ print $1===$2===$3 }'` do one_line=`echo $arg_each_line | sed 's/===/ /g'` # debug one line below if enabled #echo $one_line $WORKING_DIR/log_file_parsing_temp03.temp client_ip=`echo $one_line | awk '{ print $1 }' | sed 's/ //g'` org_date=`echo $one_line | awk '{ print $2 }' | sed 's/ //g'` oracle_date=`$SCRIPT_HOME/ldate $org_date` host_ip=`echo $one_line | awk '{ print $3 }' | sed 's/ //g'` # transfer client_ip from alphabet to digital client_addr=`echo $client_ip | egrep -i -e [a-z] | sed 's/ //g'` # get the length of client_addr LENGTH=`expr $client_addr : '.*'` if [ $LENGTH -gt 8 ] then # add pattern of [1-9][1-9] for parsing since nslookup output might be changed /usr/sbin/nslookup $client_addr 2 $WORLING_DIR/$TEMP_NAME | awk '{ print $2 }' | egrep -e [0-9]'.'[0-9]'.' nslookup_result NSR_LINES=`cat nslookup_result | wc -l` if [ $NSR_LINES -eq 2 ];then client_digit=`cat nslookup_result 2 $WORLING_DIR/$TEMP_NAME | awk '( NR == 2 ) { print $0 }'` elif [ $NSR_LINES -eq 3 ];then client_digit=`cat nslookup_result 2 $WORLING_DIR/$TEMP_NAME | awk '( NR == 3 ) { print $0 }'` fi # remove the result file rm nslookup_result 2 $WORLING_DIR/$TEMP_NAME # check whether or not the nslookup command gets a result,which it should be larger than 8 LENGTH=`expr $client_digit : '.*'` if [ $LENGTH -gt 8 ] then client_ip=$client_digit fi fi # output the result echo $client_ip $oracle_date $host_ip $OUTPUT_FILE let success=success+$? done # get whole NetTracker related lines whole_NetTracker_lines=`cat
Re: AW: UNIX : script help/input
A search on 'cygwin perl dbi oracle' revealed a number of URL's that may be helpful. This one looked promising: http://sources.redhat.com/ml/cygwin/2002-08/msg00923.html Jared Stefan Jahnke [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 10/02/2003 03:49 AM Please respond to ORACLE-L To:Multiple recipients of list ORACLE-L [EMAIL PROTECTED] cc: Subject:AW: UNIX : script help/input Hi Speaking of Perl, ... maybe somebody (Jared) can help out with some Perl / Windows problems: I'm using ActiveState 5.6 with DBI module, which works fine. Now, since I basically work within a CygWin environment on my laptop, I installed perl there, but there are no DBI modules. The basic problem is, that in order to get the DBI stuff compiled within cygwin, you would need a unix/cygwin wrapper for the OCI dlls, which are common windows dlls coming with the Oracle client (9.2.0.4) in order to import OCI stuff correctly, which is needed by DBI (at least I think so). The dlltool doesn't really help me here, since the dlls supplied by Oracle seem to be stripped (at least, dlltool can't find any symbols). If I try: $ nm oci.dll | grep ' T _' | sed 's/.* T _//' oci.def I only get: nm: oci.dll: no symbols Does anybody have an idea how to use the windows oci (or any other Oracle dll) from cygwin ? Otherwise I can also go ahead and toss out cygwin, since accessing Oracle is basically all I need it for. Regards, Stefan -Ursprüngliche Nachricht- Von: Jared Still [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 2. Oktober 2003 00:29 An: Multiple recipients of list ORACLE-L Betreff: RE: UNIX : script help/input Good! The more the merrier! Welcome to the club. Oh most definitely. As I just finished writing a prototype package for assigning MAC addresses ( we make network stuff - that's a technical term ), I have endured the agonies of doing hex math in PL/SQL. I finally bit the bullet and used string manipulation to convert hex to decimal and do what I needed that way. Couldn't get BITAND to work properly on very large integers. Besides, doing XOR with BITAND in PL/SQL is very painful. UTL_RAW has an XOR, but it requires RAW values and I didn't feel like messing with it. This is all very simple in Perl. Given a MAC of 5AA, with a fixed portion of 500, it is very easy to determine the variable portion of the address via $x = 0x5AA ^ 500. Not quite so simple in PL/SQL. Jared On Wed, 2003-10-01 at 14:44, Mladen Gogala wrote: On Wed, 2003-10-01 at 14:34, Jamadagni, Rajendra wrote: Funny .. I am currently sitting in a Perl class, so I can actually read what MG has written. I'll be soon Perl-literate ... Raj Note: This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. Wang Trading LLC and any of its subsidiaries each reserve the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of any such entity. -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Mladen Gogala INET: [EMAIL PROTECTED] Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Jared Still INET: [EMAIL PROTECTED] Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Stefan Jahnke INET: [EMAIL PROTECTED
RE: UNIX : script help/input
Raj, I did consider doing it this way, but the thought of writing stuff to the bit level for a prototype was just too painful. Left pad with zeroes, take a substring, feed it to the handy-dandy hex/oct/bin/dec converter package - much easier. Jared Jamadagni, Rajendra [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 10/02/2003 05:54 AM Please respond to ORACLE-L To:Multiple recipients of list ORACLE-L [EMAIL PROTECTED] cc: Subject:RE: UNIX : script help/input XOR that gives me some painful memories in recent days ... xor is possible in pl/sql but needs a little work. I migrated a C encryption code to pl/sql and then use utl_tcp to sent it to our router which feeds the modem banks. This is how I worked on it ... but I was working on character by character ... xor(a,b) is r_a := utl_raw.cast_to_raw(chr(a)); r_b := utl_raw.cast_to_raw(chr(b)); n_xor := to_number(utl_raw.bit_xor(r_a,r_b),''); Of course the manual doesn't tell you this ... Raj Rajendra dot Jamadagni at nospamespn dot com All Views expressed in this email are strictly personal. QOTD: Any clod can have facts, having an opinion is an art ! -Original Message- Sent: Wednesday, October 01, 2003 6:29 PM To: Multiple recipients of list ORACLE-L Good! The more the merrier! Welcome to the club. Oh most definitely. As I just finished writing a prototype package for assigning MAC addresses ( we make network stuff - that's a technical term ), I have endured the agonies of doing hex math in PL/SQL. I finally bit the bullet and used string manipulation to convert hex to decimal and do what I needed that way. Couldn't get BITAND to work properly on very large integers. Besides, doing XOR with BITAND in PL/SQL is very painful. UTL_RAW has an XOR, but it requires RAW values and I didn't feel like messing with it. This is all very simple in Perl. Given a MAC of 5AA, with a fixed portion of 500, it is very easy to determine the variable portion of the address via $x = 0x5AA ^ 500. Not quite so simple in PL/SQL. Jared encoded content removed -- binaries not allowed by ListGuru
RE: UNIX : script help/input
unfortunately we _had_ to do it in pl/sql ... it is part of the encrypted feed that we send out to our clients ... it is decoded by a chip. Oh well I am back to array of references ... Raj -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]Sent: Thursday, October 02, 2003 2:20 PMTo: Multiple recipients of list ORACLE-LSubject: RE: UNIX : script help/inputRaj, I did consider doing it this way, but the thought of writing stuff to the bit level for a prototype was just too painful. Left pad with zeroes, take a substring, feed it to the handy-dandy hex/oct/bin/dec converter package - much easier. Jared "Jamadagni, Rajendra" [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 10/02/2003 05:54 AM Please respond to ORACLE-L To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] cc: Subject: RE: UNIX : script help/inputXOR that gives me some painful memories in recent days ... xor is possible in pl/sql but needs a little work. I migrated a "C" encryption code to pl/sql and then use utl_tcp to sent it to our router which feeds the modem banks. This is how I worked on it ... but I was working on character by character ... xor(a,b) is r_a := utl_raw.cast_to_raw(chr(a)); r_b := utl_raw.cast_to_raw(chr(b)); n_xor := to_number(utl_raw.bit_xor(r_a,r_b),''); Of course the manual doesn't tell you this ... Raj Rajendra dot Jamadagni at nospamespn dot com All Views expressed in this email are strictly personal. QOTD: Any clod can have facts, having an opinion is an art ! -Original Message- Sent: Wednesday, October 01, 2003 6:29 PM To: Multiple recipients of list ORACLE-L Good! The more the merrier! Welcome to the club. Oh most definitely. As I just finished writing a prototype package for assigning MAC addresses ( we make network stuff - that's a technical term ), I have endured the agonies of doing hex math in PL/SQL. I finally bit the bullet and used string manipulation to convert hex to decimal and do what I needed that way. Couldn't get BITAND to work properly on very large integers. Besides, doing XOR with BITAND in PL/SQL is very painful. UTL_RAW has an XOR, but it requires RAW values and I didn't feel like messing with it. This is all very simple in Perl. Given a MAC of 5AA, with a fixed portion of 500, it is very easy to determine the variable portion of the address via $x = 0x5AA ^ 500. Not quite so simple in PL/SQL. Jared
Re: UNIX : script help/input
[EMAIL PROTECTED] wrote: Left pad with zeroes, take a substring, feed it to the handy-dandy hex/oct/bin/dec converter package - much easier. Jared, what Oracle edition do you use? I'm asking because you might want to consider not to use 'handy-dandy' hex/oct/bin/dec converter package, but TO_CHAR/TO_NUMBER in case it's = 8i -- it would work faster. SELECT TO_NUMBER(SUBSTR('0x50AA', -6), 'FM0X') dec , '0x' || TO_CHAR(170, 'FM0X') hex FROM dual / -- Vladimir Begun The statements and opinions expressed here are my own and do not necessarily represent those of Oracle Corporation. -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Vladimir Begun INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: UNIX : script help/input
Jamadagni, Rajendra wrote: unfortunately we _had_ to do it in pl/sql ... it is part of the encrypted feed that we send out to our clients ... it is decoded by a chip. Oh well I am back to array of references ... I'd suggest to consider external C function -- it's faster, it's easier to write especially when you need to work with bits, shifts etc.. I've recently implemented crc32 for some internal project -- works well, obviously faster than SQL, PL/SQL and native comp of PL/SQL code. Native comp. is also good to consider, if it's 9i. Sure, it depends... -- Vladimir Begun The statements and opinions expressed here are my own and do not necessarily represent those of Oracle Corporation. -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Vladimir Begun INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: UNIX : script help/input
Title: RE: UNIX : script help/input it was actually C code ... but because data is going on a modem, the pl/sql speed is acceptable (in fact we have to _wait_ after sending out each message). Had fun doing that though ... it is critical, tied to our SLA ... so must be up all the time. I'd rather handle exceptions in pl/sql than in C. Raj -Original Message- From: Vladimir Begun [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 02, 2003 3:35 PM To: Multiple recipients of list ORACLE-L Subject: Re: UNIX : script help/input Jamadagni, Rajendra wrote: unfortunately we _had_ to do it in pl/sql ... it is part of the encrypted feed that we send out to our clients ... it is decoded by a chip. Oh well I am back to array of references ... I'd suggest to consider external C function -- it's faster, it's easier to write especially when you need to work with bits, shifts etc.. I've recently implemented crc32 for some internal project -- works well, obviously faster than SQL, PL/SQL and native comp of PL/SQL code. Native comp. is also good to consider, if it's 9i. Sure, it depends... -- Vladimir Begun The statements and opinions expressed here are my own and do not necessarily represent those of Oracle Corporation. -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Vladimir Begun INET: [EMAIL PROTECTED] Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). This e-mail message is confidential, intended only for the named recipient(s) above and may contain information that is privileged, attorney work product or exempt from disclosure under applicable law. If you have received this message in error, or are not the named recipient(s), please immediately notify corporate MIS at (860) 766-2000 and delete this e-mail message from your computer, Thank you.*2
Re: UNIX : script help/input
This database is 8i. I would probably still use the package, as it does octal, hex and binary as well as base 36 and 64. Jared Vladimir Begun [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 10/02/2003 12:24 PM Please respond to ORACLE-L To:Multiple recipients of list ORACLE-L [EMAIL PROTECTED] cc: Subject:Re: UNIX : script help/input [EMAIL PROTECTED] wrote: Left pad with zeroes, take a substring, feed it to the handy-dandy hex/oct/bin/dec converter package - much easier. Jared, what Oracle edition do you use? I'm asking because you might want to consider not to use 'handy-dandy' hex/oct/bin/dec converter package, but TO_CHAR/TO_NUMBER in case it's = 8i -- it would work faster. SELECT TO_NUMBER(SUBSTR('0x50AA', -6), 'FM0X') dec , '0x' || TO_CHAR(170, 'FM0X') hex FROM dual / -- Vladimir Begun The statements and opinions expressed here are my own and do not necessarily represent those of Oracle Corporation. -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Vladimir Begun INET: [EMAIL PROTECTED] Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: UNIX : script help/input
I would be tempted to use Java for this rather than C. Much more portable than external procedures, an important distinction in a heterogenous shop. Jared Vladimir Begun [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 10/02/2003 12:34 PM Please respond to ORACLE-L To:Multiple recipients of list ORACLE-L [EMAIL PROTECTED] cc: Subject:Re: UNIX : script help/input Jamadagni, Rajendra wrote: unfortunately we _had_ to do it in pl/sql ... it is part of the encrypted feed that we send out to our clients ... it is decoded by a chip. Oh well I am back to array of references ... I'd suggest to consider external C function -- it's faster, it's easier to write especially when you need to work with bits, shifts etc.. I've recently implemented crc32 for some internal project -- works well, obviously faster than SQL, PL/SQL and native comp of PL/SQL code. Native comp. is also good to consider, if it's 9i. Sure, it depends... -- Vladimir Begun The statements and opinions expressed here are my own and do not necessarily represent those of Oracle Corporation. -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Vladimir Begun INET: [EMAIL PROTECTED] Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
UNIX : script help/input
Anybody with a quick and dirty (elegant would be nice too), to munge output from a nslookup output file to a delimited file? 'File content: Server: dns1.mci.comAddress: 199.249.19.1 Name: WCOM-4NXZGAPWY5.mcilink.comAddress: 166.50.73.209 Delimited file should have the following line(s); (using | or whatever asdelimiter): '166.50.73.209'|'4NXZGAPWY5.mcilink.com'. Required for both single and multiple records. TIA
RE: UNIX : script help/input
Anybody with a quick and dirty (elegant would be nice too), to munge output from a nslookup output file to a delimited file? 'File content: Server: dns1.mci.com Address: 199.249.19.1 Name:WCOM-4NXZGAPWY5.mcilink.com Address: 166.50.73.209 Delimited file should have the following line(s); (using | or whatever as delimiter): '166.50.73.209'|'4NXZGAPWY5.mcilink.com'. Required for both single and multiple records. TIA awk 'BEGIN{ok=0;}\ {if (($1 == Address:) ok)\ {printf(%s|%s\n, $2, name);ok=0;}\ else {if ($1 == Name:)\ {name = $2; ok = 1;}}}' your_file_here Don't understand your 'single' and 'multiple' records too well but it should get you started. Regards, Stephane Faroult Oriole -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Stephane Faroult INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: UNIX : script help/input
I supposed if you send to a file, we can read it using ORACLE to parse it w/plsql and then using utl_file write it back out but seems like overkill to use oracle for that, but then again this is an oracle list, so i'll have to assume thats what you wanted, anyone up for the task :) joe Johan Muller wrote: Anybody with a quick and dirty (elegant would be nice too), to munge output from a nslookup output file to a delimited file? 'File content: Server: dns1.mci.com Address: 199.249.19.1 Name:WCOM-4NXZGAPWY5.mcilink.com Address: 166.50.73.209 Delimited file should have the following line(s); (using | or whatever as delimiter): '166.50.73.209'|'4NXZGAPWY5.mcilink.com'. Required for both single and multiple records. TIA -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Joe Testa INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: UNIX : script help/input
#!/usr/bin/perl -w use strict; use bytes; my ($NAME,$IP,@LB); while () { chomp; @LB=split /\s+/; if ($LB[0] =~ /^name:/i) { $NAME=$LB[1]; } if ($LB[0] =~ /^address:/i) { $IP=$LB[1]; write; } } format STDOUT= @ ,@ $NAME,$IP
Re: UNIX : script help/input
Mladen, It worked! Heartfelt thank you from the evangelized perl crowd (now watch the list-owner grin).Mladen Gogala [EMAIL PROTECTED] wrote: #!/usr/bin/perl -wuse strict;use bytes;my ($NAME,$IP,@LB);while () {chomp;@LB=split /\s+/;if ($LB[0] =~ /^name:/i) {$NAME=$LB[1];}if ($LB[0] =~ /^address:/i) {$IP=$LB[1];write;}}format STDOUT=@ ,@$NAME,$IP
Re: UNIX : script help/input
On Wed, 2003-10-01 at 13:24, Johan Muller wrote: Mladen, It worked! Did you have any doubts? That's precisely what perl is good for. Note: This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. Wang Trading LLC and any of its subsidiaries each reserve the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of any such entity. -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Mladen Gogala INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: UNIX : script help/input
Thank God for Perl and Mladen ;) Tanel. - Original Message - From: Johan Muller To: Multiple recipients of list ORACLE-L Sent: Wednesday, October 01, 2003 8:24 PM Subject: Re: UNIX : script help/input Mladen, It worked! Heartfelt thank you from the evangelized perl crowd (now watch the list-owner grin).Mladen Gogala [EMAIL PROTECTED] wrote: #!/usr/bin/perl -wuse strict;use bytes;my ($NAME,$IP,@LB);while () {chomp;@LB=split /\s+/;if ($LB[0] =~ /^name:/i) {$NAME=$LB[1];}if ($LB[0] =~ /^address:/i) {$IP=$LB[1];write;}}format STDOUT=@ ,@$NAME,$IP
RE: UNIX : script help/input
Funny .. I am currently sitting in a Perl class, so I can actually read what MG has written. I'll be soon Perl-literate ... Raj -Original Message-From: Tanel Poder [mailto:[EMAIL PROTECTED]Sent: Wednesday, October 01, 2003 1:35 PMTo: Multiple recipients of list ORACLE-LSubject: Re: UNIX : script help/input Thank God for Perl and Mladen ;) Tanel. - Original Message - From: Johan Muller To: Multiple recipients of list ORACLE-L Sent: Wednesday, October 01, 2003 8:24 PM Subject: Re: UNIX : script help/input Mladen, It worked! Heartfelt thank you from the evangelized perl crowd (now watch the list-owner grin).Mladen Gogala [EMAIL PROTECTED] wrote: #!/usr/bin/perl -wuse strict;use bytes;my ($NAME,$IP,@LB);while () {chomp;@LB=split /\s+/;if ($LB[0] =~ /^name:/i) {$NAME=$LB[1];}if ($LB[0] =~ /^address:/i) {$IP=$LB[1];write;}}format STDOUT=@ ,@$NAME,$IP This e-mail message is confidential, intended only for the named recipient(s) above and may contain information that is privileged, attorney work product or exempt from disclosure under applicable law. If you have received this message in error, or are not the named recipient(s), please immediately notify corporate MIS at (860) 766-2000 and delete this e-mail message from your computer, Thank you.*2
Re: UNIX : script help/input
:) On Wed, 2003-10-01 at 10:24, Johan Muller wrote: Mladen, It worked! Heartfelt thank you from the evangelized perl crowd (now watch the list-owner grin). Mladen Gogala [EMAIL PROTECTED] wrote: #!/usr/bin/perl -w use strict; use bytes; my ($NAME,$IP,@LB); while () { chomp; @LB=split /\s+/; if ($LB[0] =~ /^name:/i) { $NAME=$LB[1]; } if ($LB[0] =~ /^address:/i) { $IP=$LB[1]; write; } } format STDOUT= @ ,@ $NAME,$IP -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Jared Still INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: UNIX : script help/input
Thank God for Jared -Original Message- From: Tanel PoderSent: 10/1/2003 10:37:55 AMTo: [EMAIL PROTECTED]Subject: Re: UNIX : script help/input Thank God for Perl and Mladen ;) Tanel. - Original Message - From: Johan Muller To: Multiple recipients of list ORACLE-L Sent: Wednesday, October 01, 2003 8:24 PM Subject: Re: UNIX : script help/input Mladen, It worked! Heartfelt thank you from the evangelized perl crowd (now watch the list-owner grin).Mladen Gogala [EMAIL PROTECTED] wrote: #!/usr/bin/perl -wuse strict;use bytes;my ($NAME,$IP,@LB);while () {chomp;@LB=split /\s+/;if ($LB[0] =~ /^name:/i) {$NAME=$LB[1];}if ($LB[0] =~ /^address:/i) {$IP=$LB[1];write;}}format STDOUT=@ ,@$NAME,$IP ___Get Your 10MB account for FREE at http://mail.arabia.com !Access MILLIONS of JOBS NOW!
RE: UNIX : script help/input
On Wed, 2003-10-01 at 14:34, Jamadagni, Rajendra wrote: Funny .. I am currently sitting in a Perl class, so I can actually read what MG has written. I'll be soon Perl-literate ... Raj Good! The more the merrier! Welcome to the club. Note: This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. Wang Trading LLC and any of its subsidiaries each reserve the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of any such entity. -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Mladen Gogala INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: UNIX : script help/input
Why thank you. :) On Wed, 2003-10-01 at 13:29, Govindan K wrote: Thank God for Jared -Original Message- From: Tanel Poder Sent: 10/1/2003 10:37:55 AM To: [EMAIL PROTECTED] Thank God for Perl and Mladen ;) Tanel. - Original Message - From: Johan Muller mailto:[EMAIL PROTECTED] To: Multiple recipients of list ORACLE-L mailto:[EMAIL PROTECTED] Sent: Wednesday, October 01, 2003 8:24 PM Subject: Re: UNIX : script help/input Mladen, It worked! Heartfelt thank you from the evangelized perl crowd (now watch the list-owner grin). Mladen Gogala [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: #!/usr/bin/perl -w use strict; use bytes; my ($NAME,$IP,@LB); while () { chomp; @LB=split /\s+/; if ($LB[0] =~ /^name:/i) { $NAME=$LB[1]; } if ($LB[0] =~ /^address:/i) { $IP=$LB[1]; write; } } format STDOUT= @ ,@ $NAME,$IP ___ Get Your 10MB account for FREE at http://mail.arabia.com ! Access MILLIONS of JOBS NOW! http://ads.arabia.com/?SHT=text_email_english -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Jared Still INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: UNIX : script help/input
Good! The more the merrier! Welcome to the club. Oh most definitely. As I just finished writing a prototype package for assigning MAC addresses ( we make network stuff - that's a technical term ), I have endured the agonies of doing hex math in PL/SQL. I finally bit the bullet and used string manipulation to convert hex to decimal and do what I needed that way. Couldn't get BITAND to work properly on very large integers. Besides, doing XOR with BITAND in PL/SQL is very painful. UTL_RAW has an XOR, but it requires RAW values and I didn't feel like messing with it. This is all very simple in Perl. Given a MAC of 5AA, with a fixed portion of 500, it is very easy to determine the variable portion of the address via $x = 0x5AA ^ 500. Not quite so simple in PL/SQL. Jared On Wed, 2003-10-01 at 14:44, Mladen Gogala wrote: On Wed, 2003-10-01 at 14:34, Jamadagni, Rajendra wrote: Funny .. I am currently sitting in a Perl class, so I can actually read what MG has written. I'll be soon Perl-literate ... Raj Note: This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. Wang Trading LLC and any of its subsidiaries each reserve the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of any such entity. -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Mladen Gogala INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Jared Still INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: UNIX : script help/input
Jared Jared Still wrote: Good! The more the merrier! Welcome to the club. Oh most definitely. As I just finished writing a prototype package for assigning MAC addresses ( we make network stuff - that's a technical term ), I have endured the agonies of doing hex math in PL/SQL. I finally bit the bullet and used string manipulation to convert hex to decimal and do what I needed that way. Couldn't get BITAND to work properly on very large integers. Besides, doing XOR with BITAND in PL/SQL is very painful. BITAND in PL/SQL works for INTEGER/PLS_INTEGER only. UTL_RAW has an XOR, but it requires RAW values and I didn't feel like messing with it. This is all very simple in Perl. Sure! Given a MAC of 5AA, with a fixed portion of 500, it is very easy to determine the variable portion of the address via $x = 0x5AA ^ 500. Not quite so simple in PL/SQL. Globally unique addresses are allocated by the IEEE in blocks containing 2^24 (16,777,216) addresses. In each allocation, the first 3 octects are fixed (e.g. 00-00-0C is Cisco) and the last three octects are variable (e.g. 00-00-00 through FF-FF-FF). The fixed portion of the allocation is known formally as the Organizationally Unique Identifier (OUI), and infomally as the Ethernet Vendor ID. Often, the OUI portion of a MAC address is extremely helpful in indentifying which physical piece of equipment is generating a particular packet. 00-00-50 is for RADISYS CORPORATION, right? x := SUBSTR('0x50AA', -6); Then you can use BITAND. However, I'm not saying that PL/SQL is better than perl -- every language has its own purpose. -- Vladimir Begun The statements and opinions expressed here are my own and do not necessarily represent those of Oracle Corporation. -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Vladimir Begun INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: OT: unix script quetion: to replace $ with \$
Nope. I will work. Try it. -Original Message- The problem is that if LINE contains $ (dollar sign), as some InterMedia table names do, the piped command will fail. Guang -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Stephen Lee Sent: Monday, February 03, 2003 3:54 PM To: Multiple recipients of list ORACLE-L Subject: RE: OT: unix script quetion: to replace $ with \$ Would something like this be adaptable to your stuff? #!/usr/bin/ksh { sqlplus -s -XXX joe/blow@SID set this and that off set the other thing and trimspool on set whatever else select table_name from dba_tables where owner = 'BUBBA'; } | while read LINE; do echo exec analyze_that_puppy BUBBA.$LINE real good; | sed 's/\$/\\\$/g' done -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Stephen Lee INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: gmei INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Stephen Lee INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
FW: OT: unix script quetion: to replace $ with \$
SQL show user; USER is ISI SQL select segment_name from user_segments 2 where segment_type='TABLE' 3 and segment_name like 'DR$%' 4 order by segment_name; SEGMENT_NAME DR$ABSTRACT_TEXT$I DR$ABSTRACT_TEXT$R DR$COREREF_ABSTRACT$I DR$COREREF_ABSTRACT$R DR$COREREF_TITLE$I DR$COREREF_TITLE$R DR$TEST_CONTEXT$I DR$TEST_CONTEXT$R 8 rows selected. -- login to essex (a unix box): login: oracle Password: Last login: Mon Feb 3 21:25:31 from rex.xyz.com Sun Microsystems Inc. SunOS 5.8 Generic Patch October 2001 essex$ echo exec analyze table ISI.DR$TEST_CONTEXT$R compute statistics; | sed 's/\$/\\\$/g' exec analyze table ISI.DR compute statistics; essex$ It will try to analyze table DR, which does not exist. Guang -Original Message- Sent: Tuesday, February 04, 2003 9:20 AM To: Multiple recipients of list ORACLE-L Nope. I will work. Try it. -Original Message- The problem is that if LINE contains $ (dollar sign), as some InterMedia table names do, the piped command will fail. Guang -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Stephen Lee Sent: Monday, February 03, 2003 3:54 PM To: Multiple recipients of list ORACLE-L Subject: RE: OT: unix script quetion: to replace $ with \$ Would something like this be adaptable to your stuff? #!/usr/bin/ksh { sqlplus -s -XXX joe/blow@SID set this and that off set the other thing and trimspool on set whatever else select table_name from dba_tables where owner = 'BUBBA'; } | while read LINE; do echo exec analyze_that_puppy BUBBA.$LINE real good; | sed 's/\$/\\\$/g' done -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Stephen Lee INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: gmei INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Stephen Lee INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: gmei INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: FW: OT: unix script quetion: to replace $ with \$
The shell is interpreting $string as a variable. You need to escape $, like this: ISI.DR\$TEST_CONTEXT\$R gmei wrote: SQL show user; USER is ISI SQL select segment_name from user_segments 2 where segment_type='TABLE' 3 and segment_name like 'DR$%' 4 order by segment_name; SEGMENT_NAME DR$ABSTRACT_TEXT$I DR$ABSTRACT_TEXT$R DR$COREREF_ABSTRACT$I DR$COREREF_ABSTRACT$R DR$COREREF_TITLE$I DR$COREREF_TITLE$R DR$TEST_CONTEXT$I DR$TEST_CONTEXT$R 8 rows selected. -- login to essex (a unix box): login: oracle Password: Last login: Mon Feb 3 21:25:31 from rex.xyz.com Sun Microsystems Inc. SunOS 5.8 Generic Patch October 2001 essex$ echo exec analyze table ISI.DR$TEST_CONTEXT$R compute statistics; | sed 's/\$/\\\$/g' exec analyze table ISI.DR compute statistics; essex$ It will try to analyze table DR, which does not exist. Guang -Original Message- Sent: Tuesday, February 04, 2003 9:20 AM To: Multiple recipients of list ORACLE-L Nope. I will work. Try it. -Original Message- The problem is that if LINE contains $ (dollar sign), as some InterMedia table names do, the piped command will fail. Guang -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Stephen Lee Sent: Monday, February 03, 2003 3:54 PM To: Multiple recipients of list ORACLE-L Subject: RE: OT: unix script quetion: to replace $ with \$ Would something like this be adaptable to your stuff? #!/usr/bin/ksh { sqlplus -s -XXX joe/blow@SID set this and that off set the other thing and trimspool on set whatever else select table_name from dba_tables where owner = 'BUBBA'; } | while read LINE; do echo exec analyze_that_puppy BUBBA.$LINE real good; | sed 's/\$/\\\$/g' done -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Stephen Lee INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: gmei INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Stephen Lee INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: gmei INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Suzy Vordos INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE
Re: OT: unix script quetion: to replace $ with \$
Use the translate command tr. Type man tr for help with using it. RWB Guang Mei [EMAIL PROTECTED]@fatcity.com on 02/03/2003 12:39:48 PM Please respond to [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] cc: Hi: I have a quick question about replacing $ with \$ on unix. I need to convert string 123$45$678 to 123\$45\$678 through a pipe. I tried with sed command, but could not get it to work: essex$ echo 123$45$678 | sed s/$/\$/g 123578$ essex$ echo 123$45$678 | sed s/$/\\$/g 123578$ Maybe there is another syntax that I should use? TIA. Guang Mei _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Guang Mei INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
OT: unix script quetion: to replace $ with \$
Hi: I have a quick question about replacing $ with \$ on unix. I need to convert string 123$45$678 to 123\$45\$678 through a pipe. I tried with sed command, but could not get it to work: essex$ echo 123$45$678 | sed s/$/\$/g 123578$ essex$ echo 123$45$678 | sed s/$/\\$/g 123578$ Maybe there is another syntax that I should use? TIA. Guang Mei _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Guang Mei INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: unix script quetion: to replace $ with \$
echo '123$456$789' | sed 's/\$/\\\$/g' 123\$456\$789 Why? The $ means end of line to sed; so you have to quote it too. -Original Message- Maybe there is another syntax that I should use? TIA. -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Stephen Lee INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: OT: unix script quetion: to replace $ with \$
Please note the use of single-quotes (') instead of double-quotes () in the echo command, as well as the use of single-quotes in the sed command... $ echo '123$45$678' | sed 's/\$/\\$/g' 123\$45\$678 Hope this helps... Hi: I have a quick question about replacing $ with \$ on unix. I need to convert string 123$45$678 to 123\$45\$678 through a pipe. I tried with sed command, but could not get it to work: essex$ echo 123$45$678 | sed s/$/\$/g 123578$ essex$ echo 123$45$678 | sed s/$/\\$/g 123578$ Maybe there is another syntax that I should use? TIA. Guang Mei __ ___ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Guang Mei INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services -- --- To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: OT: unix script quetion: to replace $ with \$
Problem here is that sed treats $ as a special characer meaning end of line as well as the korn shell meaning variable replacement. To avoid the shell evaluation, use ' not . to avoid the sed special charater, escape it. echo '123$45$678' | sed 's/\$/\\\$/g' Ron Thomas Hypercom, Inc [EMAIL PROTECTED] Each new user of a new system uncovers a new class of bugs. -- Kernighan [EMAIL PROTECTED] Sent by: To: [EMAIL PROTECTED] [EMAIL PROTECTED] cc: Subject: OT: unix script quetion: to replace $ with \$ 02/03/2003 11:39 AM Please respond to ORACLE-L Hi: I have a quick question about replacing $ with \$ on unix. I need to convert string 123$45$678 to 123\$45\$678 through a pipe. I tried with sed command, but could not get it to work: essex$ echo 123$45$678 | sed s/$/\$/g 123578$ essex$ echo 123$45$678 | sed s/$/\\$/g 123578$ Maybe there is another syntax that I should use? TIA. Guang Mei _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Guang Mei INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Ron Thomas INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: OT: unix script quetion: to replace $ with \$
echo '123$45$678' | sed -e 's#\$#\\$#g' Guang Mei [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 02/03/2003 10:39 AM Please respond to ORACLE-L To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] cc: Subject:OT: unix script quetion: to replace $ with \$ Hi: I have a quick question about replacing $ with \$ on unix. I need to convert string 123$45$678 to 123\$45\$678 through a pipe. I tried with sed command, but could not get it to work: essex$ echo 123$45$678 | sed s/$/\$/g 123578$ essex$ echo 123$45$678 | sed s/$/\\$/g 123578$ Maybe there is another syntax that I should use? TIA. Guang Mei _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Guang Mei INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: OT: unix script quetion: to replace $ with \$
Hi, Brian: Thanks for your (and others) help. I can not use signle quotes in echo in my program. The reason is this: I am trying to run table analyze in multiple treads (I found doing this reduce time by 50%). By doing this I run sh script gather_ISI_table_stats_executeX.sh: essex$ more gather_ISI_table_stats_executeX.sh #!/bin/sh sqlplus -s isi/password @/oracle/dba/get_ISI_tabs.sql | awk '{print echo \$0\ | sqlplus -s isi/password}' | /oracle/dba/executeX 3 Here executeX is a program to run multiple threads (3 in this case). The script get_ISI_tabs.sql is just a script to get all the tables in the schema. The problem is that there are Oracle Inter-Media tables like DR$TEST_CONTEXT$R which makes this whole script fail. I can not seem to find a way to get around of this issue. essex$ more get_ISI_tabs.sql -- Script for listing analyze table commands in decreating size -- of tables -- Turn off heading SET NEWPAGE 0 SET SPACE 1 SET LINESIZE 512 SET PAGESIZE 0 SET ECHO OFF SET FEEDBACK OFF SET HEADING OFF select 'execute DBMS_STATS.GATHER_TABLE_STATS('''||owner||''','''|| segment_name||''',cascade = TRUE);' from ( select owner,segment_name, sum(bytes) from dba_segments s where segment_type like 'TABLE%' and owner = 'ISI' and s.partition_name is null group by owner,segment_name order by sum(s.bytes) desc); exit; - Guang Mei Original Message Follows To: [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Date: Mon, 3 Feb 2003 12:58:01 -0700 Your first echo needs to be in single quotes or else it results in... 29912:oracle@mybox echo 123$45$678 123578 Once that is done this... 29912:oracle@mybox echo '123$45$678' | sed 's/\$/\\$/g' 123\$45\$678 ...or this... 29912:oracle@mybox echo '123$45$678' | sed 's/\$/\\\$/g' 123\$45\$678 ...will work Guang Mei [EMAIL PROTECTED]To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] m cc: Sent by: Subject: OT: unix script quetion: to replace $ with \$ [EMAIL PROTECTED] 02/03/03 11:39 AM Please respond to ORACLE-L Hi: I have a quick question about replacing $ with \$ on unix. I need to convert string 123$45$678 to 123\$45\$678 through a pipe. I tried with sed command, but could not get it to work: essex$ echo 123$45$678 | sed s/$/\$/g 123578$ essex$ echo 123$45$678 | sed s/$/\\$/g 123578$ Maybe there is another syntax that I should use? TIA. Guang Mei _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Guang Mei INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Guang Mei INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: OT: unix script quetion: to replace $ with \$
Your first echo needs to be in single quotes or else it results in... 29912:oracle@mybox echo 123$45$678 123578 Once that is done this... 29912:oracle@mybox echo '123$45$678' | sed 's/\$/\\$/g' 123\$45\$678 ...or this... 29912:oracle@mybox echo '123$45$678' | sed 's/\$/\\\$/g' 123\$45\$678 ...will work Guang Mei [EMAIL PROTECTED]To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] m cc: Sent by: Subject: OT: unix script quetion: to replace $ with \$ [EMAIL PROTECTED] 02/03/03 11:39 AM Please respond to ORACLE-L Hi: I have a quick question about replacing $ with \$ on unix. I need to convert string 123$45$678 to 123\$45\$678 through a pipe. I tried with sed command, but could not get it to work: essex$ echo 123$45$678 | sed s/$/\$/g 123578$ essex$ echo 123$45$678 | sed s/$/\\$/g 123578$ Maybe there is another syntax that I should use? TIA. Guang Mei _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Guang Mei INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: OT: unix script quetion: to replace $ with \$
Use the octal code for the character, and using the quoting mechanism of your choice: $ = octal 044 echo '123$45$678' | sed -e s#\044#\\\044#g Jared Guang Mei [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 02/03/2003 12:09 PM Please respond to ORACLE-L To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] cc: Subject:Re: OT: unix script quetion: to replace $ with \$ Hi, Brian: Thanks for your (and others) help. I can not use signle quotes in echo in my program. The reason is this: I am trying to run table analyze in multiple treads (I found doing this reduce time by 50%). By doing this I run sh script gather_ISI_table_stats_executeX.sh: essex$ more gather_ISI_table_stats_executeX.sh #!/bin/sh sqlplus -s isi/password @/oracle/dba/get_ISI_tabs.sql | awk '{print echo \$0\ | sqlplus -s isi/password}' | /oracle/dba/executeX 3 Here executeX is a program to run multiple threads (3 in this case). The script get_ISI_tabs.sql is just a script to get all the tables in the schema. The problem is that there are Oracle Inter-Media tables like DR$TEST_CONTEXT$R which makes this whole script fail. I can not seem to find a way to get around of this issue. essex$ more get_ISI_tabs.sql -- Script for listing analyze table commands in decreating size -- of tables -- Turn off heading SET NEWPAGE 0 SET SPACE 1 SET LINESIZE 512 SET PAGESIZE 0 SET ECHO OFF SET FEEDBACK OFF SET HEADING OFF select 'execute DBMS_STATS.GATHER_TABLE_STATS('''||owner||''','''|| segment_name||''',cascade = TRUE);' from ( select owner,segment_name, sum(bytes) from dba_segments s where segment_type like 'TABLE%' and owner = 'ISI' and s.partition_name is null group by owner,segment_name order by sum(s.bytes) desc); exit; - Guang Mei Original Message Follows To: [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Date: Mon, 3 Feb 2003 12:58:01 -0700 Your first echo needs to be in single quotes or else it results in... 29912:oracle@mybox echo 123$45$678 123578 Once that is done this... 29912:oracle@mybox echo '123$45$678' | sed 's/\$/\\$/g' 123\$45\$678 ...or this... 29912:oracle@mybox echo '123$45$678' | sed 's/\$/\\\$/g' 123\$45\$678 ...will work Guang Mei [EMAIL PROTECTED]To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] m cc: Sent by: Subject: OT: unix script quetion: to replace $ with \$ [EMAIL PROTECTED] 02/03/03 11:39 AM Please respond to ORACLE-L Hi: I have a quick question about replacing $ with \$ on unix. I need to convert string 123$45$678 to 123\$45\$678 through a pipe. I tried with sed command, but could not get it to work: essex$ echo 123$45$678 | sed s/$/\$/g 123578$ essex$ echo 123$45$678 | sed s/$/\\$/g 123578$ Maybe there is another syntax that I should use? TIA. Guang Mei _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Guang Mei INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Guang Mei INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services
RE: OT: unix script quetion: to replace $ with \$
Would something like this be adaptable to your stuff? #!/usr/bin/ksh { sqlplus -s -XXX joe/blow@SID set this and that off set the other thing and trimspool on set whatever else select table_name from dba_tables where owner = 'BUBBA'; } | while read LINE; do echo exec analyze_that_puppy BUBBA.$LINE real good; | sed 's/\$/\\\$/g' done -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Stephen Lee INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: OT: unix script quetion: to replace $ with \$
Hi: I ended up solving my problem by changing my query in get_ISI_tabs.sql to: select 'execute DBMS_STATS.GATHER_TABLE_STATS('''||owner||''','''|| segment_name||''',cascade = TRUE);' from ( select owner, replace (segment_name, '$','\$') segment_name, sum(bytes) from dba_segments s where segment_type like 'TABLE%' and owner = 'ISI' and s.partition_name is null group by owner,segment_name order by sum(s.bytes) desc); -- Use of function replace solved my problem. But thanks for you help. Guang Original Message Follows To: [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Date: Mon, 3 Feb 2003 13:14:38 -0800 Use the octal code for the character, and using the quoting mechanism of your choice: $ = octal 044 echo '123$45$678' | sed -e s#\044#\\\044#g Jared Guang Mei [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 02/03/2003 12:09 PM Please respond to ORACLE-L To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] cc: Subject:Re: OT: unix script quetion: to replace $ with \$ Hi, Brian: Thanks for your (and others) help. I can not use signle quotes in echo in my program. The reason is this: I am trying to run table analyze in multiple treads (I found doing this reduce time by 50%). By doing this I run sh script gather_ISI_table_stats_executeX.sh: essex$ more gather_ISI_table_stats_executeX.sh #!/bin/sh sqlplus -s isi/password @/oracle/dba/get_ISI_tabs.sql | awk '{print echo \$0\ | sqlplus -s isi/password}' | /oracle/dba/executeX 3 Here executeX is a program to run multiple threads (3 in this case). The script get_ISI_tabs.sql is just a script to get all the tables in the schema. The problem is that there are Oracle Inter-Media tables like DR$TEST_CONTEXT$R which makes this whole script fail. I can not seem to find a way to get around of this issue. essex$ more get_ISI_tabs.sql -- Script for listing analyze table commands in decreating size -- of tables -- Turn off heading SET NEWPAGE 0 SET SPACE 1 SET LINESIZE 512 SET PAGESIZE 0 SET ECHO OFF SET FEEDBACK OFF SET HEADING OFF select 'execute DBMS_STATS.GATHER_TABLE_STATS('''||owner||''','''|| segment_name||''',cascade = TRUE);' from ( select owner,segment_name, sum(bytes) from dba_segments s where segment_type like 'TABLE%' and owner = 'ISI' and s.partition_name is null group by owner,segment_name order by sum(s.bytes) desc); exit; - Guang Mei Original Message Follows To: [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Date: Mon, 3 Feb 2003 12:58:01 -0700 Your first echo needs to be in single quotes or else it results in... 29912:oracle@mybox echo 123$45$678 123578 Once that is done this... 29912:oracle@mybox echo '123$45$678' | sed 's/\$/\\$/g' 123\$45\$678 ...or this... 29912:oracle@mybox echo '123$45$678' | sed 's/\$/\\\$/g' 123\$45\$678 ...will work Guang Mei [EMAIL PROTECTED]To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] m cc: Sent by: Subject: OT: unix script quetion: to replace $ with \$ [EMAIL PROTECTED] 02/03/03 11:39 AM Please respond to ORACLE-L Hi: I have a quick question about replacing $ with \$ on unix. I need to convert string 123$45$678 to 123\$45\$678 through a pipe. I tried with sed command, but could not get it to work: essex$ echo 123$45$678 | sed s/$/\$/g 123578$ essex$ echo 123$45$678 | sed s/$/\\$/g 123578$ Maybe there is another syntax that I should use? TIA. Guang Mei _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Guang Mei INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Guang Mei INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services
RE: OT: unix script quetion: to replace $ with \$
The problem is that if LINE contains $ (dollar sign), as some InterMedia table names do, the piped command will fail. Guang -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Stephen Lee Sent: Monday, February 03, 2003 3:54 PM To: Multiple recipients of list ORACLE-L Subject: RE: OT: unix script quetion: to replace $ with \$ Would something like this be adaptable to your stuff? #!/usr/bin/ksh { sqlplus -s -XXX joe/blow@SID set this and that off set the other thing and trimspool on set whatever else select table_name from dba_tables where owner = 'BUBBA'; } | while read LINE; do echo exec analyze_that_puppy BUBBA.$LINE real good; | sed 's/\$/\\\$/g' done -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Stephen Lee INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: gmei INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: Unix script to stop pwd-protected listener
Hi, we have lsnrctl with 750 and listener.ora with 600 permissions and everything runs fine. For job stopping process you can then use the encrypted password wirtten in listener.ora. HTH, Mike [EMAIL PROTECTED] wrote: Hi, Solaris 8, Oracle 9i listener It seems that anyone who has a login on Solaris can shut the listener down. I have tried with a non-dba userid and could stop the listener. The default file permission for ORACLE_HOME/bin/lsnrctl is 751, and for ORACLE_HOME/network/admin/listener.ora file is 644. I asked Oracle if I could change them to 750 and 640 respectively and they said that you should not change the defaults since they are verified against the system. So I password protected it. However to stop a password-protect listener you need to do the following interactively: run lsnrctl, issue set password command, put in the password, issue stop, issue exit. I need to implement this stop in a Shell script so that I can call the script at the server reboot time. Do you know how to supply a password to lsnrctl set password command in a script? Have attempted with the script but have not got it worked yet. Thanks Long -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Ing. Michal Zaschke DB Administrator Sokolovska uhelna, a.s. phone: +420 352 465417 e-mail: [EMAIL PROTECTED] -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Michal Zaschke INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Unix script to stop pwd-protected listener
Hi, Solaris 8, Oracle 9i listener It seems that anyone who has a login on Solaris can shut the listener down. I have tried with a non-dba userid and could stop the listener. The default file permission for ORACLE_HOME/bin/lsnrctl is 751, and for ORACLE_HOME/network/admin/listener.ora file is 644. I asked Oracle if I could change them to 750 and 640 respectively and they said that you should not change the defaults since they are verified against the system. So I password protected it. However to stop a password-protect listener you need to do the following interactively: run lsnrctl, issue set password command, put in the password, issue stop, issue exit. I need to implement this stop in a Shell script so that I can call the script at the server reboot time. Do you know how to supply a password to lsnrctl set password command in a script? Have attempted with the script but have not got it worked yet. Thanks Long -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: Unix script to stop password-protected listener
Hi Michal, It's a security breach and bug #2366907 has been opened for that. So protect carefully your listener.ora file from non privileged readers. Regards At 01:53 08/10/2002 -0800, you wrote: Yes, you can change your listener.ora file permission up to 600 on the server side. In a shell script you can then use encrypted password found in listener.ora on line PASSWORDS_listener. lsnrctl EOF set password C6C144CF750E3CA5 stop exit EOF If the password is not in the listener.ora file, run lsnrctl, set password manualy and execute SAVE_CONFIG. This will write a line into your listener.ora file with the encrypted password. HTH, Mike Gilles Parc carpe diem !! -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Gilles PARC INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: Unix script to stop password-protected listener
Yes, you can change your listener.ora file permission up to 600 on the server side. In a shell script you can then use encrypted password found in listener.ora on line PASSWORDS_listener. lsnrctl EOF set password C6C144CF750E3CA5 stop exit EOF If the password is not in the listener.ora file, run lsnrctl, set password manualy and execute SAVE_CONFIG. This will write a line into your listener.ora file with the encrypted password. HTH, Mike Choudhary Rajendra (TTL_LKO) pe: Hi , We can very well protect the Server side executables by changing the permission of the file . We had implemented this on all our database sites and normal user don't have access to lsnrctl,svrmgrl,namesctl etc .You can also protect the listener.ora file by changing the permission to 770 or 700 as applicable to your environment . The sqlnet.ora file need to be given read access to all and also the tnsnames.ora file (If you have not gone for nameserver) . Regards Rajendra -Original Message- Sent: Tuesday, October 08, 2002 11:13 AM To: Multiple recipients of list ORACLE-L Hi, Solaris 8, Oracle 9i listener It seems that anyone who has a login on Solaris can shut the listener down. I have tried with a non-dba userid and could stop the listener. The default file permission for ORACLE_HOME/bin/lsnrctl is 751, and for ORACLE_HOME/network/admin/listener.ora file is 644. I asked Oracle if I could change them to 750 and 640 respectively and they said that you should not change the defaults since they are verified against the system. So I password protected it. However to stop a password-protect listener you need to do the following interactively: run lsnrctl, issue set password command, put in the password, issue stop, issue exit. I need to implement this stop in a Shell script so that I can call the script at the server reboot time. Do you know how to supply a password to lsnrctl set password command in a script? Have attempted with the script but have not got it worked yet. Thanks Long -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Choudhary Rajendra (TTL_LKO) INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Ing. Michal Zaschke DB Administrator Sokolovska uhelna, a.s. phone: +420 352 465417 e-mail: [EMAIL PROTECTED] -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Michal Zaschke INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Unix script to stop password-protected listener
Hi, Solaris 8, Oracle 9i listener It seems that anyone who has a login on Solaris can shut the listener down. I have tried with a non-dba userid and could stop the listener. The default file permission for ORACLE_HOME/bin/lsnrctl is 751, and for ORACLE_HOME/network/admin/listener.ora file is 644. I asked Oracle if I could change them to 750 and 640 respectively and they said that you should not change the defaults since they are verified against the system. So I password protected it. However to stop a password-protect listener you need to do the following interactively: run lsnrctl, issue set password command, put in the password, issue stop, issue exit. I need to implement this stop in a Shell script so that I can call the script at the server reboot time. Do you know how to supply a password to lsnrctl set password command in a script? Have attempted with the script but have not got it worked yet. Thanks Long -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: Unix script to stop password-protected listener
Hi , We can very well protect the Server side executables by changing the permission of the file . We had implemented this on all our database sites and normal user don't have access to lsnrctl,svrmgrl,namesctl etc .You can also protect the listener.ora file by changing the permission to 770 or 700 as applicable to your environment . The sqlnet.ora file need to be given read access to all and also the tnsnames.ora file (If you have not gone for nameserver) . Regards Rajendra -Original Message- Sent: Tuesday, October 08, 2002 11:13 AM To: Multiple recipients of list ORACLE-L Hi, Solaris 8, Oracle 9i listener It seems that anyone who has a login on Solaris can shut the listener down. I have tried with a non-dba userid and could stop the listener. The default file permission for ORACLE_HOME/bin/lsnrctl is 751, and for ORACLE_HOME/network/admin/listener.ora file is 644. I asked Oracle if I could change them to 750 and 640 respectively and they said that you should not change the defaults since they are verified against the system. So I password protected it. However to stop a password-protect listener you need to do the following interactively: run lsnrctl, issue set password command, put in the password, issue stop, issue exit. I need to implement this stop in a Shell script so that I can call the script at the server reboot time. Do you know how to supply a password to lsnrctl set password command in a script? Have attempted with the script but have not got it worked yet. Thanks Long -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Choudhary Rajendra (TTL_LKO) INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: Unix Script Quest : Urgent
Don't forget the lsof command (list open files). Just as invaluable as truss. Get it at http://www.sunfreeware.com/ chris.w.johnson@b t.comTo: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] Sent by: cc: [EMAIL PROTECTED] Subject: RE: Unix Script Quest : Urgent 08/09/02 09:08 AM Please respond to ORACLE-L Hannah, I'm no Unix guru either but in this situation I use 'truss', e.g. truss procname HTH Chris -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 09 August 2002 16:08 To: Multiple recipients of list ORACLE-L Subject: Unix Script Quest : Urgent Is there a way to capture all files hit by a process/user in unix (Sun Solaris 9, ksh)? I am seeing an OCI file not found on my production box. I can't resovle it. So, I want to run the same process on my development box (where it works) and get a list of files that it is hitting (I can grep by username) for comparison in production. Only I am definitely NOT the Unix guru and as this is for a prod issue, so my time is very limited. Thanks in advance, Hannah -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Unix Script Quest : Urgent
Is there a way to captureall files hit by a process/user in unix (Sun Solaris 9, ksh)? I am seeing an OCI file not found on my production box. I can't resovle it. So, I want to run the same process on my development box (where it works) and get a list of files that it is hitting (I can grep by username) for comparison in production. Only I am definitely NOT the Unix guru and as this is for a prod issue, so my time is very limited. Thanks in advance, Hannah
Re: Unix Script Quest : Urgent
Is there a way to capture all files hit by a process/user in unix (Sun Solaris 9, ksh)? I am seeing an OCI file not found on my production box. I can't resovle it. So, I want to run the same process on my development box (where it works) and get a list of files that it is hitting (I can grep by username) for comparison in production. Only I am definitely NOT the Unix guru and as this is for a prod issue, so my time is very limited. Thanks in advance, touch BEFORE; ... find $wherever -newer ./BEFORE; will give you a list of files that have changed since the BEFORE file. If you are sure that the files are being created (vs. modified or accessed) by one specific userid then: find / -newer BEFORE -user id will work also. If you are going to run the thing regularly then take a look at find2p, which will spit out a perl script to match your find command. The perly code will give you finer control and better sanity checks (e.g., comparing to a list in memory of what has already been found to avoid dup's) than find can. enjoi. -- Steven Lembark 2930 W. Palmer Workhorse Computing Chicago, IL 60647 +1 800 762 1582 -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Steven Lembark INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: Unix Script Quest : Urgent
ldd filename should give you the dependencies. --- [EMAIL PROTECTED] wrote: Is there a way to capture all files hit by a process/user in unix (Sun Solaris 9, ksh)? I am seeing an OCI file not found on my production box. I can't resovle it. So, I want to run the same process on my development box (where it works) and get a list of files that it is hitting (I can grep by username) for comparison in production. Only I am definitely NOT the Unix guru and as this is for a prod issue, so my time is very limited. Thanks in advance, Hannah = Pete Barnett Lead Database Administrator The Regence Group [EMAIL PROTECTED] __ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Peter Barnett INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: Unix Script Quest : Urgent
I think that will give you files that it successfully accessed, but not the ones that were referenced but not found. You can do what you're asking on VMS and NT, so it seems like there should be a way in Unix, although I asked my Unix SA's that same question a few years back and they said that there isn't. They were pretty sharp guys so I tend to believe them. -Original Message- Sent: Friday, August 09, 2002 11:33 AM To: Multiple recipients of list ORACLE-L Is there a way to capture all files hit by a process/user in unix (Sun Solaris 9, ksh)? I am seeing an OCI file not found on my production box. I can't resovle it. So, I want to run the same process on my development box (where it works) and get a list of files that it is hitting (I can grep by username) for comparison in production. Only I am definitely NOT the Unix guru and as this is for a prod issue, so my time is very limited. Thanks in advance, touch BEFORE; ... find $wherever -newer ./BEFORE; will give you a list of files that have changed since the BEFORE file. If you are sure that the files are being created (vs. modified or accessed) by one specific userid then: find / -newer BEFORE -user id will work also. If you are going to run the thing regularly then take a look at find2p, which will spit out a perl script to match your find command. The perly code will give you finer control and better sanity checks (e.g., comparing to a list in memory of what has already been found to avoid dup's) than find can. enjoi. -- Steven Lembark 2930 W. Palmer Workhorse Computing Chicago, IL 60647 +1 800 762 1582 -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Steven Lembark INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Seefelt, Beth INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: Unix Script Quest : Urgent
Thanks, But I don't know the file or pid. Here's what we are doing: From an NT box, we are trying to run Sagent software to an Oracle db on unix sun solaris (both 64bit). When we try to refresh, we get a sagent error - OCI file not found. Of course it does not specifiy the file name. Using the same client, I can connect and run on my development box. Now, I know the username that Sagent connect to unix as, so I was hoping that I could run a trace on the Unix box based on the user name. But I am not finding a clear way to do this. I want to run the trace on the develpment box (the one that works), so that I can retrieve a list of filenames that the sagent process is hitting. Then I would want to compare the filenames to the directories on the prod bix to see what file is missing. Anyway, I am not seeing a clear way of doing this. I thinkg I'm going to wind up dumping the directories to file and doing a manual compare (ugh!) . Thanks, Hannah -Original Message- From: [EMAIL PROTECTED]@SUNGARD On Behalf Of Peter Barnett [EMAIL PROTECTED] Sent: Friday, August 09, 2002 11:48 AM To: Multiple recipients of list ORACLE-L Subject: Re: Unix Script Quest : Urgent ldd filename should give you the dependencies. -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: Unix Script Quest : Urgent
Hannah, I'm no Unix guru either but in this situation I use 'truss', e.g. truss procname HTH Chris -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]Sent: 09 August 2002 16:08To: Multiple recipients of list ORACLE-LSubject: Unix Script Quest : Urgent Is there a way to captureall files hit by a process/user in unix (Sun Solaris 9, ksh)? I am seeing an OCI file not found on my production box. I can't resovle it. So, I want to run the same process on my development box (where it works) and get a list of files that it is hitting (I can grep by username) for comparison in production. Only I am definitely NOT the Unix guru and as this is for a prod issue, so my time is very limited. Thanks in advance, Hannah
Re: Unix Script Quest : Urgent
Never say never. The output from truss shows all system calls; which includes file opens. Here is an interesting exercise for those on *nix boxes. From one window/session do the following ... $ sqlplus From a different window where you are logged onto the system as root find the pid (process ID) of the SQLPLUS process from 1st window. $ truss -p pid | tee /tmp/capture After the truss command has been initiated go back to the 1st window and enter a valid Oracle username/password to connect to the DB. In the window running the truss you'll see all the various login files which SQL*Plus attempts to open before returning control to the user presenting the SQL prompt. HTH YMMV HAND! Seefelt, Beth wrote: I think that will give you files that it successfully accessed, but not the ones that were referenced but not found. You can do what you're asking on VMS and NT, so it seems like there should be a way in Unix, although I asked my Unix SA's that same question a few years back and they said that there isn't. They were pretty sharp guys so I tend to believe them. -Original Message- Sent: Friday, August 09, 2002 11:33 AM To: Multiple recipients of list ORACLE-L Is there a way to capture all files hit by a process/user in unix (Sun Solaris 9, ksh)? I am seeing an OCI file not found on my production box. I can't resovle it. So, I want to run the same process on my development box (where it works) and get a list of files that it is hitting (I can grep by username) for comparison in production. Only I am definitely NOT the Unix guru and as this is for a prod issue, so my time is very limited. Thanks in advance, touch BEFORE; ... find $wherever -newer ./BEFORE; will give you a list of files that have changed since the BEFORE file. If you are sure that the files are being created (vs. modified or accessed) by one specific userid then: find / -newer BEFORE -user id will work also. If you are going to run the thing regularly then take a look at find2p, which will spit out a perl script to match your find command. The perly code will give you finer control and better sanity checks (e.g., comparing to a list in memory of what has already been found to avoid dup's) than find can. enjoi. -- Steven Lembark 2930 W. Palmer Workhorse Computing Chicago, IL 60647 +1 800 762 1582 -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Steven Lembark INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Seefelt, Beth INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Charlie Mengler Maintenance Warehouse [EMAIL PROTECTED] 10641 Scripps Summit Ct. 858-831-2229 San Diego, CA 92131 Lack of planning on your part doesn't constitute an emergency on my part! -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Charlie Mengler INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: Unix Script --- Archive Log Destination Issue
I have found doing a ps command for your job name alone is just asking for a world of pain, and very very unreliable for reasons that I will not go into here. I like to create a lock file as the following ksh example illustrates: JOB_LOCK=/tmp/${0##*/} if [ -f ${JOB_LOCK} ] then cat ${JOB_LOCK} | read v_LOCK_PID echo Found job lock pid ${v_LOCK_PID} if ps -ef | grep ${v_LOCK_PID} | grep -v grep | grep ${0##*/} /dev/null then echo Job lock pid ${v_LOCK_PID} is running exit fi echo Job lock pid ${v_LOCK_PID} not found, removing old job lock rm ${JOB_LOCK} fi v_LOCK_PID=${$} echo ${v_LOCK_PID} ${JOB_LOCK} echo Created job file lock . .the rest of your script goes here . rm ${JOB_LOCK} PS: I'm looking for a new TV, think you could get me a deal at BestBuy with your employee discount? Brian P. MacLean Oracle DBA, OCP8i Reddy, Madhusudana Madhusudana.Reddy@bTo: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] estbuy.com cc: Sent by:Subject: RE: Unix Script --- Archive Log Destination Issue [EMAIL PROTECTED] 05/13/02 10:48 AM Please respond to ORACLE-L My mistake , this new script is only working sometimes. Which is scheduled every hour , but not working at all the hour changes . -Original Message- Sent: Monday, May 13, 2002 11:28 AM To: Multiple recipients of list ORACLE-L Hello All, I have a script, which cleans up the archive log destination by moving the old archive logs to a retention area based on the thresholds 1. Percent of space utilization 2. greater than 2 days old. The script was working fine , except for the reason , sometimes we see multiple copies of the same. So I have added the following to code just to stop multiple copies. But now the script is not running at all and we did see more than 90% space utilization archive log destination. Here is the added code: # Exit If Already Running function ExitIfAlreadyRunning { copies=`ps -ef | grep OraProcessArch | grep $SID_NAME | grep -v grep | wc -l` if [ $copies -gt 2 ] then echo $(date) Number Of Copies Running : $copies exit 0 else return 0 fi } Any suggestions ??? I am not so good in using semaphores and all , looking for a simple solution if possible .. Thanks in advance, Madhu -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Reddy, Madhusudana INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Reddy, Madhusudana INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED
Unix Script --- Archive Log Destination Issue
Hello All, I have a script, which cleans up the archive log destination by moving the old archive logs to a retention area based on the thresholds 1. Percent of space utilization 2. greater than 2 days old. The script was working fine , except for the reason , sometimes we see multiple copies of the same. So I have added the following to code just to stop multiple copies. But now the script is not running at all and we did see more than 90% space utilization archive log destination. Here is the added code: # Exit If Already Running function ExitIfAlreadyRunning { copies=`ps -ef | grep OraProcessArch | grep $SID_NAME | grep -v grep | wc -l` if [ $copies -gt 2 ] then echo $(date) Number Of Copies Running : $copies exit 0 else return 0 fi } Any suggestions ??? I am not so good in using semaphores and all , looking for a simple solution if possible .. Thanks in advance, Madhu -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Reddy, Madhusudana INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: Unix Script --- Archive Log Destination Issue
My mistake , this new script is only working sometimes. Which is scheduled every hour , but not working at all the hour changes . -Original Message- Sent: Monday, May 13, 2002 11:28 AM To: Multiple recipients of list ORACLE-L Hello All, I have a script, which cleans up the archive log destination by moving the old archive logs to a retention area based on the thresholds 1. Percent of space utilization 2. greater than 2 days old. The script was working fine , except for the reason , sometimes we see multiple copies of the same. So I have added the following to code just to stop multiple copies. But now the script is not running at all and we did see more than 90% space utilization archive log destination. Here is the added code: # Exit If Already Running function ExitIfAlreadyRunning { copies=`ps -ef | grep OraProcessArch | grep $SID_NAME | grep -v grep | wc -l` if [ $copies -gt 2 ] then echo $(date) Number Of Copies Running : $copies exit 0 else return 0 fi } Any suggestions ??? I am not so good in using semaphores and all , looking for a simple solution if possible .. Thanks in advance, Madhu -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Reddy, Madhusudana INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Reddy, Madhusudana INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Does any one know how to call LDAP from UNIX script ?
Hello: Hope the subject make sense. I'm new to LDAP, and don't know how it works. I need to use SQL Loader to load a text file into Oracle817 Database from a unix box. The file/data comes from LDAP server. My question is: how do I get the file/object from LDAP site from my unix script? Does anyone has any examples? or know a helpful URL? Thanks From Steven __ Do You Yahoo!? Yahoo! Health - your guide to health and wellness http://health.yahoo.com -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Steven Joshua INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Does any one know how to call LDAP from UNIX script ?
Hello: Hope the subject make sense. I'm new to LDAP, and don't know how it works. I need to use SQL Loader to load a text file into Oracle817 Database from a unix box. The file/data comes from LDAP server. My question is: how do I get the file/object from LDAP site from my unix script? Does anyone has any examples? or know a helpful URL? Thanks From Steven __ Do You Yahoo!? Yahoo! Health - your guide to health and wellness http://health.yahoo.com -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Steven Joshua INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: Does any one know how to call LDAP from UNIX script ?
I hope you can read UGLY Perl code. HTH YMMV! #!/usr/local/bin/perl # File: chg-oracle-passwd.cgi use Net::LDAP; use Carp; use DBI; $ENV{ORACLE_HOME} = /db02/app/oracle/product/8.1.6; print Content-type: text/html\n\n; print HTML\n\nBODY\n\n; #print METHOD = $ENV{'REQUEST_METHOD'}\n; if ($ENV{'REQUEST_METHOD'} eq 'GET') { $form_info = $ENV{'QUERY_STRING'}; } elsif ($ENV{'REQUEST_METHOD'} eq 'POST') { $form_info = ''; $bytes = $ENV{'CONTENT_LENGTH'}; read (STDIN, $form_info, $bytes); } @pairs = split(//, $form_info); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack(C, hex($1))/eg; if ($name eq UNAME) { $istring = $value; } if ($name eq PWORD) { $passwd = $value; } if ($name eq DATABASE) { $dbase = $value; } } # my ($ldap, $res, $code); $mypasswd = $passwd; $myuid= $istring; $ldap = Net::LDAP-new('ldap.mwh.com:389') || die $@; $mesg = $ldap-bind('cn=Directory Manager') || die(failed to bind with , $mesg-code(),\n); $res = $ldap-search ( base = ou=People,o=mwh.com, filter = (uid=$myuid ) (!(objectclass=alias)), attrs = [] ) || die; $code = $res-code; $cnt = $res-count; #print After 1st LDAP call using $myuid with results = $codebr\n; #die User $myuid not found if $code || $res-count != 1; if ( $code == 1 || $cnt == 1 ) { $valid_username = 1; #print code equal to $code and count = $cnt br\n; my $entry = $res-entry(0); $res = $ldap-bind(dn = $entry-dn, password = $mypasswd) or die; $code = $res-code; #print LDAP return value = $code \n; #die Login failed if $code; if ( $code != 0 ) { $pwmatch = 0; } else { $pwmatch = 1; } #$mesg = $ldap-search #print mesg is $mesgbr; } else { $valid_username = 0; $pwmatch = 0; #print invalid username br; } $ldap-unbind; Steven Joshua wrote: Hello: Hope the subject make sense. I'm new to LDAP, and don't know how it works. I need to use SQL Loader to load a text file into Oracle817 Database from a unix box. The file/data comes from LDAP server. My question is: how do I get the file/object from LDAP site from my unix script? Does anyone has any examples? or know a helpful URL? Thanks From Steven __ Do You Yahoo!? Yahoo! Health - your guide to health and wellness http://health.yahoo.com -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Steven Joshua INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Charlie Mengler Maintenance Warehouse [EMAIL PROTECTED] 10641 Scripps Summit Ct. 858-831-2229 San Diego, CA 92131 Am I sure? Of course I'm sure. I could be wrong, but I'm sure for now! -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Charlie Mengler INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: Does any one know how to call LDAP from UNIX script ?
You need to do an LDIF export, using the LDAP export tool that came with your LDAP server -- the tools differ between servers. Or you could write your own using one of the Perl LDAP modules. -Joe --- Steven Joshua [EMAIL PROTECTED] wrote: Hello: Hope the subject make sense. I'm new to LDAP, and don't know how it works. I need to use SQL Loader to load a text file into Oracle817 Database from a unix box. The file/data comes from LDAP server. My question is: how do I get the file/object from LDAP site from my unix script? Does anyone has any examples? or know a helpful URL? Thanks From Steven __ Do You Yahoo!? Yahoo! Health - your guide to health and wellness http://health.yahoo.com -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Steven Joshua INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). __ Do You Yahoo!? Yahoo! Health - your guide to health and wellness http://health.yahoo.com -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Joe Raube INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: Does any one know how to call LDAP from UNIX script ?
Interesting, Charlie! By the name of this script, I assume it's used to change your Oracle password, but it's not searching against OiD, unless you've manually added the Directory Manager cn. Are you using iPlanet? Are your Oracle clients authenticating against this LDAP server? Or for Oracle names resolution? Very interesting. Especially since Oracle Support now balks at every mention of a non-OiD LDAP server for Oracle lookups. And the stupid netca (Net Config Assist) is the only supported method of creating an Oracle Context in LDAP (in order to use OiD for Oracle names resolution). Of course it only takes a little work to create the correct LDIFs to create your own Oracle Context in iPlanet... :D soapbox The reason I'm asking is because OID IS A PAIN. Even v3. Documentation is horrible, replication is a bear, and OiD is not LDAP. From a co-worker who has setup iPlanet in-house, it looks like Oracle's gone off on their own to try and change the loose LDAP standard. This gets to be a pain when you're trying to debug an LDAP problem, but since Oracle's moved the location of LDAP attributes, for example, you can't readily use widely available LDAP documentation and examples to troubleshoot. You must use Oracle Support. That's fine, but I don't want to have to log another 25 TARs to get answers to what should be simple questions. /soapbox Ah...that felt good. Rich Jesse System/Database Administrator [EMAIL PROTECTED] Quad/Tech International, Sussex, WI USA -Original Message- From: Charlie Mengler [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 02, 2002 3:54 PM To: Multiple recipients of list ORACLE-L Subject: Re: Does any one know how to call LDAP from UNIX script ? I hope you can read UGLY Perl code. HTH YMMV! #!/usr/local/bin/perl # File: chg-oracle-passwd.cgi use Net::LDAP; use Carp; use DBI; [truncated for brevity] -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Jesse, Rich INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: Does any one know how to call LDAP from UNIX script ?
Thanks for the code. But can we do this in UNIX shell script or Java? Thanks again Steven --- Charlie Mengler [EMAIL PROTECTED] wrote: I hope you can read UGLY Perl code. HTH YMMV! #!/usr/local/bin/perl # File: chg-oracle-passwd.cgi use Net::LDAP; use Carp; use DBI; $ENV{ORACLE_HOME} = /db02/app/oracle/product/8.1.6; print Content-type: text/html\n\n; print HTML\n\nBODY\n\n; #print METHOD = $ENV{'REQUEST_METHOD'}\n; if ($ENV{'REQUEST_METHOD'} eq 'GET') { $form_info = $ENV{'QUERY_STRING'}; } elsif ($ENV{'REQUEST_METHOD'} eq 'POST') { $form_info = ''; $bytes = $ENV{'CONTENT_LENGTH'}; read (STDIN, $form_info, $bytes); } @pairs = split(//, $form_info); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack(C, hex($1))/eg; if ($name eq UNAME) { $istring = $value; } if ($name eq PWORD) { $passwd = $value; } if ($name eq DATABASE) { $dbase = $value; } } # my ($ldap, $res, $code); $mypasswd = $passwd; $myuid= $istring; $ldap = Net::LDAP-new('ldap.mwh.com:389') || die $@; $mesg = $ldap-bind('cn=Directory Manager') || die(failed to bind with , $mesg-code(),\n); $res = $ldap-search ( base = ou=People,o=mwh.com, filter = (uid=$myuid ) (!(objectclass=alias)), attrs = [] ) || die; $code = $res-code; $cnt = $res-count; #print After 1st LDAP call using $myuid with results = $codebr\n; #die User $myuid not found if $code || $res-count != 1; if ( $code == 1 || $cnt == 1 ) { $valid_username = 1; #print code equal to $code and count = $cnt br\n; my $entry = $res-entry(0); $res = $ldap-bind(dn = $entry-dn, password = $mypasswd) or die; $code = $res-code; #print LDAP return value = $code \n; #die Login failed if $code; if ( $code != 0 ) { $pwmatch = 0; } else { $pwmatch = 1; } #$mesg = $ldap-search #print mesg is $mesgbr; } else { $valid_username = 0; $pwmatch = 0; #print invalid username br; } $ldap-unbind; Steven Joshua wrote: Hello: Hope the subject make sense. I'm new to LDAP, and don't know how it works. I need to use SQL Loader to load a text file into Oracle817 Database from a unix box. The file/data comes from LDAP server. My question is: how do I get the file/object from LDAP site from my unix script? Does anyone has any examples? or know a helpful URL? Thanks From Steven __ Do You Yahoo!? Yahoo! Health - your guide to health and wellness http://health.yahoo.com -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Steven Joshua INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Charlie Mengler Maintenance Warehouse [EMAIL PROTECTED] 10641 Scripps Summit Ct. 858-831-2229 San Diego, CA 92131 Am I sure? Of course I'm sure. I could be wrong, but I'm sure for now! -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Charlie Mengler INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). __ Do You Yahoo!? Yahoo! Health - your guide to health and wellness http://health.yahoo.com -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Steven Joshua INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include
Re: Does any one know how to call LDAP from UNIX script ?
Yes, you'd need the LDAP API libraries, check here http://www.openldap.org/ Steven Joshua wrote: Thanks for the code. But can we do this in UNIX shell script or Java? Thanks again Steven --- Charlie Mengler [EMAIL PROTECTED] wrote: I hope you can read UGLY Perl code. HTH YMMV! #!/usr/local/bin/perl # File: chg-oracle-passwd.cgi use Net::LDAP; use Carp; use DBI; $ENV{ORACLE_HOME} = /db02/app/oracle/product/8.1.6; print Content-type: text/html\n\n; print HTML\n\nBODY\n\n; #print METHOD = $ENV{'REQUEST_METHOD'}\n; if ($ENV{'REQUEST_METHOD'} eq 'GET') { $form_info = $ENV{'QUERY_STRING'}; } elsif ($ENV{'REQUEST_METHOD'} eq 'POST') { $form_info = ''; $bytes = $ENV{'CONTENT_LENGTH'}; read (STDIN, $form_info, $bytes); } @pairs = split(//, $form_info); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack(C, hex($1))/eg; if ($name eq UNAME) { $istring = $value; } if ($name eq PWORD) { $passwd = $value; } if ($name eq DATABASE) { $dbase = $value; } } # my ($ldap, $res, $code); $mypasswd = $passwd; $myuid= $istring; $ldap = Net::LDAP-new('ldap.mwh.com:389') || die $@; $mesg = $ldap-bind('cn=Directory Manager') || die(failed to bind with , $mesg-code(),\n); $res = $ldap-search ( base = ou=People,o=mwh.com, filter = (uid=$myuid ) (!(objectclass=alias)), attrs = [] ) || die; $code = $res-code; $cnt = $res-count; #print After 1st LDAP call using $myuid with results = $codebr\n; #die User $myuid not found if $code || $res-count != 1; if ( $code == 1 || $cnt == 1 ) { $valid_username = 1; #print code equal to $code and count = $cnt br\n; my $entry = $res-entry(0); $res = $ldap-bind(dn = $entry-dn, password = $mypasswd) or die; $code = $res-code; #print LDAP return value = $code \n; #die Login failed if $code; if ( $code != 0 ) { $pwmatch = 0; } else { $pwmatch = 1; } #$mesg = $ldap-search #print mesg is $mesgbr; } else { $valid_username = 0; $pwmatch = 0; #print invalid username br; } $ldap-unbind; Steven Joshua wrote: Hello: Hope the subject make sense. I'm new to LDAP, and don't know how it works. I need to use SQL Loader to load a text file into Oracle817 Database from a unix box. The file/data comes from LDAP server. My question is: how do I get the file/object from LDAP site from my unix script? Does anyone has any examples? or know a helpful URL? Thanks From Steven __ Do You Yahoo!? Yahoo! Health - your guide to health and wellness http://health.yahoo.com -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Steven Joshua INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Charlie Mengler Maintenance Warehouse [EMAIL PROTECTED] 10641 Scripps Summit Ct. 858-831-2229 San Diego, CA 92131 Am I sure? Of course I'm sure. I could be wrong, but I'm sure for now! -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Charlie Mengler INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). __ Do You Yahoo!? Yahoo! Health - your guide to health and wellness http://health.yahoo.com -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Steven Joshua INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access
RE: Does any one know how to call LDAP from UNIX script ?
Are you kidding? Charlie goes through the trouble of sending this to you and the list and you ask for it in a different language? Jump in, learn something new. It's fun in here. Lisa Koivu Oracle Database Baby Oven Fairfield Resorts, Inc. 5259 Coconut Creek Parkway Ft. Lauderdale, FL, USA 33063 -Original Message- From: Steven Joshua [SMTP:[EMAIL PROTECTED]] Sent: Thursday, May 02, 2002 6:17 PM To: Multiple recipients of list ORACLE-L Subject: Re: Does any one know how to call LDAP from UNIX script ? Thanks for the code. But can we do this in UNIX shell script or Java? Thanks again Steven --- Charlie Mengler [EMAIL PROTECTED] wrote: I hope you can read UGLY Perl code. HTH YMMV! #!/usr/local/bin/perl # File: chg-oracle-passwd.cgi use Net::LDAP; use Carp; use DBI; $ENV{ORACLE_HOME} = /db02/app/oracle/product/8.1.6; print Content-type: text/html\n\n; print HTML\n\nBODY\n\n; #print METHOD = $ENV{'REQUEST_METHOD'}\n; if ($ENV{'REQUEST_METHOD'} eq 'GET') { $form_info = $ENV{'QUERY_STRING'}; } elsif ($ENV{'REQUEST_METHOD'} eq 'POST') { $form_info = ''; $bytes = $ENV{'CONTENT_LENGTH'}; read (STDIN, $form_info, $bytes); } @pairs = split(//, $form_info); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack(C, hex($1))/eg; if ($name eq UNAME) { $istring = $value; } if ($name eq PWORD) { $passwd = $value; } if ($name eq DATABASE) { $dbase = $value; } } # my ($ldap, $res, $code); $mypasswd = $passwd; $myuid= $istring; $ldap = Net::LDAP-new('ldap.mwh.com:389') || die $@; $mesg = $ldap-bind('cn=Directory Manager') || die(failed to bind with , $mesg-code(),\n); $res = $ldap-search ( base = ou=People,o=mwh.com, filter = (uid=$myuid ) (!(objectclass=alias)), attrs = [] ) || die; $code = $res-code; $cnt = $res-count; #print After 1st LDAP call using $myuid with results = $codebr\n; #die User $myuid not found if $code || $res-count != 1; if ( $code == 1 || $cnt == 1 ) { $valid_username = 1; #print code equal to $code and count = $cnt br\n; my $entry = $res-entry(0); $res = $ldap-bind(dn = $entry-dn, password = $mypasswd) or die; $code = $res-code; #print LDAP return value = $code \n; #die Login failed if $code; if ( $code != 0 ) { $pwmatch = 0; } else { $pwmatch = 1; } #$mesg = $ldap-search #print mesg is $mesgbr; } else { $valid_username = 0; $pwmatch = 0; #print invalid username br; } $ldap-unbind; Steven Joshua wrote: Hello: Hope the subject make sense. I'm new to LDAP, and don't know how it works. I need to use SQL Loader to load a text file into Oracle817 Database from a unix box. The file/data comes from LDAP server. My question is: how do I get the file/object from LDAP site from my unix script? Does anyone has any examples? or know a helpful URL? Thanks From Steven __ Do You Yahoo!? Yahoo! Health - your guide to health and wellness http://health.yahoo.com -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Steven Joshua INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Charlie Mengler Maintenance Warehouse [EMAIL PROTECTED] 10641 Scripps Summit Ct. 858-831-2229 San Diego, CA 92131 Am I sure? Of course I'm sure. I could be wrong, but I'm sure for now! -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Charlie Mengler INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed
Re: Does any one know how to call LDAP from UNIX script ?
Here are a few more resources: http://www.umich.edu/~dirsvcs/ldap/ldclients.html (you could download the client for Unix and use those libraries in shell) http://www.mozilla.org/directory/standards.html Suzy Vordos wrote: Yes, you'd need the LDAP API libraries, check here http://www.openldap.org/ Steven Joshua wrote: Thanks for the code. But can we do this in UNIX shell script or Java? Thanks again Steven --- Charlie Mengler [EMAIL PROTECTED] wrote: I hope you can read UGLY Perl code. HTH YMMV! #!/usr/local/bin/perl # File: chg-oracle-passwd.cgi use Net::LDAP; use Carp; use DBI; $ENV{ORACLE_HOME} = /db02/app/oracle/product/8.1.6; print Content-type: text/html\n\n; print HTML\n\nBODY\n\n; #print METHOD = $ENV{'REQUEST_METHOD'}\n; if ($ENV{'REQUEST_METHOD'} eq 'GET') { $form_info = $ENV{'QUERY_STRING'}; } elsif ($ENV{'REQUEST_METHOD'} eq 'POST') { $form_info = ''; $bytes = $ENV{'CONTENT_LENGTH'}; read (STDIN, $form_info, $bytes); } @pairs = split(//, $form_info); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack(C, hex($1))/eg; if ($name eq UNAME) { $istring = $value; } if ($name eq PWORD) { $passwd = $value; } if ($name eq DATABASE) { $dbase = $value; } } # my ($ldap, $res, $code); $mypasswd = $passwd; $myuid= $istring; $ldap = Net::LDAP-new('ldap.mwh.com:389') || die $@; $mesg = $ldap-bind('cn=Directory Manager') || die(failed to bind with , $mesg-code(),\n); $res = $ldap-search ( base = ou=People,o=mwh.com, filter = (uid=$myuid ) (!(objectclass=alias)), attrs = [] ) || die; $code = $res-code; $cnt = $res-count; #print After 1st LDAP call using $myuid with results = $codebr\n; #die User $myuid not found if $code || $res-count != 1; if ( $code == 1 || $cnt == 1 ) { $valid_username = 1; #print code equal to $code and count = $cnt br\n; my $entry = $res-entry(0); $res = $ldap-bind(dn = $entry-dn, password = $mypasswd) or die; $code = $res-code; #print LDAP return value = $code \n; #die Login failed if $code; if ( $code != 0 ) { $pwmatch = 0; } else { $pwmatch = 1; } #$mesg = $ldap-search #print mesg is $mesgbr; } else { $valid_username = 0; $pwmatch = 0; #print invalid username br; } $ldap-unbind; Steven Joshua wrote: Hello: Hope the subject make sense. I'm new to LDAP, and don't know how it works. I need to use SQL Loader to load a text file into Oracle817 Database from a unix box. The file/data comes from LDAP server. My question is: how do I get the file/object from LDAP site from my unix script? Does anyone has any examples? or know a helpful URL? Thanks From Steven __ Do You Yahoo!? Yahoo! Health - your guide to health and wellness http://health.yahoo.com -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Steven Joshua INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Charlie Mengler Maintenance Warehouse [EMAIL PROTECTED] 10641 Scripps Summit Ct. 858-831-2229 San Diego, CA 92131 Am I sure? Of course I'm sure. I could be wrong, but I'm sure for now! -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Charlie Mengler INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like
RE: Does any one know how to call LDAP from UNIX script ?
I'm very very appreciate call the helps I get here. Just have to listen to the users also. Thanks --- Koivu, Lisa [EMAIL PROTECTED] wrote: Are you kidding? Charlie goes through the trouble of sending this to you and the list and you ask for it in a different language? Jump in, learn something new. It's fun in here. Lisa Koivu Oracle Database Baby Oven Fairfield Resorts, Inc. 5259 Coconut Creek Parkway Ft. Lauderdale, FL, USA 33063 -Original Message- From: Steven Joshua [SMTP:[EMAIL PROTECTED]] Sent: Thursday, May 02, 2002 6:17 PM To: Multiple recipients of list ORACLE-L Subject:Re: Does any one know how to call LDAP from UNIX script ? Thanks for the code. But can we do this in UNIX shell script or Java? Thanks again Steven --- Charlie Mengler [EMAIL PROTECTED] wrote: I hope you can read UGLY Perl code. HTH YMMV! #!/usr/local/bin/perl # File: chg-oracle-passwd.cgi use Net::LDAP; use Carp; use DBI; $ENV{ORACLE_HOME} = /db02/app/oracle/product/8.1.6; print Content-type: text/html\n\n; print HTML\n\nBODY\n\n; #print METHOD = $ENV{'REQUEST_METHOD'}\n; if ($ENV{'REQUEST_METHOD'} eq 'GET') { $form_info = $ENV{'QUERY_STRING'}; } elsif ($ENV{'REQUEST_METHOD'} eq 'POST') { $form_info = ''; $bytes = $ENV{'CONTENT_LENGTH'}; read (STDIN, $form_info, $bytes); } @pairs = split(//, $form_info); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack(C, hex($1))/eg; if ($name eq UNAME) { $istring = $value; } if ($name eq PWORD) { $passwd = $value; } if ($name eq DATABASE) { $dbase = $value; } } # my ($ldap, $res, $code); $mypasswd = $passwd; $myuid= $istring; $ldap = Net::LDAP-new('ldap.mwh.com:389') || die $@; $mesg = $ldap-bind('cn=Directory Manager') || die(failed to bind with , $mesg-code(),\n); $res = $ldap-search ( base = ou=People,o=mwh.com, filter = (uid=$myuid ) (!(objectclass=alias)), attrs = [] ) || die; $code = $res-code; $cnt = $res-count; #print After 1st LDAP call using $myuid with results = $codebr\n; #die User $myuid not found if $code || $res-count != 1; if ( $code == 1 || $cnt == 1 ) { $valid_username = 1; #print code equal to $code and count = $cnt br\n; my $entry = $res-entry(0); $res = $ldap-bind(dn = $entry-dn, password = $mypasswd) or die; $code = $res-code; #print LDAP return value = $code \n; #die Login failed if $code; if ( $code != 0 ) { $pwmatch = 0; } else { $pwmatch = 1; } #$mesg = $ldap-search #print mesg is $mesgbr; } else { $valid_username = 0; $pwmatch = 0; #print invalid username br; } $ldap-unbind; Steven Joshua wrote: Hello: Hope the subject make sense. I'm new to LDAP, and don't know how it works. I need to use SQL Loader to load a text file into Oracle817 Database from a unix box. The file/data comes from LDAP server. My question is: how do I get the file/object from LDAP site from my unix script? Does anyone has any examples? or know a helpful URL? Thanks From Steven __ Do You Yahoo!? Yahoo! Health - your guide to health and wellness http://health.yahoo.com -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Steven Joshua INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Charlie Mengler Maintenance Warehouse [EMAIL PROTECTED] 10641 Scripps Summit Ct. 858-831-2229 San Diego, CA 92131 Am I sure? Of course I'm sure. I could be wrong, but I'm sure for now! -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Charlie Mengler INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public
Re: Unix script
Still room for improvement but enough changes to keep you busy for awhile. Please note that I changed the script to use ksh shell (required by several of the commands I added) and the exec command that will redirect all script text output to a common file so that you don't have to redeclare the output file with each tail and echo command. Have fun.. #!/bin/ksh JOB_LOG=/d31/appl/konto/log/laddabilbo.txt exec 1${JOB_LOG} 21 . /usr/bin/orasetup.sh . /d31/appl/konto/bat/movefiles.sh STATUS=0 echo ### echo #Starting ${0##*/} at $(date) echo # sqlldr userid=konto/icakort control=/d31/appl/konto/bat/ehbgrupp.ctl log=/d31/appl/konto/log/ehbgrupp.log STATUS=$((${STATUS} + ${?})) sqlldr userid=konto/icakort control=/d31/appl/konto/bat/kampanj.ctl log=/d31/appl/konto/log/kampanj.log STATUS=$((${STATUS} + ${?})) sqlldr userid=konto/icakort control=/d31/appl/konto/bat/mxurval.ctl log=/d31/appl/konto/log/mxurval.log STATUS=$((${STATUS} + ${?})) sqlldr userid=konto/icakort control=/d31/appl/konto/bat/load_arg.ctl log=/d31/appl/konto/log/load_arg.log STATUS=$((${STATUS} + ${?})) sqlldr userid=konto/icakort control=/d31/appl/konto/bat/laddabsg.ctl log=/d31/appl/konto/log/laddabsg.log STATUS=$((${STATUS} + ${?})) sqlplus -s konto/icakort ! whenever sqlerror exit 1 set heading off set verify off set feedback off set termout off set pages 0 begin konto.fillbilbotables.anrop; END; / EXIT ! STATUS=$((${STATUS} + ${?})) echo -- echo ehbgrupp status tail -11 /d31/appl/konto/log/ehbgrupp.log echo -- echo -- echo kampanj status tail -11 /d31/appl/konto/log/kampanj.log echo -- echo -- echo mxurval status tail -11 /d31/appl/konto/log/mxurval.log echo -- echo -- echo load_arg status tail -11 /d31/appl/konto/log/load_arg.log echo -- echo -- echo laddabsg status tail -11 /d31/appl/konto/log/laddabsg.log echo -- echo Jobb klart! :\c date v_error_sum=0 egrep Total logical records skipped|Total logical records rejected|Total logical records discarded \ /d31/appl/konto/log/ehbgrupp.log /d31/appl/konto/log/kampanj.log /d31/appl/konto/log/mxurval.log \ /d31/appl/konto/log/load_arg.log /d31/appl/konto/log/laddabsg.log | cut -d: -f2 | while read v_error_number do v_error_sum=$((${v_error_sum} + ${v_error_number})) done if [ ${v_error_sum} -gt 0 ] then STATUS=$((${STATUS} + 1)) fi echo # echo #Job run time was: $((${SECONDS} / 3600)) hours, $(((${SECONDS} % 3600) / 60)) minutes, $((${SECONDS} % 60)) seconds echo # echo #Ending ${0##*/} at $(date) with an exit status of ${1} echo ### if [ ${STATUS} -gt 0 ] then cat /d31/appl/konto/log/laddabilbo.txt \ | mailx -s Konto - Statusrapport [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] fi # # END-OF-SCRIPT ### Brian P. MacLean Oracle DBA, OCP8i Roland.Skoldbl [EMAIL PROTECTED]To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] Sent by: cc: [EMAIL PROTECTED] Subject: Unix script om 04/15/02 11:43 PM Please respond to ORACLE-L
Re: Unix script
Oops. The line echo #Ending ${0##*/} at $(date) with an exit status of ${1} should have been echo #Ending ${0##*/} at $(date) with an exit status of ${STATUS} Brian P MacLean To: [EMAIL PROTECTED] cc: [EMAIL PROTECTED] 04/16/02 09:06 Subject: Re: Unix script(Document link: Brian P MacLean) AM Still room for improvement but enough changes to keep you busy for awhile. Please note that I changed the script to use ksh shell (required by several of the commands I added) and the exec command that will redirect all script text output to a common file so that you don't have to redeclare the output file with each tail and echo command. Have fun.. #!/bin/ksh JOB_LOG=/d31/appl/konto/log/laddabilbo.txt exec 1${JOB_LOG} 21 . /usr/bin/orasetup.sh . /d31/appl/konto/bat/movefiles.sh STATUS=0 echo ### echo #Starting ${0##*/} at $(date) echo # sqlldr userid=konto/icakort control=/d31/appl/konto/bat/ehbgrupp.ctl log=/d31/appl/konto/log/ehbgrupp.log STATUS=$((${STATUS} + ${?})) sqlldr userid=konto/icakort control=/d31/appl/konto/bat/kampanj.ctl log=/d31/appl/konto/log/kampanj.log STATUS=$((${STATUS} + ${?})) sqlldr userid=konto/icakort control=/d31/appl/konto/bat/mxurval.ctl log=/d31/appl/konto/log/mxurval.log STATUS=$((${STATUS} + ${?})) sqlldr userid=konto/icakort control=/d31/appl/konto/bat/load_arg.ctl log=/d31/appl/konto/log/load_arg.log STATUS=$((${STATUS} + ${?})) sqlldr userid=konto/icakort control=/d31/appl/konto/bat/laddabsg.ctl log=/d31/appl/konto/log/laddabsg.log STATUS=$((${STATUS} + ${?})) sqlplus -s konto/icakort ! whenever sqlerror exit 1 set heading off set verify off set feedback off set termout off set pages 0 begin konto.fillbilbotables.anrop; END; / EXIT ! STATUS=$((${STATUS} + ${?})) echo -- echo ehbgrupp status tail -11 /d31/appl/konto/log/ehbgrupp.log echo -- echo -- echo kampanj status tail -11 /d31/appl/konto/log/kampanj.log echo -- echo -- echo mxurval status tail -11 /d31/appl/konto/log/mxurval.log echo -- echo -- echo load_arg status tail -11 /d31/appl/konto/log/load_arg.log echo -- echo -- echo laddabsg status tail -11 /d31/appl/konto/log/laddabsg.log echo -- echo Jobb klart! :\c date v_error_sum=0 egrep Total logical records skipped|Total logical records rejected|Total logical records discarded \ /d31/appl/konto/log/ehbgrupp.log /d31/appl/konto/log/kampanj.log /d31/appl/konto/log/mxurval.log \ /d31/appl/konto/log/load_arg.log /d31/appl/konto/log/laddabsg.log | cut -d: -f2 | while read v_error_number do v_error_sum=$((${v_error_sum} + ${v_error_number})) done if [ ${v_error_sum} -gt 0 ] then STATUS=$((${STATUS} + 1)) fi echo # echo #Job run time was: $((${SECONDS} / 3600)) hours, $(((${SECONDS} % 3600) / 60)) minutes, $((${SECONDS} % 60)) seconds echo # echo #Ending ${0##*/} at $(date) with an exit status of ${1} echo ### if [ ${STATUS} -gt 0 ] then cat /d31/appl/konto/log/laddabilbo.txt \ | mailx -s Konto - Statusrapport [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] fi # # END-OF-SCRIPT ### Brian P. MacLean Oracle DBA, OCP8i Roland.Skoldbl [EMAIL PROTECTED]To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] Sent
Unix script
Hallo, I have this unix script, please tell me how to change it so it also does the following: (See attached file: laddabilbo.sh) counts the time between start time and end time of the process(I mean time difference between Jobb startat(Job started) and Job Klart(Job Finished). IThis log file is also sent by mail to people. I would like this log file only to be sent if there is anything wrong with the script(for instance if the database is down) So if the script goes fine, then no email will be sent. The log file looks like this: Jobb startat :Sun Apr 14 18:06:23 MEST 2002 -- ehbgrupp status Total logical records skipped: 0 Total logical records read: 400 Total logical records rejected: 0 Total logical records discarded:0 Run began on Sun Apr 14 18:06:23 2002 Run ended on Sun Apr 14 18:11:51 2002 Elapsed time was: 00:05:28.15 CPU time was: 00:00:00.07 (Ma -- -- kampanj status Total logical records skipped: 0 Total logical records read:13 Total logical records rejected: 0 Total logical records discarded:0 Run began on Sun Apr 14 18:11:51 2002 Run ended on Sun Apr 14 18:12:44 2002 Elapsed time was: 00:00:52.52 CPU time was: 00:00:00.04 (Ma -- -- mxurval status Total logical records skipped: 0 Total logical records read: 4829 Total logical records rejected: 0 Total logical records discarded:0 Run began on Sun Apr 14 18:12:44 2002 Run ended on Sun Apr 14 18:12:50 2002 Elapsed time was: 00:00:05.90 CPU time was: 00:00:00.18 (Ma -- -- load_arg status Total logical records skipped: 0 Total logical records read:151613 Total logical records rejected: 0 Total logical records discarded:0 Run began on Sun Apr 14 18:12:50 2002 Run ended on Sun Apr 14 18:28:11 2002 Elapsed time was: 00:15:20.92 CPU time was: 00:00:25.07 (Ma -- -- laddabsg status Total logical records skipped: 0 Total logical records read: 92326 Total logical records rejected: 0 Total logical records discarded:0 Run began on Sun Apr 14 18:28:11 2002 Run ended on Sun Apr 14 18:40:15 2002 Elapsed time was: 00:12:03.95 CPU time was: 00:00:32.17 (Ma -- Jobb klart! :Sun Apr 14 18:49:23 MEST 2002 I would really appreciate help. Thanks in advance Roland laddabilbo.sh Description: Binary data
Help in unix script
Greetings all, I need to do the following unix top -b -U norad PID USERNAME THR PRI NICE SIZE RES STATE TIMECPU COMMAND 12733 norad 1 602 3936K 3392K run 0:05 7.21% dbganlz 12747 norad 4 522 13M 10M sleep 0:05 4.20% dbgora 12721 norad 1 532 3160K 2584K sleep 0:00 0.12% dbgsam 12726 norad 1 522 3184K 2416K sleep 0:00 0.02% dbgalert 12740 norad 1 532 2992K 2128K sleep 0:00 0.02% dbgrepos 12594 norad 1 590 3200K 2544K sleep 0:00 0.01% dbgsam 12606 norad 1 590 4696K 4160K sleep 0:11 0.00% dbganlz 12620 norad 4 590 42M 13M sleep 0:06 0.00% dbgora 12599 norad 1 580 3216K 2400K sleep 0:00 0.00% dbgalert 12613 norad 1 590 3016K 2112K sleep 0:00 0.00% dbgrepos I have to check the last character of SIZE column. If the size is in M(megabyte) then check if the value is 40 then send an e-mail with the COMMAND name and the size. Something like dbgora has a size of 42M I was trying the following script. But I am not sure how to get the last character of SIZE column from the above output and compare with 'M' and then compare with the value. top -b -U norad | grep norad | awk '{ print $6, $11 }' | \ while read SIZE COMMAND do echo Command : $COMMAND Size : $SIZE done Any suggestions will be appreciated. Thanks, Ashoke -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Mandal, Ashoke INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: Help in unix script
Oops, forgot the mail part. change: echo Greater than ${MAX} - ${SIZE}:${COMMAND} to: echo Process ${COMMAND} is above the ${MAX}M max size, currently ${SIZE} | mailx -s bad boy [EMAIL PROTECTED] Brian P MacLean To: [EMAIL PROTECTED] cc: [EMAIL PROTECTED] 03/28/02 11:05 Subject: Re: Help in unix script(Document link: Brian P MacLean) AM #!/bin/ksh MAX=40 top -b -U norad | grep norad | awk '{ print $6, $11 }' | \ while read SIZE COMMAND do #echo working with ${SIZE}:${COMMAND}#DEBUG WORK=${SIZE#*M} #echo 1-${WORK} #DEBUG if [[ ${#WORK} -eq 0 ]] then WORK=${SIZE%%M} #echo 2-${WORK} #DEBUG if [[ ${WORK} -ge ${MAX} ]] then echo Greater than ${MAX} - ${SIZE}:${COMMAND} fi fi done Brian P. MacLean Oracle DBA, OCP8i Mandal, Ashoke ashoke.k.mandal@medt To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] ronic.com cc: Sent by:Subject: Help in unix script [EMAIL PROTECTED] 03/28/02 09:28 AM Please respond to ORACLE-L Greetings all, I need to do the following unix top -b -U norad PID USERNAME THR PRI NICE SIZE RES STATE TIMECPU COMMAND 12733 norad 1 602 3936K 3392K run 0:05 7.21% dbganlz 12747 norad 4 522 13M 10M sleep 0:05 4.20% dbgora 12721 norad 1 532 3160K 2584K sleep 0:00 0.12% dbgsam 12726 norad 1 522 3184K 2416K sleep 0:00 0.02% dbgalert 12740 norad 1 532 2992K 2128K sleep 0:00 0.02% dbgrepos 12594 norad 1 590 3200K 2544K sleep 0:00 0.01% dbgsam 12606 norad 1 590 4696K 4160K sleep 0:11 0.00% dbganlz 12620 norad 4 590 42M 13M sleep 0:06 0.00% dbgora 12599 norad 1 580 3216K 2400K sleep 0:00 0.00% dbgalert 12613 norad 1 590 3016K 2112K sleep 0:00 0.00% dbgrepos I have to check the last character of SIZE column. If the size is in M(megabyte) then check if the value is 40 then send an e-mail with the COMMAND name and the size. Something like dbgora has a size of 42M I was trying the following script. But I am not sure how to get the last character of SIZE column from the above output and compare with 'M' and then compare with the value. top -b -U norad | grep norad | awk '{ print $6, $11 }' | \ while read SIZE COMMAND do echo Command : $COMMAND Size : $SIZE done Any suggestions will be appreciated. Thanks, Ashoke -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Mandal, Ashoke INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California
RE: Help in unix script
Hi Ashoke, I see that you are using NORAD (I am the resident NORAD sales critter ;P). Can't help you much on the script help, but one thing I can say: Have you looked at the IAS agent of NORAD (the system monitoring agent)? This will be able to do all that you want.. Under the standard rules (just the same as you see when using NORAD against Oracle) there is an IAS rule called IAS_PROCESSES_KMEM_USAGE (Interval KMem usage exceeds value) that will flag exactly what you want. Then all you have to do is generate an event handler for that rule that will email you the results.. If you want it to just run against the NORAD processes, copy the rule, and edit the where clause to also include and command like dbg%.. You could also use the Process Monitor built in to the IAS agent, to group the DBGXXX agents together to monitor the NORAD program as a group.. What version are you running, and what O/S are you running this against? You may want to get in touch with your local supplier (whoever that is) to talk about IAS. Alternatively, get in touch with me back channel ([EMAIL PROTECTED]) and I'll see if I can help you out (we are Bradmark's No.1 distributor worldwide..). I won't be able to supply the agents (that's best left to your local supplier), but I can point you in the right direction.. HTH Mark === Mark Leith | T: +44 (0)1905 330 281 Sales Marketing | F: +44 (0)870 127 5283 Cool Tools UK Ltd | E: [EMAIL PROTECTED] === http://www.cool-tools.co.uk Maximising throughput performance -Original Message- Ashoke Sent: 28 March 2002 16:28 To: Multiple recipients of list ORACLE-L Greetings all, I need to do the following unix top -b -U norad PID USERNAME THR PRI NICE SIZE RES STATE TIMECPU COMMAND 12733 norad 1 602 3936K 3392K run 0:05 7.21% dbganlz 12747 norad 4 522 13M 10M sleep 0:05 4.20% dbgora 12721 norad 1 532 3160K 2584K sleep 0:00 0.12% dbgsam 12726 norad 1 522 3184K 2416K sleep 0:00 0.02% dbgalert 12740 norad 1 532 2992K 2128K sleep 0:00 0.02% dbgrepos 12594 norad 1 590 3200K 2544K sleep 0:00 0.01% dbgsam 12606 norad 1 590 4696K 4160K sleep 0:11 0.00% dbganlz 12620 norad 4 590 42M 13M sleep 0:06 0.00% dbgora 12599 norad 1 580 3216K 2400K sleep 0:00 0.00% dbgalert 12613 norad 1 590 3016K 2112K sleep 0:00 0.00% dbgrepos I have to check the last character of SIZE column. If the size is in M(megabyte) then check if the value is 40 then send an e-mail with the COMMAND name and the size. Something like dbgora has a size of 42M I was trying the following script. But I am not sure how to get the last character of SIZE column from the above output and compare with 'M' and then compare with the value. top -b -U norad | grep norad | awk '{ print $6, $11 }' | \ while read SIZE COMMAND do echo Command : $COMMAND Size : $SIZE done Any suggestions will be appreciated. Thanks, Ashoke -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Mandal, Ashoke INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Mark Leith INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: Help in unix script
#!/bin/ksh MAX=40 top -b -U norad | grep norad | awk '{ print $6, $11 }' | \ while read SIZE COMMAND do #echo working with ${SIZE}:${COMMAND}#DEBUG WORK=${SIZE#*M} #echo 1-${WORK} #DEBUG if [[ ${#WORK} -eq 0 ]] then WORK=${SIZE%%M} #echo 2-${WORK} #DEBUG if [[ ${WORK} -ge ${MAX} ]] then echo Greater than ${MAX} - ${SIZE}:${COMMAND} fi fi done Brian P. MacLean Oracle DBA, OCP8i Mandal, Ashoke ashoke.k.mandal@medt To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] ronic.com cc: Sent by:Subject: Help in unix script [EMAIL PROTECTED] 03/28/02 09:28 AM Please respond to ORACLE-L Greetings all, I need to do the following unix top -b -U norad PID USERNAME THR PRI NICE SIZE RES STATE TIMECPU COMMAND 12733 norad 1 602 3936K 3392K run 0:05 7.21% dbganlz 12747 norad 4 522 13M 10M sleep 0:05 4.20% dbgora 12721 norad 1 532 3160K 2584K sleep 0:00 0.12% dbgsam 12726 norad 1 522 3184K 2416K sleep 0:00 0.02% dbgalert 12740 norad 1 532 2992K 2128K sleep 0:00 0.02% dbgrepos 12594 norad 1 590 3200K 2544K sleep 0:00 0.01% dbgsam 12606 norad 1 590 4696K 4160K sleep 0:11 0.00% dbganlz 12620 norad 4 590 42M 13M sleep 0:06 0.00% dbgora 12599 norad 1 580 3216K 2400K sleep 0:00 0.00% dbgalert 12613 norad 1 590 3016K 2112K sleep 0:00 0.00% dbgrepos I have to check the last character of SIZE column. If the size is in M(megabyte) then check if the value is 40 then send an e-mail with the COMMAND name and the size. Something like dbgora has a size of 42M I was trying the following script. But I am not sure how to get the last character of SIZE column from the above output and compare with 'M' and then compare with the value. top -b -U norad | grep norad | awk '{ print $6, $11 }' | \ while read SIZE COMMAND do echo Command : $COMMAND Size : $SIZE done Any suggestions will be appreciated. Thanks, Ashoke -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Mandal, Ashoke INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: OT : Unix script to monitor log file size/disk space
Hi, What version of unix do you use ? I use this script on HP. If you want I can send it to you. Radim -Original Message- Ling Catherine (CSC) Sent: Wednesday, March 13, 2002 6:08 AM To: Multiple recipients of list ORACLE-L Hi Gurus, Does anyone have the unix script to monitor disk space or a certain file ? For example, if the disk space is more than 80%, send an email to the administrator or if the log file is too huge, email the log file to the administrator and truncate the file etc . Please help. Thanks. Regds, New Bee in Unix -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: CHAN Chor Ling Catherine (CSC) INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Radim J. INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: OT : Unix script to monitor log file size/disk space
Hi Radim, We are using Sun Solaris Version 2.6 right now. By this weekend, we'll be upgrading our OS to Version 2.8. I am very interested in your script. Could U send your scripts to me? Thank you so much. Regds, New Bee -Original Message- From: Radim J. [mailto:[EMAIL PROTECTED]] Sent: Friday, March 22, 2002 5:13 AM To: Multiple recipients of list ORACLE-L Subject:RE: OT : Unix script to monitor log file size/disk space Hi, What version of unix do you use ? I use this script on HP. If you want I can send it to you. Radim -Original Message- Ling Catherine (CSC) Sent: Wednesday, March 13, 2002 6:08 AM To: Multiple recipients of list ORACLE-L Hi Gurus, Does anyone have the unix script to monitor disk space or a certain file ? For example, if the disk space is more than 80%, send an email to the administrator or if the log file is too huge, email the log file to the administrator and truncate the file etc . Please help. Thanks. Regds, New Bee in Unix -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: CHAN Chor Ling Catherine (CSC) INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Radim J. INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: CHAN Chor Ling Catherine (CSC) INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
OT : Unix script to monitor log file size/disk space
Hi Gurus, Does anyone have the unix script to monitor disk space or a certain file ? For example, if the disk space is more than 80%, send an email to the administrator or if the log file is too huge, email the log file to the administrator and truncate the file etc . Please help. Thanks. Regds, New Bee in Unix -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: CHAN Chor Ling Catherine (CSC) INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
OT - Unix Script to get file name and size from remote server
This may be a little off topic so I apologize in advance. But I have seen some good Unix scripting help come across lately so I thought I would go ahead and send this. I am trying to setup a Unix script that will logon to a remote server, get the name and size of all the files in a remote directory and write the results to a local directory. I need to do this to ensure that all the source files for loading our data warehouse have been received and are complete. The list of files to be received changes nightly and I don't have the ability to add a record to the files that would provide an end of file marker. I have tested ftp using ls but it only allows a short list of file names, not the long listing with file sizes. I have also tried nlist, size and dir from ftp but those commands don't allow printing the results to the local server. I have tried rsh and rlogin but these commands just sit there with no response. I have to use an ip address, not the hostname, so I don't know if this is the problem or not. I have the SA looking into this for me. I could probably setup a cron job on the remote server to do the long listing of the directory and then ftp the results to my local server, but then this would be outside the control of my load process. I would prefer to do everything from the local server if possible. Any ideas? Thanks, Nancy -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Nancy McCormick INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: OT - Unix Script to get file name and size from remote server
Hi, Never tried it but feeling creative today How about rsh to the remote machine to start a script that does the long listing and ftp's back to your machine Jack Nancy McCormick [EMAIL PROTECTED]@fatcity.com on 01-03-2002 16:08:40 Please respond to [EMAIL PROTECTED] Sent by:[EMAIL PROTECTED] To:Multiple recipients of list ORACLE-L [EMAIL PROTECTED] cc: (bcc: Jack van Zanen/nlzanen1/External/MEY/NL) er This may be a little off topic so I apologize in advance. But I have seen some good Unix scripting help come across lately so I thought I would go ahead and send this. I am trying to setup a Unix script that will logon to a remote server, get the name and size of all the files in a remote directory and write the results to a local directory. I need to do this to ensure that all the source files for loading our data warehouse have been received and are complete. The list of files to be received changes nightly and I don't have the ability to add a record to the files that would provide an end of file marker. I have tested ftp using ls but it only allows a short list of file names, not the long listing with file sizes. I have also tried nlist, size and dir from ftp but those commands don't allow printing the results to the local server. I have tried rsh and rlogin but these commands just sit there with no response. I have to use an ip address, not the hostname, so I don't know if this is the problem or not. I have the SA looking into this for me. I could probably setup a cron job on the remote server to do the long listing of the directory and then ftp the results to my local server, but then this would be outside the control of my load process. I would prefer to do everything from the local server if possible. Any ideas? Thanks, Nancy -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Nancy McCormick INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). == De informatie verzonden in dit e-mailbericht is vertrouwelijk en is uitsluitend bestemd voor de geadresseerde. Openbaarmaking, vermenigvuldiging, verspreiding en/of verstrekking van deze informatie aan derden is, behoudens voorafgaande schriftelijke toestemming van Ernst Young, niet toegestaan. Ernst Young staat niet in voor de juiste en volledige overbrenging van de inhoud van een verzonden e-mailbericht, noch voor tijdige ontvangst daarvan. Ernst Young kan niet garanderen dat een verzonden e-mailbericht vrij is van virussen, noch dat e-mailberichten worden overgebracht zonder inbreuk of tussenkomst van onbevoegde derden. Indien bovenstaand e-mailbericht niet aan u is gericht, verzoeken wij u vriendelijk doch dringend het e-mailbericht te retourneren aan de verzender en het origineel en eventuele kopieën te verwijderen en te vernietigen. Ernst Young hanteert bij de uitoefening van haar werkzaamheden algemene voorwaarden, waarin een beperking van aansprakelijkheid is opgenomen. De algemene voorwaarden worden u op verzoek kosteloos toegezonden. = The information contained in this communication is confidential and is intended solely for the use of the individual or entity to whom it is addressed. You should not copy, disclose or distribute this communication without the authority of Ernst Young. Ernst Young is neither liable for the proper and complete transmission of the information contained in this communication nor for any delay in its receipt. Ernst Young does not guarantee that the integrity of this communication has been maintained nor that the communication is free of viruses, interceptions or interference. If you are not the intended recipient of this communication please return the communication to the sender and delete and destroy all copies. In carrying out its engagements, Ernst Young applies general terms and conditions, which contain a clause that limits its liability. A copy of these terms and conditions is available on request free of charge. === -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Jack van Zanen INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists
RE: OT - Unix Script to get file name and size from remote server
I wrote some shell scripts that do something similar. Here is the sequence of events: On host running the control process, run a script that resides on remote server containing the logic to generate a file with the information needed using rsh command. This remote script would also contain logic to rcp the file generated to the host running the control process. You will also need to pass the appropriate hostnames as variables for 2 reasons: the script remains dynamic and the script knows which host to run the rsh on and which host to rcp to. Example: On controlling host: rsh remote_host_variable get_files.sh this_host_variable On remote host - get_files.sh contains: ls -lt blahblah file_list.out rcp -p file_list.out this_host_variable:file_list.out Also, make sure you code error checking in your routines. Hope that helps. -Original Message- Sent: Friday, March 01, 2002 10:09 AM To: Multiple recipients of list ORACLE-L This may be a little off topic so I apologize in advance. But I have seen some good Unix scripting help come across lately so I thought I would go ahead and send this. I am trying to setup a Unix script that will logon to a remote server, get the name and size of all the files in a remote directory and write the results to a local directory. I need to do this to ensure that all the source files for loading our data warehouse have been received and are complete. The list of files to be received changes nightly and I don't have the ability to add a record to the files that would provide an end of file marker. I have tested ftp using ls but it only allows a short list of file names, not the long listing with file sizes. I have also tried nlist, size and dir from ftp but those commands don't allow printing the results to the local server. I have tried rsh and rlogin but these commands just sit there with no response. I have to use an ip address, not the hostname, so I don't know if this is the problem or not. I have the SA looking into this for me. I could probably setup a cron job on the remote server to do the long listing of the directory and then ftp the results to my local server, but then this would be outside the control of my load process. I would prefer to do everything from the local server if possible. Any ideas? Thanks, Nancy -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Nancy McCormick INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: OT - Unix Script to get file name and size from remote server
I finally got the ls -l command with ftp working. It didn't like having the remotedirectory specified so I just do a cd to the remote directory and then ls -l with the local file name. Here is a snippet from the script I am running right now # set variables SITE_DIR=$1; export SITE_DIR . DWH.ENV . $SITE_DIR.ENV # # generate ftp command list rm $KSH_DIR/ftp_$SITE_DIR.ksh echo 'ftp -n -v *EOI ' $KSH_DIR/ftp_$SITE_DIR.ksh echo 'open '$RSRV $KSH_DIR/ftp_$SITE_DIR.ksh echo 'user '$FTPU' '$FTPP $KSH_DIR/ftp_$SITE_DIR.ksh echo 'cd '$RDIR $KSH_DIR/ftp_$SITE_DIR.ksh echo 'get report.nite.list' $KSH_DIR/ftp_$SITE_DIR.ksh echo 'ls -l '$SITE_DIR'_files.lst' $KSH_DIR/ftp_$SITE_DIR.ksh echo 'bye ' $KSH_DIR/ftp_$SITE_DIRksh echo '*EOI ' $KSH_DIR/ftp_$SITE_DIR.ksh chmod 744 $KSH_DIR/ftp_$SITE_DIR.ksh # # execute ftp command cd $KSH_DIR $KSH_DIR/ftp_$SITE_DIR.ksh I am going to continue to look at the rsh options as the commands I can execute via rsh may produce more reliable results. Thanks to everyone who responded for your help and suggestions. Nancy -Original Message- McCormick Sent: Friday, March 01, 2002 9:09 AM To: Multiple recipients of list ORACLE-L This may be a little off topic so I apologize in advance. But I have seen some good Unix scripting help come across lately so I thought I would go ahead and send this. I am trying to setup a Unix script that will logon to a remote server, get the name and size of all the files in a remote directory and write the results to a local directory. I need to do this to ensure that all the source files for loading our data warehouse have been received and are complete. The list of files to be received changes nightly and I don't have the ability to add a record to the files that would provide an end of file marker. I have tested ftp using ls but it only allows a short list of file names, not the long listing with file sizes. I have also tried nlist, size and dir from ftp but those commands don't allow printing the results to the local server. I have tried rsh and rlogin but these commands just sit there with no response. I have to use an ip address, not the hostname, so I don't know if this is the problem or not. I have the SA looking into this for me. I could probably setup a cron job on the remote server to do the long listing of the directory and then ftp the results to my local server, but then this would be outside the control of my load process. I would prefer to do everything from the local server if possible. Any ideas? Thanks, Nancy -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Nancy McCormick INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Nancy McCormick INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
UNIX SCRIPT
HI LIST, I AM LOOKING FOR A SCRIPT TO MAKE A COLD BACKUP FOR ORACLE 8.1.6 ON SunOS 5.7. I want to schedule this script to shutdown the database at mid night and make a backup then start it up at 5:00 AM. Any URL or link or any document it will be very helpful. Hamid Alavi Office 818 737-0526 Cell818 402-1987 The information contained in this message and any attachments is intended only for the use of the individual or entity to which it is addressed, and may contain information that is PRIVILEGED, CONFIDENTIAL and exempt from disclosure under applicable law. If you have received this message in error, you are prohibited from copying, distributing, or using the information. Please contact the sender immediately by return e-mail and delete the original message from your system. -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Hamid Alavi INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: UNIX SCRIPT
Thats a rather open question. What are you doing your backup to ? Simply to another disk drive or are you putting the files out to a tape? If you are using a tape, are you using some kind of tape management software or simply copying the files to the tape ? Are you copying it all to a backup machine or is the backup media on the same machine ? What kind of file system do you have ? Something simple or are you using netapps or some other network file system ? Please be a bit more specific. -Original Message- Sent: Friday, February 15, 2002 11:25 AM To: Multiple recipients of list ORACLE-L HI LIST, I AM LOOKING FOR A SCRIPT TO MAKE A COLD BACKUP FOR ORACLE 8.1.6 ON SunOS 5.7. I want to schedule this script to shutdown the database at mid night and make a backup then start it up at 5:00 AM. Any URL or link or any document it will be very helpful. Hamid Alavi Office 818 737-0526 Cell818 402-1987 The information contained in this message and any attachments is intended only for the use of the individual or entity to which it is addressed, and may contain information that is PRIVILEGED, CONFIDENTIAL and exempt from disclosure under applicable law. If you have received this message in error, you are prohibited from copying, distributing, or using the information. Please contact the sender immediately by return e-mail and delete the original message from your system. -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Hamid Alavi INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Kevin Lange INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: UNIX SCRIPT
Please check www.orafaq.com Also, a google search will yield more scripts than you can use. Find one that meets your needs, modify if necessary, test it til you know it works. Jared Hamid Alavi [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 02/15/02 09:24 AM Please respond to ORACLE-L To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] cc: Subject:UNIX SCRIPT HI LIST, I AM LOOKING FOR A SCRIPT TO MAKE A COLD BACKUP FOR ORACLE 8.1.6 ON SunOS 5.7. I want to schedule this script to shutdown the database at mid night and make a backup then start it up at 5:00 AM. Any URL or link or any document it will be very helpful. Hamid Alavi Office 818 737-0526 Cell818 402-1987 The information contained in this message and any attachments is intended only for the use of the individual or entity to which it is addressed, and may contain information that is PRIVILEGED, CONFIDENTIAL and exempt from disclosure under applicable law. If you have received this message in error, you are prohibited from copying, distributing, or using the information. Please contact the sender immediately by return e-mail and delete the original message from your system. -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Hamid Alavi INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: UNIX SCRIPT
Here's basically what you need to do: 1) Write a script which determines which files to backup (hit the DBA and V$ tables) 2) Shutdown the database 3) Once you have those files, use them as a driver in a for|while loop (for each file, A) Check if it's raw or UFS if [ raw ] then use dd to backup else use whatever you want (dd|cpio|tar) to backup to disk|tape write in the logfile what time you started this file copy B) if success, write to log else try again and write to log 4) Startup the database This can, and should, all be in one script. You can schedule this script to kick off at midnight. You can have another script, which you kick off to start at 5 which 1) Checks to see whether the first script is running 2) If it is, kill it and all its subprocesses 3) Write to the first one's log file that it was killed at 5AM 4) Start up the database As for what the commands are to do all this, they are both easy and time/space consuming to spell out, so I'll leave it to you. It seems to me that you are asking for a backup script. There is a book from Oracle Press on Oracle backups where you can type it in line by line from the book. Have fun! Bambi. -Original Message- Sent: Friday, February 15, 2002 11:25 AM To: Multiple recipients of list ORACLE-L HI LIST, I AM LOOKING FOR A SCRIPT TO MAKE A COLD BACKUP FOR ORACLE 8.1.6 ON SunOS 5.7. I want to schedule this script to shutdown the database at mid night and make a backup then start it up at 5:00 AM. Any URL or link or any document it will be very helpful. Hamid Alavi Office 818 737-0526 Cell818 402-1987 The information contained in this message and any attachments is intended only for the use of the individual or entity to which it is addressed, and may contain information that is PRIVILEGED, CONFIDENTIAL and exempt from disclosure under applicable law. If you have received this message in error, you are prohibited from copying, distributing, or using the information. Please contact the sender immediately by return e-mail and delete the original message from your system. -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Hamid Alavi INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Kevin Lange INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Bellows, Bambi INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: Unix script
Do some research man!! This stuff isn't hard to find...sheesh!! -Original Message- Sent: 28 January 2002 14:31 To: Multiple recipients of list ORACLE-L Hallo, I have this unix script. I would like to include code which checks if the oracle database is up and running so the procedure konto.fillbotables.anrop doesnt start at all.. I also want an errorlog file to be created. Please tell me how to write the code and where to include it in this shell script. #!/bin/sh . /usr/bin/orasetup.sh . /d31/appl/konto/bat/movefiles.sh sqlldr userid=konto/icakort control=/d31/appl/konto/bat/ehbgrupp.ctl log=/d31/appl/konto/log/ehbgrupp.log sqlplus -s konto/icakort ! set heading off set verify off set feedback off set termout off set pages 0 begin konto.fillbilbotables.anrop; END; / EXIT Thanks in advance Roland -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Thomas, Kevin INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: Unix script
Title: RE: Unix script Basis of a script added into yours below. Note I am only checking to see if there is a PMON proces up - maybe best to make a sqlplus connection and read v$instance or something and exit if it fails. Really very poor but will give you something to work on. What I don't see from your sample script is the end marker for the ! command I normally use EOF and then at the end of the sql statements I have a line with EOF in. I do not see your ! marker To get a log file call the shell script and to log_file or set that up in your cron routine HTH John -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 28 January 2002 14:31 To: Multiple recipients of list ORACLE-L Subject: Unix script Hallo, I have this unix script. I would like to include code which checks if the oracle database is up and running so the procedure konto.fillbotables.anrop doesnt start at all.. I also want an errorlog file to be created. Please tell me how to write the code and where to include it in this shell script. #!/bin/sh . /usr/bin/orasetup.sh . /d31/appl/konto/bat/movefiles.sh numberOfLines=`ps -ef|grep pmon wc -l` grep for sid or ora_pmon_sid or whatever if [ $numberOfLines -lt 2 ] # ie database not running then cat dummy_file |mailx -s No database running loader not started [EMAIL PROTECTED] else fi sqlldr userid=konto/icakort control=/d31/appl/konto/bat/ehbgrupp.ctl log=/d31/appl/konto/log/ehbgrupp.log sqlplus -s konto/icakort ! set heading off set verify off set feedback off set termout off set pages 0 begin konto.fillbilbotables.anrop; END; / EXIT fi sqlldr userid=konto/icakort control=/d31/appl/konto/bat/ehbgrupp.ctl log=/d31/appl/konto/log/ehbgrupp.log sqlplus -s konto/icakort ! set heading off set verify off set feedback off set termout off set pages 0 begin konto.fillbilbotables.anrop; END; / EXIT Thanks in advance Roland -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). = This electronic message contains information from the mmO2 plc Group which may be privileged or confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or email (to the numbers or address above) immediately. =
Unix script
Hallo, I have this unix script. I would like to get a errorlog if the pl/sql procedure konto.fillbotables.anrop doesnt start at all. Please tell me how to write the code and where to include it in this shell script. #!/bin/sh . /usr/bin/orasetup.sh . /d31/appl/konto/bat/movefiles.sh sqlldr userid=konto/icakort control=/d31/appl/konto/bat/ehbgrupp.ctl log=/d31/appl/konto/log/ehbgrupp.log sqlplus -s konto/icakort ! set heading off set verify off set feedback off set termout off set pages 0 begin konto.fillbilbotables.anrop; END; / EXIT Thanks in advance Roland -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Ang: RE: Unix script
yes, but please help me with that. Thanks roland Boivin, Patrice J [EMAIL PROTECTED]@fatcity.com den 2002-01-27 02:30 PST Sänd svar till [EMAIL PROTECTED] Sänt av: [EMAIL PROTECTED] Till: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] Kopia: Well, how about just putting a parameter in your procedure. If the procedure finishes successfully change that parameter's value, and pass it back to the parent script. Regards, Patrice Boivin Systems Analyst (Oracle Certified DBA) Systems Admin Operations | Admin. et Exploit. des systèmes Technology Services| Services technologiques Informatics Branch | Direction de l'informatique Maritimes Region, DFO | Région des Maritimes, MPO E-Mail: [EMAIL PROTECTED] -Original Message- Sent: Sunday, January 27, 2002 5:45 AM To:Multiple recipients of list ORACLE-L Hallo, I have this unix script. I would like to get a errorlog if the pl/sql procedure konto.fillbotables.anrop doesnt start at all. Please tell me how to write the code and where to include it in this shell script. #!/bin/sh . /usr/bin/orasetup.sh . /d31/appl/konto/bat/movefiles.sh sqlldr userid=konto/icakort control=/d31/appl/konto/bat/ehbgrupp.ctl log=/d31/appl/konto/log/ehbgrupp.log sqlplus -s konto/icakort ! set heading off set verify off set feedback off set termout off set pages 0 begin konto.fillbilbotables.anrop; END; / EXIT Thanks in advance Roland -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Boivin, Patrice J INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: Unix - script
Try out the following. wget ftp://user:password@host IP/full path of File/Directory Example :- wget ftp://oracle:[EMAIL PROTECTED]//home/superman/myfile.txt Get back in case of any clarification. Bye Sundar Thomas, Kevin wrote: Roland,Try this by setting up environment variables at the top of your script:SERVER1= 10.10.10.10USER1= 'xxx'PWD1= 'xxx'SERVER2= 10.10.10.20USER1= 'yyy'PWD2= ''Then have this:ftp -i -n EOFopen $SERVER1user $USER1 $PWD1cd scriptsget filecloseEOFYou can then have a section like the one below if you want to copy to adifferent serverother than the one you are running this script from:ftp -i -n EOFopen $SERVER2user $USER2 $PWD2cd scriptsput filecloseEOFBoth of these can be included in the one shell script.Hope that helps.Kev.'In Windows no one can hear you scream'__Kevin ThomasTechnical AnalystDeregulation ServicesCalanais Ltd.(2nd Floor East - Weirs Building)Tel: 0141 568 2377Fax: 0141 568 2366http://www.calanais.com-Original Message-Sent: 09 January 2002 07:16To: Multiple recipients of list ORACLE-LHallo,I would like to have an example of a unix script, which does the following:copy some files from directory /prod/sas/data located at "hardy".(which isa computer)to the other database hakon. Is it possible to do this. Please help mequick.Thanks in advanceRoland S
RE: Unix - script
Is there any similar command in AIX? Can't find wget. Saludos, Veronica Levin Enriquez Compañía Cervecera de Nicaragua -Mensaje original- De: Gogala, Mladen [mailto:[EMAIL PROTECTED]] Enviado el: Miércoles, 09 de Enero de 2002 09:12 a.m. Para: Multiple recipients of list ORACLE-L Asunto: RE: Unix - script I would suggest using wget, which is built exactly for this purpose. -Original Message- Sent: Wednesday, January 09, 2002 3:20 AM To: Multiple recipients of list ORACLE-L Roland, Try this by setting up environment variables at the top of your script: SERVER1= 10.10.10.10 USER1= 'xxx' PWD1= 'xxx' SERVER2= 10.10.10.20 USER1= 'yyy' PWD2= '' Then have this: ftp -i -n EOF open $SERVER1 user $USER1 $PWD1 cd scripts get file close EOF You can then have a section like the one below if you want to copy to a different server other than the one you are running this script from: ftp -i -n EOF open $SERVER2 user $USER2 $PWD2 cd scripts put file close EOF Both of these can be included in the one shell script. Hope that helps. Kev. 'In Windows no one can hear you scream' __ Kevin Thomas Technical Analyst Deregulation Services Calanais Ltd. (2nd Floor East - Weirs Building) Tel: 0141 568 2377 Fax: 0141 568 2366 http://www.calanais.com -Original Message- Sent: 09 January 2002 07:16 To: Multiple recipients of list ORACLE-L Hallo, I would like to have an example of a unix script, which does the following: copy some files from directory /prod/sas/data located at hardy.(which is a computer) to the other database hakon. Is it possible to do this. Please help me quick. Thanks in advance Roland S -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Thomas, Kevin INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Gogala, Mladen INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Veronica Levin INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: Unix - script
try www.wget.org Veronica Levin vlevin@victor To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] ia.com.ni cc: Sent by: Subject: RE: Unix - script [EMAIL PROTECTED] om 01/11/02 12:55 PM Please respond to ORACLE-L Is there any similar command in AIX? Can't find wget. Saludos, Veronica Levin Enriquez Compañía Cervecera de Nicaragua -Mensaje original- De: Gogala, Mladen [mailto:[EMAIL PROTECTED]] Enviado el: Miércoles, 09 de Enero de 2002 09:12 a.m. Para: Multiple recipients of list ORACLE-L Asunto: RE: Unix - script I would suggest using wget, which is built exactly for this purpose. -Original Message- Sent: Wednesday, January 09, 2002 3:20 AM To: Multiple recipients of list ORACLE-L Roland, Try this by setting up environment variables at the top of your script: SERVER1= 10.10.10.10 USER1= 'xxx' PWD1= 'xxx' SERVER2= 10.10.10.20 USER1= 'yyy' PWD2= '' Then have this: ftp -i -n EOF open $SERVER1 user $USER1 $PWD1 cd scripts get file close EOF You can then have a section like the one below if you want to copy to a different server other than the one you are running this script from: ftp -i -n EOF open $SERVER2 user $USER2 $PWD2 cd scripts put file close EOF Both of these can be included in the one shell script. Hope that helps. Kev. 'In Windows no one can hear you scream' __ Kevin Thomas Technical Analyst Deregulation Services Calanais Ltd. (2nd Floor East - Weirs Building) Tel: 0141 568 2377 Fax: 0141 568 2366 http://www.calanais.com -Original Message- Sent: 09 January 2002 07:16 To: Multiple recipients of list ORACLE-L Hallo, I would like to have an example of a unix script, which does the following: copy some files from directory /prod/sas/data located at hardy.(which is a computer) to the other database hakon. Is it possible to do this. Please help me quick. Thanks in advance Roland S -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Thomas, Kevin INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Gogala, Mladen INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet
Ang: RE: Unix - script
So I have to use the ip-addresses? I cant use the name of the computer, for instance hakon5. Thanks in advance Roland Gogala, Mladen [EMAIL PROTECTED]@fatcity.com den 2002-01-09 07:11 PST Sänd svar till [EMAIL PROTECTED] Sänt av: [EMAIL PROTECTED] Till: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] Kopia: I would suggest using wget, which is built exactly for this purpose. -Original Message- Sent: Wednesday, January 09, 2002 3:20 AM To: Multiple recipients of list ORACLE-L Roland, Try this by setting up environment variables at the top of your script: SERVER1= 10.10.10.10 USER1= 'xxx' PWD1= 'xxx' SERVER2= 10.10.10.20 USER1= 'yyy' PWD2= '' Then have this: ftp -i -n EOF open $SERVER1 user $USER1 $PWD1 cd scripts get file close EOF You can then have a section like the one below if you want to copy to a different server other than the one you are running this script from: ftp -i -n EOF open $SERVER2 user $USER2 $PWD2 cd scripts put file close EOF Both of these can be included in the one shell script. Hope that helps. Kev. 'In Windows no one can hear you scream' __ Kevin Thomas Technical Analyst Deregulation Services Calanais Ltd. (2nd Floor East - Weirs Building) Tel: 0141 568 2377 Fax: 0141 568 2366 http://www.calanais.com -Original Message- Sent: 09 January 2002 07:16 To: Multiple recipients of list ORACLE-L Hallo, I would like to have an example of a unix script, which does the following: copy some files from directory /prod/sas/data located at hardy.(which is a computer) to the other database hakon. Is it possible to do this. Please help me quick. Thanks in advance Roland S -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Thomas, Kevin INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Gogala, Mladen INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: Unix - script
Use unix utility ftp to copy file between 2 mc's or use rcopy. For more details refer to man pages. -- On Tue, 08 Jan 2002 23:15:35 Roland.Skoldblom wrote: Hallo, I would like to have an example of a unix script, which does the following: copy some files from directory /prod/sas/data located at hardy.(which is a computer) to the other database hakon. Is it possible to do this. Please help me quick. Thanks in advance Roland S -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: C.S.Venkata Subramanian INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: Unix - script
Roland, Try this by setting up environment variables at the top of your script: SERVER1= 10.10.10.10 USER1= 'xxx' PWD1= 'xxx' SERVER2= 10.10.10.20 USER1= 'yyy' PWD2= '' Then have this: ftp -i -n EOF open $SERVER1 user $USER1 $PWD1 cd scripts get file close EOF You can then have a section like the one below if you want to copy to a different server other than the one you are running this script from: ftp -i -n EOF open $SERVER2 user $USER2 $PWD2 cd scripts put file close EOF Both of these can be included in the one shell script. Hope that helps. Kev. 'In Windows no one can hear you scream' __ Kevin Thomas Technical Analyst Deregulation Services Calanais Ltd. (2nd Floor East - Weirs Building) Tel: 0141 568 2377 Fax: 0141 568 2366 http://www.calanais.com -Original Message- Sent: 09 January 2002 07:16 To: Multiple recipients of list ORACLE-L Hallo, I would like to have an example of a unix script, which does the following: copy some files from directory /prod/sas/data located at hardy.(which is a computer) to the other database hakon. Is it possible to do this. Please help me quick. Thanks in advance Roland S -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Thomas, Kevin INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: Unix - script
Forgot to mention, the 'cd scripts' line in both examples is not required, it's just been left in from the script I copied. oops! K. -Original Message- Sent: 09 January 2002 08:20 To: Multiple recipients of list ORACLE-L Roland, Try this by setting up environment variables at the top of your script: SERVER1= 10.10.10.10 USER1= 'xxx' PWD1= 'xxx' SERVER2= 10.10.10.20 USER1= 'yyy' PWD2= '' Then have this: ftp -i -n EOF open $SERVER1 user $USER1 $PWD1 cd scripts get file close EOF You can then have a section like the one below if you want to copy to a different server other than the one you are running this script from: ftp -i -n EOF open $SERVER2 user $USER2 $PWD2 cd scripts put file close EOF Both of these can be included in the one shell script. Hope that helps. Kev. 'In Windows no one can hear you scream' __ Kevin Thomas Technical Analyst Deregulation Services Calanais Ltd. (2nd Floor East - Weirs Building) Tel: 0141 568 2377 Fax: 0141 568 2366 http://www.calanais.com -Original Message- Sent: 09 January 2002 07:16 To: Multiple recipients of list ORACLE-L Hallo, I would like to have an example of a unix script, which does the following: copy some files from directory /prod/sas/data located at hardy.(which is a computer) to the other database hakon. Is it possible to do this. Please help me quick. Thanks in advance Roland S -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Thomas, Kevin INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Thomas, Kevin INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: Unix - script
It could be faster to remote copy: rcp -p /archive/orcl/arch_1_2290.arc oracle@server2:/archive/orcl/arch_1_2290.arc Mike From: Thomas, Kevin [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] Subject: RE: Unix - script Date: Wed, 09 Jan 2002 00:35:23 -0800 Forgot to mention, the 'cd scripts' line in both examples is not required, it's just been left in from the script I copied. oops! K. -Original Message- Sent: 09 January 2002 08:20 To: Multiple recipients of list ORACLE-L Roland, Try this by setting up environment variables at the top of your script: SERVER1= 10.10.10.10 USER1= 'xxx' PWD1= 'xxx' SERVER2= 10.10.10.20 USER1= 'yyy' PWD2= '' Then have this: ftp -i -n EOF open $SERVER1 user $USER1 $PWD1 cd scripts get file close EOF You can then have a section like the one below if you want to copy to a different server other than the one you are running this script from: ftp -i -n EOF open $SERVER2 user $USER2 $PWD2 cd scripts put file close EOF Both of these can be included in the one shell script. Hope that helps. Kev. 'In Windows no one can hear you scream' __ Kevin Thomas Technical Analyst Deregulation Services Calanais Ltd. (2nd Floor East - Weirs Building) Tel: 0141 568 2377 Fax: 0141 568 2366 http://www.calanais.com -Original Message- Sent: 09 January 2002 07:16 To: Multiple recipients of list ORACLE-L Hallo, I would like to have an example of a unix script, which does the following: copy some files from directory /prod/sas/data located at hardy.(which is a computer) to the other database hakon. Is it possible to do this. Please help me quick. Thanks in advance Roland S -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Thomas, Kevin INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Thomas, Kevin INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Mike Killough INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: Unix - script
Yip, never thought of that one ;o) -Original Message- Sent: 09 January 2002 10:55 To: Multiple recipients of list ORACLE-L It could be faster to remote copy: rcp -p /archive/orcl/arch_1_2290.arc oracle@server2:/archive/orcl/arch_1_2290.arc Mike From: Thomas, Kevin [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] Subject: RE: Unix - script Date: Wed, 09 Jan 2002 00:35:23 -0800 Forgot to mention, the 'cd scripts' line in both examples is not required, it's just been left in from the script I copied. oops! K. -Original Message- Sent: 09 January 2002 08:20 To: Multiple recipients of list ORACLE-L Roland, Try this by setting up environment variables at the top of your script: SERVER1= 10.10.10.10 USER1= 'xxx' PWD1= 'xxx' SERVER2= 10.10.10.20 USER1= 'yyy' PWD2= '' Then have this: ftp -i -n EOF open $SERVER1 user $USER1 $PWD1 cd scripts get file close EOF You can then have a section like the one below if you want to copy to a different server other than the one you are running this script from: ftp -i -n EOF open $SERVER2 user $USER2 $PWD2 cd scripts put file close EOF Both of these can be included in the one shell script. Hope that helps. Kev. 'In Windows no one can hear you scream' __ Kevin Thomas Technical Analyst Deregulation Services Calanais Ltd. (2nd Floor East - Weirs Building) Tel: 0141 568 2377 Fax: 0141 568 2366 http://www.calanais.com -Original Message- Sent: 09 January 2002 07:16 To: Multiple recipients of list ORACLE-L Hallo, I would like to have an example of a unix script, which does the following: copy some files from directory /prod/sas/data located at hardy.(which is a computer) to the other database hakon. Is it possible to do this. Please help me quick. Thanks in advance Roland S -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Thomas, Kevin INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Thomas, Kevin INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Mike Killough INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Thomas, Kevin INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message
RE: Unix - script
on hakon: scp user@hardy:/prod/sas/data/file /dir/on/hardy/ is one way if you have ssh/scp installed. Scott Shafer San Antonio, TX 210-581-6217 Common sense will not accomplish great things. Simply become insane and desperate. -Original Message- From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]] Sent: Wednesday, January 09, 2002 1:16 AM To: Multiple recipients of list ORACLE-L Subject: Unix - script Hallo, I would like to have an example of a unix script, which does the following: copy some files from directory /prod/sas/data located at hardy.(which is a computer) to the other database hakon. Is it possible to do this. Please help me quick. Thanks in advance Roland S -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).