SSAS Cube processing logs - ssas

Where are SSAS cube processing (not error, not flight recorder) logs stored?
We have a SQL Agent Job running a SQL Server Analysis Services command. In there is some DMX which processes each dimension then processes the cube database (containing two cubes)
I want to know how long each of the various queries are taking. There is one query per dimension and one query per measure group
The cube was taking 20 minutes now it's taking 2 hours.
We are using SSAS 2008 R2
I have searched long and hard and as far as I can tell there is no such log.
questions which are not duplicates of this:
Error Log records in SSAS
get output of last Process on SSAS cube
I don't want to use Profiler. I want to see how long each query took in the last cube build at least. I can see all this info if I run interactively. How do I make it log this info when run from a job?

There are a couple of options. You could just continue processing the cube just the way you are but start logging all processing events. Other than the Profiler GUI, there are three main ways to do that:
A server side trace writes a .trc file to disk on the SSAS server with little overhead:
http://blogs.msdn.com/b/karang/archive/2009/11/02/sql-2005-sql-2008-analysis-services-server-side-tracing.aspx
Then you can load it into SQL server to analyze later via PowerShell:
http://www.bp-msbi.com/2012/02/counting-number-of-queries-executed-in-ssas/
Install a community maintained service called ASTrace which uses the Profiler APIs (without the GUI) and writes the Profiler events you choose directly to SQL Server real-time.
https://github.com/Microsoft/Analysis-Services/tree/master/AsTrace
Log XEvents and analyze them later:
http://blog.crossjoin.co.uk/2012/05/05/using-xevents-in-ssas-2012/
Or:
https://francescodechirico.wordpress.com/2012/08/03/identify-storage-engine-and-formula-engine-bottlenecks-with-new-ssas-xevents-5/
All of those options will log all processing transactions. You get to choose just which events you want to log (processing events not queries, for example).
But another alternative is to use a session trace. You could stop using the "SQL Server Analysis Services Command" step type in SQL Agent and start using a PowerShell step type and do something like the following. This example is running an SSAS backup from PowerShell with a SessionTrace to watch all the "profiler" events just for that one session:
https://gallery.technet.microsoft.com/scriptcenter/Backup-Ssas-Databases-with-da62b084

Related

what to setup in SQL profiler to investigate SSAS Cube synchronization job hang?

I am using SSIS job to process the ssas DB(cube, dim, partition etc) in source server and XMLA script in the same SSIS package to synchronize the SSAS DB from source server to destination server. This SSIS job is deployed and get initiated daily on source server.
This was running fine since years, but recently SSAS DB Synchronization is getting hang and not stopping/completing even after 3-4 hours. Generally it takes 30 minutes to complete. then I need to kill the job and manually sync the SSAS DB using synchronization wizard at destination server.
any way to figure out the real problem? what events to setup in SQL profiler to catch this issue while ssas db sync? or any other way?Also SQL Profiler should be run against source server or destination server?
Please help/guide/suggest. Thanks

Querying PowerBI data from MS-SQL

I finally decided to ask this (after a lot of google searching):
So we use Power BI for data visualization and thus in it are some calculated dashboards / data outputs which are used to monitor data quality etc. I want to be able to historical log these results so that over-time we can monitor progress i.e. was data quality improved. This is the end of the initial problem.
One approach to this problem was to connect to PowerBI from the MS-SQL side - hoping we can then set timed triggers to do the log by READING THE POWER-BI DASHBOARDS: So how do I query that (I have already developed a method to determine the connection using the Power-BI port as described here:
EXPORTING DATA FROM POWER BI DESKTOP TO MS-SQL
This is a screenshot from one of my MS-SQL connections through "Analysis Services":
I am assuming the objects named like "LocalDateTable_" are the actual BI analysis I want to query. "New Query" is an MDX type of Query. Should I go this route for my problem (logging powerbi analyses)?
At first this sounds crazy but on reflection I guess it was only a matter of time, and a sign of the maturity of Power BI solutions ...
I would use the SQL Server Profiler to capture the queries generated while you use your dashboard & report.
https://insightsquest.com/2017/05/07/profiler-trace-for-power-bi-desktop/
Then I would build an SSIS package to run the MDX queries and deliver the datasets to SQL Server, with extra columns e.g. StartTime.

Log Shipping vs Replciation Vs Mirroring in SQL server 2012

I have a SQL Server 2012 database which currently used as a transactional database and reporting database. The application reads/writes into the same database and the reports are also generated against the same database.
Due to some performance issue, I have decided to maintain the two copies of the database. One will be a transactional database which will be accessed by the application. The other database will be the exact copy of the transactional database and it will only be used by the reporting service.
Following are the requirements:
The reporting database should be synched with transactional database in every one hour. That is, the reporting database can have stale data for maximum of 1 hour.
It must be read-only database.
The main intension is NOT recovery or availability.
I am not sure which strategy, transactional log shipping, mirroring or replication, will be best suited in my case. Also if I do the synch operation more frequently (say in every 10 minutes), will there be any impact on the transactional database or the reporting service?
Thanks
I strongly recommend you to use a standby database in readonly state. And every 15 minutes your sqlserveragent has a scheduled job to: a) generate a new .trn logfile within main db, and b) restore it into standby one(your reports db). The only issue is: using this technique your session will be disconnected while agent restores the .trn logfile. But if you can stop the restore job, run your reports and then reactivate it, there is no problem. Seems to be exactly what you need. Or if your reports are fast to run, probably will not be disconnected...if im not wrong restore job can also be configured to wait opened session to finish or to close it. I can check it this last doubt for you tomorrow if you don't find..
Once it is running in the same sql server instance, you don't have to worry about extra licensing...

SQL Server Profiler needs too much memory

I'm using SQL Server Profiler for recording the activity of an software, which creates a ~50 GByte database with > 300 tables including the data. The Profiler saves the trace log into a table in a second database, which will be used for analysis later.
But, there is a problem with the memory usage of the SQL Server Profiler, because the application displays ALL (!) Traces in a table of the interface. As an result, the application needs more than 3 GByte after a few minutes. I don't have more than 50 GByte memory!
Is there a way to disable this table and only log into a table in the database? Also a command line tool which is able to record the same information would be great.
There are a whole load of stored procedures/functions, etc, for creating traces, without using the SQL Server profiler UI. There are too many to list them all here, but the root of the documentation is Introducing SQL Trace. You should hopefully be able to find the right combination to call to get the trace you want.
These server-side traces have to be stored to file, rather than into another table, but you can always import them into a table later if you need them there for analysis.

SQL Server PerfMon Counter Details

I am working on SQL Server 2008R2 and 2012 Denali Monitoring Project in this I want to find out all PerfMon counters and its details I mean which perfmon counter used for what purpose.
I did try on Google and MSDN but i was not able to get that table which provides the details of all SQL Server PerfMon counters.
From following query I got all perfmon counters list but I am not able to find the details of each and every PerfMon counters.
SELECT *
FROM sys.dm_os_performance_counters
What are you trying to monitor? Monitoring everything is not really a feasible plan. Both SQL Server 2008 R2 and Denali come with the management data warehouse(MDW), and if you have enterprise, the utility control point(UCP) is available. These are monitoring tools built into SQL Server to save the information in several of the DMV's(sys.dm_os_performance_counters included). The information is polled at a certain interval (generally 15 seconds, but you can change) and is saved into the respective database for reporting and inspection at your leisure. One of the reasons this information is polled and saved is because the counters are for specific use, meaning some counters increment from the beginning of the install and many others are reset when SQL Server is restarted. CPU ticks is one I know that needs at least 2 points of data to see what the load on the cpu is. Not sure if this will help you in your endeavor, but if it does , then cool
This said, there are hundreds of SQL Server perfomance counters, If you look in perfmon, when you bring up a SQL counter, there is a description available below, telling you what exactly it does. If you can not find the monster list somewhere, I would try to use powershell to extract all sql counters and their respective descriptions. I would not try to get the information from SQL because it isn't there, it is in the BOL, but not as a list that I have ever seen. Plus to add to problem, not all of the counters are very well documented.
This will give you All SQL related counters in perfmon. Hope this helps. Still working on pulling the description. Don't know powershell that well.
Get-Counter -listSet SQL | %{$_.counter}
there are supposed to be asteriks around the word SQL, but it's formatting to italics, and I'm new so I don't know how to get around that yet.