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

Thread: New database creation scripts on Sun Solaris

  1. #1
    Join Date
    Dec 2001
    Posts
    22
    Hi,
    This is the scenario.
    1. We do have an existing database in Sun Solaris Machine.
    2. We are trying to create a new database in the same machine.
    3. This is what we did
    a. SVRMGRL
    b. run database creation script.
    c. Oracle was not identified
    d. So we connected internal
    e. It got connected to the old database
    f. So we said startup nomount pfile="new database's init.ora file"
    g. when we say V$instance it still says our old database.

    how do I avoid connecting to the old database.

    Can anybody help us in this regard.

    thanks in advance

  2. #2
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    Did you change your environment variables to point to the new environment?
    Jeff Hunter

  3. #3
    Join Date
    May 2002
    Location
    USA
    Posts
    462
    Change .profile file in unix ,
    add ORACLE_SID , ORACLE_HOME , AND ORACLE_HOME These variables and after unix prompt set . oraenv apply a new oracle_sid .
    export ORACLE_SID ( if not set in .profile )
    u can check if you are pointing to the right instance .
    siva prakash
    DBA

  4. #4
    Join Date
    Oct 2000
    Location
    Charlotte, USA
    Posts
    330
    Hi you are trying to create another database ....right?.
    That means ORACLE_HOME and ORACLE_BASE are same for both the databases...So,comment oracle_sid if you have specified in .profile or .cshrc file...

    Make entry in oratab file....(/var/opt/oracle/oratab)
    for the new database.....say db is TEST

    TESTath of the oracle_home:Y
    then
    coraenv or oraenv
    set to TEST

    svrmgrl
    connect internal
    run the script...
    you are good to go sir.
    Thanks.
    Thanigaivasan.


  5. #5
    Join Date
    May 2002
    Posts
    2,645
    Originally posted by thanigai
    That means ORACLE_HOME and ORACLE_BASE are same for both the databases
    ORACLE_BASE, which can be used to derive ORACLE_HOME, are directories leading to the RDBMS program files and have ABSOLUTELY NOTHING to do with establishing where your datafiles go.

    ORACLE_BASE, roughly speaking, is the mount point on your file system where the Oracle product tree starts. Your ORACLE_BASE may be /disk1/ora816/app/oracle.
    ORACLE_HOME is $ORACLE_BASE/product/version (for example, $ORACLE_BASE/product/8.1.6).

    Do you have a DBA reference book? The nature of your question really suggests you should get one if you don't, or read it, if you do. In UNIX, it is important to know who you are and where you are. Starting server manager and not knowing where you are (wrong ORACLE_SID) can have disastrous consequences if your database is critical.

  6. #6
    Join Date
    Oct 2000
    Location
    Charlotte, USA
    Posts
    330
    Hi Stecal,
    Why you show that much anger...?.
    I could not even understand to whom you are showing that anger.
    I just suggested him to do to set the correct SID before svrmgrl..but you gave big lecture...
    Can't we have diff $ORACLE_BASE and $ORACLE_HOME in same machine???????.
    many places....even in our work..
    we have two diff $ORACLE_HOME /apps/product/8.1.7 and /apps/8.1.6 in same machine.
    decide it by setting SID...
    First of all he is in nervous.....
    Also by giving steps he is asking help...try to help him ...
    By showing anger donot put people to do more mistakes..
    Sorry about that.
    I appricite your theoritical knowledge
    Thanks.
    Thanigaivasan.

  7. #7
    Join Date
    May 2001
    Posts
    41

    Thumbs up

    Thanigai's soulation is the correct one, I have done this last night............................



    Cheers,
    ~mn

  8. #8
    Join Date
    Dec 2001
    Location
    SAN FRANCISCO, CA
    Posts
    306
    boss correct me if i am wrong.

    he can copy the .profile from his earlier unix user login where in the .profile he must have given the instance details ,oracle_home details , to new unix user login and set the new oracle_sid , oracle_home ad other variables in that profile - right ?

    and if for any particular instance he has to connect he can just issue EXPORT_SID = < INSTANCE NAME > and then issue svrmgrl command - right

    --pravin

    Eat , Drink & Enjoy life -

    pravin_kini@hotmail.com

  9. #9
    Join Date
    May 2002
    Posts
    2,645
    Sorry if it came across that way - I was really trying to emphasize the importance of knowing your environment and understanding what some names/variables refer to and how they relate to your system - topics that are usually stressed in the beginning of reference books.

    As mentioned, yes you can have multiple Oracle homes on a workstation - they will refer to different products. And as a technique, name the owner of each product something related to what the product is or does. Your base product 8.1.6 owner can be named oracle. When you go to 8.1.7 or 9i, use a UNIX account name of ora817 and ora9i (or ora91). They will all belong to the same group (dba, oinstall, etc.) and have that in common.

    This way, when you log in for a product, you can pretty much touch/write ONLY that product - especially the datafiles. Prevents accidental erasure and problems like that. The only variable you need to manipulate is ORACLE_SID. If you log in against the wrong product-related SID, you are protected. Just my two cents worth.

  10. #10
    Join Date
    Oct 2000
    Location
    Charlotte, USA
    Posts
    330
    Stecal,
    That is not my intention too...
    I always teach fishing than feeding fish.But this case he is in trouble...help him first by feeding and later teach him.Thats it.
    Thanks.
    Pravin,
    ..having multiple account in same box is not a good idea..
    Have a single account...oracle...login home /apps/oracle or /apps2/oracle ....like that...so u will have only one environment....
    set .profile or .cshrc file such a way no value for $ORACLE_HOME or $ORACLE_SID is mentioned...
    meaning ...install the software in required oRACLE_HOME..
    set PATH=$ORACLE_HOME/bin:/var/opt/oracle:/....
    PFILE=$ORACLE_BASE/admin/$ORACLE_SID/pfile like that.

    the oracle_home should be taken only from ORATAB file..depending on SID value...
    so define there..
    TEST:/apps/oracle/product/8.1.6:Y
    DATA:/apps/oracle/8.1.6:Y
    TRUE:/apps/oracle/8.1.7:Y

    now when u source the coraenv/oraenv
    you are setting the SID and getting ORACLE_HOME for the SID..
    that way we can manage multiple oracle_home...
    Thanks.
    Thanigaivasan.

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