Re: Shell и Oracle Instance

From
Andrew Lutov (2:5000/26)
To
Mihail Kuznetsov
Date
2006-01-19T09:07:08Z
Area
RU.UNIX.SOLARIS
From: "Andrew Lutov" <andrew_l @ newmail.ru>

Hello, Mihail!

 S>>>> ORACLE_SID=lgota ; export ORACLE_SID

 AL>>> Монопенисуально.
 MK> а вот и нет

 MK> пардон для ksh: set ORACLE_SID <SID>
 MK> а прописывать в файлах ~/*.sh

Работает для sh, но мне нужен ksh. Можно увидеть правильный
скрипт для него ?


У меня вот такой не работает:

#!/usr/bin/ksh

ORACLE_BASE=/pub/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/8.1.7

ORACLE_PATH=$ORACLE_HOME/bin

set ORACLE_SID lgota
$ORACLE_PATH/sqlplus '/as sysdba' <<EOF
set echo on
archive log list;
EOF


Кстати, man ksh для Solaris 9 Sparc говорит:

     ** export [ name[=value] ] ...

     ** export -p
           The given names are marked for automatic export to the
           environment of subsequently-executed commands.

           When -p is specified, export writes  to  the  standard
           output  the names and values of all exported variables
           in the following format:


           "export %s=%s\n", name, value

           if name is set, and:


           "export %s\n", name

           if name is unset.

           The shell formats the output, including the proper use
           of  quoting, so that it is suitable for reinput to the
           shell as commands  that  achieve  the  same  exporting
           results, except for the following:

           1. Read-only variables with values cannot be reset.

           2. Variables that were unset at  the  time  they  were
              output  are not reset to the unset state if a value
              is assigned to the variable between  the  time  the
              state  was  saved  and  the time at which the saved
              output is reinput to the shell.


т.е. как бы "export ORACLE_SID=lgota" должно работать. Только
непонятно про "**" перед командой.

     4. Words, following a command preceded by ** that are in the
        format  of  a  variable assignment, are expanded with the
        same rules as a  variable  assignment.  This  means  that
        tilde substitution is performed after the = sign and word
        splitting and file name generation are not performed.


Про "set" там тоже есть, но тоже почему-то не работает.

-- 
А5 увидимся е2 ли 


--- ifmail v.2.14.os-p7
 * Origin: Garant-Siberia fidonet station (2:5000/26@fidonet)
SEEN-BY: 46/50 400/333 520 450/1024 463/68 464/36 910 465/213 550/5068 5000/0
SEEN-BY: 5000/2 3 14 26 67 81 94 104 130 170 5000 5002/5002 5004/75 1111
SEEN-BY: 5005/14 5009/14 5010/77 352 5011/13 5012/46 5015/10 28 5020/545 715
SEEN-BY: 5020/4441 5021/29 5025/3 5027/12 5029/34 5030/115 1957 5035/38 5045/7
SEEN-BY: 5053/16 5054/1 4 8 9 28 35 37 5055/177 5062/10 5069/7 5070/66
SEEN-BY: 5080/1003 5085/13 5090/1029 5095/20 5096/18 6000/254 6035/1
PATH: 5000/26 5000 5020/545 5054/1 37