Modify tnsnames.ora file part 2

Home Forums Scripting General Scripting Modify tnsnames.ora file part 2

This topic contains 0 replies, has 1 voice, and was last updated by CaTBuS CaTBuS 10 years, 7 months ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • CaTBuS
    CaTBuS
    Participant
    #138753

    Ok, a few months ago, the wonderful members of Petri helped me out with modifying a tnsnames.ora file. The code edited the file by adding several lines of text to the end of the oracle world entries.

    Previous post:
    http://forums.petri.com/showthread.php?t=26943

    I need to modify the above code so that it now checks for a specific line of text. If found, the script would edit so many lines below. For instance, in the entry below, I would need to search the file for the test.world entry, then check the port number and host. If port number =1521 and host = oracle, change port line to 1520 and host to oracle10g.

    Code:
    test.world =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS =
    (COMMUNITY = tcp.world)
    (PROTOCOL = TCP)
    (Host = oracle)
    (Port = 1521)
    )
    (ADDRESS =
    (COMMUNITY = tcp.world)
    (PROTOCOL = TCP)
    (Host = oracle)
    (Port = 1526)
    )
    )

    Looking forward to the genius slew of solutions. As always, you guys are a life saver.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.