Announcement

Collapse
No announcement yet.

Modify tnsnames.ora file part 2

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Modify tnsnames.ora file part 2

    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.
Working...
X