No announcement yet.

Using GPO to change tnsname.ora configs

  • Filter
  • Time
  • Show
Clear All
new posts

  • Using GPO to change tnsname.ora configs

    Hello, I am having about 100 Oracle client machines connected or joined to a Windows Server 2003 domain. These clients are currently connected to an older Oracle database server machine.

    I now have a new database mounted on a separate system; I want these machines to automatically connect to the newer database when they start up their client applications, since the older database server is going to be decommissioned.

    How do I use GPO settings or scripting to automatically change the tnsnames.ora file of the individual client machines to point to the new IP address of the new database?


  • #2
    Re: Using GPO to change tnsname.ora configs

    I have never used a oracle, but with a quick google it looks like its a just a text file in a set location, so you could replace it with a script, use a script to write one on the fly, or use a batch file to modifiy the existing file.

    The simplest methiod, if you can replace the file would be to write a new one, store it at a location that all computers have access to, then get a batch file to move it to the correct location on the local machines (or use folder redirection to redirect the request to the server, but I have no idea if that would work for a database settings file like this).

    If you can not replace the old file, and have to modifiy it, you can use the >> command to write lines to a text file using a CLI. This will be messy, and as far as I am aware you can only add lines to the END of the file.

    If there is any reason why you can not use the above methiods, let me know and I will go back to my SBS coner, but if so, I can write up a batch file that will create a file with
    ORA11 =
       (ADDRESS_LIST =
         (ADDRESS = (PROTOCOL = TCP)(HOST = = 1521))
       (SERVICE_NAME = ORA11)
    In it no problem.

    Good to be back....


    • #3
      Re: Using GPO to change tnsname.ora configs

      You could also use ant to modify the file.
      Gareth Howells

      BSc (Hons), MBCS, MCP, MCDST, ICCE

      Any advice is given in good faith and without warranty.

      Please give reputation points if somebody has helped you.

      "For by now I could have stretched out my hand and struck you and your people with a plague that would have wiped you off the Earth." (Exodus 9:15) - I could kill you with my thumb.

      "Everything that lives and moves will be food for you." (Genesis 9:3) - For every animal you don't eat, I'm going to eat three.