1846644 Members
2280 Online
110256 Solutions
New Discussion

Re: Query

 
Hunki
Super Advisor

Query

I have JBOSS installed on my server. The server has two environments test and develop and there is a single instance of JBOSS on the server. At a given time I need to start the JBOSS for either environments. ( Just one needs to be up ).For starting the JBOSS or pointing the JBOSS to one of the environments I need to make a change to a file called oracle.xml in which I change the Oracle SID according to the environments.

Can I make a script which automatically changes the SID to point to the repsective environments. The sample file is attached herewith.

The oracle SID is given like this in the file :

jdbc:oracle:thin:@172.200.80.73:1522:SID1

I just need to make a change to SID1 to point it another oracle SID.

Can I do it through a script.
2 REPLIES 2
Hunki
Super Advisor

Re: Query

The file is in the following path :

$JBOSS_HOME/server/default/deploy/oracle-ds.xml


OldSchool
Honored Contributor

Re: Query

to things come to mind:

use sed to make a change in the existing file, or, you could have 2 different files (possibly w/ an extension of "test" and "prod"?) and make a symbolic link between the original file name and the one w/ the correct contents for your instance?

There probably a bunch of others, like echoing the appropriate contents into the file based on condition, cating file mentioned above to existing file and so on