3.15. <SessionDatabase SQL> Previous topic Parent topic Child topic Next topic

This optional clause specifies an external SQL Session Database for radiusd.
<SessionDatabase SQL> has a number of customisable SQL statements (AddQuery, DeleteQuery, UpdateQuery, ReplaceQuery, ClearNasQuery and CountQuery). These statements are used to add, remove, maintain and count the entries in the SQL Session Database. The default statements will work with the example RADONLINE table in the example SQL schemas in the goodies directory. If you wish, you can use more or fewer columns in your SQL Session Database, and you can change the names of the columns or the table. If you do use a different table schema, you will probably have to change statements to match your schema.
You can configure the SQL database(s) that <SessionDatabase SQL> uses in the same way as with AuthBy SQL: by defining one or more DBSource, DBUsername and DBAuth lines. For more information, see Section 3.35. <AuthBy SQL>.
You can specify multiple databases by using multiple DBSource, DBUsername and DBAuth parameters. Whenever Radiator tries to connect to an SQL Session Database, SQL will try to connect to the first DBSource listed, using the first DBUsername and DBAuth parameters. If that connection fails, it will try the second, third etc., until all the databases are exhausted, and finally gives up.
<SessionDatabase SQL> is tolerant of database failures. If your database server goes down, Radiator will try to reconnect to a database as described above, starting again at the first database you specified. Whichever database Radiator connects to, it will stay connected to it until that database becomes unreachable, at which time it will again search for a database, starting at the first again. If on the other hand, Radiator is not able to connect to any SQL server, it will stop enforcing Simultaneous-Use limits until one of its databases comes back on line.
<SessionDatabase SQL> understands also the same parameters as <SessionDatabase xxxxxx>. For more information, see Section 3.14. <SessionDatabase xxxxxx>. It supports also all the common SQL configuration parameters. For more information about the SQL configuration parameters, see Section 3.6. SQL configuration.