Mehboob

" Every cloud has a silver lining "

SQL Server 2008 Service fails to start

Posted by Mehboob on 03/10/2011

SQL Server 2008 Service fails to start after Service Pack Installation

Some times you may find that the SQL Server Service is not starting after applying a service pack and when you check in the Event Viewer you find the below message.

Script level upgrade for database ‘master’ failed because upgrade step ‘sqlagent100_msdb_upgrade.sql’ encountered error 598, state 1, severity 25. This is a serious error condition which might interfere with regular operation and the database will be taken offline. If the error happened during upgrade of the ‘master’ database, it will prevent the entire SQL Server instance from starting. Examine the previous errorlog entries for errors, take the appropriate corrective actions and re-start the database so that the script upgrade steps run to completion.

SQL Server Setup creates a database with the data file name temp_MS_AgentSigningCertificate_Database.mdf  during the installation process and if the SQL Server setup is not able to create that database in the default data path then the above error is returned as it is not able to find the path.
To fix this issue.

1.

Go to Registry editor,  ->To open this, ->go to “Run” and type -> ”regedit” and click “ok”

2.

First go to this path and make sure that the path in the key SQLDataRoot exists. If not then give a valid path to this key.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10.<instance name>\Setup3

Then go to this path and make sure that the path in the keys “BackupDirectory”, “DefaultData” and “DefaultLog” exists. If not then give a valid path to these keys.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10.<instance name>\MSSQLServer

4.

Now you should be able to start the SQL Server Service without any issues.
Once the Service is started, verify the SQL Server, databases and others to make sure everything is fine.

Also verify if the Service pack or the CU is installed correctly.

Posted in MS SQL Server | Leave a Comment »

SQL Server Migration Checklist

Posted by Mehboob on 03/10/2011

SQL Server Migration Checklist

Are you migrating your SQL Servers? Here is a checklist for your SQL Server Migration, easy way to achive your moving goal.

1.Build your New Server, Install SQL Server and required updates and keep the server ready for migration

2.Stop Application Service(s).This is to ensure that the no applications are connected to the Databases during the migration process.

3.Change the Properties of the databases that are part of Migration to “Read-only”. This is to ensure that the data modification is not happening by any other sources.

4. Take a FULL backup of all the User databases that are involved in the Migration Process.

5.Move the backups to the destination server or a Shared location, then restore them to the appropriate drives on the destination.

6.Change the compatibility level of the databases (Optional) Do this if the applications connecting to these databases are independent of the database compatibility level.

7.Transfer logins using SSIS (Transfer Logins Task) or using “sp_help_revlogin” More information about sp_help_revlogin is at http://support.microsoft.com/kb/246133

8.Check for Orphaned Users in the databases and Fix them (if Any)

9.Update Usage on the migrated Databases

10.Update Stats on the migrated Databases

11.Re-Index or Re-Organize Indexes on the migrated Databases

12.Transfer Jobs using SSIS or manually create them

13.Build Maintenance plans (if Any)

14.Recompile database objects if required

15.Move or rebuild SSIS or DTS packages (if Any)

16.Create Alerts and Operators (if Any)

17.Setup High Availability Options (if Any Like Replication, LogShipping, Mirroring)

18.Test the High Availability options that were setup in the previous step

19.Point the Application(s) to new Server and start the Application Service(s)

20.Test the Application(s)

Let me know if you any other question or suggestion.

Mehboob – MCTS

Posted in MS SQL Server | Leave a Comment »

Developing on SharePoint 2010

Posted by Mehboob on 02/09/2011

Software developers can use the SharePoint 2010 business collaboration platform to build enterprise-class solutions for intranet portals and the web. Use these ten modules to get started with development for SharePoint 2010 using Visual Studio 2010. 

SharePoint 2010 Advanced IT Professional Training
For IT professionals, SharePoint 2010 offers enhancements to drive productivity, a scalable unified infrastructure, and flexible deployment. SharePoint 2010 Advanced IT Professional Training is a deep technical learning series for current SharePoint professionals who are looking to upgrade their skills to SharePoint 2010.

Khan – MCTS

www.addarr.com

Posted in SharePoint | Comments Off

SharePoint 2010 Enterprise Developer Training

Posted by Mehboob on 02/09/2011

SharePoint 2010 Enterprise Developer Training

 

Khan – MCTS

Posted in SharePoint | Comments Off

SQL Azure Price

Posted by Mehboob on 28/07/2011

What is SQL Azure?

SQL Azure is a cloud based relational database as a Service offered by Microsoft. Conceptually it is SQL server in the cloud.

What is cloud computing?

National Institute of standards and computing definition of cloud computing:

Cloud computing is a model for enabling ubiquitous, convenient, on-demand network access to a shared pool of configurable computing resources (e.g., networks, servers, storage, applications, and services) that can be rapidly provisioned and released with minimal management effort or service provider interaction.

SQL Azure Pricing Overview:-

Compute time, measured in service hours: Windows Azure compute hours are charged only when your application is deployed. When developing and testing your application, developers will want to remove the compute instances that are not being used to minimize compute hour billing.

The standard pay-as-you-go pricing for Windows Azure compute is as follows:

Extra small instance**: $0.05 per hour
Small instance (default): $0.12 per hour
Medium instance: $0.24 per hour
Large instance: $0.48 per hour
Extra Large instance: $0.96 per hour

More info visit here …

To pick the best Windows Azure platform offer for your needs, please visit our Pricing Calculator.

I have not included the questions specific to unsupported features because it keeps on changing. Read general guidelines and limitations. Also note that SQL Azure is evolving very fast and it is important to keep a tab on the features that are added in service releases.

Posted in Cloud | Comments Off

Videos Training MCM

Posted by Mehboob on 14/07/2011

The following readiness videos provide candidates who want to pursue SQL Server 2008 Microsoft Certified Master certification with an overview of what you need to know to prepare for the SQL Server 2008 Microsoft Certified Master Knowledge Exam. All of this free of cost, no fee or regestration require in order to watch, simple just click and enjoy…

Microsoft Certified Masters Video från Brent Ozar.

Immersion Event on Performance Tuning

Immersion Event on HA+DR

Immersion Event on Security and Development Support

Khan – MCTS

Posted in MS SQL Server | Comments Off

Free videos to learn more about Microsoft

Posted by Mehboob on 13/07/2011

Microsoft Virtualization whenever and from wherever you want just click, listen, and learn. Start by clicking the title to learn more about the video. You can then stream it or download to view offline.

Desktop Virtualization:-

TechNet Video: Virtualization Jump Start (12): Application Delivery for VDI

 Server Virtualization:-

 

Posted in Cloud | Comments Off

Office 365 Video for IT Pros

Posted by Mehboob on 08/07/2011

The Microsoft Office 365 Overview provides an excellent perspective of the overall value Office 365 provides to modern organizations in terms of productivity, access, familiarity, security, control and reliability. This section will help IT Pros better understand the options and advantages organizations have by taking this approach.

Watch the complete video series:

 Additional Resources:

 

Posted in MS Windows | Comments Off

Cloud & database service (RDBMS)

Posted by Mehboob on 04/07/2011

Microsoft SQL Azure Database is a relational cloud database service (RDBMS) built on SQL Server technologies. It is a highly available, scalable, multi-tenant database service hosted by Microsoft in the cloud. SQL Azure Database helps to ease provisioning and deployment of multiple databases.

Microsoft Virtual Academy: Understanding the Private Cloud

 “Microsoft Virtualization for VMware Professionals”      Video Learning:
 

To download or watch the complete video series

TechNet Edge Media: Video’s

Top Edge Categories:

How to deploy Windows Azure Worker Nodes as part of a Windows …

Windows HPC Server integrates with Windows Azure to allow you to add Windows Azure nodes to supplement your on-premises computing cluster. This video shows how to create a hosted service and storage account in your Windows Azure subscription, create a node template in HPC Cluster Manager, and then deploy a set of nodes. This video is meant to introduce steps for node deployment, and does not cover application deployment or file staging.

0 Time: 9:38  June 27, 2011

This short video introduces Windows Azure AppFabric, a comprehensive middleware platform that can help you develop and manage your business applications. It covers key features and benefits, including middleware services, application composition and management, and a cloud-optimized application infrastructure.

4 Time: 5:00   May 16, 2011

This short video discusses the comprehensive platform that allows developers to easily deploy and manage .NET-based applications spanning on-premises and cloud-based components. In addition it covers the benefits of the four main parts: Middle-Tier Services, Composition Model, Developer Tools and the AppFabric Application Manager.

0 Time: 4:27  May 16, 2011

 Basic Architectural Considerations

This walkthrough provides an overview of some basic architectural considerations that you can use to establish best practices and optimize your SQL Azure databases. Specifically, the video discusses standard database optimization techniques, database sharding, and table considerations. The demo portion of the video shows how to create a clustered index in the Windows Azure portal and shows how to test for latency using SQL Server Management Studio. The conclusion points you to some additional resources to help you get started using SQL Azure.

0 Time: 7:40  April 26, 2011

This walkthrough demonstrates how easy it is to extend, share, and integrate SQL Azure data with mobile and heterogeneous applications using other programming platforms via an OData service. The video starts by covering the benefits of using SQL Azure, and then it briefly reviews an existing ASP.NET application that was built to support this series of videos. The video goes on to cover how to enable the application to expose some of the data via an OData service, and finally, it shows how a variety of different client applications, such as an Android phone, can interact with this OData service. The video concludes by referring users to additional resources that offer further support.

0 Time: 9:14  April 25, 2011

 
  • Test your service both locally and remotely

    1 Time: 2:16  February 09, 2011

    Ease the barriers to getting you started with cloud service development.

    4 Time: 2:59  February 09, 2011

     What is Windows Azure?

    How does Windows Azure work? How does it let you concentrate more on your code and less on operations, maintenance and scaling? Let Steve Marx from Microsoft draw you a picture.

    5 Time: 4:15  February 09, 2011

    Origin Digital wanted to increase transcoding without increasing capital expense. To gain dynamic scalability within a familiar development environment, the company built an innovative transcoding application called Cloudcoder on the Windows Azure platform.

    0 Time: 8:49  February 09, 2011

    Siemens IT Solutions and Services developed a system for remote service of more than 80,000 devices worldwide. Its users can distribute software packages to devices spread around the gloabe through virtual private network connections. To be more efficient and reduce costs, Siemens uses the Windows Azure platform.

    0 Time: 14:31  February 09, 2011

    T-Mobile USA needed new mobile software that simplified communications for families and their tight deadline left no time to implement application or server infrastructure. With Microsoft Visual Studio 2010 Professional, T-Mobile was able to build their solution for the Windows Phone 7 on the Windows Azure platform in just six weeks.

    3 Time: 3:44  February 09, 2011

     How to deploy Windows Azure Worker Nodes as part of a Windows HPC Cluster

  • Windows HPC Server integrates with Windows Azure to allow you to add Windows Azure nodes to supplement your on-premises computing cluster. This video shows how to create a hosted service and storage account in your Windows Azure subscription, create a node template in HPC Cluster Manager, and then deploy a set of nodes. This video is meant to introduce steps for node deployment, and does not cover application deployment or file staging.

    0 Time: 9:38  June 27, 2011

    This short video introduces Windows Azure AppFabric, a comprehensive middleware platform that can help you develop and manage your business applications. It covers key features and benefits, including middleware services, application composition and management, and a cloud-optimized application infrastructure.

    4 Time: 5:00  May 16, 2011

    Views: 1,478

     
    This short video discusses the comprehensive platform that allows developers to easily deploy and manage .NET-based applications spanning on-premises and cloud-based components. In addition it covers the benefits of the four main parts: Middle-Tier Services, Composition Model, Developer Tools and the AppFabric Application Manager.

    0 Time: 4:27  May 16, 2011 

    This walkthrough provides an overview of some basic architectural considerations that you can use to establish best practices and optimize your SQL Azure databases. Specifically, the video discusses standard database optimization techniques, database sharding, and table considerations. The demo portion of the video shows how to create a clustered index in the Windows Azure portal and shows how to test for latency using SQL Server Management Studio. The conclusion points you to some additional resources to help you get started using SQL Azure.

    0 Time: 7:40  April 26, 2011

    This walkthrough demonstrates how easy it is to extend, share, and integrate SQL Azure data with mobile and heterogeneous applications using other programming platforms via an OData service. The video starts by covering the benefits of using SQL Azure, and then it briefly reviews an existing ASP.NET application that was built to support this series of videos. The video goes on to cover how to enable the application to expose some of the data via an OData service, and finally, it shows how a variety of different client applications, such as an Android phone, can interact with this OData service. The video concludes by referring users to additional resources that offer further support.

    0 Time: 9:14  April 25, 2011

    This walkthrough demonstrates how easy it is to extend, share, and integrate SQL Azure data with Microsoft applications via an OData service. The video starts by covering the benefits of using SQL Azure, and then it briefly reviews an existing ASP.NET application that was built to support this series of videos. The video goes on to cover how to enable the application to expose some of the data via an OData service, and finally, it shows how a variety of different client applications, such as Excel, Javascript, and Windows Phone 7, can interact with this OData service. The video concludes by referring users to additional resources that offer further support.

    0 Time: 11:24  April 25, 2011

  • This walkthrough demonstrates how to use the Windows Azure AppFabric Cache to cache data from a SQL Azure database. This includes: – Populating an ASP.NET GridView control from SQL Azure – Provisioning a Windows Azure AppFabric Cache – Retrieving SQL Azure data into the default cache – Retrieving SQL Azure data from the default cache – Enabling the local cache – Retrieving SQL Azure data from the local cache – Using ASP.NET code to compare the performance benefits

    4 Time: 9:14  April 25, 2011

    This walkthrough introduces some of the features of SQL Azure Reporting and demonstrates the use of advanced analytical tools, such as using SQL Azure data with Excel and PowerPivot. Specifically, users will learn how to use SQL Azure data with Excel and create two pivot tables using employee expense report data. The conclusion points to some additional resources to help users get started.

    5 Time: 6:42  April 12, 2011

    This walkthrough discusses how businesses can take business intelligence to the cloud with SQL Azure. The video covers the benefits of SQL Azure—including the ability to establish business intelligence without adding hardware costs or IT overhead—and it also introduces SQL Azure Reporting. The ability to embed SQL Azure reports into on-premises Apps and Windows Azure Web Apps—as well as the ability to create and export SQL Azure reports using available report authoring tools is also covered. The demonstration portion of the video shows users how to author a report with Business Intelligence Development Studio (BIDS), display reports, embed a report into a web app, and manage and deliver reports. The conclusion offers some additional resources to help users get started.

    4 Time: 12:34  April 12, 2011

    This walkthrough covers the value of using SQL Azure Data Sync to provide bi-directional synchronization and data-management capabilities with on-premises and cloud databases. The video covers both the benefits and features of SQL Azure and explains how businesses can use SQL Azure Data Sync to share information efficiently. The demonstration portion of the video covers how to establish synchronization between an on-premises database and SQL azure, as well as between two SQL Azure databases. It also shows the sync results in real time within a web application. The conclusion offers additional resource information to help users get started with SQL Azure and SQL Azure Data Sync.

    0 Time: 10:12   April 12, 2011

Let me know if you have any further question or comments.

Khan – MCTS, MCITP, MCDBA, MCSE @ MCP

 

Posted in BI-DW, MS SQL Server, MS Windows, SharePoint | Comments Off

How to change the SA password

Posted by Mehboob on 28/06/2011

How to change the SA password without having Sysadmin rights

Log on interactively to the physical server (RDP is fine) that hosts the SQL Server\Instance. It is important that we are logged on as Local Admin or eqvivalent.

In a DOS window, navigate to the directory that keeps OSQL.EXE

Issue the following command at the DOS prompt:
OSQL -E

If everything is ok, the SQL prompt will appear. This means we are now connected to the SQL Server through Trusted Connection. At the SQL prompt, issue the following command:

EXEC sp_password NULL,’newpassword’,'SA’ GO

If everything is ok, this command now have changed the password for SA to the new password, and you exit the SQL prompt and close the DOS window. If you connect to a certain instance, the initial command line would be:

OSQL -E -S Server\Instance

If you aren’t sure of the name of the server, you can list all servers:
OSQL -L

Khan – SQL DBA – SPA  MCTS

Posted in MS SQL Server, MS Windows | Comments Off

Terabyte, Petabyte, Exabyte, Zettabyte & Petaflop

Posted by Mehboob on 22/06/2011

Byte, Kilobyte, Megabyte, Gigabyte, Terabyte, Petabyte, Exabyte, Zettabyte & Petaflop

Computer storage and memory is often measured in megabytes (MB) and gigabytes (GB). A medium-sized novel contains about 1MB of information. 1MB is 1,024 kilobytes, or 1,048,576 (1024×1024) bytes, not one million bytes.

Unit  Equivalent
1 kilobyte (KB)  1,024 bytes
1 megabyte (MB)  1,048,576 bytes
1 gigabyte (GB)  1,073,741,824 bytes
1 terabyte (TB)  1,099,511,627,776 bytes
1 petabyte (PB)  1,125,899,906,842,624 bytes

Similarly,
1 GB is 1,024MB, or 1,073,741,824 (1024x1024x1024) bytes.
A terabyte (TB) is 1,024GB; 1TB is about the same amount of information as all of the books in a large library, or roughly 1,610 CDs worth of data.
A petabyte (PB) is 1,024TB. Indiana University – USA is now building storage systems capable of holding petabytes of data.
An exabyte (EB) is 1,024PB.
A zettabyte (ZB) is 1,024EB.

Finally, a yottabyte (YB) is 1,024ZB, however, in a binary system, 10GB is 10,737,418,240 bytes. WOW

Top 10 are
Nebulae at China’s National Supercomputing Center in Shenzen (1.27 petaflop/s),
Tsubame 2.0 at the Tokyo Institute of Technology (1.19 petaflop/s),
Cielo at Los Alamos National Laboratory in New Mexico (1.11 petaflop/s),
Pleiades at the NASA Ames Research Center in California (1.09 petaflop/s),
Hopper at DOE’s National Energy Research Scientific Computing Center (NERSC) in California (1.054 petaflop/s),
Tera 100 at the CEA (Commissariat à l’énergie atomique et aux énergies alternatives) in France (1.05 petaflop/s),
and Roadrunner at Los Alamos National Laboratory in New Mexico (1.04 petaflop/s).

World Best Computer:

1. Riken, Japan                                                                                    8773 teraflops
2. National Supercomputing Center Tianjin, Kina               4701 teraflops
3. Oak Ridge National Laboratory, USA                                   2331 teraflops
4.  National SuperComputing, Shenshen, Kina                      2984 teraflops
5 Tokyo Institute of Technology, Japan                                  2287 teraflops
6. Los Alamos National Laboratory, USA                               1365 teraflops
7. NASA, USA                                                                                      1315 teraflops
8. Nersc, USA                                                                                      1288 teraflops
31. KTH, Sweden                                                                                  305  teraflops

The New Number One
The K Computer, built by Fujitsu – (my employer), currently combines 68544 SPARC64 VIIIfx CPUs, each with eight cores, for a total of 548,352 cores—almost twice as many as any other system in the TOP500. The K Computer is also more powerful than the next five systems on the list combined.

The K Computer’s name draws upon the Japanese word “Kei” for 10^16 (ten quadrillions), representing the system’s performance goal of 10 petaflops. RIKEN is the Institute for Physical and Chemical Research. Unlike the Chinese system it displaced from the No. 1 slot and other recent very large system, the K Computer does not use graphics processors or other accelerators. The K Computer is also one of the most energy-efficient systems on the list.

Khan – sql dba

MCTS

Posted in BI-DW, MS SQL Server, MS Windows, SharePoint | Comments Off

Error: 1418 fails to connect sql 2008 mirror server

Posted by Mehboob on 20/06/2011

Error 1418, fails to connect sql 2008 mirror server:

  • The server network address can not be reached
  • Alter failed
  • Error 1418
  • Insufficient Log Data
  • Error 1478

Start with: In this example we are inside a DOMAIN. We have a domain user called khan_machine

1)      Machine A, Machine B with Sqlserver installed. NO XP or other kind of firewalls ON.

2)      khan_machine is local admin in both machines. Also is a sysadmin user in both sqlservers.

3)      khan_machine  is the MSSQLSERVER service account in both machines

4)      Machine A is gonna be the PRINCIPAL, B the MIRROR.

5)      Log on in my machine as khan_machine

6)      Open Sql server Studio. Connect to both machines using windows authenticacion.

7)      Create a New Database in A (you may need to have sysadmin role to khan_machine using sa) create a table, add some data

8)       Backup the new DB (Full backup) with .bak extension

9)       Backup the new DB (Transaction log) with .trn extension

10)    Copy the both files to a location in B machine.

11)     Restore .bak into a new DB using NORECOVERY option

12)     Restore .trn into the previous DB using NORECOVERY option

13)    Go to Machine A, open a new query

14)    Take a look to the endpoints

Run this syntax in QA:

SELECT type_desc, port FROM sys.tcp_endpoints;
SELECT name,role,state_desc FROM sys.database_mirroring_endpoints;

15)   Delete existing ones (DROP ENDPOINT [NAME])
16)   Create a new endopoint

 

 

 

Run this syntax in QA:
CREATE ENDPOINT [Mirroring]
AS TCP (LISTENER_PORT = 5023)
FOR DATA_MIRRORING (ROLE = PARTNER, ENCRYPTION=DISABLED)

17)   Start it

ALTER ENDPOINT [Mirroring]
STATE = STARTED
AS TCP (LISTENER_PORT = 5023)
FOR database_mirroring (ROLE = PARTNER);
GO

18)   Do steps 13 to 17 in machine B.

19)   Return to machine A. Query.

20)   Lets link to our partner in machine B. First ensure you can see it with ping and telnet to the port.

ALTER DATABASE NAME
SET PARTNER =’TCP://MACHINENAME:5023′

21)   Repeat step 20 from MACHINE B pointing to MACHINE A

22)   Note: Refresh the both databases in the UI, you should see the role and status of the mirror beside the database UI object.

23)   Lets test them: Add some new data in Machine A database.

24)   Then, right click over database, then mirror, then in the form select “FAILOVER”, then say yes.

25)   Refresh the 2 databases in the UI you should see the new status and roles changed.

26)   Open Machine B databse, the new data should be there.

To establish any mirroring session (with or without certificates) you must use FQDN (Fully Qualified Domain Names) machine name.domain.com.  ** Before going on, be sure that you can reach the 3 machines with a single PING. Also, is a good practice to ensure that you can reach a telnet call over the FQDN + the port you plan to use (5022 in this example)** 

FIX: Over the post above. When establishing a mirroring session using machine accounts (not certificates, so you are inside a DOMAIN)  ensure your 3 mssqlservices are running under NETWORK SERVICE account

 

För more information have a look here

 

Khan – MCTS

Posted in MS SQL Server | Comments Off

Microsoft SQL Server 2008 Service Pack 2

Posted by Mehboob on 19/06/2011

Microsoft SQL Server 2008 Service Pack 2 download here 

Microsoft SQL Server 2008 Service Pack 2 (SP2) is now available for download.

Posted in MS SQL Server | Comments Off

Professional SQL DBA Tips

Posted by Mehboob on 17/06/2011

Top Tips for Effective Database Maintenance

Paul S. Randal

Several times a week I’m asked for advice on how to effectively maintain a production database. Sometimes the questions come from DBAs who are implementing new solutions and want help.  It’s worth to go through here is link: http://technet.microsoft.com/en-us/magazine/2008.08.database.aspx

Some other topic which you might want to know:

Twit List
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=69568

It’s dead, Jim
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=67782

Not Even Stupid
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=79305

 Khan – MCTS

 

Posted in MS SQL Server | Comments Off

Log Shipping – solutions for high availability

Posted by Mehboob on 15/06/2011

Log Shipping is one of the solutions for High Availability for business critical application. Log Shipping is first introduced in SQL Server 7.0.  Log Shipping; as name defines does the shipping of Transaction Log to another server; it does exact replica of the database; it does backup of Transaction Log and restores it on a Secondary /Stand by Server which keeps database on secondary server in sync with the database on Primary Server. In case of failure work loss happens only for the time being copy of T-Log backup and restoring back to
Secondary/Stand by Server. Stand by / Secondary server which can act as a primary server in case of failure.

SQL Server DBA has to perform some manual tasks to bring it online for business. There are other options like Clustering and Replication for High Availability of Business Critical Application, so why do we go for Log Shipping? that good question so here we go .. 

Well, there are reasons for choosing Log Shipping against Cluster and Replications: Its easy to maintian and cost$ is less then other technolog, such as cluster, some details why we go for LS.

1. Setting up: It is very easy to create a Log Shipping, only thing you need to identify is you must have two servers with SQL Server Enterprise Edition and a database(s) which is critical to your business environment.
2. Manageability: It is easy to manage Log Shipping comparing to Replication and Cluster Server, generally Log Shipping works well and you don’t feel panic with its monitoring or maintenance work.
3. Act as a Reporting Server: Stand by or Secondary Server can act as a Reporting Server in your organization, your database which is being log shipped can be used for Read Only queries or I would rather say it can act as a Reporting Server. The thing need to be consider here is it will be unavailable at the time of Restoration of Transaction Log e.g. if your Transaction Log backup takes 10 minutes of Restoration Time and you does Log Shipping every 60 minutes then your Reporting/Secondary/Stand by Server will be un-available for 10 minutes.
4. Can use multiple database(s)/server(s): You can use multiple server(s) as a Stand by or Secondary Server for different purpose, e.g. you can create two Stand by server(s) one for Reporting and another for High Availability
5. Cheaper then cluster: If you go for a Cluster Server you will have to meet software and Hardware requirement; I mean you need identical hardware to setup clustering where as in case of Log Shipping you don’t need to have exactly the same set of hardware for Primary and Secondary or Stand by server.
6. Best solution for physical dispersed location: Data Center: In your environment you are having a cluster server configured at your Data Center for high availability so that if in case of any failure or damaged you can recover your data back, imagine what if your data center itself got damaged!!!!!! In this type of scenario Log Shipping does good job you can configure Log Shipping to Dr Server which is at different physically location and if your local Data Center / Server got damaged you may still recover your data. You can do this thing using Replication too; in case of replication again you have to select Snapshot/Transactional/Snapshot Replication, now as you may use Log Shipping you would rather go for Snapshot Replication, you have to monitoring it regularly whether it is running or not!!! Where as with Log Shipping it generally runs smoothly and even if it caught an error it will tell you exact where it breaks so fixing a Log Shipping is not difficult.

Prerequisite
1. Database must be in Full or Bulk-Logged Recovery Model.It is required that Database has to be in Full or Bulk-Logged Recovery Model,One can perform T-Log backup only when Database Recovery Model is set to Full or Bulk-Logged, here is a brief on recovery model.

3. Create a share on Primary Server and Secondary Server with change and write permissions for Windows Account User which is used for SQL Server Agent.

4. You may Restore Full Database on Secondary Server manually or it can be done via Log Shipping installation itself at the time of setup process (Ensure this database on Secondary Server must be restored with NORECOVERY or STANDBY option).It is required to Restore Database with NORECOVERT STANDBY because if the database restored in recovered/write enabled mode you can not apply another T-Log.

Optional Component : Monitoring / Witness Server
Identify your Monitor Server which will look after for your Primary Server and SECONDARY Server’s Activity.It is better to use separate server which monitors the activity of Primary and Secondary Server so that you can get the alert even if server itself won’t works.

Primary Server:
1. Create a Share with read/write permission for domain user which we’ll be using to startup SQLServerAgent
2. Create a Full Database backup for LogShDB
3. Backed up T-Log on the folder you have created earlier to store the log backup You can create a maintenance plan to take a T-Log backup for regular interval and then add it as a Step in job to automate this process
4. Please ensure that the duration must enough to copy the log backup file to Secondary Server.Suppose we are taking T-Log backup each 1/2 hour and if the backup file is big enough which takes more then 1/2 to copy over the network share, it will again creates a new T-Log backup which will then occupies recourse unnecessarily.
5. Copy T-Log backup file to Secondary Server’s shared folder
6. Delete the T-Log backup file after it copied to the Secondary Server’s shared folder.
7. Ensure you have selected Allow Database to assume primary role option so that if in future requirement of role reversal can be possible easily.If in case we need to change the role of primary server or secondary server to act as Primary or Secondary this option should be used while setting up Log Shipping.
8. Ensure that you have set up proper threshold values for Destination Database for Out of Sync, Load Time Delay, File Retention Period and History Retention Period option.These options are self explanatory: Out of Sync=used by witness server to send alert if the specified time has been exceeded between Last T-Log backup on primary and secondary server, Load Time Delay= Destination Database waits before it restores the T-Log, File Retention Period= Time elapse till file gets deleted and History Retention Period= Time till we retain History details
Secondary Server
1. Check if the Database is already exists on Secondary Server, if it is already their drop it.
2. Restore a Full Database Backup for LogShipping database. Restore a T-Log for LogShipping database. on the secondary server which is copied on the shared folder of Secondary Server;
4. Ensure you have given STANDBY or NORECOVERY option while restoring T-Log backup for LogShipping database..

You may find log shipping is a very use full yet simple to configure, use and manage, it is cheaper and easily manageable solution for High Availability of your data(Most of the company want cheep and good solution for there invoriment). It is a good solution over clustering (because it is costly; requires identical hardware to setup cluster) and easily manageable, easy troubleshooting against replication as it clearly says where it breaks.

Generally Log Shipping works very smooth once it is configured. Even if you have to re-configure it from the scratch it is easy job to do, which i love that.

Posted in MS SQL Server | Comments Off

World Wide Visitors

Posted by Mehboob on 05/06/2011

free counters

Posted in BI-DW, MS SQL Server, MS Windows, SharePoint | Comments Off

Learning Portals

Posted by Mehboob on 23/05/2011

This Issue: May 2011

Resources

Learning Portals

Cloud Power: Create the Next Big App

So you’ve got an idea for that next big app and you need to get it launched as quickly as possible. Maybe it’s a mobile app, something you want to run on Facebook, or a project that stretches your ASP.NET skills. Tune in to this five-part online event series and learn how to harness the cloud or get your apps into it. We’ll share hands-on lessons, make it real with code samples, and set you up with a 30-day complimentary Windows Azure Pass. Join as we explore the topics that matter most for today’s developers.

Training – MOC/Courseware/Exams/Clinics: Special Training Offers on Windows 7 Now Available

Microsoft Learning Partners are offering specials during the month of May for training on Course 6294: Planning and Managing Windows 7 Desktop Deployments and Environments. This five-day, instructor-led course covers how to design, configure, and manage the Windows 7 client environment. It also prepares students for Exam 70-686, Pro: Windows 7, Enterprise Desktop Administrator. Sign up for training soon to enjoy the savings!

Posted in BI-DW, MS SQL Server, MS Windows, SharePoint | Comments Off

Website Security Errors with IE9

Posted by Mehboob on 12/05/2011

Website Security Certificate Error:  Security zones to default. If you configure security settings to be too restrictive, you may prevent Internet Explorer from displaying certain Web sites. To determine whether an issue is caused by overly restrictive security settings, revert to default security settings. To do this, just follow these 5 steps:
 
Option A:
 
01. Open Internet Explorer.
 
02. Click Tools, and then click Internet Options.
 
03. Click the Security tab.
 
05. Click reset all zones to default level, and then click OK.
 
After you do this, test Internet Explorer to verify that it works correctly, if answer is NO, go for B.
 
Option B:
 
Also try the following steps:
 
1. Open an Internet Explorer window. Click “Tools,” then choose “Internet Options.” This will open the Internet Options window.
 
2. Click the “Content” tab in the Internet Options window. This will open the Content options page.
 
3. Click the “Certificates” button on the Content options page. This will open the Certificates window.
 
4. Click the “Untrusted Publishers” tab in the Certificates window. It may be necessary to scroll horizontally to see the tab.
 
5. Click to highlight the security certificate that you want to trust, then click the “Remove” button.
This will open a confirmation window.

Click the “Yes” button in the confirmation window to complete the process.

About certificate errors link: http://windows.microsoft.com/en-US/windows7/About-certificate-errors

software config:  •Windows 7 Ultimate 32 OR 64-bit  •IE9 Beta, Version 9.0.7930.16406

I hope this information help you.

Khan

MCTS.

Posted in SharePoint | Comments Off

Free SQL Server tools

Posted by Mehboob on 05/05/2011

I start with this and i hope its help dba folks…

Free SQL Server books:-

“Boost your DBA expertise” and “DBA Best Practices”  – books by RedGate

SQL Injection tools:-

Top 15 free SQL Injection Scanners- 15 free SQL injection scanners, kool

Microsoft Source Code Analyzer for SQL Injection – a static code analysis tool for finding SQL Injection vulnerabilities in ASP

UrlScan v3.0 Beta – a Microsoft security tool that restricts the types of HTTP requests that Internet Information Services (IIS) will process

HP Scrawlr – crawls a website, simultaneously analyzing the parameters of each individual web page for SQL Injection vulnerabilities

Blind Sql Injection Brute Forcer version 2 – accepts custom SQL queries as a command line parameter.

Administration:-

SQL Web Data Administrator – enables you to easily manage your SQL Server data from a web browser

SQL Server Cache Manager – allows you to return information about what is stored is the SQL Server cache and how efficiently it is being used.

SQL Internals Viewer – a tool for looking into the SQL Server storage engine and seeing how data is physically allocated, organized and stored.

Microsoft SQL Server 2000/2005 Management Pack – monitors the availability and performance of SQL Server 2000 and 2005 and can issue alerts for configuration problems.

Performance Analysis of Logs (PAL) Tool – tool that reads in a performance monitor counter log (any known format) and analyzes it using complex, but known thresholds (provided).

Microsoft Baseline Security Analyzer – helps small- and medium-sized businesses determine their security state in accordance with Microsoft security recommendations and offers specific remediation guidance

RML Utilities for SQL Server (x86) and (x64) – tools to help database administrators manage the performance of Microsoft SQL Server: Overview

SQLDumper.exe – comes with SQL Server. Installed at ..\Microsoft SQL Server\90\Shared\SQLDumper.exe. Generates a dump file on demand for any Microsoft Windows application.

SQL Server 2005 Partition Management – helps in data loading and extraction from partitions

SQLdiag Utility – a general purpose diagnostics collection utility that can be run as a console application or as a service (comes with SQL Server)

SQL Nexus – analyzes SQLDIAG captures

SQL Server 2005 Express Profiler – a free SQL Profiler for SQL Express

Log Parser 2.2 – provides query access to log files, XML files and CSV files, the Event Log, the Registry, the file system, and AD

Microsoft SQL Server Management Studio Express – apparently a lot of people don’t know this exists. Stripped down version of SSMS

SQL Server 2005 System Views Map – a nice map of all the DMV’s and links between them

SQL Server Web Data Administrator – admin your SQL Server over the web

SQL Server Express Utility – simple interaction with SQL Server

TableDiff.exe – utility that compares 2 tables for differences in data and schema for SQL Server 2000 and 2005

DMVStats – collects, analyzes and reports on SQL Server 2005 DMV performance data

Best practices, analysis, health and performance:-

SQL Server FineBuild – provides one-click install and best-practice configuration of SQL Server 2005.

SQL Server 2005 Assessment Configuration Pack for Sarbanes-Oxley Act (SOX) – contains configuration items intended to help you establish and validate a desired configuration for your SQL 2005 

SQLIO GUI – user interface for SQLIO Disk Subsystem Benchmark Tool

SQLQueryStress -  automatically collects metrics to help you determine whether your queries will perform under load, and what kind of resource strain they put on your server

SQLIO Disk Subsystem Benchmark Tool – used to determine the I/O capacity of a given configuration

SQL Server 2005 Best Practices Analyzer – lets you verify the implementation of common Best Practices in SQL Server 2005

SQL Server 2000 Best Practices Analyzer – lets you verify the implementation of common Best Practices in SQL Server 2000

SQL Server Health and History Tool (SQLH2) – collects information from instances of SQL Server to determine how SQL Server is being used much more.

SQL Server Health and History Tool (SQLH2) Performance Collector – optional tool to collect performance counters that are consumed by the SQLH2

SQL Server Health and History Tool (SQLH2) Reports – reports needed to view the data collected by the SQLH2

SQL Server 2005 Performance Dashboard Reports – performance reports that integrate into SQL Server Management Studio

Microsoft SQL Server 2000/2005 Management Pack – monitors the availability and performance of SQL Server 2000 and 2005 and can issue alerts for configuration problems

Database Publishing to hosted servers:-

Microsoft SQL Server Database Publishing Wizard – provides a way to publish databases to T-SQL scripts or directly to supporting hosting service providers

Microsoft SQL Server Database Publishing Services – deployed by shared hosting providers to enable publishing of SQL Server databases over the Internet

Upgrade and Migration:-

Microsoft SQL Server 2005 Upgrade Advisor – used when upgrading from lower SQL Server version to SQL Server 2005

SQL Server Migration Assistant for Access

SQL Server Migration Assistant for Oracle

SQL Server Migration Assistant for Sybase ASE

SQL Server Analysis Services:-

MDX Script Performance Analyser – allows the user to identify how much each calculated member, analysis Services cube’s MDX script contributes to the overall performance of a given MDX query, name its self show you.

Microsoft SQL Server 2005 Data Mining Add-ins for Microsoft Office 2007 – SQL Server 2005 predictive analytics in Office Excel 2007 and Office Visio 2007

 SQL Server Integration Services:-

DTLoggedExec  – allows you to run a Sql Server Integration Services (SSIS) Package 

 SQL Server 2005 BI Development Studio (BIDS):-

BIDS Helper – Add-in for Visual Studio Business Intelligence Development Studio

SQL Server Analysis Services Product Samples

SQL Server 2005 Samples and Sample Databases

MS stuff:-

SQL CLR Project – a tool that allows you to deploy .NET assemblies to SQL Server.

SQL Designer – online SQL Database designer. Contains Importing and Exporting scripts to and from different formats

DbDiff and DbScripting – Compare SQL Server database structures and generate scripts

SQL Accord Community Edition – compares database schema

Quest software’s Comparison Suite for SQL Server

Bypsoft’s DBTYP.NET – compares SQL Server, MySQL and Oracle databases.

SQL DB Tools – SqlDbDiff, SqlDbSearch and SqlDbSize utility

ClearTrace – utility to easier read your saved trace files

SQL Sripter – data export and scripting utility for Microsoft SQL Server

ScriptDb – data export and scripting utility for Microsoft SQL Server

Idera’s Free Tools – SQL Server backup and recovery tool, performance dashboard and logons and permissions etc etc

Posted in SharePoint | Comments Off

Shortcut / Keyboard keys

Posted by Mehboob on 21/04/2011

Here is list of Shortcut keys to work with SSMS handy.

 

Action SSMS-Shortcut Key
Move to the SQL Server Management Studio menu bar ALT
Activate the menu for a tool component ALT+HYPHEN
Display the context menu SHIFT+F10
Display the New File dialog box to create a file CTRL+N
Display the New Project dialog box to create a new project CTRL+SHIFT+N
Display the Open File dialog box to open an existing file CTRL+O
Display the Open Project dialog box to open an existing project CTRL+SHIFT+O
Display the Add New Item dialog box to add a new file to the current project CTRL+SHIFT+A
Display the Add Existing Item dialog box to add an existing file to the current project ALT+SHIFT+A
Display the Query Designer CTRL+SHIFT+Q
Close a menu or dialog box, canceling the action ESC
Clear all bookmarks CTRL-SHIFT-F2
Insert or remove a bookmark (toggle) CTRL+F2
Move to next bookmark F2
Move to previous bookmark SHIFT+F2
Cancel a query ALT+BREAK
Connect CTRL+O
Disconnect CTRL+F4
Disconnect and close child window ALT+F4
Database object information ALT+F1
Clear the active Editor pane CTRL+SHIFT+DEL
Comment out code CTRL+SHIFT+C
Copy CTRL+C or Ctrl+Insert
Cut CTRL+X or Shift+Del
Decrease indent SHIFT+TAB
Delete through the end of a line in the Editor pane CTRL+DEL
Find CTRL+F
Go to a line number CTRL+G
Increase indent TAB
Make selection lowercase CTRL+SHIFT+L
Make selection uppercase CTRL+SHIFT+U
Paste CTRL+V or Shift+Insert
Remove comments CTRL+SHIFT+R
Repeat last search or find next F3
Replace CTRL+H
Select all CTRL+A
Undo CTRL+Z
Execute a query F5 or Ctrl + E
Help for Query Analyzer F1
Help for the selected Transact-SQL statement SHIFT+F1
Switch between query and result panes F6
Switch panes Shift+F6
Window Selector CTRL+W
New Query window CTRL+N
Object Browser (show/hide) F8
Object Search F4
Parse the query and check syntax CTRL+F5
Print CTRL+P
Display results in grid format CTRL+D
Display results in text format CTRL+T
Move the splitter CTRL+B
Save results to file CTRL+SHIFT+F
Show Results pane (toggle) CTRL+R
Save CTRL+S
Insert a template CTRL+SHIFT+INSERT
Replace template parameters CTRL+SHIFT+M
Display estimated execution plan CTRL+L
Display execution plan (toggle ON/OFF) CTRL+K
Index Tuning Wizard CTRL+I
Show client statistics CTRL+SHIFT+S
Show server trace CTRL+SHIFT+T
Use database CTRL+U

Posted in MS SQL Server | Comments Off

Microsoft product release date 2011 to 2013

Posted by Mehboob on 21/04/2011

Microsoft product release date  insider leak Windows 8 release date.

For the upcoming version of Windows, new critical features are being worked on including cluster support and support for one way replication. “The core engine is also being reworked to provide dramatic performance improvements.

We will also soon be starting major improvements for Windows 8 where we will be including innovative features which will revolutionize file access in branch offices.” Microsoft typically does not publicize the release dates and even the names of products still under wraps.
The one confirmed product name is Windows 8.  All i can say Welcome to 8 and good bye to 7, haaa.

Microsoft has not yet announced:

  •  Windows 8 on July 1, 2011
  •  Windows Server 2012 on July 2, 2012
  •  Office 2012 on July 2, 2012
  •  SQL Server 2011 on July 1, 2011
  •  SharePoint Server 2013 on July 1, 2013
  •  Exchange 2013 on July 1, 2013

The Windows 8 RTM date appears to be a bit accelerated from Microsoft’s typical three-year interval between new operating system releases. However, some RTM dates in the chart are accurate at least for existing Microsoft products. For instance, Windows 7 had its RTM on July 22, 2009, which is one day off from the date listed.

-
“Windows 8 will be released around 2011 with Microsoft publicly promising a 2012 delivery target.”

-

Posted in MS SQL Server, MS Windows, SharePoint | Comments Off

SQL Server Community

Posted by Mehboob on 18/04/2011

In the SQL Server Community:

Aaron Bertrand’s Blog
Brad McGehee’s Blog
Chad Boyd’s Blog
Greg Low’s Blog
Jonathan Kehayias’s Blog
Kevin Kline’s Blog
Kimberly Trip’s Blog
Paul Randal’s Blog
Pinal Dave’s Blog
Satya SK Jayanty’s Blog
Simple Talk
SQL Server Magazine
TechNet Magazine
Tibor Karaszi’s Blog &  Ola Hallengren

SQL Server Central and  CodePlex

Posted in MS SQL Server | Comments Off

Reduce MSDB database size

Posted by Mehboob on 18/04/2011

SQL Server: Delete Backup History to reduce MSDB database size

SQL Server keeps a track of the backup history of your server, in the msdb database.

Every time a backup or restore operation occurs on your database, additional rows are added to the backup and restore history tables. If you do not keep a check on this, you will find your msdb database growing over time.

SQL Server provides the sp_delete_backuphistory database engine stored procedure which makes it very simple to delete history that is older than the specified date.

Here’s how to use this stored procedure to delete backup history that is older than April 18, 2011, 5:30 p.M. in the backup and restore history tables.

Similarly if you want to automatically delete records that is say 1 or 2 months old,

create a stored procedure that calculates the date and executes the sp_delete_backuphistory procedure

Here’s the same query to try out:

CREATE PROCEDURE [dbo].[DeleteBackupHistory]
AS 
DECLARE @BckDate DATETIME
SET @BckDate = CONVERT(varchar(10), DATEADD(dd, -60, GETDATE()), 101)
EXEC sp_delete_backuphistory @BckDate

Now whenever you want to delete records 1 or 2 or 3 months prior to the current date, just call the DeleteBackupHistory stored procedure.

Similarly, you may also want to look at the sp_purge_jobhistory and sp_maintplan_delete_log

to remove other history information and keep your msdb database from growing over time.

Khan – MCTS

Posted in MS SQL Server | Comments Off

Windows Sysinternals Download

Posted by Mehboob on 07/04/2011

Windows Sysinternals – Sysinternals Suite

Downloads > Here

AccessChk

AccessEnum

AdExplorer

AdRestore

Autologon

Autoruns

BgInfo

CacheSet

ClockRes

Contig

Coreinfo

Ctrl2Cap

DebugView

Desktops

Disk2vhd

DiskExt

DiskMon

DiskView

Disk Usage (DU)

EFSDump

Handle

Hex2dec

Junction

LDMDump

ListDLLs

LiveKd

LoadOrder

LogonSessions

MoveFile

NTFSInfo

PageDefrag

PendMoves

PipeList

PortMon

ProcDump

Process Explorer

Process Monitor

ProcFeatures

PsExec

PsFile

PsGetSid

PsInfo

PsKill

PsList

PsLoggedOn

PsLogList

PsPasswd

PsService

PsShutdown

PsSuspend

RAMMap

RegDelNull

RegJump

RootkitRevealer

SDelete

ShareEnum

ShellRunas

SigCheck

Streams

Strings

Sync

TCPView

VMMap

VolumeID

WhoIs

WinObj

ZoomIt

 

Khan – SQLDBA -MCTS

www.addarr.com

Posted in BI-DW, MS SQL Server, MS Windows | Comments Off

Free Microsoft iSCSI Target

Posted by Mehboob on 07/04/2011

Has everyone heard the news? Microsoft has finally released for free the iSCSI target that was previously only available through OEMs as part of Windows Storage Server.

This will sure make setting up Test/Dev/Experimental clusters easier! VM to setup with FreeNAS.  And it is even supported for production use on Windows Server 2008 R2.

Visit here: http://blogs.technet.com/b/virtualization/archive/2011/04/04/free-microsoft-iscsi-target.aspx

Learn, how to setup iSCSI target, here we go!!! Jose Barreto’s Blog help you.

Khan SQL DBA – MCTS

www.addarr.com

Posted in MS SQL Server | Comments Off

SQL DBA några vanliga misstag

Posted by Mehboob on 01/04/2011

SQL DBA Misstag: Vad kan det vara, jag har jobbat i 10 år som sql dba ? Läs här….
Som SQL DBA måste följa upp sättning bästa practices för att säkerställa en smidig och mycket optimerad databaser tillgänglighet.  Jag har lärt mig från mina misstag eller p.g.a stress eller tidbrist(hitta på orskan) här är några vanliga misstag som jag har identifierat och skulle rekommendera att fixa om du har stött på eller se något liknande. Inte minst jag har sett små och stora företag data och deras SQL Server-säkerhet, det går inte beskriva, data lever mycket farlig nivå. Back to point.

En. Inte förberedelse och godkännande av en pålitlig backup och återställning politik med säkerhetskopior Lagringstiden för databaser enligt överenskomna dataförlust och tillämpning driftstopp det kan orsaka att tillfriskna databaser.

Mycket ofta några DBA: s starkt beroende av att lägga en plan för databasunderhåll bara för regelbunden säkerhetskopiering och med tanke på det gjort. Jag tror det är inte tillräckligt; en DBA ofta måste kontrollera hur lång tid det tar att återställa databaser och bör kontrollera backup filer för tidpunkt återhämtning. Också, beroende på databasens storlek kan det ta längre tid än väntat tid att göra databasen återhämtning. Därför kan ta säkerhetskopior inte lösa dina krav och det är rådet att använda standby-server med log shipping eller databas spegling för snabb databaslösningar DR.

Två. Att inte veta gränser server hårdvara och utnyttjande. Det är måste att se System resursutnyttjandet och identifiera flaskhalsar på regelbundna intervall för DISKIO, minne, CPU, Lås & Blocking etc räknare. Denna information kan ge insikt om hur mycket serverhårdvara resurser utnyttjas / tillgängliga för nuvarande och kommande arbetsbörda som genereras av applikation (er). Denna information kan hjälpa att stabilisera prestanda för en längre period, liksom att veta sina begränsningar.

Tre. Inte verifiera SQL Server-säkerhet, och inte tillämpar senaste Service Pack 1, 2, 3, 4 / version. Det rekommenderas att plåstret och tillämpa buggfixar så snart som möjligt. En föråldrad SQL server build / version rekommenderas inte att hålla igång för produktion servrar. Har kontrollera att du noga har valt rollen sysadmin medlemmar och tas bort alltför tillstånd från normala användarna av databasen. Det är en allmän praxis att endast SQL alternativ / inställningar som krävs liknande – xp_cmdshell, CLR etc och använda sig av kryptering & revision för att skydda kritiska data.

Fyra. Inte defragging index eller springer Databas konsistenskontrollerna. Också inte kör regelbundet underhåll aktiviteter såsom uppdatera statistik om produktion databaser. Eller i vissa fall verkställande underhåll och andra höga resurskrävande verksamhet under produktion arbetstid.

Fem. Inte kontrollera hur mycket ledigt utrymme finns på data eller loggfiler och krympande databaser och om igen. Eller inställning “Auto Shrink” databas alternativet till sant är likvärdigt skadligt.

Sex. Skapa databaser för Dev, Staging, UAT, Test, QA etc på produktion SQL Server eller instans. Detta majorly orsakar manuell / mänskliga misstag genom att radera / ändra objekt eller felaktigt tilldela behörigheter.

Sju. Proaktiv övervakning: Ställer inte in SQL-varningar med e-post för allvarlighetsgrad fel från 17 till 25, ledigt utrymme check, CPU-användning, SQL / Agent / SSRS / SSAS tjänster omstart osv. Det är mycket lämpligt att inrätta automatiska registreringar om SQL Server för kritiska händelser. Så att du är fullt medveten och känner sig trygga att alla händelser når till dig / lag även om de inte sitter framför datorskärmen. Framöver kan du använda Policy förvaltning för att fånga händelser och effektivisera olika SQL instanser i din miljö.

Åtta. Inte använder / tillämpar Hög tillgänglighet tekniker (kluster, spegling, log shipping) för kritiska databaser. En DBA måste identifiera verksamhetens krav och tillämpa hög tillgänglighet tekniker enligt redan fastställda SLA mål. Det garanterar snabb tillgång till databaser för tillämpningar i händelse av fel.

Nio. Kör SQL profiler på produktionen utan filter och sluttid. Detta är bland de vanligaste som händer misstag. En DBA måste förstå att köra Profiler utan filter kommer att fånga alla händelser och T-SQL-frågor vilket genererar extra arbetsbelastning en på produktionen. Dess mycket rekommenderas att använda Profiler med försiktighet.

En Tia. Inställnings alternativ databas återvinning till “full” och aldrig tar transaktionsloggbackups. Jag har sett fall där transaktionsförteckning filstorlek har ökat 100 gånger till faktiska data på grund av säkerhetskopiering oaktsamhet. Kontrollera att du väljer modell databas återvinning efter behov och använda backup politik därefter. Dessutom noga titta på dina transaktionsförteckning säkerhetskopieringar av  med mera. Om du har några frågor eller förslag, skriv mig.

Khan – SQL DBA, MCTS.

Posted in MS SQL Server | Comments Off

Coffee, Table & Computer (CTC)

Posted by Mehboob on 01/04/2011

CTS From Microsoft Future

 

 

Microsoft “Surface” – The Possibilities

Microsoft Surface, Microsoft Corp.’s first commercially available surface

 

 

Microsoft MS Surface

 

 

Much more to come

 

 

 

Posted in SharePoint | Comments Off

SharePoint Server 2007 video tutorials

Posted by Mehboob on 22/03/2011

SharePoint Server 2007 video tutorials:-

SharePoint document libraries I: Introduction to sharing files 1 to 14, just click to start and learn.

A roadmap to SharePoint Server 2007 training:

http://office.microsoft.com/en-us/sharepoint-server-help/sharepoint-document-libraries-i-introduction-to-sharing-files-RZ010234528.aspx

Office 2010 online training:-

.

______________________________________________________________________________________________________________
View training anywhere :-
______________________________________________________________________________________________________________
Getting started with Microsoft Word 2010 :-
 
Thumbnail Image
Thumbnail Image
Thumbnail Image
Thumbnail Image
Thumbnail Image
Thumbnail Image
Thumbnail Image
Thumbnail Image
 
Thumbnail Image
Thumbnail Image
Thumbnail Image
Thumbnail Image
Thumbnail Image
Thumbnail Image
Thumbnail Image
Thumbnail Image

Posted in SharePoint | Comments Off

Free Video Tutorials

Posted by Mehboob on 22/03/2011

Free Video tutorial

 

MS SQL Server 2008:-

TechNet Video: How Do I: Add a Node to an Existing Failover Cluster in SQL Server 2008?

24 Hours of SQL Server 2008

TechNet Video: Microsoft Certification Coaching Session: Preparing for your Microsoft SQL Server 2008, Implementation and Maintenance Exam (70-432)

 

Posted in MS SQL Server | Comments Off

Microsoft White Papers

Posted by Mehboob on 20/03/2011

Microsoft  White Papers

 

Community Articles :-

Watch Videos :-

Free program and ASP.NET 2.0 & 3.5 web applications video’s :-

Intro to Visual Web Developer#1 | Intro to Visual Web Developer39 minutes, 27 seconds

IntelliSense#2 | IntelliSense14 minutes, 16 seconds

Intro to Web Forms#3 | Intro to Web Forms23 minutes, 7 seconds

Page Layout#4 | Page Layout8 minutes, 57 seconds

Page Lifecycle Events#5 | Page Lifecycle Events12 minutes, 11 seconds

Intro to ASP.NET Controls#6 | Intro to ASP.NET Controls8 minutes, 44 seconds

Submit and Postback#7 | Submit and Postback19 minutes, 24 seconds

Application Level Objects#8 | Application Level Objects13 minutes, 32 seconds

Session Level Objects#9 | Session Level Objects10 minutes, 2 seconds

Debugging#10 | Debugging37 minutes, 19 seconds

CSS#11 | CSS24 minutes, 32 seconds

MasterPages#12 | MasterPages16 minutes, 2 seconds

Validation#15 | Validation16 minutes, 45 seconds

Login Controls#16 | Login Controls10 minutes, 28 seconds

Posted in BI-DW, MS SQL Server, MS Windows | Comments Off

Fill Factor explain

Posted by Mehboob on 15/03/2011

Fill Factor explain,

Fillfactor will specify how full sql server should make each index page when it creates a new index using existing data, it specify how full each page in the leaf level of an index should be. Index value can be from 0 to 100.

1.  Fill factor 100 implies the leaf Pages, data pages if clustered index, else

FID(FileID)
+PN(Page Number)
+RN (Row Number))
will be 100 percent full.

2.  Fill factor 0 implies, the leaf pages will be almost full, but SQL Server leaves some space within the upper level of the index tree. In both the cases even though it fills the leaf pages(data pages), the root and intermediate pages will still have room for two additional rows (1 root + 1 intermediate).
3.  Fill factor from 1 to 100, will be the percentage of each leaf page to fill with rows.

The fillfactor is used only when you create the index,it is not maintained over time.This value is not maintained after index creation, you index leaf pages may become full and experience many page splitting even you specify a very low value at the beginning.

Generally, when page splitting occurs, half of the data rows will be moved to the newly allocated data page, and half of the rows are remained on the original page. the Fill Factor is not maintained during the spliting. For example, if the Fill Factor is 40% full, in this case, the value is not maintained. One exception may be, when inserting a row containing variable-length columns, if this row is very large, more data rows will be kept on the other page to vacate space for this big-size row.

Select an appropriate fill factor for each index. If the data has a minimal amount of changes to the middle of the table, configure the indexes to have a high fill factor, i.e., closer to 100%, which will save on the storage needed. If the data has many changes to the middle of the table, select a lower fill factor, i.e., 65% to 85%, so that as data is added to a page, page splitting is minimized until the indexes are rebuilt.

Information: About fill factor.

Fill factor 100%              =  If DB is read only
Fill factor b/w 50% and 70%   =  If DB is write intensive (writes greatly exceed reads)
Fill factor b/w 80% to 90%    =  If DB is both read and write intensive

Posted in MS SQL Server | Comments Off

SQL Question and Answer

Posted by Mehboob on 07/03/2011

Self Test :-

 

1. Which SQL Server 2008 edition supports IA64?

A. Enterprise and Developer editions

2. How many instances can be created in SQL Server 2008 Standard Edition?

A. 16

3. How many SQL Server default instances can be installed on a single?
No clustered server?

A. 1

4. Which of the following editions has all the features and functionality but is not
licensed for production?

A. Developer Edition

5. Which SQL Server 2008 edition is best suited for mobile applications?

A. Compact Edition.

6. Which SQL Server 2008 edition provides the most Analysis Services?
features?

A. Enterprise Edition

7. Which tool should be on an existing SQL Server 2000 or 2005 database
Instance prior to upgrading to SQL Server 2008?

A. Upgrade Advisor Tool

8. Which of the following is a command line utility used to run PowerShell
command and scripts?

A. sqlps

9. Which of the following editions does not support any Reporting Services
features?

A. Express Edition

10. Which of the following accounts has the least privilege when used as a service
account?

A. Local user account

11. Which of the following accounts should be used to perform a SQL Server
2008 installation or upgrade?

A. Administrator account

12. In which of the following directories are the default instance database data
and log files located?

A. <drive>:\Program Files\Microsoft SQL Server\MSSQL10.
MSSQLSERVER\Data

13. What additional software is required for SQL Server’s Business Intelligence
Developer’s Tool?

A. Microsoft Internet Explorer 6 SP1 or later

14. Which of the following is the SQL Server component that provides the services
for creating, processing, and managing OLAP and data mining?

A. Analysis Services

15. Which of the following is a scalability feature in SQL Server Enterprise
Edition?

A. Partitioning

16. In which directory are the installation log files found?

A. <drive>:\Program Files\Microsoft SQL Server\\100\Setup Bootstrap\LOG\Files\

17. Which system database is hidden to SQL Server Management Studio and is
used to persist a read-only version of system objects?

A. Resource

18. Which is the compatibility version associated with SQL Server 2008?

A. 100

19. Which SQL Server tool is used to check that SQL Server component services
are running?

A. SQL Server Configuration Manager

20. Which type of file contains data and database objects such as tables and
indexes?

A. Data files

1. You are setting up security for your new SQL Server 2008 installation.
Management is concerned about security. What approach should you take to
ensure security settings are optimal?

A. Use SQL Server Configuration Manager to secure the installation

2. You have been tasked with setting up standards for your SQL Server 2008
installation. You need to enforce a table naming convention. What is the best
way to accomplish this in your SQL Server 2008 environment?

A. Create a Declarative Management Framework policy

3. You have been asked to create a backup of your production database and
restore it on a development server. Your production server is using the full
recovery model. Full backups are taken Monday and Wednesday. Transaction
log backups are taken every hour. Today is Friday. The backup needs to be
created as quickly as possible. What’s the fastest way to get the latest database
copy while minimizing impact to production?

A. Create a Copy Only Backup. Use that to restore to development.

4. You have a SQL Server 7.0 database and would like to move it to a new
SQL Server 2008 instance. The database is part of an FDA-validated system
and cannot be changed at all? How can this be accomplished?

A. You must upgrade the database to SQL 2005 or greater.

5. You have an application that is being upgraded from SQL Server 2005 to
SQL Server 2008. You notice that some stored procedures are not working
correctly. An excerpt is as follows:
SELECT *
FROM Territories, Region
WHERE territories.regionid *= region.regionid
What should you do to resolve the issue?

A. The join syntax is incorrect. Replace with left join.

6. Your disk is almost full on the transaction log drive for a database server.
How can you resolve this issue?

A. Change the mode to simple and shrink the log

7. You want to enforce a standard naming convention for stored procedures.
What’s the best way to do this in SQL Server 2008?

A. Use the SQL Server 2008 Declarative Management Framework

8. You want to enforce a standard naming convention for tables and stored
procedures. Your company has two SQL 2008 Servers and 60 SQL 2005
Servers. You need to use the same solution on all servers. What’s the best way
to do this in SQL Server 2005 and SQL Server 2008?

A. Create a DDL trigger for all servers

9. You have a database table with a varchar(600) field in it. Most of the records
in the table have a null value for this field. How can you save space?

A. Move the data into a second table

10. You have a database table with a FileStream field in it. Most of the records
in the table have a null value for this field. What’s the best way to save
space?

A. Move the data into a second table
B. Use sparse columns
C. Use the SQL Server 2008 Declarative Management Framework
D. None of the above

11. You need to store images in for a Web site using SQL Server 2008. How can
you accomplish this?

A. Use a FileStream data type, and the images will be stored on disk

12. You are responsible for a system that is used for both online transaction
processing (OLTP) and reporting. When reports run on the server, the OLTP
process slows way down. How can you allow reports to be run on the server
and minimize impact to the OLTP processes?

A. Use the Resource Governor

13. You are creating an application to track crime in different locations
throughout a large city. What data type could prove useful for storing location
data (longitude and latitude)?

A. Varchar

14. You are running out of space on the drive used to store backups. All of the
servers use the same network location. What can you do to save space with
your backups while maintaining the same number of backups?

A. Use compressed backups

15. You need to store sensitive data in your SQL Server database. The application
has already been written and works fine. What’s the easiest way to do this
without having to change your application?

A. Use transparent data encryption

16. Within your application, you need to log all changes to one table. DDL
and DML changes must be logged. What’s the best approach to solve this
problem?

A. Use the built-in auditing capability

17. You have a server that supports Hot Add CPU. The current CPU utilization
is 95 to 100 percent most of the time. The server is mission-critical and cannot
be shut down. SQL Server 2008 Standard Edition is installed. What should
you do?

A. Schedule an outage and add another CPU to the server

18. You are contemplating using data compression on a table. You would like to
know how much space this will save. How can you determine the savings?

A. Use sp_estimate_data_compression_savings

19. You have a server that supports Hot Add Memory. Performance is sluggish,
and you believe adding more memory will help. The server is mission-critical
and cannot be shut down. SQL Server 2008 Standard Edition is installed.
What should you do?

A. Schedule an outage and add memory to the server.

20. You have a SQL Server 2008 installation, and you want to create a high availability
Solution. What are the ideal approach(es) to solve this problem?
A. Mirroring
A. Clustering

Frequently Asked Questions

Q: Do I have to install a default instance?
A: No. You can install named instances on a server without having a default instance.

Q: If a named instance uses dynamic port allocation how will I know which port
to connect to each time?
A: The SQL Browser service needs to be running on the SQL Server. It will
automatically
return the correct port to your connection without you having to
specify anything.

Q: Why shouldn’t I change a SQL Server service account using the services applet?

A: Changing the service account using SQL Server Configuration Manager will
assign all the file system permissions and advanced user rights needed for
SQL Server to work properly. Using the services applet won’t do this and could
cause problems when the service is next started.

Q: Should I change SQL Server configuration settings using the Management
Studio interface or with sp_configure?

A: The end result is the same so it doesn’t really matter. However, sp_confgure has
many more options than the interface and is easy to script so it tends to be the
popular choice with DBAs.

Q: I’ve enabled AWE on my 32-bit SQL Server but still can’t see more than 2 GB
of RAM. What should I do?

A: First, check that you’re running the Enterprise or Datacenter version of Windows.
Then check in c:\boot.ini for the /PAE switch which enables Windows to
see the extra RAM. If that all looks fine then check that the service account has
the ‘lock pages in memory’ user right. If it doesn’t there will be an error logged to
the SQL Server errorlog on startup.

Q: What is considered to be a Principal in SQL Server 2008?
A: Any entity that requests SQL Server Resources.

Q: What is the definition of “The Principle of Least Privilege”?
A: Only give permissions that are needed. Giving more access violates this
principle.

Q: Can you modify Server-level Roles?
A: No, Server-level Roles are fixed and cannot be modified.

Q: Can you create your own Database-level Roles?
A: Yes, Database-level Roles can be created to better fit a user’s security
requirements.

Q: What is the most secure Authentication Mode and why?
A: The Windows Authentication Mode is more secure because it is managed by
the Windows operating system and subject to additional Windows password
policies.

Q: What SQL Server tool is used to enable the DatabaseMail feature in
SQL Server 2008?
A: The Surface Configuration Tool.

Q: When working with SQL Server services such as SQL Server Agent, which tool
do you use?
A: SQL Server Configuration Manager.

Q: When setting up SQL Server services that need to perform tasks outside of the
local server, which account type should you use?
A: Domain Service Accounts.
There are two types of database-level roles, fixed database roles that are predefined
in the database and flexible database roles that you can create.

The fixed database-level roles are:

db_owner – Can drop the database as well as permission to perform  m all
configuration and maintenance tasks.

db_security_admin – Can modify role membership and manage permissions.
Please be careful when adding principals to this role; an unintended privilege
escalation could result.

db_accessadmin – Can add or remove database access for Windows logins,
Windows groups, and SQL Server logins.

db_backupoperator – Can back up the database.

db_ddladmin – Can run any Data Definition Language command.

db_datawriter – Can add, delete, or change data in all user tables.

db_datareader – Can read all data from all user tables.

db_denydatawriter – Will deny permission in the database to add, modify,
or delete any data in the user tables.

db_denydatareader – Will deny permission in the database to read any data
in the user tables.
These objects can be helpful when working with Database-level roles:

 sp_helpdbfixedrole – Returns a list of the fixed database roles.

 sp_dbfixedrolepermission – Displays the permissions of a fixed database role.

 sp_helprole – Returns information about the roles in the current database.

 sp_helprolemember – Returns information about the members of a role
in the current database.

 sys.database_role_members – Returns one row for each member of each
database role.

 IS_MEMBER – Indicates whether the current user is a member of the
specified Microsoft Windows group or Microsoft SQL Server database role.

 CREATE_ROLE – Creates a new database role in the current database.

 ALTER_ROLE – Changes the name of a database role.

 DROP_ROLE – Removes a role from the database.
sp_addrole – Creates a new database role in the current  Ent database.

 sp_droprole – Removes a database role from the current database.

 sp_addrolemember – Adds a database user, database role, Windows login,
or Windows group to a database role in the current database.

sp_droprolemember – Removes a security account from a SQL Server role
in the current database.

Posted in MS SQL Server | Comments Off

SQL Server Videos

Posted by Mehboob on 03/03/2011

SQL Server Videos

 Here is link for different video’s : Click …

Leverage Microsoft Attunity Connector for Oracle to enhance Package Performance

How to create, modify, execute, save, and open a query with the database manager for SQL Azure?

How to create and modify a table with the database manager for SQL Azure?

How to create, select, and modify a view with the database manager for SQL Azure?

How to create, modify, and execute a stored procedure with the database manager for SQL Azure?

Import Data Into Master Data Services

PowerPivot Data Refresh in SharePoint

Using PowerPivot Workbooks as a Data Source

Security Context of PowerPivot Connections in a Farm

How to create, modify, and execute a stored procedure with Project Houston?

How to create, select, and modify a view with Project Houston?

How to create, modify, execute, save, and open a query with Project Houston?

How to create and modify a table with Project Houston?

How Do I: Optimize SQL Server Integration Services?

How Do I: Render reports to a wide-range of formats?

How Do I: Create an gallery of reusable report parts?

Creating a Basic Package (SQL Server Video)

Designing Your SSIS Packages for Parallelism (SQL Server Video)

How to: Automate SSIS Package Execution by Using the SQL Server Agent (SQL Server Video)?

How to: Call a Web Service by Using the Web Service Task (SQL Server Video)? (Learn how to call a Web service successfully from an Integration Services package by configuring an HTTP connection manager and the Web Service task. Then, set up an XML task to read the information that you have retrieved, and use that information in the package.)

Exporting SQL Server Data to Excel (SQL Server Video) (This video demonstrates how to use the SQL Server Import and Export Wizard to create a package that exports data from a SQL Server database to a Microsoft Excel spreadsheet.)

How to: Use the Data Profiling Task (SQL Server Video)? (Learn how to use this powerful new task in SQL Server 2008 to become familiar with an unfamiliar database, or to look for problems in existing data. Take a quick look at all eight of the profiles that the task can compute.)

 

Measuring and Understanding the Performance of Your SSIS Packages in the Enterprise (SQL Server Video) (

This video demonstrates how to measure and understand the performance of packages, based on lessons learned from enterprise customers. In this video, you will learn the following guidelines for improving performance: 1) How the limits of the source system affect performance; 2) Why disk I/O is important; 3) Why you should establish a package performance baseline.)

Posted in MS SQL Server | Comments Off

Säkerhetskopiera användardatabaser

Posted by Mehboob on 15/02/2011

Vi tar alla en säkerhetskopia av databasen i första taget att återhämta sig från en skada kan uppstå under katastrofen, servern kraschar, eller av någon annan anledning. För att göra det schema vi brukar ett jobb eller använda sig av databasen underhållsplan som utför säkerhetskopiering av databaser, vare sig det full / differentiella eller Logg och vi alla tar ett särskilt försiktig & övervägande under utformningen strategi för säkerhetskopiering!

Men vad som hänt om en vacker dag när du behöver din fil för backup av databaser för att fungera bra och det inte? Tänk om det är skadat! Och du har bara en komplett säkerhetskopiering för den dagen?

Idag kommer jag att diskutera om de manus som jag har skrivit i ladda ner sektion par dagar tillbaka, skriptet kommer inte bara att göra en fullständig säkerhetskopia av databasen för alla användardatabaser men det kommer också “kontrollera validering av backup file “. Det är ett måste för DB omgivning med strategi för säkerhetskopiering som – där i du inte håller flera kopior av säkerhetskopior eller bara har en dag säkerhetskopia period fil retention.

“”

declare @int int ,@dbname varchar(22),@maxdbid int
declare @bkpath varchar(25),@path varchar(50)
select @maxdbid= max(dbid) from master..sysdatabases
set @int = 0
set @bkpath=’C:\SQLDB\backup\’    — du kan ta d:\ eller z:\
USE master
while (@int < @maxdbid)
begin
set @dbname = (select [name] from master..sysdatabases where dbid=@int and status!=1073807392)
if (@dbname != ‘tempdb’)
begin
  select @int as ‘DBID’,@dbname as ‘Database’
  select @path=@bkpath+@dbname+CONVERT(VARCHAR(12),GETDATE(),112)
  BACKUP DATABASE @dbname TO DISK = @path
  print @path
  print @bkpath
  restore verifyonly from disk=@path
  end
set @int = @int + 1
continue
break
end
“”

Kontrollera raden # 17, återställa verifyonly från disk = @ väg är den linje som kommer att hjälpa oss att övervinna ovanstående fråga. Detta är inte en dold kod som ligger på ett hemligt ställe någonstans men detta är något som vi missat i vår kod – Jag vet de flesta av er redan har använder det här alternativet för din databas backup validering, hur många av er använder detta alternativ? Eller av nyfikenhet något annat alternativ!

Note: Denna kod är mycket grundläggande kod som jag har skrev inledningsvis, kan du ändra och använda skriptet enligt dina krav utan förpliktelser.

Dina förslag är välkomna!

Khan SQLDBA – MCTS

Posted in MS SQL Server | Comments Off

How many SQL Server Instances are there ?

Posted by Mehboob on 24/01/2011

How many SQL Server Instances are there ?

In most of the scenario, We would need to identify that how many instances are there or How many instances installed in current server.

* Login into SQL Server in which server you want to…
* Copy & Paste the script given below and hit your ‘F5′ (or) Execute.

CREATE TABLE #Instances
(
InstanceName VARCHAR(100)
)

INSERT #Instances
EXEC(‘xp_cmdshell ”SQLCMD -L”’)

DECLARE @ServerName VARCHAR(100)
SELECT @ServerName = CAST(SERVERPROPERTY(‘MachineName’) AS VARCHAR)

SELECT LTRIM(InstanceName) [Instance Name] FROM #Instances WHERE LTRIM(InstanceName) LIKE @ServerName + ‘%’

DROP TABLE #Instances

* Now you got the list of Instances installed on the current server.

_____________ *** _______________

Can’t drop the index ‘Table.StatisticsName’ because it is not a statistics collection.
Normally, When we try to DELETE the statistics using the following statement, The Error occrred

DROP STATISTICS TableName.StatisticsName
GO

Msg 3739, Level 11, State 1, Line 1

Cannot DROP the index ‘Table.StatisticsName’ because it is not a statistics collection.

The reason is, The statistics name we going to DELETE should be a Statistics collection.

Ok

What is statistics collection ?

“Creating statistics on multiple column on a table”

How to create ?

CREATE STATISTICS StatisticsName ON TableName(Column1,Column2)

Now the statistics collection can be deleted.

_____________ *** _______________ 

Alternate to DBCC CLEANTABLE

Normally, we will execute this whenever we do some significant changes to variable-length columns in a table or indexed view.

But, we can also do some alternate to this activity.

Yes

we can Rebuild the indexes on tables and viewes.

_____________ *** _______________ 

Backup and restore operations are not allowed on database tempdb

1.Tempdb is re-created every time SQL Server is started so that the system always starts with a clean copy of the database.

2.Temporary tables and stored procedures are dropped automatically on disconnect.

So, Backup and restore operations are not allowed on tempdb

_____________ *** _______________ 

How to force Checkpoint process to occur every 2 minutes

Normally, The recovery interval is default to 0. It means SQL Server dynamically manages how offen a checkpoint occure.

We can force the SQL Server to occur the recovery interval every 2 minutes

sp_configure ‘Show Advanced Options’,1
GO

sp_configure ‘Recovery Interval’,2
Reconfigure with Override
GO

sp_configure ‘Show Advanced Options’,0
GO

_____________ *** _______________ 

Where is the SQL Server Error log file ?

SELECT ServerProperty(‘ErrorLogFileName’)

_____________ *** _______________ 

Linked Server providers…

Use Master
Go

EXEC dbo.xp_enum_oledb_providers
_____________ *** _______________ 

To identify Clustered and Non-Clustered Primary key table(s) in the Database ?
To fetch all the Primary key tables in the current Database.

Use SQLServerdude
Go

SELECT
O.[NAME] ‘Table Name’,
I.[NAME] ‘Key Name’,
CASE I.[TYPE] WHEN 2 THEN ‘Non Clustered Primary Key’ ELSE ‘Clustered Primary Key’ END ‘Clustered /NonClustered’
FROM SYS.INDEXES I JOIN SYS.OBJECTS O
ON (I.[OBJECT_ID] = O.[OBJECT_ID])
WHERE O.[TYPE] = ‘U’
AND I.IS_PRIMARY_KEY = 1
ORDER BY 1
 
The column Type in Sys.Indexes DMV have the following values
 
0 – HEAP
1 – CLUSTERED
2 – NONCLUSTERED

_____________ *** _______________ 

A particular stored procedure used in which JOB
Here, we want to search a particular stored procedure(USP_Proc1) used in wich JOB.

Use Master
Go
SELECT V.name ‘JOB Name’ FROM msdb.dbo.sysjobsteps s JOIN msdb.dbo.sysjobs_view v
ON(S.job_id = V.job_id)
WHERE S.command LIKE ‘%USP_Proc1%’

_____________ *** _______________

The user does not have permission to perform this action.
Scenario:
We have created a new Login (ie: Test) and Login into this account and able to access the Databases.

When I try to execute DMVs like SYS.dm_exec_connections, The following Err occurred.

Msg 297, Level 16, State 1, Line 1
The user does not have permission to perform this action.

So, The login required some Server permission to access the DMVs. correct ?

Login into sa account and grant the following permission to login: test

USE master
GO
GRANT VIEW SERVER STATE TO [test]

The View Server State permission granted to the Test Login.

Now we can access the DMVs.

_____________ *** _______________

Server Permission Needed
VIEW SERVER STATE permission required for the user to execute DMO objects with SQL Server 2005, 2008, and 2008 R2.

To identify the permission already exists / not:
IF EXISTS(SELECT 1 FROM fn_my_permissions(NULL,’SERVER’)
WHERE permission_name = ‘VIEW SERVER STATE’)
SELECT ‘Permission Exists’ ‘Permission’
ELSE
SELECT ‘Permission not Exists’ ‘Permission’
Go

To grand permission to the login:
USE master
Go
GRANT VIEW SERVER STATE TO loginID
Go

_____________ *** _______________

Who is accessing your Database ?

We can identify that who are all accessing your Database with the various information as given below..

- When they connected
- From which machine name
- From which machine IP
- What program they using
- Login Name
- From which session
- Current request mode
- Active status
- What query thay finally applied

Here, I have used four DMOs – sys.dm_tran_locks, sys.dm_exec_sessions, sys.dm_exec_connections, sys.dm_exec_sql_text.

I try to identify that who are all accessing my SQLServerABCDE database.

SELECT DB_NAME(l.resource_database_id) ‘Database Name’,
l.request_mode ‘Request Mode’,
l.request_status ‘Status’,
l.request_session_id ‘SessionID’,
s.login_time ‘Connected at’,
c.client_net_address ‘Client IP’,
s.[host_name] ‘Client Machine’,
s.[program_name] ‘Program Name’,
s.login_name ‘Login’,
q.[text] ‘Query Used’
FROM sys.dm_tran_locks l JOIN sys.dm_exec_sessions s
ON(L.request_session_id = S.session_id)
JOIN sys.dm_exec_connections c CROSS APPLY sys.dm_exec_sql_text(c.most_recent_sql_handle) q
ON(C.session_id = S.session_id)
WHERE l.resource_type = ‘DATABASE’
AND l.resource_database_id = DB_ID(‘SQLServerABCDE’)
AND l.request_session_id <> @@SPID

_____________ *** _______________

Linked Server Limitations
The following are the Linked Server limitations:

1. Login mappings have to exist along all paths it’s using (Servers)

2. Amount of data coming from the other server, resulting in some very bad query plans (Query plan may not be Re-Used effectively)

3. Context Switching inside the Stored Procedure will cause problem.

4. XML type parameter cannot be used with Linked Server.

5. Table-valued parameters cannot be used.

6. CLR User-defined data type cannot be used.

7. Cannot call table-valued functions with four-part notation.

8. BULK INSERT statement into linked server is not supported.

9. Save Transaction Cannot be applied during distributed transaction.

10. Case statement won’t work properly.

11. There is a chance to exceed the “remote query timeout (s)”

Note:
The following are the two main system stored procedures to implement Linked Server
1. sp_addlinkedserver – Used to define the linked server name to access an OLEDB datasources.

2. sp_addlinkedsrvlogin – Local SQL Server logins are mapped to logins in the linked server.

_____________ *** _______________

Table wise Memory Allocation using Script
We can identify the Memory Allocation of table(s) using Script insteadof SP_SpaceUsed system stored procedure.
SELECT OBJECT_NAME(p.[object_id]) ‘Table Name’,
p.[rows] ‘Record(s)’,
a.total_pages*8 ‘Total Pages(KB)’,
a.used_pages*8 ‘Used Pages(KB)’,
((a.total_pages*8)- (a.used_pages*8)) ‘Unused Pages(KB)’,
a.type_desc ‘Page Type’
FROM sys.allocation_units A JOIN sys.partitions P
ON (A.container_id = P.hobt_id)
JOIN sys.sysobjects O
On (O.id = p.[object_id])
WHERE O.[type] = ‘U’
Result:

2)
Table wise Memory Allocation
We can identify each table wise memory allocation in a Database using Sp_SpaceUsed.
Create Table #TableAllocation
(
[Table Name] Varchar(100),
Records Varchar(10),
Reserved Varchar(10),
Data Varchar(10),
[Index Size] Varchar(10),
UnUsed Varchar(10)
)
Insert #TableAllocation
Exec(‘Sp_MSForEachTable ”Sp_SpaceUsed ””?”””’)
Go
Select * from #TableAllocation
Go
Drop Table #TableAllocation
Go

Result:

Posted in MS SQL Server | Comments Off

Protected: Database Backup to / Restore from Remote Server – SQL Server

Posted by Mehboob on 24/01/2011

This post is password protected. To view it please enter your password below:

Posted in MS SQL Server | Comments Off

Microsoft SQL Server Developer Training Kit

Posted by Mehboob on 24/01/2011

SQL Server Training Kit

Microsoft SQL Server Developer Training Kit which is very helpful resource for the SQL Server Developers, trainers and professionals to understand the improvements comes with the release of SQL Server 2008.

Recently, 18th January 2011 Microsoft has released the updated version of Microsoft SQL Server Developer Training Kit which has

•31 Presentations (includes Slide decks, videos and transcripts)
•27 Demos (includes installer scripts, videos and transcripts)
•12 hands on labs (includes installer scripts)

Highlight of the updated version is – BI Solution, yes you read it right. The version of developer training kit has Solutions like:

•Build your first Microsoft BI Solution with SQL Server 2008 R2
•Introduction to BI Modeling Techniques
•Introduction to SQL Server 2008 R2 Integration Services
•Introduction to SQL Server 2008 R2 Reporting Services
•Publishing and Accessing SQL Server 2008 R2 Reporting Services Reports
•Introduction to SQL Server 2008 R2 Analysis Services
•Introduction to SQL Server 2008 R2 Analysis Services Query Syntax
•Accessing SQL Server 2008 R2 Analysis Services Data
•Introduction to SharePoint 2010 PerformancePoint Services
•Introduction to Data Mining with SQL Server 2008 R2 Analysis Services
•Introduction to Self-Service Reporting and Analysis with SQL Server 2008 R2

All of this are free! Download the updated version of SQL Server Developer Training kit from here

 Check the complete list of what is included in SQL Server Developer Training Kit and System Requirements  before you begin download.

Khan – SQLDBA -MCTS

Posted in SharePoint | Comments Off

Do not know the SQL login and password

Posted by Mehboob on 10/01/2011

Setup SQL 2008 or SQL 2008 R2 for development or QA environment, but they don’t know the login by which they can connect to server.  In SQL server 2005, SQL use to add group BUILTIN\Administrators to the sysadmin fixed server role, meaning that any local NT administrator is automatically a SQL Server’s sysadmin. But 2008 onwards, Windows Group BUILTIN\Administrators is not included in the SQL Server sysadmin server role by default.   

To avoid this situation, we need to specify the SQL server administrator on “Database Engine Configuration” screen while setup sql server. But, sometime this step is missed or the IT guys set some odd password to SA user. One way to recover from this situation is to uninstall and re-install the sql server again. But, using the below mentioned steps we can create a new login

  1. Open command prompt.
  2. If you have default instance run following command on command prompt to stop SQL service: “net stop mssqlserver”
  3. Now go to the directory where SQL server is installed. In my case the directory is “C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn”. So need to run CD C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn.
  4. Now run the following command to start sql server in single user mode. As we have specified “SQLCMD”, now only SQLCMD connection can be made.
1.sqlservr -m"SQLCMD"
  • Now open another command prompt window and write command SQLCMD
  • Run following two commands
     
  • 1.CREATE LOGIN [testAdmin] WITH PASSWORD=N'test@1234', DEFAULT_DATABASE=[master];
    2.EXEC sys.sp_addsrvrolemember @loginame = N'testAdmin', @rolename = N'sysadmin';
    3.GO
  • Go back to first command window and press Ctrl+C to stop the SQL server and then type ‘Y’ for confirmation. This will stop the sql server.
  • Start SQL server again and no startup parameters need to specified this time.
  • Now using SSMS, try to connect with “testAdmin” as user and test@abcd as password.
  • Create your own logins
  • Drop testAdmin as it is not required any more.
  • Note: If you do not have SQL authentication enabled then you can try adding your windows user and replace setp-6 with below queries. Here <<DOMAIN\USERNAME>> is placeholder for your user name

    1.create login [<<DOMAIN\USERNAME>>] from windows; 
    2.EXEC sys.sp_addsrvrolemember @loginame = N'<<DOMAIN\USERNAME>>', @rolename = N'sysadmin'
    3.GO;
    Update 08-Jan-2011:- Recently, I found the script that is useful in  doing all this task, may be it's useful to you when you are in thin air.

    Posted in MS SQL Server | Comments Off

    Tlog files in a Log Shipping environment

    Posted by Mehboob on 10/01/2011

    Tlog files in a Log Shipping environment to move database in easy way. MS SQL database administrator to move database transaction log files. F.ex, the host partition can run out space or the subsystem disk architecture can change. Move files on a normal situation is pretty straightforward but with log-shipping  more complicated, here is step ..

    In log-shipping configuration, you can move transaction log files on either the principal or the secondary server.

    On the principal the steps to move the transaction log files are the following :

    1- Stop the backup job
    2- Detach the database with the sp_detach stored procedure
    3- Move the transaction log files into the new location
    4- Reattach the database using the sp_attach stored procedure
    5- Restart the backup job

    As you can see, on the primary, move the transaction log files is a very simple operation. On the secondary, this operation is more complicated. Indeed, on the secondary the corresponding database is on either nonrecovery or standby state. Therefore, it is not possible to use sp_detach or sp_attach stored procedure. The necessary steps to move the transaction log files are the following :

    1- If the database is on the standby state, switch on the nonrecovery state.
    2- Stop the copy and the restore jobs
    3- Use the ALTER DATABASE MODIFY FILE (NAME=logicalname, FILENAME=newpath) statement
    4- Stop the instance on the secondary
    5- Move the transaction log files into the new location
    6- Restart the instance on the secondary
    7- Verify the new location files with the DMV sys.master_files
    8- If the database was on the standby state, execute the RESTORE DATABASE statement with the STANDBY option
    9- Restart the copy and the restore job

    In fact, log-shipping is not aware of the file locations. Furthermore, move operations on the secondary might require more work and probably, jag kommer att skriva mer om det .. 

    Speed SQL Tuning Your Database Calls with Tier Interaction Profiling

    Khan SQL DBA – MCTS www.addarr.com

    Posted in MS SQL Server | Comments Off

    WordPress now runs on SQL Server

    Posted by Mehboob on 07/01/2011

    WordPress Now Runs on SQL Server and SQL Azure

     WordPress, one of the most popular blogging platforms out there, can now run on SQL Server and SQL Azure thanks to a new patch made available via OmniTI. And if you’re interested in making the switch (or starting from scratch), there’s a new resource for you available from WordPress.Visitmix.com which contains all sorts of info about using WordPress along with Microsoft technologies.

    The site offers helpful articles about using themes, plugins and Windows Live Writer to compose posts, a link to support forums and a great article about why the bleep (yes, that’s what it says) Microsoft is doing this.

    To get started with WordPress on SQL Server or SQL Azure, you need to download the SQL Server distro or patch. Then you can check out the Getting Started page to get everything properly set up.

    Posted in MS SQL Server | Comments Off

     
    Follow

    Get every new post delivered to your Inbox.