DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: linux/unix environement

  1. #1
    Join Date
    Aug 2003
    Posts
    54

    linux/unix environement

    quick questions:

    in .bashrc in linux you export certain for the environment on Linux. One of the command is to export the SID as follow:

    export ORACLE_SID=test

    what if you have two or three instances on the same server???? can we say :

    export ORACLE_SID=test, dummy1, dummy2


    or we have to have different export line for each instance????

    thanks

  2. #2
    Join Date
    Dec 2000
    Location
    Brazil / São Paulo
    Posts
    97
    The ORACLE_SID is a reference to the current instance (that it will have to be worked at the moment)
    Does not have reference with TNSNAMES or LISTENER
    Márcio de Souza Almeida
    DBA Oracle / SQLServer / PostgreSQL
    Rua Cupa, 139 Apto 85 A
    Penha - São Paulo - SP
    03640-000 - Brasil
    http://www.directory.com.br

  3. #3
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,334
    if you maintain the oratab file you can use oraenv (. oraenv) and then choose your sid which will set your environment for that server. Otehrwise you eitehr have to have a separate user for each instance (bad idea) or set it the ORACLE_SID manually each time

  4. #4
    Join Date
    Aug 2003
    Posts
    54
    Dave,

    thanks for your response, if I want to set ORACLE_SID everytime, what do I need to do??? I never done this before so could you please kindly give me the full instructions????

    thanks

  5. #5
    Join Date
    Mar 2002
    Location
    Mesa, Arizona
    Posts
    1,204
    We have a setdb script that sets the environment for the current db on a machine. You could run it at login. Replace the **DBXX** with your db name.

    if [ "$XSETAPP" = "TRUE" ]
    then
    echo "Your Environment has ALREADY been set"
    echo "Type exit to return to your previous environment before running setapp"
    exit
    fi

    choice=NG
    while [ "$choice" = "NG" ]
    do
    # echo ""
    clear
    echo "Select an Environment to Set :"
    echo ""
    echo " 1) **DB1** 8.1.7"
    echo " 2) **DB2** 7.3.4"
    echo " 3) **DB3** 8.1.7"
    .
    .
    echo " 12) **DB12** 8.1.7"
    echo " Q) Quit"
    echo ""
    echo "Enter choice : \c"
    read choice

    case $choice in

    1|**DB1**|**db1**)
    umask 022
    XSETAPP=TRUE
    ORACLE_SID=**DB1**
    ORACLE_HOME=/u001/oracle/8.1.7
    PATH=$ORACLE_HOME/bin:$PATH
    SHLIB_PATH=$ORACLE_HOME/lib
    ADMIN=/u001/home/oracle/admin
    export XSETAPP ORACLE_SID ORACLE_HOME PATH SHLIB_PATH ADMIN
    ;;
    2|**DB2**|**db2**)
    umask 022
    XSETAPP=TRUE
    .
    cut
    .
    12|**DB12**|**db12**)
    umask 022
    XSETAPP=TRUE
    ORACLE_SID=**DB12**
    ORACLE_HOME=/u001/oracle/8.1.7
    PATH=$ORACLE_HOME/bin:$PATH
    SHLIB_PATH=$ORACLE_HOME/lib
    TNS_ADMIN=$ORACLE_HOME/network/admin
    NLS_LANG=AMERICAN_AMERICA.UTF8
    ADMIN=/u001/home/oracle/admin
    export XSETAPP ORACLE_SID ORACLE_HOME PATH SHLIB_PATH TNS_ADMIN NLS_LANG ADMIN
    ;;
    Q|q|quit|QUIT)
    clear
    ORACLE_SID=invalid
    export ORACLE_SID
    exit
    ;;
    *)
    echo "\n\007Invalid choice."
    echo "Please make another selection.\n"
    echo "Press Enter to continue ...\c"
    ORACLE_SID=invalid
    export ORACLE_SID
    read return
    choice=NG
    ;;
    esac
    echo "ORACLE_SID is set to " $ORACLE_SID
    done

    trap 'echo "\nReturning to previous shell and environment ORACLE SID set to 'invalid' "' 0
    $SHELL
    "I do not fear computers. I fear the lack of them." Isaac Asimov
    Oracle Scirpts DBA's need

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width