Product:

Microsoft Windows

git version 2.33.1.windows.1

Issue:
What is a good order of command to work with GIT?

Suggestion:

Install GIT on your computer from here https://git-scm.com/download/win

https://git-scm.com/book/en/v2/Getting-Started-Installing-Git

Create a folder, where you will work with git, in our example we use C:\kurser\git-demo-example

To setup a repository, you can follow this steps: https://towardsdatascience.com/an-easy-beginners-guide-to-git-2d5a99682a4c

When you are inside your git folder, you can start using GIT from tools like GIT BASH or SOURCETREE. https://www.sourcetreeapp.com/enterprise          https://gitforwindows.org/

Git commands are case sensitive, and git commands is always lowercase. git used to that.

If you work with Azure DevOps as master source, the git function can depend on how Azure DevOps is setup.

We guess you have already clone your repo, so you can start to work.

git status  (to check you are in correct folder and branch, mostly main at start)

git pull  (to download the latest changes to the project from the remote master)

git checkout -b  “Feature/1234”  (to create a branch and start working on the files)

Work with your file in Notepad++ or Visual Studio, and save your work in the folder you have for git.

git add .  (to add all changed files to the git source control)

git commit -m “This is a updated file”   (to save the changes to your branch, add a online comment about the files)

git checkout master (switch to your local main branch to update it with any new remote changes)

git pull  (download the latest changes done by others to your main branch)

git checkout “Feature/1234”  (go back to your local branch, you been working in)

git merge master (get the files from master into your branch, any conflicts have to be solved in Visual Studio locally)

You may have to change the word master to main in your version of GIT, also remember that the branch-name is case sensitive.

git push origin “Feature/1234”   (to push your changes up to the remote git server)

Then you have to go to your remote git (or Azure DevOps) in your web browser and complete the pull there.

This picture will look different for what kind of remote repo you use. Above is from https://github.com

Click on Compare & pull request button

Enter some descriptive text and click on Create pull request button.

As we are lucky, no conflicts, you can press Merge pull request. Good practice is to leave explaining comments about what the code change is about.

Click on Confirm merge button.

Recommendation is to Delete the branch, so it is not laying around.

Then you are good to go – and start over from top with your next change.

git log –oneline   (enter to see the steps you have done)

Download and install WinMerge, to have a tool to compare files. https://winmerge.org/downloads/

Download and use Visual Studio Code https://code.visualstudio.com/download to solve conflicts.

git reflog  (to see more detail’s of what you done)

If I accidental delete files in my local folder for the git project, i can reset my state to the one before with command:

git reset  –hard origin

This will only work if i have not committed and push the change up to remote repo.

 

More Information:

https://education.github.com/git-cheat-sheet-education.pdf

https://towardsdatascience.com/an-easy-beginners-guide-to-git-2d5a99682a4c

https://rogerdudler.github.io/git-guide/

https://rogerdudler.github.io/git-guide/files/git_cheat_sheet.pdf

https://www.atlassian.com/git/tutorials/git-bash

https://docs.microsoft.com/en-us/azure/devops/repos/git/pull-requests?view=azure-devops&tabs=browser

https://www.stanleyulili.com/git/how-to-install-git-bash-on-windows/

https://www.freecodecamp.org/news/practical-git-and-git-workflows/

https://docs.microsoft.com/en-us/visualstudio/subscriptions/download-software

https://visualstudio.microsoft.com/vs/older-downloads/

https://visualstudio.microsoft.com/free-developer-offers/

https://github.com/microsoft/vscode

https://medium.com/@deprov447/a-simple-git-guide-8854d5c3ae12

https://git-scm.com/docs/gittutorial

https://www.edureka.co/blog/git-commands-with-example/

Product:

Microsoft Power BI local server

Microsoft Windows 2019 server

Issue:

When user browse to the home or browse button in the Power BI portal they get a error like:

Could not load folder contents

You are not allowed to view this folder. Contact your administrator to obtain the necessary permissions

This when they go to http://servername/Reports/browse

Solution:

In Power BI, all reports and folders, can be you set security on. The root or browse folder is the same, it is only that it is hard to find.  You need to click on “Manage Folder” to get there.

Login to PowerBI as administrator.
Go to the “root” folder by click on browse.

Then click on “manage folder ” on the right to get to the security dialog.

Inside security, click on “Add group or user” to add a group like “everyone”.

Enter the name of the group, mark “browse” and click OK.

Now this group can see this folder, and all sub-folders that do not have “customize security” set.

Recommendation, is that you on all folders and reports in the top (root) folder are having “customize security” active, so you need to manually add the users or AD groups to this folders for users to be able to view them.

Customize Security will make the folder to not inherit the security groups from the folder above.

To be able to see a sub-folder, the user need access to the top folder above as Browser.

More Information:

https://community.powerbi.com/t5/Report-Server/Access-to-the-home-folder/m-p/448374#M6249

https://docs.microsoft.com/en-us/power-bi/enterprise/service-admin-rls

https://guyinacube.com/2020/02/25/can-you-use-groups-with-power-bi-row-level-security-rls/

https://www.bconcepts.pt/power-bi-report-server-configuration-and-security-implementation/

https://iterationinsights.com/article/how-to-get-set-up-with-power-bi-desktop-and-power-bi-service/

https://www.bluegranite.com/blog/tips-for-a-successful-power-bi-report-server-implementation

Product:
Microsoft SQL server 2016

Issue:

SSIS job fail with error:

Could not find database ID 42, name ’42’. The database may be offline. Wait a few minutes and try again.

Solution:
Check if the database have change ID.

select * from sys.databases

Above will list the database name and id.

When you do a detach and attach on a database file, you can if you are unlucky, get a new ID on the database. Then old SSIS job that worked yesterday, will fail.

Repeat the detach and attach process to get the database back to correct number.

Move file locations with ALTER command instead; this script will list the commands for each database

SELECT DB_NAME(database_id) AS [Database] 
, name AS [LogicalName]
, type_desc AS [FileType]
, physical_name AS [FilePath]
, 'ALTER DATABASE ' + DB_NAME(database_id)
+ ' MODIFY FILE ( NAME = ' + name + ', FILENAME = ''' + physical_name + '''); 'AS Command
FROM SYS.master_files
WHERE database_id > 4
ORDER BY database_id ASC, type_desc DESC;

You have to change the path to new location before you run the command.

Also copy the database files to the new location before you run the script.

https://blog.coeo.com/moving-sql-databases

 

More Information:

https://docs.microsoft.com/en-us/sql/relational-databases/system-catalog-views/sys-databases-transact-sql?view=sql-server-ver15

Understanding different SQL Server database states

https://www.mssqltips.com/sqlservertip/1420/sql-server-system-databases/

 

Product:

SAS

Microsoft SQL server 2016

Issue:

Some tables are not visible in SAS client program, even do the same user can see the tables in Microsoft SQL Server Management Studio (SSMS) or Tableau.

As the same user can see the tables inside Microsoft SQL Studio, it is not a permission issue.

Solution:

Change the tables and views in SQL to have shorter names. SAS can not show SQL tables or views that have a name longer than 32 characters.

 

More Information:

http://support.sas.com/documentation/installcenter/en/ikforecastwofrsr/75572/HTML/default/index.html

https://www.tableau.com/sv-se/products/desktop

Product:
Microsoft Power BI
Microsoft Windows 2016 server

Issue:
You have a working Dynamic SQL query, but when you schedule it, it stop working.

Suggested solution:
Rebuild your query to not use Dynamic SQL, to make it possible to schedule it in PowerBi.

See if you can change to use fewer different data sources.

More Information:

https://docs.microsoft.com/en-us/power-query/dataprivacyfirewall

https://medium.datadriveninvestor.com/setting-a-scheduled-refresh-on-a-dynamic-data-source-in-power-bi-409ccec7337b

https://community.powerbi.com/t5/Service/Dynamic-SQL-through-ODBC-is-breaking-refresh-capability/m-p/276408

https://powerbitalks.com/2020/06/refresh-dataset-using-button-powerbi.html

https://docs.microsoft.com/en-us/power-bi/connect-data/refresh-data

Product:
Microsoft PowerBI report server  Version 1.10.7737.32652 (January 2021)
Microsoft Windows 2016 server

Issue:
Some of the powerbi reports does not refresh from the portal or on schedule. You get a error message like this;

2022-01-19 : |ERROR|63|Error Processing Data Model Refresh: SessionId: , Status: Error Failed to refresh the model, Exception Microsoft.AnalysisServices.OperationException: Failed to save modifications to the server. Error returned: ‘COM error: Microsoft.PowerBI.ReportServer.ASEngineManagedRoot, Datasource … is not found..
COM error: Microsoft.PowerBI.ReportServer.ASEngineManagedRoot, Datasource … is not found..
The current operation was cancelled because another operation in the transaction failed.

The powerbi report can be refreshed from PowerBI for Desktop. Also the report works from a different PowerBI server.

You can check error messages in folder c:\Program Files\Microsoft Power BI Report Server\PBIRS\LogFiles

 

Suggested solution:

Restart the windows PowerBIReportServer service, to release memory or cache that is used by PowerBI server.

 

More information:

ERROR|19|Failed to get connection string for model | RequestID =  ClientSessionID =  Microsoft.PowerBI.ReportServer.AsServer.AsConnectionException: Failed to get connection string for model

error in the log file can be because you have 2 data sources in the model pointing to the same database, where the database name was all lower case in one source and upper case in the other. Use the advanced editor in PowerBI desktop to rename them to be unique and then there was one source and data refreshes fine. You must use the same letter format on all fields.

https://docs.microsoft.com/en-us/power-bi/report-server/scheduled-refresh 

Product:
Microsoft SQL 2016 server
Microsoft Windows 2016

Issue:

List when all the SQL agent jobs are run.

Solution:   (https://www.mssqltips.com/)

In SQL Management Studio enter this query:

-- list jobs and schedule info with daily and weekly schedules

-- jobs with a daily schedule
select
sysjobs.name job_name
,sysjobs.enabled job_enabled
,sysschedules.name schedule_name
,sysschedules.freq_recurrence_factor
,case
when freq_type = 4 then 'Daily'
end frequency
,
'every ' + cast (freq_interval as varchar(3)) + ' day(s)' Days
,
case
when freq_subday_type = 2 then ' every ' + cast(freq_subday_interval as varchar(7)) 
+ ' seconds' + ' starting at '
+ stuff(stuff(RIGHT(replicate('0', 6) + cast(active_start_time as varchar(6)), 6), 3, 0, ':'), 6, 0, ':')
when freq_subday_type = 4 then ' every ' + cast(freq_subday_interval as varchar(7)) 
+ ' minutes' + ' starting at '
+ stuff(stuff(RIGHT(replicate('0', 6) + cast(active_start_time as varchar(6)), 6), 3, 0, ':'), 6, 0, ':')
when freq_subday_type = 8 then ' every ' + cast(freq_subday_interval as varchar(7)) 
+ ' hours' + ' starting at '
+ stuff(stuff(RIGHT(replicate('0', 6) + cast(active_start_time as varchar(6)), 6), 3, 0, ':'), 6, 0, ':')
else ' starting at ' 
+stuff(stuff(RIGHT(replicate('0', 6) + cast(active_start_time as varchar(6)), 6), 3, 0, ':'), 6, 0, ':')
end time
from msdb.dbo.sysjobs
inner join msdb.dbo.sysjobschedules on sysjobs.job_id = sysjobschedules.job_id
inner join msdb.dbo.sysschedules on sysjobschedules.schedule_id = sysschedules.schedule_id
where freq_type = 4

union

-- jobs with a weekly schedule
select
sysjobs.name job_name
,sysjobs.enabled job_enabled
,sysschedules.name schedule_name
,sysschedules.freq_recurrence_factor
,case
when freq_type = 8 then 'Weekly'
end frequency
,
replace
(
CASE WHEN freq_interval&1 = 1 THEN 'Sunday, ' ELSE '' END
+CASE WHEN freq_interval&2 = 2 THEN 'Monday, ' ELSE '' END
+CASE WHEN freq_interval&4 = 4 THEN 'Tuesday, ' ELSE '' END
+CASE WHEN freq_interval&8 = 8 THEN 'Wednesday, ' ELSE '' END
+CASE WHEN freq_interval&16 = 16 THEN 'Thursday, ' ELSE '' END
+CASE WHEN freq_interval&32 = 32 THEN 'Friday, ' ELSE '' END
+CASE WHEN freq_interval&64 = 64 THEN 'Saturday, ' ELSE '' END
,', '
,''
) Days
,
case
when freq_subday_type = 2 then ' every ' + cast(freq_subday_interval as varchar(7)) 
+ ' seconds' + ' starting at '
+ stuff(stuff(RIGHT(replicate('0', 6) + cast(active_start_time as varchar(6)), 6), 3, 0, ':'), 6, 0, ':') 
when freq_subday_type = 4 then ' every ' + cast(freq_subday_interval as varchar(7)) 
+ ' minutes' + ' starting at '
+ stuff(stuff(RIGHT(replicate('0', 6) + cast(active_start_time as varchar(6)), 6), 3, 0, ':'), 6, 0, ':')
when freq_subday_type = 8 then ' every ' + cast(freq_subday_interval as varchar(7)) 
+ ' hours' + ' starting at '
+ stuff(stuff(RIGHT(replicate('0', 6) + cast(active_start_time as varchar(6)), 6), 3, 0, ':'), 6, 0, ':')
else ' starting at ' 
+ stuff(stuff(RIGHT(replicate('0', 6) + cast(active_start_time as varchar(6)), 6), 3, 0, ':'), 6, 0, ':')
end time
from msdb.dbo.sysjobs
inner join msdb.dbo.sysjobschedules on sysjobs.job_id = sysjobschedules.job_id
inner join msdb.dbo.sysschedules on sysjobschedules.schedule_id = sysschedules.schedule_id
where freq_type = 8
order by job_enabled desc

 

More Information:

https://www.mssqltips.com/sqlservertip/5019/sql-server-agent-job-schedule-reporting/

https://database.guide/4-ways-to-get-a-list-of-schedules-in-sql-server-agent-t-sql/

Product:
Microsoft SQL server 2016

Microsoft Windows 2019 server

Issue:
List size and location of SQL database files?

Solution:

In SQL management studio enter this query;

SELECT
    db.name AS DBName,
    type_desc AS FileType,
    Physical_Name AS Location,mf.size/128 as Size_in_MB
FROM
    sys.master_files mf
INNER JOIN 
    sys.databases db ON db.database_id = mf.database_id
ORDER BY  Size_in_MB DESC,DBName

More information:

How to determine free space and file size for SQL Server databases

SQL SERVER – Find Location of Data File Using T-SQL

Product:
Microsoft SQL server 2016
Microsoft Windows 2019

Issue:
How do i see what roles a user is member of? The roles show what kind of user access he gets in the database.

Solution:

In SQL management studio, enter this query, to find roles the user is part of;

exec xp_logininfo 'DOMAIN\username', 'all'

In powershell you can enter this command to find content of groups

Get-ADGroupMember -Identity adgroupname | select name, objectclass

Or also expand to find users in groups

Get-ADGroupMember -Identity adgroupname -Recursive| select name, samaccountname

 

 

More information:

https://4sysops.com/wiki/how-to-install-the-powershell-active-directory-module/

https://docs.microsoft.com/en-us/powershell/module/activedirectory/get-adgroupmember?view=windowsserver2022-ps

https://ss64.com/ps/get-adgroupmember.html

https://www.sqlserver-dba.com/2016/01/how-to-query-active-directory-with-xp_logininfo.html

https://www.mssqltips.com/sqlservertip/1252/auditing-windows-groups-from-sql-server/

Product:
Cognos Analytics
Microsoft Windows 2016 server

Issue:

How do i check my computer for this issue?

Suggested solution:

Paste below code in a text file, name the file to check.ps1

gci 'C:\' -rec -force -include *.jar -ea 0 | foreach {select-string "JndiLookup.class" $_} | select -exp Path

Place the file in c:\temp and start a powershell session:

.\check.ps1 > result.txt

Run the file with pipe the result to a text file, so you later easy can check what files can be an issue.

The command will check in jar files if they have the string JndiLookup.class

It will list the jar files that can have the issue, one example is C:\Program Files\ibm\cognos\analytics\bin\ThirdPartyCertificateTool.jar.  Think that this program is not running all the time, it is only used when you use the tool from the command line.  Then this jar file have a very little risk. It is worse for web-servers and web applications that run all the time.

You can unzip a jar file, to check its content.

If you remove the file JndiLookup.class and zip it back to a JAR file, you have cleaned the program.

 

More information:

https://www.ibm.com/support/pages/node/6526474

https://pmsquare.com/analytics-blog/2021/12/13/ibm-ca-pa-and-the-apache-log4j-cve-2021-44228-vulnerability

https://www.ibm.com/blogs/psirt/an-update-on-the-apache-log4j-cve-2021-44228-vulnerability/

https://www.ibm.com/support/pages/node/6525700?myns=swgother&mynp=OCSSCTEW&mync=E&cm_sp=swgother-_-OCSSCTEW-_-E

Within IBM Planning Analytics 2.0, only the IBM Planning Analytics Workspace component of IBM Planning Analytics is affected by a security vulnerability. Apache Log4j is used by IBM Planning Analytics Workspace as part of its logging infrastructure. This bulletin addresses the exposure to the Apache Log4j (CVE-2021-44228) vulnerability.

Log4j 1.2.17 and 1.x does not contain any of the same lookup / template evaluation code, and the only class related to JNDI (JMSAppender) does not appear to connect to user-controlled remote systems based on log events.  Older version of Cognos Controller that uses log4j-1.2.7.jar, does not have the same issue.

Log4j: It’s worse than you think