Results 1 to 9 of 9

Thread: Renaming a DB?

  1. #1
    Join Date
    Jul 2004
    Posts
    3

    Unhappy Unanswered: Renaming a DB?

    Hi Everybody,

    This is my first post so please bear with me. I've just recently inherited the administration of a few Oracle 9i databases at the company I work for. I've run in to the situation of the developers wanting to combine the data from 2 db's into one. Essentially one of the db's has only a few bits of data and one schema, but it has the name that the developers would like to keep. The other db has all the info but is called something else. My question is this... is it possible to "rename" the larger database? I've done some searching but I haven't found anything yet. If anybody has any ideas it would be most appreciated. Thanks in Advance

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >is it possible to "rename" the larger database?
    Yes, but other alternatives exist.
    1) You could export all the schemas from the BIG database & import into the other.
    2) Since most likely, the developers are remote clients to the DB server; change the TNS alias to be the desired name.
    See it really depends upon what you mean by the "database name".
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Jul 2004
    Posts
    3
    > See it really depends upon what you mean by the "database name".

    Basically by database name I mean the name which the developers use to connect to the db. They are connecting remotely so it sounds like the renaming the TNS Alias would probably be the way I'd like to go. Im not to familar with which part of the entry needs to be changed for that to happen though.

  4. #4
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    $ORACLE_HOME/NETWORK/ADMIN/SAMPLE/TNSNAMES.ORA is a well documented example TNSNAMES.ORA file.
    Use the clues in it to make the desired changes.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  5. #5
    Join Date
    Jul 2003
    Posts
    2,296
    basically, all you are concerned about in the tnsnames file is the "alias"
    which is what the developers will be connecting to (sqlplus user/password@alias)

    so, if in my tnsnames file I have this:
    PHP Code:
    Axe1 =  /* this line is your alias */
      
    (DESCRIPTION =
        (
    ADDRESS_LIST =
          (
    ADDRESS = (PROTOCOL TCP)(HOST 122.133.0.20)(PORT 1521))
        )
        (
    CONNECT_DATA =
          (
    SID prod1)
          (
    SERVER DEDICATED)
        )
      ) 
    then the developers say they want the db to be named to "Production", not "Axe1" then all you need to do is:
    PHP Code:
    Production =  /* this line is your alias */
      
    (DESCRIPTION =
        (
    ADDRESS_LIST =
          (
    ADDRESS = (PROTOCOL TCP)(HOST 122.133.0.20)(PORT 1521))
        )
        (
    CONNECT_DATA =
          (
    SID prod1)
          (
    SERVER DEDICATED)
        )
      ) 
    - The_Duck
    you can lead someone to something but they will never learn anything ...

  6. #6
    Join Date
    Jul 2004
    Posts
    3
    Thank you all for your help, I changed the alias and the developers are much happier now. I've got alot to learn but it's lot's of fun doing it. I'll just keep pluggin away and maybe I'll be able to turn around and help some others out like you've helped me. Thank you again.

  7. #7
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    Below is also a valid TNSNAMES.ORA entry...
    Production,AXE1,DBA_TEST = /* this line is your alias */
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 122.133.0.20)(PORT = 1521))
    )
    (CONNECT_DATA =
    (SID = prod1)
    (SERVER = DEDICATED)
    )
    )
    ################################################
    where any of the alias names to the left of the equal sign can be used.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  8. #8
    Join Date
    Jul 2003
    Posts
    2,296
    didn't know you could just use comas and have multiple aliases.
    nice!
    - The_Duck
    you can lead someone to something but they will never learn anything ...

  9. #9
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    Being able to have multiple aliases comes in handy where some client's
    have a SQLNET.ORA file which automagically appends ".WORLD" onto the connect string.


    mydb,mydb.world = ......
    then provides a single entry which satifies any client connection request.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

Posting Permissions

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