« Home « Chủ đề SQL căn bản

Chủ đề : SQL căn bản


Có 80+ tài liệu thuộc chủ đề "SQL căn bản"

SQL Server Tacklebox- P1

tailieu.vn

SQL Server Tacklebox. Rodney Landrum. High Performance SQL Server. By Rodney Landrum. Copyright Rodney Landrum 2009 ISBN . The right of Rodney Landrum to be identified as the author of this work has been asserted by him in accordance with the Copyright, Designs and Patents Act 1988. No part of this publication may be reproduced, stored or introduced into a...

SQL Server Tacklebox- P2

tailieu.vn

Rodney Landrum has been working with SQL Server technologies for longer than he can remember (he turned 40 in May of 2009, so his memory is going). He writes regularly about many SQL Server technologies, including Integration Services, Analysis Services, and Reporting Services. He is a regular contributor to SQL Server Magazine and Simple-Talk, the latter of which he sporadically...

SQL Server Tacklebox- P3

tailieu.vn

Surely, like me, you are afraid of break-ins. It is the Data Corruption beast. Here, I will intentionally, though begrudgingly, corrupt a database and show some of the ways to discover and fix it, emphasizing the need for a solid backup strategy.. All of the scripts provided in this 'tacklebox', as well as the full DBA Repository solution, presented in...

SQL Server Tacklebox- P4

tailieu.vn

It becomes second nature to them to install, prep and release a SQL Server into production. It is a painful experience so, before you hunker down to install SQL Server, you will want to review your SQL Server Installation Check List. It will contain multiple instructions for different versions of SQL Server. Many of the configuration options, such as the...

SQL Server Tacklebox- P5

tailieu.vn

SQL Server will live within the 2G memory range to which 32-bit applications are generally relegated.. The automated SQL Server configuration script. SQL Server Memory. Listing 1.2 displays the actual T-SQL automation script to implement the above steps, which you can execute against your newly installed SQL Server instance. SQL Server Automated Configuration Script 2009 - Rodney Landrum. --Setup Database...

SQL Server Tacklebox- P6

tailieu.vn

msdb.dbo.syscategories WHERE. EXEC @ReturnCode = msdb.dbo.sp_add_category @class = N'JOB'. msdb.dbo.sysjobs WHERE. msdb.dbo.syscategories Where. Exec msdb.dbo.sp_delete_job. EXEC @ReturnCode = msdb.dbo.sp_add_job @job_name = N'IDX Maintenance. EXEC @ReturnCode = msdb.dbo.sp_add_jobstep @job_id = @jobId. EXEC @ReturnCode = msdb.dbo.sp_update_job @job_id = @jobId. EXEC @ReturnCode = msdb.dbo.sp_add_jobschedule @job_id = @jobId. EXEC @ReturnCode = msdb.dbo.sp_add_jobserver @job_id = @jobId. EVENTDATA().value('(/EVENT_INSTANCE/TSQLCommand/CommandText)[1]. EVENTDATA().value('(/EVENT_INSTANCE/EventType)[1]','nvarchar(ma x)'). EVENTDATA().value('(/EVENT_INSTANCE/ServerName)[1]','nvarchar(m ax)'). EVENTDATA().value('(/EVENT_INSTANCE/LoginName)[1]','nvarchar(ma x)'). EVENTDATA().value('(/EVENT_INSTANCE/UserName)[1]','nvarchar(max. EVENTDATA().value('(/EVENT_INSTANCE/DatabaseName)[1]','nvarchar...

SQL Server Tacklebox- P7

tailieu.vn

1 – Eating SQL Server installations for breakfast. Listing 1.2: The SQL Server automated configuration script.. Documenting will be the focus of Chapter 2, where I will introduce you to the DBA Repository, a tool that incorporates the combined reporting and data migration strengths of SQL Server Reporting Services and SQL Server Integration Services. As a result, my first week...

SQL Server Tacklebox- P8

tailieu.vn

CASE WHEN CONVERT(CHAR(100), SERVERPROPERTY('IsClustered. CASE WHEN CONVERT(CHAR(100), SERVERPROPERTY('IsFullTextInstalled. CONVERT(CHAR(100), SERVERPROPERTY('SqlCharSet. AS SqlCharSet, CONVERT(CHAR(100), SERVERPROPERTY('SqlCharSetName. AS SqlCharSetName, CONVERT(CHAR(100), SERVERPROPERTY('SqlSortOrder. AS SqlSortOrderID, CONVERT(CHAR(100), SERVERPROPERTY('SqlSortOrderName. Listing 2.1: Server information.. FROM tempdb.dbo.sysobjects WHERE id. EXEC sp_MSforeachdb 'SELECT CONVERT(char(100), SERVERPROPERTY(''Servername. SELECT CONVERT(char(100), SERVERPROPERTY('Servername. AS Server, msdb.dbo.backupmediafamily.logical_device_name, msdb.dbo.backupmediafamily.physical_device_name, msdb.dbo.backupset.expiration_date,. msdb.dbo.backupset.name,. msdb.dbo.backupset.description, msdb.dbo.backupset.user_name,. msdb.dbo.backupset.backup_start_date, msdb.dbo.backupset.backup_finish_date, CASE msdb..backupset.type. msdb.dbo.backupset.backup_size, msdb.dbo.backupset.database_name,. msdb.dbo.backupset.server_name AS Source_Server FROM msdb.dbo.backupmediafamily. INNER JOIN msdb.dbo.backupset...

SQL Server Tacklebox- P9

tailieu.vn

FROM tempdb.dbo.sysobjects WHERE id. [?]..sysusers usg ON mem.groupuid = usg.uid) ON usu.uid = mem.memberuid LEFT OUTER JOIN master.dbo.syslogins lo ON usu.sid = lo.sid. msdb.dbo.sysjobs.job_id, msdb.dbo.sysjobs.name,. msdb.dbo.sysjobs.enabled AS Job_Enabled, msdb.dbo.sysjobs.description,. msdb.dbo.sysjobs.notify_level_eventlog, msdb.dbo.sysjobs.notify_level_email, msdb.dbo.sysjobs.notify_level_netsend, msdb.dbo.sysjobs.notify_level_page,. msdb.dbo.sysjobs.notify_email_operator_id, msdb.dbo.sysjobs.date_created,. msdb.dbo.syscategories.name AS Category_Name, msdb.dbo.sysjobschedules.next_run_date, msdb.dbo.sysjobschedules.next_run_time, msdb.dbo.sysjobservers.last_run_outcome, msdb.dbo.sysjobservers.last_outcome_message, msdb.dbo.sysjobservers.last_run_date,. msdb.dbo.sysjobservers.last_run_time, msdb.dbo.sysjobservers.last_run_duration,. msdb.dbo.sysjobs.date_modified, GETDATE() AS Package_run_date,. msdb.dbo.sysschedules.name AS Schedule_Name, msdb.dbo.sysschedules.enabled,. msdb.dbo.sysschedules.freq_type, msdb.dbo.sysschedules.freq_interval,. msdb.dbo.sysschedules.freq_subday_interval, msdb.dbo.sysschedules.freq_subday_type, msdb.dbo.sysschedules.freq_relative_interval, msdb.dbo.sysschedules.freq_recurrence_factor, msdb.dbo.sysschedules.active_start_date,...

SQL Server Tacklebox- P10

tailieu.vn

One of these tools is PowerShell, which has been incorporated into SQL Server 2008 and promoted extensively by Microsoft. SQL Server 2008 Data Collector – this is a new feature in SQL Server 2008 that you may choose to use in your day-to-day DBA data gathering tasks. http://www.simple-talk.com/sql/learn-sql-server/sql-server-2008- performance-data-collector/.. In addition to free tools and technologies, you could certainly acquire...

SQL Server Tacklebox- P11

tailieu.vn

ServerList_SSIS , which can then be used to "seed". The ServerList_SSIS table is shown in Figure 2.9.. Figure 2.9: The Serverlist_SSIS table.. Version – version of the SQL Server instance, 8, 9 or 10 for SQL Server and 2008 respectively. This field is used after the package execution to update the servers that are added to the SQL_Servers table that...

SQL Server Tacklebox- P12

tailieu.vn

Figure 2.14: Connection Manager property with blank Server name.. Figure 2.15 shows the Properties window for the Multiserver object.. Figure 2.15: Assigning the User::SRV_Conn variable to the ServerName property.. Now that we know how to populate DBA_Rep , via the SSIS Populate_DBA_Rep. Figure 2.16 shows the. Populate_DBA_Rep package executing in real time (the task to populate the. SQL_Servers table is...

SQL Server Tacklebox- P13

tailieu.vn

2 – The SQL Server landscape. document a SQL Server infrastructure, using some T-SQL scripts, a DBA Repository, SSIS and SSRS. If you are interested in deploying this solution in your environment, it is available to download from:. RodneyLandrum/SQL_Server_Tacklebox_Code.zip . With this repository, or something similar, in place you will have a means to easily get to know, and monitor,...

SQL Server Tacklebox- P14

tailieu.vn

I have found that SSIS is one of the best choices for moving data, especially in terms of cost, and in situations where near real-time data integration is not a requirement, such as you may achieve with native replication or Change Data Capture technologies. Whether you choose to use BCP or SSIS will depend on the exact nature of the...

SQL Server Tacklebox- P15

tailieu.vn

we are loading data from the text file back in to the SQL_Conn table, which currently holds 58K rows.. As you can see in Figure 3.2, this is exactly the number of rows that is now in the. SQL_Conn table, after 20 iterations of the BCP command, using the 58,040 records in the f1_out.txt file as the source.. Figure 3.2:...

SQL Server Tacklebox- P16

tailieu.vn

ORDER , which speeds performance when working with tables with clustered indexes so that the data being loaded is pre-sorted to match the physical order of the clustered index.. First, however, I would like to add a data viewer to the process. A data viewer lets you, the package designer, view the data as it flows through from the source...

SQL Server Tacklebox- P17

tailieu.vn

For this next section, however, I need to start with a clean slate and refactor the SQL_Conn and SQL_Conn_Archive. The SISS package that populates the SQL_Conn table runs every 15 minutes, and captures the date and time that the package ran as a field value, so this "run time". Since the tables currently contain duplicate rows, in this example, I...

SQL Server Tacklebox- P18

tailieu.vn

the data in them needs to be regularly resynched with the source. The added benefit of using a tool such as log shipping is that you can segregate reporting processes from transactional processes, which can offer performance gains in some scenarios.. Log shipping vs. Log Shipping – I have used log shipping for a variety of data migration tasks and...

SQL Server Tacklebox- P19

tailieu.vn

Figure 3.19: Setting up initial restore of secondary database for Log Shipping.. Figure 3.20: Setting up Copy Files options for Transaction Log Shipping.. 3 – The migratory data. The next and final, "Restore Transaction Log", tab is very important. This is where you set the database state to either "No Recovery". You will want to use Standby mode if you...

SQL Server Tacklebox- P20

tailieu.vn

Poorly configured Model database – meaning that subsequent databases adopt properties (AutoGrowth, Recovery Model and so on) that are inappropriate for their intended use.. Inefficient Delete, Insert or Bulk Insert statements – such processes, plus those that create temp tables, can very quickly fill the log file with unnecessary data. The situation is exacerbated by incorrect Model database configuration.. I...