<?xml version="1.0"?>
<!DOCTYPE instances SYSTEM "sqlrelay.dtd">

<instances>

	<!-- Regular SQL Relay Instance -->
	<instance id="example" port="9000" socket="/tmp/example.socket" dbase="oracle8" connections="3" maxconnections="15" maxqueuelength="5" growby="1" ttl="60" maxsessioncount="1000" endofsession="commit" sessiontimeout="600" runasuser="sqlrelay" runasgroup="sqlrelay" cursors="5" maxcursors="10" cursors_growby="1" authtier="connection" handoff="pass" deniedips="" allowedips="" maxquerysize="65536" maxstringbindvaluelength="4000" maxlobbindvaluelength="71680" idleclienttimeout="-1" maxlisteners="-1" listenertimeout="0" reloginatstart="no" fakeinputbindvariables="no" translatebindvariables="no" isolationlevel="read committed" ignoreselectdatabase="no" waitfordowndatabase="yes">
		<users>
			<user user="user1" password="password1"/>
			<user user="user2" password="password2"/>
			<user user="user3" password="password3"/>
		</users>
		<session>
			<start>
				<runquery>alter session set nls_date_format='MM-DD-YYYY HH24:MI:SS'</runquery>
			</start>
			<end>
				<runquery>alter session set nls_date_format='DD-MON-YYYY'</runquery>
			</end>
		</session>
		<connections>
			<connection connectionid="db1" string="user=exampleuser1;password=examplepassword1;oracle_sid=EXAMPLE1;" metric="1" behindloadbalancer="no"/>
			<connection connectionid="db2" string="user=exampleuser2;password=examplepassword2;oracle_sid=EXAMPLE2;" metric="3" behindloadbalancer="no"/>
			<connection connectionid="db3" string="user=exampleuser3;password=examplepassword3;oracle_sid=EXAMPLE3;" metric="5" behindloadbalancer="no"/>
			<connection connectionid="db4" string="user=exampleuser4;password=examplepassword4;oracle_sid=EXAMPLE4;" metric="6" behindloadbalancer="no"/>
		</connections>
	</instance>


	<!-- Query Router/Filter -->
	<instance id="routerexample" port="9001" socket="/tmp/example.socket" dbase="router" connections="3" maxconnections="15" maxqueuelength="5" growby="1" ttl="60" maxsessioncount="1000" endofsession="commit" sessiontimeout="600" runasuser="sqlrelay" runasgroup="sqlrelay" cursors="5" authtier="connection" handoff="pass" deniedips="" allowedips="" maxquerysize="65536" maxstringbindvaluelength="4000" maxlobbindvaluelength="71680" idleclienttimeout="-1" maxlisteners="-1" listenertimeout="0" reloginatstart="no">
		<users>
			<user user="user1" password="password1"/>
			<user user="user2" password="password2"/>
			<user user="user3" password="password3"/>
		</users>
		<router>
			<!-- send all queries for table1 to host1 -->
			<route host="host1" port="9000" socket="" user="host1user" password="host1password">
				<query pattern="^\s*select\s+.*\s+from\s+table1"/>
				<query pattern="^\s*insert\s+into\s+table1"/>
				<query pattern="^\s*update\s+table1"/>
				<query pattern="^\s*delete\s+from\s+table1"/>
				<query pattern="^\s*drop\s+table\s+table1"/>
				<query pattern="^\s*create\s+table\s+table1"/>
			</route>
			<!-- filter out any queries for table2 -->
			<filter>
				<query pattern="^\s*select\s+.*\s+from\s+table2"/>
				<query pattern="^\s*insert\s+into\s+table2"/>
				<query pattern="^\s*update\s+table2"/>
				<query pattern="^\s*delete\s+from\s+table2"/>
				<query pattern="^\s*drop\s+table\s+table2"/>
				<query pattern="^\s*create\s+table\s+table2"/>
			</filter>
			<!-- send any other queries to host2 -->
			<route host="host2" port="9000" socket="" user="host2user" password="host2password">
				<query pattern=".*"/>
			</route>
		</router>
	</instance>

</instances>
