יום שלישי, 25 בנובמבר 2014

sql saturday - עדכונים

שלום חברים,

כידוע לכם בינואר הקרוב יתקיים כנס ראשון בארץ לאנשי ה- DB וה- BI של מייקרוסופט - sql saturday.
היום פורסמה האג'נדה לכנס:
https://www.sqlsaturday.com/360/schedule.aspx
 
כפי שניתן לראות הכנס יחולק לשני מסלולים:
1. BI Platform Architecture, Development & Administraion
2. Enterprise Database Administration & Development

אל תשכחו להירשם (בחינם כמובן) על מנת להבטיח את מקומכם:
 
נשמח לראותכם !
 

יום שני, 17 בנובמבר 2014

בסיס הנתונים שלך מתועד? או - למה זה טוב Extended Properties ?

ישנם מספר נושאים חשובים שיש לתת עליהם את הדעת בפיתוח ותכנון בסיס נתונים. כמובן שצריך לשים לב לנירמול נכון של הטבלאות, וכמובן שצריך להגדיר סטנדרט לכתיבה נכונה של הקוד, וכמובן שאי אפשר בלי סטנדרט נכון לשמות האובייקטים ועוד ועוד...

בין הנושאים החשובים ביותר לפי דעתי בפיתוח בסיס נתונים הינו שלב התיעוד !

תיעוד נכון של האובייקטים יחסוך הרבה מאוד כאב ראש בשלב הפיתוח, אבל הכי חשוב בעבודה ובפיתוח השוטף.

 

בשנותיי כיועץ לחברות ניתקלתי בהרבה מאוד מקרים בהם פרוייקטי פיתוח התעכבו רק בגלל שהיה חסר תיעוד בבסיס הנתונים , סיטואציה שגרמה לעיכובים והתארכות זמני הפיתוח מהסיבה הפשוטה שהמתכנת היה צריך לפני כל שינוי קטן – זמן על מנת להבין מה מטרת האובייקט? ומה שינוי בו יגרור?

כמובן שאני לא מדבר על אי הנוחות בשינוי אובייקט בטעות :( בסביבת ייצור עקב אי הבנה מה מטרת האובייקט...

אם כן, ברור לנו שהתיעוד בא לסייע לנו כמובן בשלב הפיתוח, בעת "העברת מקל" , שימור ידע בארגון וכו'...

 

מנסיוני, תיעוד נכון של סביבת בסיס נתונים צריכה להיות מורכבת ממספר רבדים:

1.     תיעוד סביבת השרת – בשלב זה לתעד את תשתית שרת בסיס הנתונים, הגדרות, סוג החומרה, משאבים, פתרון DR, פתרון גיבויים, אבטחת מידע, תרשים הקשרים בין השרתים (שרתי האפליקציה וכו'...) וכו

2.     תיעוד סביבת ה- sql server – בשלב זה יש לתעד את ההגדרות ברמת האינסטנס, והאובייקטים "שמחוץ" לבסיס הנתונים (link server, jobs וכו'...)

3.     תיעוד סביבת בסיסי הנתונים – תיעוד אובייקטים, קוד, הוספת הסברים בקוד וכו'....

 

ישנם מספר כלים בהם ראיתי שצוותים מתעדים בהם את הסביבות, לדוגמא: Visio לטובת תיעוד יחסי הגומלין בין השרתים בסביבה, ותיעוד ה- ERD של טבלאות בסיסי הנתונים (כמובן שלטובת ה- ERD של הטבלאות ניתן להיעזר ב- database diagram שעושה עבודה מצויינת לטעמי,  לפרטים אודות היכולת : http://www.mssqltips.com/sqlservertip/1816/getting-started-with-sql-server-database-diagrams/) . כמובן שניתן פשוט להיעזר גם ב- power point ו- word אך העבודה תהיה טיפה יותר מסורבלת...

 

באותו הקשר - לפני מספר ימים פנה אליי חבר טוב בהתייעצות, מדובר במקרה של שרת בסיסי נתונים של מוצר שמידי תקופה מעלים גרסאות של עדכוני סכמה וקוד (נשמע לכם מוכר הסיטואציה? :) )

ועלתה הסוגיה – כיצד נדע לפני העלאת גרסה - איזו גרסה מותקנת על בסיס הנתונים? כמו-כן, כיצד נדע אילו אובייקטים שודרגו כבר? ואילו לא?

(כמובן שניתן להקים טבלאות מערכת שינהלו את העלאת הגרסה וכו'... – אך הלקוח רצה פתרון חכם ויעיל יותר).

 

אין ספק שתיעוד נכון וחכם הינו הפיתרון לסוגיה זו.

 

הפעם ברצוני להמליץ על פיצ'ר שקיים עוד מ- SQL Server 2000 אך לטעמי לא כולם מכירים אותו ומשתמשים בו - Extended Properties.

בעזרת ה- Extended Properties ניתן להוסיף מאפיינים והערות לכמעט כל אובייקט ב- SQL Server (כמובן שהיכולת מגיעה עם רמות הרשאה).

ה- Extended Properties בנוי כך שניתן להגדיר פרמטרים וערכים לכל אובייקט. לדוגמא: ניתן להוסיף כסטנדרט לכל אובייקט פרטמרים כגון : מספר גרסה, הערות מיוחדות וכו'...

 

ניתן להוסיף, לעדכן ולמחוק מאפיינים כמובן דרך ה- SSMS, וניתן דרך הקוד. היתרון בעבודה על ידי הקוד הוא שניתן מצד אחד לשלב בקוד (או בשלב העלאת גרסת לדוגמא) את עדכון המאפיינים והתיעוד. וכמובן ניתן לשלוף בצורה יעילה ומהירה את כל המאפיינים של והתיעוד של האובייקטים (וכמובן לפלטר בינהם).

 

אז ראשית, להלן האובייקטים והשכבות ב- SQL Server שניתן להוסיף להם Extended Properties :

 





להלן דוגמא למסך ה- Extended Properties ברמת בסיס הנתונים:



 

ולהלן דוגמאות לקוד:

 

הוספה:

USE AdventureWorks2012;

GO

--Add a caption to the AdventureWorks2012 Database object itself.

EXEC sp_addextendedproperty

@name = N'Caption',

@value = 'AdventureWorks2012 Sample OLTP Database';

 

 

עדכון:

EXEC sp_updateextendedproperty

@name = N'NAME',

@VALUE = N'Holds tables created by user itai.',

    @level0type = N'SCHEMA',

    @level0name = 'Jes';

 

מחיקה:

EXEC sp_dropextendedproperty

    @name = 'name',

        @level0type = 'SCHEMA',

        @level0name = 'Jes',

            @level1type = 'Table',

            @level1name = 'Running',

                @level2type = 'Column',

                @level2name = 'RunDistance';

 

 

וכמובן שליפה:

SELECT EP.class_desc AS PropertyOn,

    DB_NAME() AS DatabaseName,

    EP.name AS ExtendedPropertyDescription,

    EP.VALUE AS ExtendedPropertyValue,

       *

FROM sys.extended_properties AS EP

 

לפרטים נוספים אודות היכולת :


 

אז אל תשכחו לתעד !!

 

בהצלחה !

יום שלישי, 11 בנובמבר 2014

SQLSaturday #360 - Event Update

Hi all,
It's about two months to SQL Saturday Israel 360 and we're hard at work nailing down all the little details that make the difference.
We'll do most of the work, but there is are some places where you can help us.
We're finalizing the agenda and we want to understand your preferences to make our event as awesome as possible.

Please fill agenda survey:
 
All sessions that has been submitted so far were added to this poll and due to the technical limitations of the poll were separated into 3 groups. From all 3 groups, select (total) top 10 sessions that you would like to see in the agenda.
Below you can find more information about the speakers and session descriptions:
Full list of submitted sessions, session descriptions and speaker info

Please spread the word about the event. Tell your IT team (including the CIO) that we've a great event coming up on Jan 19, 2015 at Microsoft Offices, HaPnina 2, Raanana, Israel and that you'll be attending - and that you hate to go alone! It just takes a minute to send an email or instant message, or just print this email and post it in the main hallway, and it can really help us have a spectacular event.
For more information please visit SQLSaturday.com or email us at :
 
Thanks!

Team SQLSaturday 

יום רביעי, 5 בנובמבר 2014

New additional value for SQL Server Integration Services (SSIS) 2014

 
Hi,
 
The Oracle and Teradata connector V3.0 for SQL Server 2014 Integration Service is now available for download at the Microsoft Download Center.
 
Microsoft Connector Version 3.0 for Oracle by Attunity - The Oracle source and destination components are written to achieve optimal performance when loading data into Oracle or unloading data from Oracle in the context of Microsoft SSIS.

Microsoft Connector Version 3.0 for Teradata by Attunity - The components are written to achieve optimal performance when loading data into Teradata or unloading data from Teradata in the context of Microsoft SSIS.

Microsoft SSIS Connectors by Attunity Version 3.0 is a minor release. It supports SQL Server 2014 Integration Services and includes bug fixes and support for updated Oracle and Teradata product releases.
For details, please look at the download page: