OBIEE : Change Database based on USER login
Due to some performance concerns my client wants to switch some of users to a different Db and reduce the load on first Db and they want the liberty of changing the users to both database whenever they want.
Below is the solution we have implemented
1) The client provided 2 databases and by using database clone method(volume copy) data will be copied to second Db every morning.
2) To Implement the switching added 2 tables in Database
Table 1 |
|
Group |
Connection_String |
G1 | Database Connection String |
G2 | Database Connection String |
Table 2 |
|
User |
Group |
User1 | G1 |
User 2 | G2 |
3) Create Session initialization block to get the group name for the user by sending query to table 2
Sample query: Select 'GROUP_NAME',Group from table 2 where User = 'VALUEOF(NQ_SESSION.USER)'
4)Create Session initialization block to get the connection string from table 1 based on the group.
Sample query: Select 'OLAP_DSN',Connection_string from table 1 where Group= 'VALUEOF(NQ_SESSION.GROUP_NAME)'
both initializations are created as session initialization block so it will run when the user logged in. Also, these block should be run with separate connection pool with all the credential specified
5) In connection pool use the variable created using second session initialization block
For me username and PWD same for both DB so I have specified that directly in Connection pool. Or you can add username and PWD in table 1 and get it in a variable and send to Connection pool.
Hope it helps!!
Regards,
Sreejith
Comments
Post a Comment