COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => COGNOS Connection => Topic started by: cognostechie on 10 Nov 2010 06:38:46 PM

Title: Toggle between Development and Production Databases
Post by: cognostechie on 10 Nov 2010 06:38:46 PM
I have a unique requirement. The client does the development on the DEV server. However, when some changes are made (Ex: A New report is made or an existing report is modified), they want the users to
test the report with the Production Data.

Is there a way to toggle a single report between the DEV and PROD databases? Pointing the datasource of DEV to Production servers would result in all reports being pointed to the Production database. Putting a prompt in the Data Source would result in all reports prompting the users.

I did implement a solution but wanted to see if there is a better way.

Thanks
Title: Re: Toggle between Development and Production Databases
Post by: tupac_rd on 18 Nov 2010 01:39:25 PM
you can have 2 security groups Dev and Prod, and all the users are added to both the groups. Create 2 connections within the datasource - Dev and Prod, and restrict each each connection to the respective group. So, users in Dev group will only have access to dev connection and vice versa.

so if the report is given execute access only to dev group, report is run against dev db and vice versa. you could also have 2 report views one each for prod and dev and restrict them based on user groups

HTH
2pac
Title: Re: Toggle between Development and Production Databases
Post by: cognostechie on 18 Nov 2010 07:28:09 PM
Thanks ! Will this not prompt the user to select the connection when the report is run?
Title: Re: Toggle between Development and Production Databases
Post by: JGirl on 25 Nov 2010 03:14:39 PM
If the user only has permissions to one of the two connections, they will not be prompted.  If they have permissions to both connections, they will be prompted.
Title: Re: Toggle between Development and Production Databases
Post by: cognostechie on 25 Nov 2010 08:23:26 PM
They need to have permissions to both the connections otherwise they will be able to run the report only against Test or Production. The ovjective here is to let them run the report against BOTH.
Title: Re: Toggle between Development and Production Databases
Post by: josepherwin on 25 Nov 2010 09:46:53 PM
If it is only for a single report, I guess you can create a separate package which points your production model to your PRD database.

So before your user run it, make sure they point the report package to this new package.

I'm guessing that this is the only way to do it if you are only interested in testing A report.

Something that you might want to look at is the new Cognos 10 LifeCycle Manager. this is like the better version of Upgrade Manager, I have not seen it in action, but from the demo it will allow you to point a report to 2 different data sources.
Title: Re: Toggle between Development and Production Databases
Post by: cognostechie on 26 Nov 2010 04:46:24 PM
That's exactly what I have done. I wanted to see if somebody has a better solution because toggling the report between two different packages requires maintenance. When a change is made to the model, it requires to point the data source to another content manager datasource which is pointed to production and publish both the packages, not just one.
Title: Re: Toggle between Development and Production Databases
Post by: rockytopmark on 20 Dec 2010 03:30:01 PM
You can set your Framework Model up to prompt for which Data Source to use, and build the SQL to be executed to use the correct Cognos Data Source based on the prompt reply.  This would be with a single package for use in all desired environments, with each and every report requiring the parameter be satisfied.

1. In Cognos Connection, create a Cognos Data Source for each environment
2. In Framework Manager, in your model, create a Data Source entry for each Cognos Data Source desired.
3. Create a Parameter Map named "DS" with an entry for each environment's Data Source name.
4. In each and every Data Source Query Subject, replace the [DataSourceName] in the SQL statement
    with a prompt macro: #$DS{prompt('pDataSource','token','PROD')}#

... where pDataSource is a parameter name and PROD is the Default

So, your Data Source Query Subjects might look something like:

Old:
Select * from [DataSourceName].TableName

New:
Select * from #$DS{prompt('pDataSource','token','PROD')}#.TableName

and the DS Parameter Map entries might be:
Key..........Value
-----------------------------------------------------------------
PROD .......[DataSourceName-Prod]
DEV..........[DataSourceName-Dev]