01/25/2019
by Marlon Ribunal
3 Comments

SQL Server 2017 Reporting Services: The Basics Part 1

I’ve been meaning to start a series on the basics of SQL Server Reporting Services (SSRS). The last time I did this was on a book on SQL Server 2012 Reporting Services published by Packt. SSRS has since evolved into a better reporting platform with the addition of KPI’s, mobile reports, etc.

In this SSRS series, I’d like to go back to the basics. If you’ve never developed and deployed SSRS Reports to a server before, this is for you. Just like my book, this series goes through the step-by-step of the basics of SSRS. My goal is for anybody with Zero experience to be able to create and deploy reports in no time.

I am aware that there are other resources out there that are probably more extensive than what I can offer here. But, hey, the more resources, the better it would be for the learners.

In this post, let’s do the most basic step – installation.

Installing SQL Server 2017 Reporting Services

First thing first: My assumption is that you are installing SSRS in your local machine. And, also, that you already have an instance of SQL Server 2017 running on it. If you don’t have it, please install it and come back here. I’ll be waiting for you.

Download SSRS 2017 from here.

One of the good things that Microsoft started doing was simplify their software installation. SSRS installation is a breeze with the lightweight installer. If you haven’t installed any enterprise software before, you have nothing to worry about. The wizard should be as good as it gets.

When you fire up the executable, you are presented with two edition options: Free or Not Free. Under free edition, select Developer. In the Microsoft parlance, a Developer edition is equivalent to the Enterprise edition except that you cannot use it for production.

SQL Server 2017 Reporting Services Developer Edition: As Good As The Real Thing!

Follow the steps and you should be fine just by clicking Next until you reach the final step.

You may or may not restart your machine at this point. But just to make sure, reboot. After rebooting, fire up Report Server Configuration Manager. You should find it in your Start Menu.

I’d like to start setting up the database first before anything else. On the panel on the left, select Database.

Click Change Database. The next step presents two options – create a new or select an existing report server database. My assumption is that this is the first time you’re installing SSRS; so, select a new database.

The Server, Database, and Credentials defaults should be fine. Click Apply at the bottom when done. You should now see two new databases in your Object Explorer – ReportServer and ReportServerTempDB (assuming that you named your database as ReportServer)

Select Web Service URL from the panel. Review the default. You may or may not want to change the default. I’d keep it as is. Click Apply at the bottom. Open your internet browser and test the service. The URL is provided under Report Server Web Service URLs. You should get something like the screenshot below.

Yep! Your SSRS Web Service Is Up And Running!

Now, select Web Portal URL. This is where you upload your reports, data sources, datasets, etc. Review the defaults. Then click Apply at the bottom. Take note of the portal URL. Then test.

And that should be it. Your Report Server can be installed that quick. Of course your mileage varies depending on your server setup.

Up Next: Your First Report in Part 2! Tune in for more!

01/18/2019
by Marlon Ribunal
Comments Off on Miscellaneous Notes On System Architecture and Design

Miscellaneous Notes On System Architecture and Design

When I first joined the programming team at my previous job in an aerospace company, the first observation I made was that their Data Integration System was antiquated – architecture-wise. The system architecture was adopted from legacy mainframes. Most of the business processes have been migrated to modern servers at the time.

But as I dug deeper and deeper into the system, I slowly realized that the architecture stood the test of time and to the changing demands of the modern business world. Old ways of doing things are not necessarily a bad thing when they preserve the fundamental principles of a sound and stable architecture.

Here are some of the things I’ve learned from that experience:

Nothing Beats A Sound Architecture

Everything is anchored in the architecture. You cannot optimize a system that is based on a bad design. You might be skilled in performance tuning but you can only do so much when the problem is the architecture itself. What’s a good design? That’s open to debate. Simply put, a good design is one that allows for stability, flexibility, and scalability.

Leave the Data Validation in ETL

Cleansing of data must be done at the time of the ETL process. The database engine works well with Storing and Retrieving of data. Complicated validation and cleansing routines don’t do the database engine any good. SSIS, just like most ETL Tools, is an in-memory pipeline. Row-By-Row transformation and validations are efficiently handled in memory.

Platform is Just a Tool

One time I asked our Senior System Architect what Server to use – SQL 2008 or 2012 – he said: “I don’t care as long as it runs.” But I gathered what he really meant – that the architecture, when designed correctly, works regardless of the platform, and that a sound architecture does not have to depend on the target platform.

Cursor Doesn’t Scale

At this point, we should just agree that Cursor is a bad thing when there are other viable options that can do the job. Row-by-Row processing doesn’t scale. Period.

Beautiful SQL Doesn’t Translate To Performance

You need a gazillion of JOINs to return a dataset. Good luck with that one. You can write beautiful codes worthy of the Nobel Prize in Literature but the barometer of any codes is their performance. Readability is also a good attribute of good code. Your choice of query optimization techniques is limited by, guess what, the architecture. When you’re spending 70% – 80% of your maintenance effort on the query tuning, then maybe it’s time to re-think the design.

Errors Should Be Actionable

Error Alerts should prompt for action. The process should not just end in error logs or unactionable notifications. Push the errors to the proper stakeholders. The stakeholders should have the ability to correct the data on the fly – probably in a UI context. The corrected data should then be pushed back to the pipeline on the same batch as “late requirements” or exceptions. Don’t wait until the next scheduled batch to reprocess them. A late requirement process should be put in place as part of the system to handle such a case.

Good Design Enables

Good design is an enabler. User enablement is not a feature of the UI. It is an integral part of the system architecture. Good UI functions go as far as the flexibility of the design go – and not further. User Experience is therefore rooted in the architecture.

Institutionalize Peer Review

Let other people scrutinize your work. This is a good practice. There’s a reason peer review happens way before the deployment. Take advantage of the resources and bright minds around you. Let your teammates check your work. Peer Review may reveal potential problems that you might have overlooked during your unit testing or test cases.

You Cannot Over-Document

One cannot just over-document. Documenting is a good practice to develop. Document when necessary. And it’s almost always necessary to document in all circumstances. Sure you don’t have time to put together some quick documentation, but that’s not a good excuse to not do it. Do you want to secure your legacy in the annals of greatest employees? Yes, you got it. Document.

Building a robust system architecture involves a wide array of principles and checkboxes to tick as the project progresses from requirements to delivery. You’ll have a better chance of succeeding when you follow consistent and sensible fundamentals. Old, solid principles don’t die; they don’t fade either.

01/11/2019
by Marlon Ribunal
Comments Off on Book Review: SQL Server 2017 on Linux

Book Review: SQL Server 2017 on Linux

I don’t have any statistics but I think most IT Professionals in the SQL Server field are managing or developing solutions on their SQL Server Databases deployed on Windows Servers. If you’re planning to try SQL Server on Linux, this is a good book to get you started. Or, if your company is looking to deploy SQL Server into Linux, grab this book. Or, maybe you’re in a Linux shop that is considering SQL Server, that’s a solid reason to grab this book.

This book addresses some general groups of IT Pros:

  • Those Linux Admins new to the SQL Server implementation.
  • Oracle DB Admins migrating to SQL Server within their Linux Environment.
  • SQL Server Consultants who are looking to add another income stream.
  • Oracle Consultants who are looking to add another income stream.
  • Nix People who are interested in SQL Server.
  • SQL Server People who are interested in Linux.
  • People who want to add more tricks up their sleeve (chances are I belong to this group).

Published by McGraw Hill, SQL Server 2017 on Linux is a 285-page primer guaranteed to help you setup a Linux-Based SQL Server implementation. This is another good resource from Benjamin Nevarez (B|T). It is packed with great information, tips and tricks, and recommendations on installing, configuring, maintaining, tuning, optimizing, and securing SQL Server 2017 on Linux. I think this book accomplishes its goal – that is, provide comprehensive instruction on the subject.

Chapters 1 – 3: Cover Getting Started stuff – how to create VM, install the SQL Server, and its Components. Two particular Nix flavor mentioned are Ubuntu and SUSE Linux Enterprise Server. If you are into Containers, there is a portion dedicated to Docker.

If you want to understand How SQL Server works on Linux, Chapter 2 covers that. This chapter covers that backstory of how SQL Server-to-Linux came to be.

Not well-versed with the Linux OS? Chapter 3 provides the info to get you started using SQL Server. It covers both basic and advanced Linux Commands to get you up and running SQL Server on Linux in no time.

Chapters 4 – 6: Chapter 4 guides you through configuring SQL Server on the Linux Environment. It also provides more detail about the mssql-conf Utility – a tool that installs and configures SQL Server. Topics included are: NUMA, Swap Files, Trace Flags, Process Affinity, MAXDOP, Cost Threshold for Parallelism, and many more.

Chapter 5 is my favorite Chapter which covers SQL Server Query Tuning and Optimization. It even includes a mini-intro on the Query Processor Architecture, which is a good thing. Of course, it includes the usual suspects: Query Optimization, Execution Plans, Query Troubleshooting, Indexes, Statistics, among others.

Chapter 6 covers the New Query Processing Features of SQL Server such as Adaptive Query Processing, Batch Mode Adaptive Joins, Interleaved Execution for Multistatement Table-Value Functions and many more.

Chapter 7 – 8 Covers High Availability and Disaster Recovery and Security. Chapter 7 covers implementing Availability Groups – yes, this is available in SQL Server On Linux as noted in the book. There is also a short list of differences between availability groups on Windows vs Linux.

Chapter 7 also provides instruction and commands to setup Pacemaker, an open source high-availability resource manager to manage Pacemaker clusters, basically. Of course, the book demonstrates how to fail over an availability group in a Pacemaker cluster operation. If the tool does not work, a T-SQL workaround is also provided.

The book concludes a chapter about Security in Chapter 8. Topics covered are Transparent Data Encryption, Always Encrypted, Row-Level Security, Dynamic Data Masking, among others.

As you can see, this book provides everything that you need to get started using SQL Server on Linux. it pretty much covered the whole nine yards. It’s a 285-page book. You’re getting much meat in this book without you getting a deluge of information overload.

If you don’t think you’ll ever manage a SQL Server on Linux in the near future, you’ll still get a bang for your buck with this book. Most of the information, if not all, provided in Chapters 4 – 8 are generally applicable to any SQL Server implemented in Windows Server platform.