Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: usernames

Re: usernames

From: Mark C. Stock <mcstockX_at_Xenquery>
Date: Tue, 22 Feb 2005 07:13:09 -0500
Message-ID: <CcqdnUz8VN9BvIbfRVn-gg@comcast.com>

"jazzz_" <jazzz__at_poczta.onet.pl> wrote in message news:cvev2l$344$1_at_atlantis.news.tpi.pl...
>I can connect db using sqlplus -s un/pw_at_db , but i don't know how to make
>sqlplus to get usernames and write them to txt file.
> What does it mean: <<__END__ ???
>
> regards,
> jazzz_
>
>
> Uzytkownik "Cris Carampa" <cris119_at_operamail.com> napisal w wiadomosci
> news:421af0f2$0$6311$5fc30a8_at_news.tiscali.it...
> jazzz_ wrote:
>
>> how to get usernames from oracle database using shell script (from cmd
>> line)
>
> #!/bin/bash
>
> sqlplus -s un/pw_at_db << __END__
> set pages 100
> set pause off
> set feedback off
> set head off
> select username from all_users ;
> quit
> __END__
>
> Kind regards,
>
> --
> Cris Carampa (cris119_at_operamail.com)

Cris demonstrated a UNIX shell script 'here' file ... '<<' is standard input redirection of all text between two occurences of the following token -- in Cris' example, the token is __END__ (it could be anything)

Either spool the output of the script to a file with UNIX standard output redirection, or use the SQL*Plus SPOOL command to have SQL*Plus write to a file (download the SQL*Plus User's Guide at http://tahiti.oracle.com and read up on SQL*Plus commands)

++ mcs
> "Torna il re. Prosegue l'attesa per fante e cavallo."
> (da "Umanità Nova" n. 14 del 21 aprile 2002)
>
Received on Tue Feb 22 2005 - 06:13:09 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US