647 articles
Database
SQL Server, MySQL and Oracle database design, queries, backup and performance tutorials.
SQL Server 2012 : Backup and Recovery Planning - Working with the Transaction LogSometimes it seems that the transaction log has a life of its own. The space within the file seems to grow and shrink without rhyme or reason. If you've felt this way, you're not alone.…Feb 23, 2014SQL Server 2012 : Backing Up the Database (part 2) - Backing Up the Database with Code,Verifying the Backup with CodeThe BACKUP command offers a few more options than Management Studio, and using the BACKUP command directly is useful for assembling SQL Server Agent jobs by hand, rather than with the…Feb 23, 2014SQL Server 2012 : Backing Up the Database (part 1) - Performing Backup with Management StudioThe first backup must be a full database backup to begin the backup chain. You can perform a database backup from Management Studio, selecting the database to be backed up.Feb 23, 2014SQL Server : ONE-WAY ENCRYPTION (part 3) - Reducing Vulnerability: Salting a HashIn culinary circles, salt is used as a preservative and a flavor enhancer. In the days before refrigeration meat was heavily salted for extended storage. The salt slowed the…Feb 22, 2014SQL Server : ONE-WAY ENCRYPTION (part 2) - Known VulnerabilitiesThe Payment Card Industry Data Security Standard (PCI DSS), through requirement 3.4, does offer one-way encryption as a valid option in storing the primary account number, which is…Feb 22, 2014SQL Server : ONE-WAY ENCRYPTION (part 1) - How One-Way Encryption Works, Benefits and Disadvantages of One-Way EncryptionAs noted in the introduction, disclosure of the secret value, encrypted using one-way encryption, is achieved through comparing the stored hash value with a second hash value, or search…Feb 22, 2014SQL Server 2012 : Measuring SQL Server Performance (part 7) - Viewing the Data Collector Data - Query Statistics HistoryThe most common source of performance problems in SQL Server is poorly written code. Gathering information on the performance metrics of queries is a vital part of performance monitoring…Feb 20, 2014SQL Server 2012 : Measuring SQL Server Performance (part 6) - Viewing the Data Collector Data - Disk Usage SummaryWhen you open the Disk Usage Summary report, you see a single graph. The report lists the databases over a period when the data collector was gathered. This allows you to see how the…Feb 20, 2014SQL Server 2012 : Measuring SQL Server Performance (part 5) - Viewing the Data Collector Data - Server Activity HistoryIf you select the first item in the list, Server Activity History, you’ll see a window with a number of charts. All this information represents basic server-level data, showing…Feb 20, 2014SQL Server 2012 : Measuring SQL Server Performance (part 4) - Setting Up the Data CollectorOnce the security is set, you’ll need to establish a server as the host to the management data warehouse, where the performance data gathered through the data collector will be stored.Feb 20, 2014SQL Server 2012 : Measuring SQL Server Performance (part 3) - Dynamic Management Objects, Data CollectorIntroduced in SQL Server 2005, dynamic management objects (DMOs) are mechanisms for looking into the underlying structures and processes of the SQL Server 2012 system and, to a lesser…Feb 20, 2014SQL Server 2012 : Measuring SQL Server Performance (part 2) - Performance MonitorThe Performance Monitor tool comes installed with all versions of the Windows operating system. This tool provides a graphical interface for accessing the performance counters introduced…Feb 20, 2014SQL Server 2012 Security : How Hackers Attack SQL ServerExposing any operating system or application directly to the Internet without the use of a firewall is a bad thing—no matter whether you are using Linux, UNIX, Windows, or any other…Feb 20, 2014SQL Server 2012 Security : Partially Contained DatabasesThe dependency of database-specific users upon server-based logins poses a challenge when you need to move or restore a database to another server. Although the users move with the…Feb 20, 2014SQL Server 2012 : Executing Your Queries (part 2) - SQLOS - CPU Nodes, Schedulers, Tasks, Workers, ThreadsA CPU node is a logical collection of CPUs that share some common resource, such as a cache or memory. CPU nodes live below memory nodes in the SQLOS object hierarchy.Feb 19, 2014SQL Server 2012 : Executing Your Queries (part 1) - SQLOS - Memory NodesThe SQLOS memory node is a logical container for memory associated with a node, which is a collection of CPUs with shared memory. This can be either a “real” memory node, if the server…Feb 19, 2014SQL Server 2012 : Query Plans (part 3) - Reading Query PlansBecause you are looking at the inner workings of the Query Optimizer, and because this is a feature of SQL Server that is constantly evolving, installing any service pack or patch can…Feb 19, 2014SQL Server 2012 : Query Plans (part 2) - Query Plan OperatorsJoin operators enable SQL Server to find matching rows between two tables. Prior to SQL Server 2005, there was only a single join type, the nested loop join, but since then additional…Feb 19, 2014SQL Server 2012 : Backup and Recovery Planning - Recovery Models (part 3) - Bulk-Logged Recovery Model, Setting the Recovery ModelThe model system database's recovery model is applied to any newly created database. The full recovery model is the default for the Standard and Enterprise Editions. The Personal and…Feb 10, 2014SQL Server 2012 : Backup and Recovery Planning - Recovery Models (part 2) - Simple Recovery Model, The Full Recovery ModelThe simple recovery model is suitable for databases that require that each transaction be atomic but not necessarily durable. The simple recovery model directs SQL Server to truncate, or…Feb 10, 2014SQL Server 2012 : Backup and Recovery Planning - Recovery Models (part 1)The recovery model configures SQL Server database settings to accomplish the type of recovery required for the database, as shown in Table 1. The key differences among the recovery…Feb 10, 2014SQL Server 2012 : Using XML Data - XQuery and FLWOR OperationsXQuery is a language that provides the ability to query structured and semi-structured XML data. XQuery is based on the existing XPath query language but includes added support for…Feb 10, 2014SQL Server 2012 : Using XML Data - FOR XML (part 3) - Explicit, PathThe PATH directive was introduced in SQL Server 2005 as an alternative over the EXPLICIT directive. The PATH directive is just as powerful as the EXPLICIT directive, but it is as simple…Feb 10, 2014SQL Server 2012 : Query Optimization (part 2) - Understanding StatisticsStatistics provide critical information needed by SQL Server when performing query optimization. SQL Server statistics contain details about the data, and what the data looks like in…Feb 5, 2014SQL Server 2012 : SQL Server Audit (part 3) - Viewing Audited Events,Querying Audit Catalog ViewsAfter you enable your audit objects and audit specifications, SQL Server takes it from there. Audits for each monitored event declared in your audit specifications are recorded…Jan 22, 2014SQL Server 2012 : SQL Server Audit (part 2) - Auditing Server Events, Auditing Database EventsYou create a server audit specification to monitor events that occur at the server level, such as failed login attempts or other actions not associated with any particular database.Jan 22, 2014SQL Server 2012 : SQL Server Audit (part 1) - Creating an Audit Object, Recording Audits to the File SystemSQL Server Audit is a powerful security feature that can track virtually any server or database action taken by users, and log those activities to the file system or the Windows event log.Jan 22, 2014SQL Server 2012 : Encryption Support (part 4) - Transparent Data Encryption - Enabling TDE, Backing Up the CertificateOnce you’ve created a certificate-protected DEK for the database, you can start the encryption process. Encryption occurs in the background and does not interfere with applications that…Jan 22, 2014SQL Server 2012 : Encryption Support (part 3) - Transparent Data Encryption - Creating Keys and Certificates for TDETo start using TDE, you need to create a certificate, and to create a TDE certificate, you need to create a DMK. Although DMKs and certificates, in general, can be created in any…Jan 22, 2014SQL Server 2012 : Encryption Support (part 2) - Encrypting Data at RestSocial Security or other government-issue identification numbers, credit card numbers, salary information, driver’s license numbers, passwords—the list of sensitive information just…Jan 22, 2014SQL Server 2012 : Encryption Support (part 1) - Encrypting Data on the MoveAll connection login requests made to SQL Server are encrypted if the client is using the SQL Server Native Access Client application programming interfaces (APIs).Jan 22, 2014SQL Server 2012 : Authentication and Authorization (part 2) - User-Schema Separation,Execution ContextImagine that an employee in an organization who has created many tables and stored procedures leaves the company. As a database administrator, your task is to reassign ownership of all…Jan 22, 2014SQL Server 2012 : Authentication and Authorization (part 1) - How Clients Establish a Connection, Password PoliciesIf a TCP client wants to make a connection to SQL Server, it must first know which port to connect to. Prior to SQL Server 2005, there was always a thread waiting on User Datagram…Jan 22, 2014SQL Server 2012 : SQL Server Security OverviewIf you are already familiar with the concepts of users and roles and SQL Server logins. But for those who aren’t, we’ll provide a quick explanation. The concepts of users and roles exist…Jan 22, 2014SQL Server 2012 : Fault Tolerance - Configuring an AlwaysOn Availability Group (part 2) - Configuring the SQL Server InstanceWhen the SQL Server Configuration Manager launches, click the SQL Server Services node, then select the Properties context menu of the SQL Server service account. Click the AlwaysOn High…Jan 13, 2014SQL Server 2012 : Fault Tolerance - High Availability Features in SQL Server (part 2) - Replication, Database MirroringWhen the scope of the data that we want to replicate is almost the size of the database, we use features like log shipping or database mirroring to ensure we have two or more copies of…Jan 13, 2014SQL Server 2012 : Configuration Options (part 4) - Processor-Configuration PropertiesIn a multi-CPU server, the operating system can move processes to CPUs as the load requires. The SQL Server processor affinity, or the relationship between a task and a CPU, can be…Jan 11, 2014SQL Server 2012 : Working with Transactions - Transactions in SQL CLR (CLR Integration)We noted that in PSPE, a distributed transaction might not be distributed. Thus, the boundaries of what is distributed and what is not are already blurry. Well in SQL CLR, they are not…Jan 10, 2014SQL Server 2012 : Distributed Transactions (part 4) - Using a Resource Manager in a Successful TransactionBy doing so, you would note that your VolatileRM now participates in the same transaction that a database query has enlisted itself in. This is something that BEGIN DISTRIBUTED…Jan 10, 2014SQL Server 2012 : Distributed Transactions (part 3) - Distributed Transactions in the .NET Framework - Writing Your Own Resource ManagerIt is only reasonable to expect that because databases are the most critical part of the architecture (at least to database developers and administrators!), they have had fantastic…Jan 10, 2014