Отправляет email-рассылки с помощью сервиса Sendsay

MS SQL Server

  Все выпуски  

MS SQL Server - дело тонкое...


Информационный Канал Subscribe.Ru

#260<<  #261

СОДЕРЖАНИЕ

1.СТАТЬИ
1.1.Обзор механизмов виртуальной памяти Windows (продолжение "Обзор Virtual Address Space")
1.2.Руководство по работе с Microsoft SQL Server 2000 Analysis Services (продолжение)
2.ССЫЛКИ НА СТАТЬИ
2.1.Статьи на русском языке
2.2.Англоязычные статьи
3.ФОРУМ SQL.RU
3.1.Самые популярные темы недели
3.2.Вопросы остались без ответа

СТАТЬИ

Обзор механизмов виртуальной памяти Windows (продолжение "Обзор Virtual Address Space")

По материалам статьи Slava Oks: A look at Windows Virtual Memory mechanisms (continuation of "A look at Virtual Address Space - VAS")
Перевод Александра Гладченко

Как я обещал в прошлый раз, это будет следующая статья о памяти . Как Вы помните, моей целью является демонстрация того, как в SQL Server устроено управление использованием памяти. Но для читателя, чтобы в этом хорошо разобраться, я думаю важно также уяснить, как управляет памятью операционная система Windows. Важно понимать детали такого управления памятью, однако сейчас я хочу, чтобы Вы поняли заложенные в это концепции! В некоторых случаях я нарочно буду пропускать подробности, потому что в данном случае они не очень важны, и многие из них могут отличаться в разных версиях операционной системы. И так, позвольте приступить!

В моей предыдущей статье упоминалось, что участки VAS могут быть немедленно привязаны к физической памяти или после использования VirtualAlloc API. Как и большинство операционных систем, Windows осуществляет привязку физической памяти по требованию, при первом обращении к странице на участке VAS (это поведение немного отличается от тех случаев, когда Вы не используете файл подкачки, и страница VAS немедленно привязывается к странице физической памяти). Одновременно привязывается только одна страница. Когда первое обращение к памяти идёт от аппаратных средств, генерируется исключение, называемое отсутствием страницы. Исключение обрабатывается Windows и операционная система проверяет, был ли закреплён текущий участок VAS, используя для этого соответствующую этому участку структуру - Virtual Address Descriptor (VAD). Если участок закреплён, и к нему происходит первое обращение, операционная система отыщет в оперативной памяти физическую страницу, которую можно для этого использовать (стоит иметь в виду, что эта страница будет предварительно заполнена нулями, прежде чем она будет задействована, что обусловлено соображениями безопасности). Наконец, после этого будет выполнена привязка участка VAS к странице, которая будет заполнена соответствующими структурами данных, и эта информация будет загружена в процессор, что бы продолжить работу с того момента, когда было обнаружено отсутствие страницы.

Из-за недостаточности оперативной памяти Windows может принять решение отобрать физические страницы у процесса. Используя политику самостоятельного исправления, операционная система будет отыскивать свободные страницы. Для этого она проверяет, присутствует ли актуальный образ страницы в файле подкачки на диске, и при необходимости инициирует листание для страницы, что бы переместить её в файл подкачки. Как только страница попадёт на диск, операционная система сможет так настроить необходимые структуры данных, чтобы при следующем обращении к странице было известно, где её найти. После этого, физическая страница заполняется нулями и отмечается в списке свободных страниц, который используется для последующих запросов памяти.

Как я говорил ранее, процессор инициирует исключение отсутствия страницы, когда не может найти физическую страницу, при попытке обращения к соответствующим виртуальным адресам. Приложение может генерировать исключение отсутствия страницы двумя путями. Во-первых, если запрашивается участок VAS, закреплённый впервые. Во-вторых, если операционная система до этого переместила страницу данных на диск во время листания (когда приложение обращается к странице VAS, которая не была закреплена, Windows всё-таки инициирует исключение). Ошибки такого тип, когда страница должна быть возвращена с диска, называют "тяжёлыми" ошибками страниц (hard page fault). Если приложение впервые запрашивает закреплённый участок VAS, будет инициировано исключение "demand zero page fault". Существует и другой тип ошибок страниц - это "мягкие" ошибки отсутствия страниц (soft page fault). Мягкие ошибки наблюдаются тогда, когда Windows может найти страницу в физической памяти и работать с ней не считывая её с диска.

Используемый в Windows механизм виртуальной памяти позволяет отображать в разное время одни и те же физические страницы на разные VAS в разных местах. Физические страницы, которые могут быть отображены только на единственное VAS, называются приватными (private physical pages), потому что они не могут разделятся между несколькими VAS. Физические страницы, которые единовременно отображаются на несколько VAS, называются разделяемыми физическими страницами (shared physical pages).

Все закреплённые с помощью интерфейсов VirtualAlloc * участки VAS привязаны к тем физическим страницам, которые не могут быть разделены между разными VAS. Их можно считать приватными физическими страницами. Сумму всех приватных физических страниц в оперативной памяти и на диске называют приватными байтами (private bytes), если используют терминологию Системного Монитора, или размером виртуальной (выделяемой) памяти, согласно терминологии Диспетчера Задач. Сумму всех приватных физических страниц, которые располагаются в оперативной памяти, называют рабочим множеством, которое отображается в виде значения "Выделение памяти" (Memory Usage) в строке состояния Диспетчера Задач.

Как я упоминал ранее, зависимость Windows от потребности в физической памяти приводит к тому, что операционная система может изымать физические страницы из рабочего множества процесса. Обычно это проявляется в виде листания. Операционная система имеет возможность предотвратить листание этих участков VAS. За это отвечает механизм блокировки участков VAS в физической оперативной памяти. Как Вы могли догадаться, приложение, которое пробует блокировать свои участки VAS, может дестабилизировать всю систему. Чтобы сгладить этот эффект, в Windows привилегия "Lock pages in memory" по умолчанию выключена, из-за чего только те приложения, которым администратором дано на это разрешение, могут блокировать страницы в памяти. Кроме того, операционная система имеет возможность, в случае необходимости, подвергнуть листанию рабочее множество процесса целиком.

Не смотря на то, что размер регистров на платформе x86 всего 32 бита, платформа предоставляет возможность операционной системе оперировать 64 Гб оперативной памяти, для этого используется расширение физической адресации - Physical Address Extensions (PAE). Включение для Windows режима PAE может быть выполнено редактированием файла boot.ini. Если режим PAE не включен, Windows будет способна управлять максимум 4GB оперативной памяти, не смотря на то, что компьютер может иметь при этом больше оперативной памяти.

Некоторым пользовательским приложениям необходимо иметь VAS больше чем 2 Гб. В Windows имеется возможность увеличить VAS для пользовательского приложения до 3 Гб. Этот режим имеет серьёзный недостаток. В таком режиме будет ограничен до 1 Гб доступный ядру объём VAS. Увеличить размер VAS для пользователя можно добавив ключ /3GB в файл boot.ini. После внесения таких изменений необходима перезагрузка системы.

Ограничение VAS для ядра до 1 Гб влияет на весь компьютер, а не только на приложение, которому нужен большой объём VAS. Например, установка ключа /3GB влияет на размер доступный операционного системе объёма памяти, если включён режим PAE, то он снижается с 64 Гб до 16 Гб. Ключ /3GB влияете на все компоненты ядра, включая все драйверы. Включение /3GB может вызвать такие отрицательные эффекты, как снижение производительности и отказы распределения памяти с остановкой системы. Мое мнение - нужно избегать использования ключа /3GB, если в этом нет большой необходимости.

Как я уже писал, для платформы x86 объём VAS ограничен 2 Гб или 3 Гб, в зависимости от ключей в файле boot.ini. На AMD64, 32 битное приложение может иметь до 4 Гб. Такой маленький объём VAS может быть существенным недостатком для высокопроизводительных серверов с гигабайтами и терабайтными базами данных, обслуживаемых SQL Server. Также я говорил, что ключ PAE предоставляет Windows возможность оперировать с памятью до 64 Гб. Но как же в действительности один процесс обращается к такому большому объёму памяти? Чтобы предоставить одному процессу возможность работать с превышающим VAS объёмом оперативной памяти, Windows использует механизм Address Window Extension (AWE) (вспомните былые годы под DOS ). Будьте внимательны, многие из авторов используют термин AWE память. Не бывает AWE памяти, нельзя пойти и купить AWE память в магазине . А если нет AWE памяти, значит, нет и недостатка или избытка AWE памяти. Есть только AWE механизм, который предоставляет возможность управлять превышающим VAS объёмом оперативной памяти! Принцип простой. Используя AWE API, можно распределить физическую память; далее, используя VirtualAlloc API, можно распределять участки VAS; и ещё далее, используя AWE механизм можно увязывать/отвязывать участки VAS и физическую память. Как и с заблокированными страницами, для приложения, чтобы использовать AWE механизм нужно иметь разрешение на блокировку страниц памяти.

AWE API может использоваться даже на компьютерах с памятью меньшей объёма VAS процесса. На самом деле, AWE можно использовать для того, чтобы избавиться от любого типа листания (вспомните, что при блокировке страниц в памяти с использованием механизмов VirtualLock, у Windows ещё остаётся возможность подвергнуть листанию целиком весь процесс). При использовании же AWE механизма, операционная система не сможет никак вмешаться. Такая гибкость создаёт некоторые трудности. Неправильное использование AWE механизма может привести к остановке всего компьютера, преодолеть которую можно будет только путём перезагрузки.

Хорошо, я думаю, на сегодня достаточно информации . В этой и предыдущих статьях я хотел, что бы Вы поняли общую концепцию, которая действительно очень важна! Вот, что можно представить в виде краткого резюме:

  • Каждый процесс имеет свою собственную область VAS.

  • Разработчики часто не учитывают особенности VAS.

  • VAS является ограниченным ресурсом, даже на 64 - битной платформе.

  • Windows управляет VAS точно так же, как управляется хип (динамическая память).

  • Объём самого маленького участка VAS равен 64 Кб.

  • Управление участком VAS происходит посредством передачи ядру VAD - структуры.

  • VAD описывает состояние участка VAS: распределён, зафиксирован или нейтрален (allocated, committed, uncommitted).

  • Страница VAS привязывается к физической странице оперативной памяти по запросу, при первом обращении к странице, если не используется файл подкачки.

  • Физические страницы могут быть приватными или разделяемыми (private / shared).

  • Набор всех приватных, физических страниц процесса называется приватными байтами - "Private Bytes" (PM) или размером виртуальной памяти - "Virtual Memory Size" (TM).

  • Набор приватных, физических страниц оперативной памяти называют рабочим множеством процесса - "Working Set".

  • Физические страницы, привязанные к определенной участку VAS, могут быть блокированы в памяти.

  • Ключ PAE позволяет поддерживать в Windows до 64 Гб оперативной памяти.

  • На платформе x86 для VAS возможны следующие ограничения: 2 Гб, 3 Гб или 4 Гб.

  • Ключ /3GB увеличивает объём пользовательской VAS до 3 Гб и уменьшает VAS ядра до 1 Гб.

  • Ключ /3GB ограничивает предел физической памяти, расширяемый ключом PAE, до 16 Гб.

  • Ключ /3GB использовать не рекомендуется.

  • AWE механизм, это не память.

  • AWE предоставляет возможность одному процессу использовать память за пределами VAS.

  • Ключ /3GB не обязателен для включения AWE механизма.

  • Ключ /PAE не обязателен для включения AWE механизма.

Некоторые интересные "грабли":

  • Распределение физической памяти, с использованием AWE механизма, на Windows 2000 работает медленно (по этой причине SQL Server 2000 не может динамически управлять памятью, когда включён режим AWE). Проблема устранена в Windows 2003 Server, с расчётом на то, чтобы SQL Server 2005 смог распределять физическую память динамически.

  • Физические страницы, распределенные через AWE механизм, не являются частью рабочего множества процесса, как и большие страницы (я расскажу про большие страницы когда-нибудь позже). Именно по этой причине PerfMon (Системный монитор) или Task Manager (Диспетчер задач) их не показывают. Причина, по которой доступные через AWE страницы не являются частью Private Bytes состоит в том, что работа с ними строится по-другому, чем с приватными страницами процесса. Тот же самое можно сказать и о больших страницах. Я не знаю, имеются ли планы добавить в операционную систему новые счётчики производительности для AWE и больших страниц, но в следующей версии SQL Server можно будет увидеть количество страниц, распределённых AWE, для чего можно будет использовать администраторские динамические представления - dmv.

В следующий раз мы будем говорить о вытеснении памяти и, после этого, мы будет готовы погрузиться в тему менеджера памяти SQL Server.

[В начало]

Руководство по работе с Microsoft SQL Server 2000 Analysis Services (продолжение)

По материалам статьи Carl Rabeler и Dave Wickert, Microsoft Corporation: Microsoft SQL Server 2000 Analysis Services Operations Guide
Перевод Виталия Степаненко

Содержание

Введение
Управление конфигурацией
Управление выпуском
Управление изменениями
Администрирование безопасности
Управление сервисом и доступностью
Управление свободным пространством и производительностью
Управление разрешением проблем и ошибок

Буфер обработки

Analysis Services создает буфер обработки в памяти для каждого раздела, который он обрабатывает. Analysis Services выделяет память для каждого буфера, когда это нужно, и освобождает память, выделенную для буфера, когда обработка раздела завершается. Analysis Services использует каждый буфер для двух различных задач:

- Во-первых, Analysis Services загружает для раздела данные с фактами из буфера опережающего считывания в буфер обработки и потом их сортирует, индексирует и записывает данные с фактами в сегменты соответствующего уровня фактов файла раздела MOLAP. Процесс сортировки включает столько данных, сколько может одновременно уместиться в буфере обработки.

- Во-вторых, Analysis Services использует буфер обработки для расчета агрегатов. Если находящийся в памяти буфер обработки имеет недостаточный размер для хранения всех расчетов во время работы, то Analysis Services выделяет буферу обработки временные файлы на диске для завершения расчета агрегатов.

Свойство Process buffer size (размер буфера обработки) на вкладке Processing в Analysis Manager (значение ProcessReadSegmentSize в реестре) определяет максимальный размер каждого буфера обработки. По умолчанию максимальный размер каждого буфера обработки приблизительно равен 32 мегабайтам. Для большинства приложений это значение, вероятно, слишком мало и должно быть немедленно увеличено. Более эффективным здесь будет значение, равное как минимум 150-200 мегабайтам.

Если размер каждого буфера обработки имеет достаточный размер для эффективной сортировки и индексирования больших объемов данных с фактами перед их записью в сегменты файла раздела, то общая организация данных и скорость обработки запросов повышаются. Более того, если таблица фактов содержит много дублированных записей, то большой буфер обработки позволяет Analysis Services объединять дублированные значения в памяти, экономя пространство и повышая производительность запроса.

Если Analysis Services выходит за пределы буфера обработки во время создания агрегатов, то Analysis Services изменяет алгоритм обработки для использования временных файлов, которые увеличивают объем памяти, выделенный этому буферу обработки. При использовании временных таблиц Analysis Services перемещает агрегаты между этими временными файлами и памятью, выделенной буферу обработки, во время расчета агрегатов. Считывание данных из временных файлов и запись данных в них происходит намного медленнее, чем расчеты в памяти, также эти операции сопровождаются интенсивным вводом-выводом. Вам следует настроить Вашу систему так, чтобы исключить использование временных файлов, увеличив свойство Process buffer size (размер буфера обработки), если это возможно. Все агрегаты раздела рассчитываются за один раз и должны помещаться в памяти; иначе будут использоваться временные файлы.

Во время параллельной обработки множества разделов или обработки целого куба в одной транзакции, Вы должны удостовериться, что общий объем памяти, требующийся для буферов обработки, измерений, скрытых измерений, реплик и других потребителей памяти не превышает значение установки Memory conservation threshold (порог резервирования памяти). Если Analysis Services не хватает виртуального адресного пространства для этих синхронных операций, то Вы получите ошибку нехватки памяти. Если не хватает физической памяти для размещения виртуальной памяти, то операционная система Windows будет использовать файлы подкачки виртуальной памяти для дополнения доступной физической памяти. Хотя использование файлов подкачки влияет на производительность, если возникает чрезмерное использование страничной подкачки файлов, неинтенсивное использование страничной подкачки файлов (примерно 100-200 мегабайт) обычно приемлемо, если это необходимо.

С другой стороны, если значение свойства размера буфера обработки слишком велико и если количество и размер агрегатов достаточно большие для заполнения буфера обработки во время обработки, то Analysis Services может превысить порог резервирования памяти, что может вызвать частичную или полную очистку кэша запросов. Превышение порога резервирования памяти во время обработки может привести к использованию временных файлов. Запомните, что если Вы обрабатываете разделы параллельно, то каждый раздел использует отдельный буфер обработки.

Совет: Если у Вас есть достаточный объем памяти, увеличьте свойство Process Buffer Size (размер буфера обработки) как минимум до 150-200 мегабайт, чтобы избавиться от использования временных файлов во время обработки. Нередко нужно устанавливать размер буфера обработки даже равным 300-500 мегабайтам на серверах, где обрабатываются большие кубы. Чтобы определить нужный размер буфера обработки, посмтрите процедуру в приложении C "Как настроить размер буфера обработки" далее в этой статье.

Расположение файлов с данными и временных файлов

Экземпляр Analysis Services имеет папки Data и Temporary. Analysis Services использует папку Data для хранения структур с измерениями для всех объектов, определенных в экземпляре Analysis Services. Analysis Services использует папку Temporary для увеличения объема памяти, выделенной каждому буферу обработки, если буфер слишком мал для обработки агрегатов. Путь по умолчанию для обеих папок - C:\Program Files\Microsoft Analysis Services\Data. Вы можете изменять расположение каждой из этих папок во время установки Analysis Services или после. Для изменения пути после установки щелкните правой кнопкой мыши на объекте в Analysis Manager и выберите Properties. Вы также можете воспользоваться примером скрипта в Приложении D, "Пример скрипта для изменения пути к папке Data" для изменения пути к папке Data программно.

На заметку: Если Вы используете программы для поиска вирусов на компьютере, где стоит Analysis Services, то Вам нужно отключить сканирование на вирусы следующих папок Analysis Services - Data, Temporary и Bin.

Вам надо поместить папку Data на отдельный RAID; RAID 10 (или RAID 1 + 0) обеспечивает лучшую производительность, но RAID 5 часто является достаточно быстрым для поддержки множества инсталляций Analysis Services. Основная деятельность Analysis Services заключается в чтении данных из файлов в папке Data для выполнения запросов пользователей, но не в записи данных в эти файлы в папке Data. Как только Вы определите, сколько дискового пространства Вам требуется для данных, индексов и агрегатов, Вам нужно будет выделить на это примерно в два раза больше дискового пространства, чтобы оставить достаточно места для обновления данных и для скрытых файлов, появляющихся во время обработки. Дополнительную информацию о том, как рассчитать необходимый объем дискового пространства для папки Data, смотрите в пункте "Дисковое пространство" главы "Управление свободным пространством и производительностью" далее в этой статье. Дополнительную информацию о каждом типе файлов, хранящихся в папке Data, Вы найдете в Приложении K, "Структура папки Data".

На заметку: Т.к. в папке Data находятся файлы с информацией по безопасности для контроля доступа конечных пользователей к объектам Analysis Services, Вы должны защитить папку Data от несанкционированного доступа. Только члены групп OLAP Administrators и Administrators должны иметь доступ к папке Data. Если Вы изменяете расположение папки Data после установки, Вы должны сконфигурировать настройки безопасности вручную. Дополнительную информацию о настройке безопасности в Analysis Services Вы найдете в главе "Администрирование безопасности" далее в этой статье.

ПРОДОЛЖЕНИЕ СЛЕДУЕТ

[В начало]

ССЫЛКИ НА СТАТЬИ

Статьи на русском языке


Немного об автопараметризованных запросах и кешировании планов сервером.
Ivan's Blog
MSSQLServer: Для начала, что понимается под автопараметризованными запросами: Очевидно, это запросы в которых в предикате вместо переменных используются константы, а задачи параметризации возложены на сервер...

Настройка производительности и масштабируемости SQL Server
Брайан Моран
MSSQLServer: Предельная производительность - термин, который мы с коллегами придумали 5 лет назад для определения метода настройки характеристик SQL Server, рекомендованного нами клиентам, обращавшимся за консультацией. Применение этого подхода особенно полезно для планирования масштабируемости. Планирование в расчете на перспективу расширения позволит значительно повысить качество работы и воспользоваться преимуществами новых технологий, например, интеграцией среды Common Language Runtime (CLR) в SQL Server 2005...

Англоязычные статьи

A technique for ensuring plan stability in SQL Server 2000
Ken Henderson's WebLog
One of the great features in SQL Server is its optimizing query processor. The Sybase version of SQL Server pioneered on-the-fly query optimization, and, even to this day, intrinsic query optimization is one of the most useful features of the product. By automatically optimizing end-user queries, SQL Server further separates the logical work requested from the physical means of doing it, providing greater plan reuse and flexibility for most users

Disappearing DBAs
Sean McCown
In response to an article the Brian Knight write on the death of the production DBA, Sean McCown writes about the role that DBAs may play in shops that upgrade to Yukon (SQL Server 2005)

Introducing SQL Server 2005's CLR Integration
Shawn Wildermuth
T-SQL is great for database code, but writing procedural code in T-SQL has always been difficult. Invariably, your project includes a stored procedure or two, requiring some text parsing or complex math operations. Doing this in SQL Server has been difficult. Either you wrote T-SQL code, or you wrote an extended stored procedure/function and used COM to interoperate them. Neither was a good solution, but that is all we had

SQL Server 2005 Omissions
Shawn Wildermuth
I've been digging deep into SQL Server 2005's CLR integration over the last few days. I am surprised by several specific omissions. My guess is that they have been dropped because of time constraints

The Microsoft .NET Model
Rex Brooks and Russell Ruggiero
Editor's note: Part 1 of this series focused on J2EE. The article, "The Java 2 Platform Enterprise Edition (J2EE) Three-Tier Model," appeared in the February 25, 2005 issue of DM Direct and is available at http://www.dmreview.com/article_sub.cfm?articleId=1020766

SQL Server 2005 CLR Integration Part 2: Working with Data
Shawn Wildermuth
In the first part of this article, we discussed how the CLR integration works in SQL Server 2005. This included writing stored procedures, but we could not do anything interesting in those first examples because we had no access to the data inside the database

SOUNDEX String Comparison
Mike Chapple
In the late nineteenth century, United States census officials faced a dilemma. During the process of counting the huddled masses, our public servants created a huge paperwork trail that the law required them to preserve for future historians. With amazing forethought, they realized that people searching for records might not know the exact spelling of their ancestor's name. Was it Smith or Smythe? Chapple, Chapel or Chapelle?

Shipping rowsets across databases using Service Broker
Write Ahead Blog
While there are technologies such as log shipping, SQL Server Replication Service and database mirroring available for various scenarios that require maintaining a copy of the data in a secondary source, several customers have asked how they could use Service Broker for securely and reliably sending tables or rowsets from one database to another. Since there were no examples available for demonstrating how this task can be performed I decided to cook up a very simple sample. In this sample, we will use the FOR XML clause to convert a rowset into an XML document, send it from one database to another (which could be possibly residing on a different SQL Server instance and on anoher machine) using Service Broker, receive the XML message at the target and convert it back to a rowset using OPENXML to insert it into a table. What is really cool about this sample is that it is entirely written in T-SQL and does not require any magic from CLR. Also this is a very basic example and does not fully demonstrate the power of nested FOR XML queries and XQuery which are both available in SQL Server 2005

Q and A: Max memory with sql server 2000 / win2003 x64
Slava Oks's WebLog
Today, I received following question Q: Slava,I have a question for you. Sql 2000 is documented to support a maximum of 64GB when used with 2000 datacenter edition. I assume this is the limit of 2000 Datacenter, but is it also a limit defined in sql server 2000? We are purchasing a new server which can support a max of 128G of memory, and believe we have use for that much memory. If we use an OS that can recognize it (such as 2003 enterprise x64), can sql server 2000 utilize 128G, or is it somehow limited to 64G?

Q and A: Controlling size of a single cache in SQL 2005
Slava Oks's WebLog
Q: I have teaching a class on Yukon for the Ascend program, and the class had a question I wanted to double check before answering. On an Itanium with 1 TB of RAM, the class’ curiosity asked, “If plan cache is very large “Then how does Plan Cache lookups work such that the plan lookup does not itself become a bottleneck? The reason for the question is because the RM thread would not necessarily decrement the tick count on plans if they have not reached 50% of BPool (or am I wrong on that point?). So if there is 450 GB used for Plan Cache, what makes Yukon plan cache lookups work smarter than Shiloh's?

Be Aware: VirtualAlloc with MEM_RESERVE can fail even if you have plenty of VAS inside of the process
Slava Oks's WebLog
Many developers assume that if you have plenty of free VAS in your process VirtualAlloc (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/memory/base/virtualalloc.asp) and VirtualAllocEx (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/memory/base/virtualallocex.asp) calls with MEM_RESERVE parameter can't fail. This is not actually true. Remember that when allocating VAS region OS creates VAD (Virtual Address Descriptor). VAD manages VAS region, for more info read http://blogs.msdn.com/slavao/archive/2005/01/27/361678.aspx. When system is low on physical memory which includes RAM and swap file, VAD's allocation might fail. The failure will cause VirtualAlloc* call to fail. It means that if system low on physical memory VirtualAlloc* could fail. This becomes very important on 64 bit platforms. When running on 64 bit, developers might assume that reservation never fails - which is wrong.

SQL Server 2000 maintenance plan
Greg Robidoux
Can you tell me what type of locks and other information maintenance plans need when running against a SQL Server 2000 database? I am looking for the internals of how the maintenance plan works. When creating a maintenance plan, SQL Server jobs are created that break down the maintenance tasks selected into multiple jobs. The jobs then use the sqlmaint utility to complete the task. The tasks that can be run using the sqlmaint utility include database and log backups, DBCC CHECKDB and index rebuilds. These tasks have been written in SQL Server, so they can be run during normal user activity on the database, but locks are applied that can conflict

Database Geek of the Week - Don Demsak
Douglas Reilly
An interview with Don Demsak (aka DonXML). Don Demsak is a developer and consultant who serves the developer community by his participation in user group activities and Code Camps throughout the area. Don also loves XML and is a tireless advocate for using it in the right way. He is one of a relatively small number of XML Microsoft MVPs worldwide, and uses “DonXML” as his nom de plume on the web, an indication of his general area of interest. In addition to using XML in interesting ways, Don is also familiar with SQL Server databases.

Understanding the difference between IS NULL and = NULL
James Travis
This article by James Travis details the differences between IS NULL and = NULL. He also discusses the ANSI_NULLS setting.

Using ANSI SQL as a Conceptual Hierarchical Data Modeling and Processing Language for XML
Michael M David
This paper will explain and show how standard ANSI SQL processors can naturally model and automatically process complex multi-leg hierarchical data structures at a full conceptual hierarchical level. This also means the query user does not need to have structure knowledge of the hierarchical structures involved. The data modeling capability includes dynamically combining logical hierarchical relational and physical XML data structures at a full hierarchical level. This also includes the ability to link below the root of the lower level structure intuitively forming a valid unified hierarchical structure. As will be shown, ANSI SQL’s high level hierarchical data processing allows the flexible conceptual control of hierarchical node promotion, fragment processing, structure transformation, and variable structure creation. Also described is how the complex multi-leg hierarchical data filtering and processing is automatically carried out by the relational engine’s Cartesian product processing which inherently utilizes Lowest Common Ancestor (LCA) logic. Other ANSI SQL hierarchical processing features covered include the natural ability to maintain hierarchical processing operation in distributed processing environments across heterogeneous SQL systems and to apply all of these natural hierarchical processing abilities to the transparent and full integration of XML

Suggestions for Datatypes
Amit Lohia
SQL Server 2000 does a lot of things for the DBA, tuning, updating statistics, scheduling tasks, wizards and more. But one thing that it does not help with is choosing the correct data type for your data. New author Amit Lohia brings us a technique and some code that will examine your existing data and suggest places where another data type might be a better choice

SQL Server 2005 System Tables and Views
Don Schlichting
This article will explore various options for obtaining SQL 2005 metadata information

Security Design Class for SQL Server 2005
Randy Dyess
It has been a few days since the last post, I was enjoying the two days I had at home and trying to catch up on my reading and just enjoying the holiday in general. Today finds me at the Microsoft campus in Redmond were I am acting as a subject matter expert for the design of the SQL Server 2005 Security course. I am basically here to make sure the technology is correct, nothing is missed, and nothing is “under-stated” as it sometimes was in the past in Microsoft classes. Hopefully, I will have a say on the materials covered during the 300 level security course we are designing. If you have anything you would like to see covered in a SQL Server security class send me an email quickly as I only have a few days to finalize the course outline

What's a truncation exception?
Bob Beauchemin's Blog
I commonly do a demo when teaching SQL Server 2005 where I write a SQLCLR UDF that's returns the string "Hello World". The define it, sans VS autodeploy, like this

How DO you change your SQL Login password?
Bob Beauchemin's Blog
SQL Server 2005 will, by default on Windows Server 2003 systems, enforce password policies for SQL Server logins as well as Windows logins. Nice feature, but this means that your SQL Server login password can expire. So how do you change it? Well certainly the DBA can change it as (s)he always has, but you'd hate to bother your DBA every 42 days. Never mind what the DBA would think of that... And the user interface programs, SSMS and SQLCMD don't yet provide that feature. Neither does Visual Studio 2005 Server Explorer

Generic Coding with the ADO.NET 2.0 Base Classes and Factories
Bob Beauchemin
Learn more about the new functionality in ADO.NET 2.0 that enables you to create generic data access code. (14 printed pages)

Efficient Property Promotion from XML Instances (Part 2)
XQuery Inside SQL Server 2005
Last week I covered the basics of property promotion i.e. automatically extracting data from an XML instance and storing this as relational data in order to improve query readability and/or performance. If you missed this previous post, you can access it at http://blogs.msdn.com/mrorke/archive/2005/05/24/421576.aspx

CASE statements
Chris Webb's BI Blog
One of the first things I noticed when I got hold of AS2005 for the first time, well over a year ago now, was that we now had a CASE statement in MDX. The joy! And yet it's one of those small improvements which so often gets ignored, so I thought I'd mention it

Fast file initialisation
Thoughts of a Freelance Dolphin Trainer
Historically creating database files has always been a chore. Cast you mind back to SQL Server 6.5 and without vigilant monitoring (AKA a DBA doing their job correctly) you would get bitten on the backside when either the database or transaction log device filled up. There were some techniques for avoiding this but plenty of people didn't bother and just manually extended. Enter the realms of the modern day versions of SQL Server where this had been made a lot easier but the performance impact of a database expanding itself by 10% or X amount of Mb throughout a long hungry process became apparent so for critical systems you would end up doing similar things to what was done on 6.5. Now 2005

Table partioning
Thoughts of a Freelance Dolphin Trainer
I’m never going to explain this subject in more detail than the experts so I might as well go the other way on this and make it brief. In SQL Server 2000 the concept of partitioned views was introduced which along with the introduction of INSTEAD OF triggers gave users the ability to effectively deliver data into separate tables whilst retaining a single point of entry. If I cast my mind back a few years I think this was the same technique used to get SQL Server on top of the TPC benchmarks. In SQL Server 2005 you now have partitioned tables and the generation and usage around it is pretty funky to be honest. Partitioned tables are created in three stages. First is the creation of the partition function which effectively is a statement of the data range and definition of the boundaries within the range (e.g. before Jan, Jan, Feb, Mar, After Mar). Key to the statement are the LEFT or RIGHT designation which rather than attempt to badly clarify its nuances there’s an excellent posting on Kimberly Tripp’s Blog that delivers a lot of useful information on this subject

Database snapshots
Thoughts of a Freelance Dolphin Trainer
Database snapshots are very cool. I think the only problem with them is that the possible uses are so numerous that I don’t think people have quite decided yet what they are best for. One possibility is that they are going to be great for all conceivable uses but the danger is that they will get misused and then all kinds of things will happen. The technology used for database snapshots does not belong to SQL Server but Windows so there are a number of restrictions. The first thing to remember is that a database snapshot behaves like any other database but, of course, is read only. You can select from it, join its tables even restore a database to the point in the snapshot was taken which sounds great but then you think point in time copies of the database will be huge. Have a number of them and you server is going to run out of disk very quickly but if you take a snapshot of a database and then go and checkout the size of the data file in explorer you get a surprise. Even though the file states its size as, lets say, 2Gb, the same as the original data file of the database the snapshot was taken from, its size on disk will only be 64Kb

SQL PASS 2005 - SSIS Performance
Thoughts of a Freelance Dolphin Trainer
As I'm sure you're aware by now SQL Server Integration Services (SSIS) is the new version of Data Transformation Services in SQL Server 2005. This is not a simple upgrade but a complete re-architecting of the product bringing it almost in line with other enterprise ETL tools. The presentation from Grant Dickinson of Microsoft and Henk van der Valk of Unisys was a demonstration, from my perspective, not of the new features but the capabilities of the product in the area of scalability. SSIS likes memory and that was made particularly obvious by the charts and graphs we were shown that showed the 64bit server wiping the floor with the 32bit (as you would expect) and in some cases the 32bit server not even completing the process after hitting its 3Gb process limit

SQL PASS 2005 - Reporting Services Enhancements
Thoughts of a Freelance Dolphin Trainer
Ah Reporting Services. Both a blessing and curse to me in recent times. The first thing a customer always asks me to do with this tool is something it cannot do out of the box. This isn't a problem really but it can be time consuming when you're creating your suite of reports for a client (say 2 dozen) and they decide that they really would like to be able to sort one of the columns (at the end of development). Fortunately Microsoft has taken a hell of a lot on board since the first version of Reporting Services saw the light of day and features that made this an incredibly powerful reporting client have been enhanced 2 fold. Firstly as an improved product in its own right but secondly when combined with 2005 Analysis Services one of the best Microsoft OLAP client reporting tools on the market

SQL PASS 2005 - New Cube Design Features - Part 1 - Dimensions
Thoughts of a Freelance Dolphin Trainer
The next session I visited was based around new cube design features in Analysis Services 2005 presented by the MDX guru that is Chris Webb. Now I’m one of these people who never initially looked at the instructions preferring to get started and find my own way around a new product. This has been a trait of mine since I was a kid with things like Transformers (robots in disguise for the less well informed) and other such youthful pursuits. Just over a year ago after first launching the development environment for Analysis Services and taking my first tentative steps around the cube design options I had to re-think that attitude a touch

New Cube Design Features - Part 2 - More on Hierarchies
Thoughts of a Freelance Dolphin Trainer
Part 1 further down the page was cut short because I could see that it was going to be one of those 4 page word document blog postings that I would never go back and read let alone someone with any interest in this thing taking any notice of. Anyway, the dimension / hierarchies change thing is pretty huge in 2005 so continuing my piece on Chris Webb’s piece a bit more about attribute hierarchies

The Question Is No
Direct Reports
It's been hard to blog from TechEd as the wireless network at the show and the network connection in my hotel room have both been extremely spotty. Lots of stuff going on today, including Paul's announcement that Reporting Services will be available in all editions of SQL Server 2005 and Report Builder will be in Standard and Workgroup editions

Yukon Classrooms Follow-up Questions Answered
Larry Chesnut
Over the last few weeks, I have been traveling across the country, delivering training for SQL Server 2005 in a Microsoft initiative called Yukon Ascend. My first stop was in Atlanta to talk for a week with HP folks about SQL Server 2005. It was really great to get to spend time with the makers of Super Dome. My next stop was in Seattle to talk to MS people at their Issaquah campus. Beautiful, simply beautiful. After two weeks of questions, there came up a few items I promised I would address after the class. Since I couldn’t make time for each class attendee individually, I promised I would answer their questions in this forum.

TPC Benchmarks (TechEd Update)
KAREN'S SQL BLOG
Microsoft touts SQL Server's benchmarks at http://www.microsoft.com/sql/evaluation/compare/benchmarks.asp, but the page doesn't seem to have been updated since 11/04

Migration White Paper Central (TechEd Update)
KAREN'S SQL BLOG
Here's Microsoft's main TechNet page for finding information not only about upgrading SQL Server from earlier versions, but also about migrating Oracle, Sybase, Informix, MySQL, and Access databases and applications to SQL Server

SQL 2000 jobs running for days
Jeremy Kadlec
I have SQL 2000 and some jobs are running for days. The status is 'performing completion actions.' How do I stop these jobs?

Secure way to share access to a physical SQL Server running multiple databases
Steven Andres
Is there a secure way to share access to a physical SQL Server running multiple databases? I have several customers that want to share the expense of the SQL Server, but I am concerned about opening up port 1433 to them incase one is infected with a virus, I don't want the other databases to be affected

.NET Data Providers, Tools, and Vendors
Ken North
Added Atanasoft, Computer Associates, Context Software, dataWeb, Extended Systems, Gupta Technologies, IDS Software, Intersystems, Maxim Kazitov, Matisse, Mono Project, n/ Software, postgreSQL, Dirk Primbs, Recital, Sequiter Software, SourceForge. Updated Microsoft

Introduction to C# for DBA's
graz
This is the first article in a series on writing stored procedures using the Common Language Runtime (CLR). This article focuses on basic C# syntax and using Visual Studio to build a stored procedure. It's targeted at DBA's and anyone else who primarily writes in Transact-SQL and hasn't had much exposure to .NET yet. (Update: Fixed the title.)

MDX Essentials: Basic Set Functions: The TopCount() Function, Part II
William Pearson
In this article, we will continue the examination of the TopCount() function that we began in the previous article of the MDX Essentials series, Basic Set Functions: The TopCount() Function, Part I. Before getting "hands-on" with TopCount() in our last session, we introduced the function, stating that its highest value lies in the fact that we can use it as a means for isolating best performers from among potentially large populations of fellow members. We emphasized that this ranking capability is a critical need in many data analysis and decision support scenarios, where we often seek to report upon best performers for various reasons

SSIS: SCD Wizard demo
Jamie Thomson's Blog
SQL Server Integration Services (SSIS) contains a wizard that enables you to easily build packages to manage slowly changing dimensions (SCDs)

Ever-increasing clustering key - the Clustered Index Debate..........again!
Kimberly L. Tripp
As I'm preparing for my Tech*Ed session on Indexing Best Practices in SQL Server 2005, I'm reminded that there are a ton of best practices that really apply to both SQL Server 2000 as well as SQL Server 2005. When it comes to indexing, there are many dependencies on the storage structures. These dependencies are the basis for why I recommend a very specific type of clustering key - for all versions of SQL Server, 7.0 and higher!

June CTP (also known as IDW15 or "unofficial Beta 3") is now availab
Paul Flessner
It is official - the countdown to launch has begun! During my Tech.Ed keynote this morning, I announced that SQL Server(TM) 2005, Visual Studio® 2005 and BizTalk® Server 2006 will launch the week of November 7. This will be the biggest launch ever for these products, and we're very excited to deliver them to you

Analysis Services 2005 Brings You Automated Time Intelligence
Mosha Pasumansky, Robert Zare
Analysis Services has been redesigned from the ground up in SQL Server 2005 to provide the most capable business intelligence (BI) platform in the world. Analysis Services 2005 has many features and built-in enhancements that provide automatic, intelligent solutions to common business problems. Even if you're less-than-expert in OLAP or Multidimensional Expressions (MDX) coding, you can now create rich analytical applications

How are association rules different from decision tree rules?
DMTeam
Rules describing your data can be discovered by both the Microsoft_Decision_Trees and Microsoft_Association_Rules algorithms - find out how and why they might differ

Test linked server connection settings...
SQL Server Engine Tips
Have you ever encountered a scenario in SQL Server 2000 where you want to test the connectivity of a linked server configuration via TSQL? This was not possible easily and best handled from client side. But we have now a system stored procedure "sp_testlinkedserver" in SQL Server 2005 that allows you to test linked server connection. This stored procedure takes a linked server name as parameter, tests the connectivity and returns 0 for success & 1 for failure. You can find more details about this stored procedure in the SQL Server 2005 Books Online

Using the SQL Server 2005 Upgrade Advisor
David Boschmans' Weblog
My last three weeks have been completely filled with the SQL Server 2005 Early Adopter Program that Microsoft Belux is running. The program targets partners and customers who are already building applications and solutions using SQL Server 2005. The program started with some intensive training sessions on SQL Server's Data Platform, Business Intelligence and Development functionality followed by some compatibility labs and a day of training focusing on extending current applications or solutions

Roman's Weekly SQL Server Tip - Application Pool Identity in Reporting Services
Roman Rehak
IIS 6.0 allows you to create application pools, then each application pool can be configured to run under a separate identity. When my company deploys web sites, our practice is to create an account for each web application and then create a new application pool to run under that account. This approach however doesn't work with Reporting Services, you might end up getting weird errors like

Database Geek of the Week - Rebecca Riordan
Douglas Reilly
In addition to writing articles and software, I sometimes write books, which is one of the most difficult things I do. If you think that getting the contract is the hard part, it’s not. It takes longer to write a book than you might think, and you have to deal with people who tell you a particular title is too simple, too short, too long, or too boring. Others have ideas about how you could have—should have—done the job better. The bottom line is: You place your ideas out in the world, in permanent form, and allow others to pick them apart

Effective Database Design: Choosing The Right Process
Rebecca M. Riordan
In Parts 1 and 2, we looked at the principles of relational and dimensional database design. But the structure of the data is only one component of a database system—a critical component, obviously, but still only a single component. Beginning with this part, we’ll look at some of the remaining aspects of designing database systems

Comparing Web Service Performance
Microsoft
WS Test 1.1 Benchmark Results for.NET 2.0, .NET 1.1, Sun JWSDP 1.5 and IBM WebSphere 6.0

SQL Server: Capture Object changes with SMO Capture Mode
Michiel Wories' WebLog
In a previous article I have showed how a SMO object can be serialized into a Transact-SQL script, which allows you to recreate the object. What if you want to have the script that is emitted when you changed one or more properties of an object? In that case Capture Mode comes in handy. This switches the ServerConnection object in a state where it starts capturing all statements that SMO emits instead of sending these to the server. The following sample illustrates how it is used

SSIS: ContainerStartTime system variable
Jamie Thomson's Blog
WOOHOO! The ContainerStartTime system variable is a new feature in the latest CTP drop of SQL Server Integration Services (SSIS). It provides the time that the container to which the variable is scoped began to execute - from this we can derive the execution duration of the container which is an invaluable statistic for comparing package executions. In the coming months I'll look to elaborate on exactly how we plan to utilise this in our SSIS engagements

SSIS: Can we get performance increases when running data-flows in parallel?
Jamie Thomson's Blog
I'm working on a large SSIS implementation this week. Large because I'm shifting some huge amounts of data around

Error with script component after migrating to June CTP 15
Kirk Haselden
We've done our best to ensure that we're backwards compatible with packages created with previous drops. We've even built upgrade/migration features into the infrastructure to allow for automatic and transparent upgrades from version to version. However, occasionally something slips through. This is one of those cases

ContainerStartTime and EventHandlerStartTime
Kirk Haselden
So, Jamie's been pestering me about this for what seems like eons!!!

Migration whitepaper from AS2000 to AS2005
Mosha Pasumansky
There is a new whitepaper titled "Analysis Services 2005 Migration" written by Michael Young for Proclarity. It really consists of three parts. First part is an overview of Analysis Services 2005 features such as attribute hierarchies, related attributes, data source views, measure groups, perspectives etc. While first part doesn't have any information not available from elsewhere, I still recommend to read through it, because it is written well and from perspective of the user who is familiar with AS2K. The second part desctibes the Migration Wizard. It takes you step by step through the wizard and describes the decisions of the wizard and what limitations it has

Mine the Predictive Power of Data
Sara Rea
Learn how to use the built-in functionality of SQL Server to make your business processes more efficient with data mining

Counting records using SQL Server 2000
Kevin Kline
I need to count rooms sold. The problem is that a room can be sold more than once for any given trip. How can I retrieve all records including one instance where the room has been sold multiple times on a given trip?

Server Instances and Integration Services Server
Kirk Haselden
This is something you may run into, especially if you're running Integration Services on a machine with multiple instances and at least one of them is a SQL 2K instance

June 7th Tech Ed Announcements on SQL Server 2005 - and Report Builder is no longer just in Enterprise :-)
Eric Nelson
On June 7th we made some great announcments around SQL Server 2005. A letter from Paul Flessner covering these can be found at http://www.activewin.com/articles/2005/9.shtml as well as a complete transcript at http://www.microsoft.com/presspass/exec/flessner/06-07Tech-Ed05.mspx

Real World Query Plans
Steve Jones
The SQL Server 2000 Query Optimizer is one of the more complicated things that a SQL Server DBA deals with. For most of us, we just let it work and do not give it a second thought. But when a crisis occurred, Andy and Steve had to dive in to learn a few more things about it

[В начало]

ФОРУМ SQL.RU

Самые популярные темы недели

Кто на чем пишет клиентов под SQL Server?
Tool Вы знаете что твориться на ваших 10-30+ серверах ?
Больше книг хороших и разных!
Log Shipping непашет
две таблицы из одной
Две одинаковые храинимые процедуры - разная скорость...???
Покритикуйте счетчик....
The process could not execute 'sp_repldone/sp_replcounters' on 'EXCITER2'.
Вопрос про необходимость индексов
Как сосчитать столбцы
Как выбрать запись с минимальным значением в одной из колонок?
Вопрос к знатокам
Тем, кто писал хр-процедуры на C++!!
Linked Server и Insert
Нужна помощь! Помогите настроить сервер MSSQL
Помогите оптимизить выполнение запроса ?
Web-admin для MSSQL
Шевелим мозгами
Pomogite razobratsa
Сортировка дерева

[В начало]

Вопросы остались без ответа

Информация.
Параметры в DTS.
SQL Server 2005 CTP June 2005: Books Online
SQL Server June 2005 CTP
Управление Microsoft SQL Server используя SQL инъекции
Нужна помощь в импорте базы paradox 7.x
EMC SAN v vRAID SAN для MS SQL Server
DTS (вставка формул в Excel)
Я опять про архивы
Ошибка при деплоинге репорта на MSRS

[В начало]


Вопросы, предложения, коментарии, замечания, критику и т.п. оставляйте Виталию Степаненко и Александру Гладченко в форуме: Обсуждение рассылки

СЕМИНАРЫ  КОНФЕРЕНЦИИ

МИНИФОРМА
ПОДПИСКИ



ПУБЛИКАЦИИ  АРХИВ


Subscribe.Ru
Поддержка подписчиков
Другие рассылки этой тематики
Другие рассылки этого автора
Подписан адрес:
Код этой рассылки: comp.soft.winsoft.sqlhelpyouself
Отписаться
Вспомнить пароль

В избранное