Skip navigation
1 2 3 ... 7 Previous Next

Database Management Blog

92 Posts
0

I wrote an article a while ago that discussed how to interpret CPU utilization in a virtualized environment and the caveats that must be considered when diagnosing SQL Server performance on a VM.  Here is a link back to that post.

 

Similar complexities arise when discussing memory utilization on a guest VM.  On a physical server, if we look at the system properties and see 8GB of physical memory, we can be certain that we have 8GB of memory to play around with.  Only when the OS requires more than 8GB of memory, does swaping memory to disk (paging) need to occur.  In a virtualized environment, we can no longer be sure that the physical memory that we are supposed to have, is actually available to my operating system.  To create a simple example, if we have one VMWare ESX host with 4GB of physical memory, and two VM guests, each allocated to use 4GB of memory, something must give.  ESX must step in and decide how physical memory is going to be delivered to each of its gusts.  The two main processes that may occur that can impact the VM guest's memory allocation are Memory Ballooning and Hypervisor Swapping.  I will explain each below:

 

Memory Balloning

 

On each VM that is being managed by VMWare ESX, there is driver installed on each guest OS that is referred to as the balloon driver.  This driver communicates with the ESX host through a private communication channel.  If the ESX host determines that it is being starved of memory, it will tell the balloon driver to artificially expand its memory utilization on the guest OS, thereby forcing the OS to use less memory. This may result in memory paging to disk, due to less physical memory being available.  Once the balloon driver claims its memory, the ESX host can then go and reclaim it since the guest OS no longer has access to it.

 

Hypervisor Swapping

 

If the Ballooning process is insufficient, ESX will step in as a last resort and swap (at random) some of the guest OS's memory pages to a disk device on the ESX server.  A guest specific swap file is created upon startup, and is used during this process.  Significant performance implications could exist in these scenarios depending on the speed of the disk that these swap files are being placed on.

 

For a thorough discussion of both of these process along with a wealth of additional information, the following white paper provided by VMWare is an excellent read.

 

 

Bottom line, on a VMWare guest, do not always assume that just because you see 8GB of physical memory as displayed in the system properties, that you actually have access to all of that memory.  Making this assumption could have you chasing your tail trying to diagnose a performance issue that is occurring simply because of an over provisioned ESX server.

0

Remember when you were a kid and you’d hear yourself recorded on an answer machine or on someone’s old handycam? Remember how cringe-making that was? Errr…that’s how I feel watching this. GigaOm was an interesting show and it was great to get to meet so many new vendors trying to make a difference in the next wave of big data analytics. The next three years are going to be fascinating to watch. Talking of ‘watch’. Watch videos with the sponsors below. Mine is the first one. Feel free to skip over it.

0

We’re really lucky at Quest to have some very smart R+D talent. Our head of R+D in Melbourne, Australia, came to the Bay Area last week for the Strata Conference and brought a couple of his top people. I got the chance to talk with them about what they’re up to around emerging roles and technologies.

0

Toad for SQL Server v5.5

Posted by Community Admin Jan 18, 2011

by Jeff Smith

 

Toad is an Integrated Development Environment for SQL Server, also known as an IDE (wiki). Never heard of Toad before? Toad is famous in the Oracle world, but it probably more like the best-kept-secret in the SQL domain. Most folks find it because they are looking for ‘Toad’ that will help them with SQL Server.

 

 

That’s OK, but I want to make sure you know that Toad is great for any person who wants to develop better T-SQL code and do so more efficiently. A good IDE does not get in the way of the developer’s fingers. It offers help, but only when you ask for it. You should be able to work the way YOU WANT to, and not have to learn how to code in a brand new style. Is Toad for SQL Server perfect in these aspects? In a word, ‘No.’ But, we are improving the tool with each and every release. Version 5.5 is currently in Beta. I want to invite all of our Toad for SQL Server users now to participate in the Beta Program today. You get to use the next version of Toad while it is being actively developed. This is not a preview version that is a step away from being released. This software is straight from the developer’s copy of Visual Studio. Join Toad for SQL Server Beta Program A passionate Toad user and advocate shared some ideas on how to make Toad just a little bit better. After our call, I fired up the beta and started to dictate my email to the beta program manager when, lo and behold – one of his ideas was already implemented in the program! Less work for me is always good, but being able to deliver to the user and market so quickly is one of the things that has endeared me to Toad (to the point that I have the word ‘Toad’ in my Twitter handle.) Suggestion: When Selecting Columns in Code Insight Popups, Honor Order of Selection.As a common reference point, let’s investigate how this currently works in SQL Server Management Studio (SSMS), version 2008 R2.

 

 

If you type your query ‘SELECT …’, SSMS will pop up a list of columns to choose from. Unfortunately SSMS will only allow you to pick one column at a time. You type, click, type, click, …, N until you get all the all columns you need. You can do the same thing in Toad, or you can choose all of the columns you want in a single iteration. Unfortunately, Toad currently also sorts those columns in alphabetical order. Version 5.5 solves that problem by now honoring the order in which you click the column in the picker.

 

 

I definitely want ‘Gender’, and…Oh wait, that’s neat, Toad also shows me the data types of all the columns…

 

 

their ‘ContactID’, and…

 

how many ‘VacationHours’ they have accrued. Hmm, that’s good!

 

Ok, Toad has written my query, and my column order is intact! ‘F5′ and boo-yah, there’s my data.

 

 

Alright, my query is written, tested, and ready for my application. One button-click, and I can suck it into Visual Studio.

 

 

What did we really achieve here? Well, I know we made at least one person happy. But, more importantly we made a very simple change that will have a huge impact on the productivity of our users. Instead of copy and pasting columns around a SELECT list, users can now just do what they want to do and get what they want to get. Do you have an idea that you want to share? Join the Beta and plug away!

0

by Vickie Farrell

 

I just read yet another blog post telling us that implementing an end user  self-service BI tool like WebFocus or Spotfire automatically increases data quality, enables predictive insights and faster decisions, and implies that people are doing much more insightful analysis than most of them really are.

 

What the “BI as a predictive tool” section describes is not predictive analysis at all, but standard reporting of what has already happened. Useful, but not predictive.

 

I have found that the majority of people who say they do ad hoc query are actually using parameterized reports. True, end users are serving themselves, but what they are doing is hardly ad hoc. In most cases, what end users can do for themselves is chart and format data that has been cleansed and ETL’d for them.

 

Let’s not get carried away. Web-based interfaces, drop-down lists and wizards may make query and reporting easier, and they’re a valuable piece of the solution because of that, but they do not magically enable predictive analysis, ad hoc query and the ability to perform complex functions like demand forecasting and yield management.

 

Make no mistake, the ability to do predictive analysis, run ad hoc queries, detect and prevent fraud in process via real time analytics, integrating data from multiple incompatible sources, some external to your organization, with semantic reconciliation via an abstraction layer *does* exist.  But to do it requires more than turning end users loose with an easy-to-use web-based query tool.

 

As Jill Dyché points out in her January 4 “Anti-Predictions for 2011” blog post:

 

5. No one will be willing to shine a bright light on the fact that the data on their enterprise data warehouse isn’t integrated. Just because data is co-located on a single platform doesn’t mean that data is integrated. This is the dirty little secret of enterprise data warehouses that no one wants you to know.

 

Bingo. Data coming from multiple sources has to be integrated in a meaningful way before end users can use it for analysis. Of course, this can be done manually, as it has been for years. A second issue is the data quality. The data has to be trusted as a, what one of my former customers likes to call, “certified version of the truth.”

 

I have worked with organizations who are working to provision data for end users, ensuring needed level of quality, access, latency and integration. Once that has been accomplished, end users can be turned loose. I have seen these best practices really pay off in providing insightful analysis by business users themselves. And new technologies like Hadoop and MapReduce, in-memory processing, mobile BI and others can be applied to the established infrastructure.

0

by Jeff Smith

 

It happens more often than I like to admit, but I was asked a question about Toad that I could not figure out. A co-worker was trying to help a customer emulate a SSMS feature – the ability to program stored procedures to a keyboard shortcut or keystroke sequence.

 

I got part of the way there – Code Snippets. These can be customized and programmed by the end user to call frequently bits of code or scripts on demand. What I was missing was how to assign a keyboard shortcut to each snippet. Of course it was staring at me right in the face.

 

Thankfully @kekline put my nose in it in such a way I could not miss it – thanks Kevin! So just in case the rest of you are wondering how to do this, here’s a step-by-step:

 

How Microsoft SQL Server Management Studio (SSMS) Does It

  • Tools – Options
  • Keyboard page
  • Assign a shortcut to your favorite Stored Procedure (SP)
  • You can assign as many as 10 shortcuts (0-9)
  • Ctrl+1 in an editor window will auto-execute sp_who
  •  

    How Toad Does It

    Toad ships with several dozen code snippets. You can invoke them by using a right-click in the editor, or you can assign a keyboard shortcut to each of them as you see fit.

     

    To see all the Code Snippets, open them on the menu View – Code Snippets. I am going to create a new snippet group called SSMS.

     

    Once the group is created, I will add a snippet for each of the three SPs that SSMS has coded. First, I will create a new snippet:

     

    The properties:

  • Design – this is where you put your code
  • Title – this is what will show in the snippet panel
  • Shortcut – this is the NAME of the snippet, and what you will use to invoke the command in the editor.
  • Help URL – you can document your code snippets. In this case I supplied the MSDN page for sp_help
  •  

    I went ahead and coded all three SPs from SSMS:

     

     

    All Right, Let’s Do This Already!

    In the editor, to invoke the snippet, type the name and use the Ctrl+Spacebar key sequence. You then need to use F5 to execute it.

     

    So in the above example, here is what I type: ‘who’ followed by ‘Ctrl+Spacebar’

     

    Toad places the code into the editor. I can then edit or execute it as I require.

     

    That’s an extra keystroke over what SSMS requires. However, you do get to see the code used, and you have the ability to create an unlimited number of SPs you want to code into Toad. I think that is a fair tradeoff.

    0

    by Christian Hasker

     

    We love technology innovations. Technology innovations provide new market opportunities by exposing new pains that require new salves. Thank you Microsoft Azure!

     

    We are big fans of Azure here at Quest, and we are fortunate, as a two-time ISV Partner of the Year, to be in a position where we work very closely with the Microsoft product teams. When we got an early look at Azure, and then started to port some of our existing products to the platform, and then started to build new products we suddenly found that we had a lot of pain internally around understanding our Microsoft Azure utilization and billing.

     

    1.) Calculating how much my next bill is going to be is like sticking my finger in the breeze. How much do I budget?
    2.) All our developers are spinning up new Azure accounts! How can I get a single view across multiple accounts?
    3.) Just getting my bills out of the Microsoft portal is burning up a lot of time. There has to be an easier way!
    4.) What am I actually utilizing? Am I using everything I am paying for?

     

    What do we do at Quest? Why we build software of course! So, although it’s a bit of a departure for us, we decided to build a product to help solve our internal pains. We are calling it Project Cloudscope, and we’re making it available for public download as well. If you are using Azure this is likely to become a must-have tool for you so we invite you to check it out and provide us with your feedback. We’ll be continually updating the utility so if it’s missing features you need let us know.

    0

    by Trent Mera

     

    SQLServerPedia is a free knowledgebase for the SQL Server community.  It has tons of great content in video, wiki and blog formats.  Viewing the site requires no login, or you can create an account if you would like to contribute to the wiki or syndicate your own blog.  This video gives you a quick tour of the site so that you can get a head start on using this valuable resource.

     

    0

    The T-SQL Tuning feature of Toad for SQL Server can rewrite your T-SQL statements into potentially faster variations, and this video walks you through the steps.

     

    0

    by Trent Mera

     

    The editor in Toad for SQL Server is also a debugger - this video shows how to use it.

     

    0
    by Trent Mera
    For a more complete backup and recovery strategy, there are some additional items you can save off alongside your user database backups that can potentially save a lot of time and effort in a restore scenario.  These can also be helpful to have on hand for archival or historical comparison or reversion purposes.  This post will show you some simple ways to manually or automatically capture this information for storage alongside your backups.  The example items we'll cover here include information and scripts in these areas:
    • Configuration
    • Logins
    • Jobs
    • Schema records or DDL scripts

    How to output the additional information

    No matter what extra items you're looking to keep alongside your backups, there are a number of easy ways to get the
    information into a file.  The easiest is probably to use the BCP (Bulk Copy) utility, with a command like this.
    • bcp "EXEC sp_server_info" queryout C:\output.csv -Sserver -T -c -t, -r\r\n
    In this command, we're executing the sp_server_info procedure (which returns SQL Server version and settings information), performing some formatting, and putting the results into a file called output.csv.  The BCP command can be run from the Windows command line, or more practically as an Operating system (CmdExec) type job step in the same job as your backup.  If you would like to first test this BCP command as an ad-hoc T-SQL, just wrap it in single quotations and run it with xp_cmdshell:
    • EXEC master..xp_cmdshell 'bcp "EXEC sp_server_info" queryout C:\output.csv -Sserver -T -c -t, -r\r\n'

    Additional information that you might want to capture

    Now we'll turn to some of the categories of metadata that you might want to capture this way, and examples:
    .

    Configuration Info

    Information about how the server is configured is in the master database, so using your backup of that database is one way to get at that information.  But querying and saving this information from the master database into another format at the timeof your backup can be a more convenient way to have this information quickly available for review and use.  The following queries can be used inside the BCP command above to do this:
    • "EXEC master..xp_msver"
    • "SELECT * FROM master.sys.configurations"

    Security Info

    SQL Server also stores its security information in the master database, but again, that information can be queried:
    • "SELECT loginname FROM master.dbo.syslogins" or "EXEC master..xp_loginconfig"
    • "EXEC master.dbo.sp_helpsrvrolemember"

    SQL Server Agent Info

    The msdb holds information about the SQL Agent and jobs.  This information can be pulled as follows:
    • "EXEC msdb..sp_help_operator"
    Job information and schedules can be seen with these:
    • "EXEC msdb..sp_help_job"
    • "EXEC msdb..sp_help_jobstep @job_id='YourJobID"
    • "EXEC msdb.dbo.sp_help_jobschedule @job_name='YourJobName'"
    • "EXEC msdb.dbo.sp_help_schedule"
    • "EXEC msdb..sp_help_alert"

    Database Schema information and Scripts

    Backing up schema information separately from the database backup itself can be helpful in cases where you would like toreview schema changes over time or revert to an earlier version of an object.  Information about tables, columns, constraints and privileges is available from the Information Schema views.  Here we are getting information about tables, but other information can be had by replacing TABLES with TABLE_CONSTRAINTS, COLUMNS, TABLE_PRIVELEGES:
    • SELECT * FROM AdventureWorks.INFORMATION_SCHEMA.TABLES
    To get the DLL scripts for stored procedures, views or functions, you can use:
    "SELECT o.Name as Object_Name, m.definition as DDL_Script, o.create_date
    FROM AdventureWorks.sys.sql_modules as m
    JOIN AdventureWorks.sys.objects as o ON m.object_id = o.object_id
    WHERE o.type = 'P' --'P' to script procedures, 'V' for views, 'FN' for Functions"
    .
    Longer queries like this can be made into a query, which in turn can be run within the BCP command.  Also, since this output is a script rather than table data, it may make more sense to output the data to a txt format:
    .
    USE AdventureWorks;
    GO
    CREATE PROCEDURE dbo.script_procs as
    SELECT o.Name as Object_Name, m.definition as DDL_Script, o.create_date
    FROM AdventureWorks.sys.sql_modules as m
    JOIN AdventureWorks.sys.objects as o on m.object_id = o.object_id
    WHERE o.type = 'P';
    GO
    EXEC master..xp_cmdshell 'bcp "exec AdventureWorks.dbo.script_procs" queryout C:\output.txt -Sserver -T -c -t, -r\r\n'
    .
    The entire database schema can be easily scripted using the Generate SQL Server Scripts Wizard, but it is interactive (ie, manual) vs programmatic as above.
    .
    Other SQL Server Sytem Stored Procedures and Catalog Views that provide other metadata you may want are described at:

    Other methods of scripting metadata

    The BCP command mentioned at the top of the article is just one (though probably the easiest) way to pull metadata from the server into a file that you can save off with your database backup.  You can also do it from the command line:
    • osql.exe -S YourServerName -U sa -P yourpassword -Q "EXEC sp_server_info" -o "E:\output.txt"
    This can in turn be run as T-SQL, using SQL Server authentication:
    • EXEC master..xp_cmdshell 'osql.exe -S YourServerName -U sa -P yourpassword -Q "EXEC sp_who2" -o "E:\output.txt"'
    or using Windows authentication:
    • EXEC master..xp_cmdshell 'osql.exe -S YourServerName -E -Q "EXEC sp_who2" -o "E:\output.txt"'
    Also, the BCP command can be run as an ad-hoc T-SQL call, but outside of a job you'll need to use xp_cmdshell.
    0

    by susanwong

     

    SharePlex requires minimal database level supplemental logging.  This level adds row ID information to the redo logs that eliminates the need for SharePlex to build and maintain a row ID map.  Since supplemental logging’s introduction, SharePlex activation performance is substantially improved since it is no longer necessary to analyze the tables for chained rows or build the row ID map.

     

    To check to see if supplemental logging is enabled in the database –

     

    SQLplus > select supplemental_log_data_min from v$database;

     

    It has been asked if it is possible to enable supplemental logging on just the tables that SharePlex is replicating.  Minimal supplemental logging must be enabled at the database level before supplemental logging can be enabled at the table level.  To enable minimal supplemental logging -

     

    SQLPlus >  alter database add supplemental log data;

     

    Some customers have expressed concern that supplemental logging generates overhead on the database.  Though Oracle should have the last say on how much overhead supplemental logging imposes on the database, minimal level logging has Oracle add head row ID information for each change operation which is about 20 bytes.  Overhead is more likely to increase on archive storage since the data is already available to Oracle.  In general, if you generate 100GB redo log per day, it might increase to 101 – 103 GB per day with minimal supplemental logging enabled.  Performance impact has been found to be minimal, <1%.

     

    The overhead on table level (Unique Key, Primary Key) is dependent on the key itself.  If the key uses one numeric column then it is cheaper than if the key is a composite of 15 columns with char(2000) for example.  The latter would be more expensive from a space perspective.  There will be some key logging, but that would depend on the definition of the table.

     

    Quest recommends that both primary and unique key supplemental logging be enabled because SharePlex can post the modifications to the target more efficiently by having the key information from the redo logs rather than having to retrieve the information from the database which would impose database overhead.

    0

    We recently published a new brief outlining SharePlex for Oracle's support for the Oracle Exadata platform.  The brief also discusses best practices to successfully setup and utilize SharePlex for the latest Exadata environment.

     

    Get your copy of the latest brief here.

     

    Thanks - we look forward to any feedback you might have.

    0

    by Andy Grant

     

    Read our latest business brief that explores the top five reasons to choose SharePlex® over competing data replication solutions for your Oracle database environment.  This brief offers detailed analysis to help you meet key business objectives, including simplicity, support, scalability, and productivity at a much lower price.

     

    Get your copy of our business brief here and we look forward to any feedback that you may have.

    0


    Load testing is an interesting topic.  Application load testing is what most people are familiar with.  They either use something like LoadRunner, or they ask half the company to ‘jump on the website and start clicking buttons.’

     

    But what about the database?  In this case, what about SQL Server?  Will it be able to sustain the workload as it increases?  Will the performance SLAs hold?  Does the average response time for a transaction increase at a predictable rate as the user load goes up?

     

    Quest sells a solution called Benchmark Factory for Databases.  This tool allows you to generate load tests and deploy them to Oracle, SQL Server, DB2, Sybase, and MySQL.  You can either run a synthetic test like the TPC-H or TPC-E, or you can actually replay activity that you have recorded in a trace.

     

    Here is a quick example of replaying load for SQL Server 2008 R2.

     

    Step 1: Profiler

     

  • Open the SQL Server Profiler.
  • Record activity to a table
  • Be sure to only record what is of interest for the purpose of your test.
  • Try a small sample first, don’t go crazy with a 24hr replay scenario just yet.
  •  

    Step 2: Run Your Application


    As the application is running, all of the SQL and T-SQL calls will be recorded in the Profiler and stored in the table you created in step1.  Even in a small amount of time, you will have a lot of transactions.  For my example I ran in 5 minutes and captured over 90,000 calls.


     

    Step 3: Stop Your Trace/Profiler Session

     

    Step 4: Open Benchmark Factory for Databases

     

    Step 5: Launch the Load Scenario Wizard


    The Load Scenario Wizard will step you through the process of defining your replay test for SQL Server.


     

    You may see this error message, just click through it and proceed.


     

    Now enter your connection information.

     

    Benchmark Factory will allow you to browse the databases, and will recognize the profiler table you created.


     

    Benchmark Factory will now create a project based on the transactions recorded in your table.  If you want to filter out the activity to be replayed you can either:

     

  • Configure the Profiler to ONLY capture what you want to replay
  • Use your magic SQL skills to trim the table before you create your project in Benchmark Factory.
  •  

    Step 6 – Set Your Project Options


    Now you have your Benchmark Factory project and you are ready to replay the recorded load on your database.  You have a few options to explore first.


    How many users do you want running the transactions?


    Let’s assume you recorded a single user running the application.  Now you want to see what will happen if 100 users are running the same load concurrently.  Just set the ‘Users’ value for your sceneario to ’100′.  You can also optionally have the number of executions go up from the default of ’1′.  This would allow you to run the test several times in one job.

     

    You can also manipulate the latency for the transactions.  It will be default run the queries as captured and honor the timings.  However, if you want to enforce an absolute interarrival time between calls, you may do so.  You can artificially add keying and think times to simulate the users experience while they are running your application.  Removing all of the latencies will cause the project to run as fast as your SQL Server can respond to the queries.  It is critical that you define your test plan BEFORE you start jumping into the software to run your test.


     

    Step 7 – Run Your Test

     

  • Submit the job
  • Optionally add any counters you want to capture
  • View the Real Time Statistics as the test is running.
  •  

    Step 8 – View the Results


    Benchmark Factory stores the results in a local repository.  You can view key metrics such as maximum response time, bytes per second, transactions per second, and any optional counters you added in step 7.


    The graphs can be exported as image documents for your own custom reports.  You can also export all of the data to an Excel spreadsheet.

     

    Tips

     

  • After several thousand transactions, Benchmark Factory will write them out to an XML file instead of listing them separately in the project.  For the smaller project, you will be able to track performance at the query level instead of the transaction level.  You will also be able to set latencies and bind variables at the query level.  If you want to be able to do this, be sure to limit the amount of queries you are asking Benchmark Factory to replay.
  • Try to run your test as recorded without making any changes first.  Then tweak it to fit your needs.
  • Script build up and tear down directly into your Benchmark Factory project.  This way, when you execute the job, it will set your database environment to the proper state automatically.
  • Read the 5 Star Review of Benchmark Factory
  • Join the Benchmark Factory Community
  • 1 2 3 ... 7 Previous Next