Thursday, November 23, 2006

Cognos8: New data does not appear even when the query is rerun

This is due to internal caching which is a default setting in Cognos 8.
Caching options can be set in three places:

1. Properties of the query in Report Studio.
2. Properties of the model in Framework Manager (under edit Governors)
3. Global cache set which is set as follows:
a) Go to the \Cognos\C8\configuration directory.
b) Make a copy of the CQEConfig.xml.sample file.
c) Rename the above file to CQEConfig.xml.
d) Open the file for editing.
e) About half way through the file there is an entry name called queryReuse. Change the value to 0.
f) Restart the Cognos8 Service

Accessing Windows Scheduler using VB Code

Option Explicit
' Schedule api's
Declare Function NetScheduleJobAdd Lib "netapi32.dll" _(ByVal Servername As String, Buffer As Any, Jobid As Long) As Long

' Schedule structure
Type AT_INFO
JobTime As Long
DaysOfMonth As Long
DaysOfWeek As Byte
Flags As Byte
dummy As Integer
Command As String
End Type

' Schedule constants
Const JOB_RUN_PERIODICALLY = &H1
Const JOB_NONINTERACTIVE = &H10
Const NERR_Success = 0

Private Sub Command1_Click()
Dim lngWin32apiResultCode As Long
Dim strComputerName As String
Dim lngJobID As Long
Dim udtAtInfo As AT_INFO

' Convert the computer name to unicode
strComputerName = StrConv(Text1.Text, vbUnicode)

' Setup the tasks parameters
SetStructValue udtAtInfo

' Schedule the task
lngWin32apiResultCode = NetScheduleJobAdd(strComputerName, udtAtInfo, lngJobID)

' Check if the task was scheduled
If lngWin32apiResultCode = NERR_Success Then
MsgBox "Task" & lngJobID & " has been scheduled."
End If
End Sub

Private Sub SetStructValue(udtAtInfo As AT_INFO)
Dim strTime As String
Dim strDate() As String
Dim vntWeek() As Variant
Dim intCounter As Integer
Dim intWeekCounter As Integer

vntWeek = Array("M", "T", "W", "TH", "F", "S", "SU")

With udtAtInfo
' Change the format of the time
strTime = Format(Text2.Text, "hh:mm")

' Change the time to one used by the api
.JobTime = (Hour(strTime) * 3600 + Minute(strTime) * 60) * 1000

' Set the Date parameters
If Val(Text3.Text) > 0 Then
' Set the task to run on specific days of the month i.e. 9th & 22nd of the month
strDate = Split(Text3.Text, ",")
For intCounter = 0 To UBound(strDate)
.DaysOfMonth = .DaysOfMonth + 2 ^ (strDate(intCounter) - 1)
Next
Else
' Set the task to run on sepecific days of the week i.e. Monday & Thursday
strDate = Split(Text3.Text, ",")
For intCounter = 0 To UBound(strDate)
For intWeekCounter = 0 To UBound(vntWeek)
If UCase(strDate(intCounter)) = vntWeek(intWeekCounter) Then
.DaysOfWeek = .DaysOfWeek + 2 ^ intWeekCounter
Exit For
End If
Next
Next
End If

' Set the interactive property
If Check1.Value = vbUnchecked Then
.Flags = .Flags Or JOB_NONINTERACTIVE
End If

' Set to run periodically
If Option2.Value = True Then
.Flags = .Flags Or JOB_RUN_PERIODICALLY
End If

' Set the command to run
.Command = StrConv(Text4.Text, vbUnicode)
End With
End Sub

Steps to Restore Contributor application to a different database and application name

To accomplish this, first back up the Contributor application then restore the database using SQL Enterprise Manager. Restore it to a new database name, then link to new application within the Contributor Admin console.

Follow these steps to restore a Contributor Application to a new database name:
1. From the Contributor Admin Console, Expand the application you want to backup, expand Development, expand Datastore options, then select Datastore Maintenance.
2. Make a note of the location that you're backing up your files to, and then click Backup.
3. Launch SQL Enterprise Manager and browse to Databases.
4. Right-click Database and select 'All tasks', then 'Restore database'.
5. In the Restore as Database field, type the new name for the database (make certain there are no uppercase characters in the name).
6. In the Restore section click From Device, click Select Devices, click Add.
7. In the File name section browse to the location where you saved your backup database.
8. Select the .dat file that was saved in step 2, then click OK, click OK again, then click OK again.
9. Go to the Options tab and in the Move to physical filename field, type the path where you want to restore the new database to. Do the same for both the log file and the dat file.
10. Go to the General tab, select View Contents and make sure you check off the latest backup set date. (The date should correspond to the date when you performed your backup in step 2.)
11. Click OK, and click OK again. The SQL Restore is complete.
12. Launch Contributor Admin Console, right-click your Datastore server and select Link to Existing Application.
13. You should see the Application name of the new database you just restored, check that off and select Add.

Recommended to set Hyper-threading off when configuring the Contributor Web/Application

Contributor: Applies to all version

According to the documentation from Intel, the hyper-threading concept was designed to improve performance of software that uses an average of 30% CPU cycles at any given time. Hence you can effectively push two threads through the CPU for an average of 60% CPU utilization, plus some overhead, increasing the software's performance by 100%.

Contributor was designed with performance in mind, so that when you publish, initialize, and/or synchronize, the application uses 100% of the available CPU cycles.

For applications like Contributor that already maximize the CPU processes, when you attempt to push two 100% CPU utilization threads through each processor you do not receive any improvement in performance. You actually get a decrease in performance since there is some overhead to the hyper-threading processing that gets added to the 200% utilization. If we assume an additional 2% for overhead, you end up attempting to utilize 202% of the CPU cycles available. Thus, Contributor processes will run faster with hyper-threading turned off.

Hyper-threading can be setted off from BIOS Settings. You can take the help of IT Person or Network person for this task.