Center.
2008 R2 Service Pack 2 up to and including Cumulative Update 13. It is primarily a roll up of Cumulative Updates as it is the last Service Pack for SQL Server 2008 R2. It also includes the MS14-044 update.
all news and tips for database administrators and BI Architects


אני מעוניין להזין את הרישיון שקניתי ל- Sql server ולשדרג את הגרסה מגרסת ניסיון, מה עליי לעשות?
תשובה:
הפתרון למקרה הינו די פשוט, כל מה שעליך לעשות הינו להריץ את קובץ ההתקנה של ה- Sql server, תחת קטגוריית ה- maintenance עליך לבחור בפונקציית : edition upgrade.
ב- wizard שיפתח לך יהיה עלייך להזין את מספר הרישיון שברשותך ולאחר מספר קליקים גרסת ה- sql server שבשרתך תהפוך להיות חוקית!
בהצלחה!
שלום רב,
שאלה:
יש לי מערכת לחישוב שעות עבודה המבוססת כמובן בסיס נתונים מסוג sql server :) .
בחברה שלנו מוגדר כי יום ראשון בשבוע הינו חצי יום עבודה ולכן על מנת לחשב שעות נוספות ליום עבודה ספציפי זה , אני צריך לחשב כמה ימי ראשון יש לי בין שני תאריכים.
כיצד ניתן לחשב ב - sql server כמה ימי ראשון לדוגמא יש לי בין שני תאריכים?
תשובה:
על מנת לחשב כמה ימי ראשון, ובכלל כמה "שמות" ימים יש לי בין שני תאריכים אני אקרא בהתחלה לפונקציות dateadd ו- datename על מנת לקבל את מספר היום -
datename(weekday,dateadd(day,number,@date1).
לאחר מכן, אני אעזר בטבלת המערכת master..spt_values אשר מכילה כ- 2500 פרמטרים על מנת לפענח את שם היום.
הפתרון הינו:
declare @date1 datetime, @date2 datetime
select
@date1='2011-07-01', @date2='2011-07-11'
select
sum(case when datename(weekday,dateadd(day,number,@date1))='sunday' then 1 else 0 end)
as sundays,
sum(case when datename(weekday,dateadd(day,number,@date1))='Monday' then 1 else 0 end)
as Monday,
sum(case when datename(weekday,dateadd(day,number,@date1))='Tuesday' then 1 else 0 end)
as Tuesday,
sum(case when datename(weekday,dateadd(day,number,@date1))='Wednesday' then 1 else 0 end)
as Wednesday,
sum(case when datename(weekday,dateadd(day,number,@date1))='Thursday' then 1 else 0 end)
as Thursday,
sum(case when datename(weekday,dateadd(day,number,@date1))='Friday' then 1 else 0 end)
as Friday,
sum(case when datename(weekday,dateadd(day,number,@date1))='Saturday' then 1 else 0 end)
as Saturday
from master..spt_values
where type='p' and dateadd(day,number,@date1)<=@date2
כמובן שאפשר עוד לייעל את השליפה. ובמידה ויש לכם רעיונות נוספים לפתרון הבעיה אשמח לשמוע!!
בהצלחה!
בגרסאות ה- sql server הקודמות ניטרנו את השרת ובסיסי הנתונים על-ידי היכולות הבאות :
1. שאילתות DMV.
2. מערכות וכלי ניטור צד שלישי.
3. System monitor של מערכת הפעלה.
4. וכדומה.
בגרסת SQL Server 2008 R2 ישנו פתרון חדש בשם: DTA - Data Tier Applications
להבדיל מגרסאות קודמות שבהן ניטרנו את כל ה- instance , היכולת החדשה מאפשרת לנו לבחור את ה- DB הבודד או כמה הקשורים לאפליקציה אותה אנו נרצה לנטר. יכולת זו מאפשרת לנו , מנהלי הבסיסי הנתונים והאפליקציות לנטר ברמת היישום והאפליקציה את המשאבים השונים ( CPU , MEM, IO )
DTA הינה פתרון המכיל את כל האובייקטים במסד הנתונים ונותן לנו מנהלי בסיסי הנתונים והאפליקציות אפשרות לנטר אותם ברמות שונות.
ה- DTA מספק יחידה אחת עבור עריכה, פריסה וניהול של האובייקטים.
ה- DTA מאפשר לנו אינטגרציה הדוקה יותר של התפתחות והתקדמות הנתונים עם הפיתוח של קוד היישום.
בטיפים הבאים אנו נמשיך לעדכן אודות היכולות החדשות בגרסת ה- Sql server החדשה.
בהצלחה!
Veracity Group
Support Team
http://blogs.microsoft.co.il/blogs/itaib/archive/2011/03/29/dac-data-tier-applications.aspx

כיצד אפשר בגרסת 2008 לבחור את מאפייני ה- Generate script?
תשובה:
אכן בגרסת 2008 כאשר בוחרים את אופציית ה- Generate Script ה- wizard כולל בתוכו רק את בחירת האובייקטים הנדרשים ללא יכולת בחירת המאפיינים.
בגרסת manganese studio 2008 R2 אנו מגדירים את מאפייני ה- Generate Script בחלון ה- option .

בהצלחה!!
http://blogs.microsoft.co.il/blogs/itaib/archive/2011/03/15/generate-script-sql-server-2008-r2.aspx


לינק להורדת הכלי: http://www.red-gate.com/products/sql-development/sql-search/
Most of the databases with which I am familiar – still reside on rotating plates (A.K.A disks). Disks, physical disks, hard drives or whatever else you might call them – have been out there for many years, and they are one of the few products that haven’t really developed in a technological sense. Moore’s Law never really applied to disks. Only CPU power. Too bad… because when it comes to the amount of calculation a CPU can execute in a single second – we are making a great leap every 18 months, but when it comes to the amount of IO/sec we can process even when using a high-quality storage device – the mechanics that work underneath are still stuck somewhere in the late 80s or early 90s.
Recently, there is another new buzz catching everyone’s attention. This one is around SSD drives. Solid State Drives. SSDs are really good when what you want to do is to read a lot of data. They are especially good (in comparison to physical rotating disks) when you want to read a lot of data in small chunks – what is also called “Random IO”. I’ve had an opportunity to work with databases that reside on SSD drives or what are also called Flash devices. I’ve worked with databases stored on Flash drives, Flash cache, Oracle Exadata, and many other solutions. They all have one property in common: when the disk operates faster, the CPU tends to work harder to process the huge stream of data.
Up until now, physical disks have been the main bottleneck to performance improvement in most of the systems with which I have worked. But when you substitute the IO sub-system with an alternative that is capable of executing so-and-so many IO operations per second, instead of the disk being the bottleneck, instead this role goes to the CPU. I’ve seen this in real life.
Here is an example: I was working on a system with 4 Quad CPUs and SAN storage that was capable of processing 10,000 IO/sec tops. • When my disk capacity was 100% utilized, my average CPU utilization was ~40% on average, and it peaked at 70%. • When I replaced the storage system with an SSD that was capable of processing 100,000 IO/sec (ie 10 times faster than my old storage), I noticed that my CPU consumption was still ~40% on average, but it peaked at 100%! • Another thing that I noticed was that even though the SSD capacity is 100,000 IO/sec, it never went beyond a speed of 20,000 IO/sec (meaning that it was only 20% utilized). Why was that? Because now I don’t have enough CPU power to process this fast data stream… Now we all know what happens when a machine reaches 100% CPU utilization… it crashes, times out, hangs… And if someone runs a report on this machine, if before it would have jammed only the storage device, now it jams the machine’s CPU…
Now tell me something – if you have to choose from between these two options, which one would you prefer?
• working with a jammed, over-utilized storage device?
• Working with a jammed, over-utilized CPU?
I would choose the second option. Because even when my hard drive on my laptop is working hard, most of the applications that reside in my memory and consume only CPU are still working fine. But when my CPU is 100% utilized – the laptop is completely stuck. No processing ability, not to process IO, nor to carry out CPU calculations.
People told me “SSD is going to solve our performance problems”. Well… – no. It sure will speed up some of the things that you are doing. But it is not going to solve the other problem from which you probably suffer – that of QoS and SLA. As long as there are computers, performance bottlenecks will remain. If you make one component work faster without changing anything else, the bottleneck will simply move to one of the other components.
The only way you can avoid the bottleneck and guarantee QoS in this case is by controlling the amount of resources each and every transaction takes… whether the resources are CPU or IO. It doesn’t matter if your problem is CPU or IO – MoreVRP will allow you to safeguard your QoS and SLA. Until today there doesn’t seem to be an overall solution to eliminate the bottleneck… but by using MoreVRP, you can make sure that it doesn’t affect your most critical transactions. No matter if you are working with SSDs or good old physical disks.
Something to think about the next time you consider buying a new storage device.
Cheers.
http://www.more-resource.com/blog/?p=74
We all know that the secret to staying healthy and fit depends on regular, routine exercise and good maintenance habits. The same is true for our database. But how can we ensure that our routine database workouts not interfere with or delay our business?
Throughout the work week different end-users interact with the database to conduct their urgent business activities. They insert new data and run numerous varied complex transactions using a variety of applications that combine and integrate data from different sources. Sales teams enter new customer and pricing data; engineering teams change product attributes and configurations. Logistics clerks repeatedly update the database with RFID devices that transmit loads of status information from the warehouse. Consuming this varied and heavy diet while running back and forth and at the same time concentrating on difficult calculations would give anyone indigestion, especially our MS SQL Server database, with its very sensitive stomach, special dietary requirements and lean frame….
So each week we invite our SQL Server database to the fitness center for a long workout. The DBA carefully goes through the checklist, executing index and stats maintenance procedures, checking for index fragmentation or duplication that are likely to tire the database and slow it down.
Usually the DBA carries out the weekly maintenance routine on the weekend when fewer end-users need the database active. Nevertheless, we all recall the times that the database hasn’t finished its maintenance workout on-time, causing many anxious end-users to congregate around the coffee machines on Monday morning waiting for the tired database to let them get their new work week started.
What can you do to empower your database to better mobilize its resources in order to carry out all the urgent business tasks you need to do in parallel to its time-consuming yet vital maintenance routines? More IT offers you the unique wonder drug that will revitalize your database – MoreVRP! Only MoreVRP, sometimes referred to as “APM on Steroids”, can get inside the database to reallocate its resources and prevent the loads that cause database indigestion, letting it concurrently execute end-user transactions while more slowly doing its maintenance routines without interrupting your business.
There are many vendors that offer a wealth of health check monitors that will measure how tired your database is, as well as sophisticated exercise machines that let your DBAs assign more and more routine exercises and training to keep your database fit.
Only MoreVRP gives your SQL Server db the resource management “muscle” you need to keep your business going strong! For more details, check out our solution on

2. הפונקציה יכולה לתרגם את ה- login security identification number לשם המשתמש , לדוגמא:
ניתן לשלב את הפונקציה כתנאי בתוך פרוצדורה , וניתן לשלב את הפונקציה ב- DEFAULT constraint בתוך טבלה, לדוגמא:
בהצלחה !
http://blogs.microsoft.co.il/blogs/itaib/archive/2010/10/24/suser-sname.aspx
SQL 2005 :
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.
SuperSocketNetLib\TCP\
SQL 2008 :
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10.
SuperSocketNetLib\TCP\
2. xp_readerrorlog - אפשרות שנייה הינה לקרוא את ה- log של ה- sql server.
בעת העלייה של האינסטנס נרשם לתוך ה- Log ה- Port אליו הוא מאזין. על מנת למצוא את הרשומה המתאימה - תחפשו את הערך "Server is listening on".
3. וכמובן האפשרות המקובלת - SQL Server Configuration Manager - תחת אופציית SQL Server Network Configuration - ניתן לראות את מספר ה- Port תחת הגדרות ה- tcp\ip.

בהצלחה.