First (?) Announcement of Windows 7 Failure

8 09 2009

Today on twitter, @lauromoura has tweet a report about a Windows 7 failure. See the link:

http://seclists.org/fulldisclosure/2009/Sep/0039.html

Worth to see, what Steve Ballmer said on Vista’s release and the press opinions: here.

Fact: no Windows (and no Operating System) will be totally secure. It’s all just a matter of time.





Searching columns by type

16 06 2009

Today I went to review the SQL Server 2008 enhancements on XML support. To test the queries on AdventureWorks, the first thing I needed to know was: “Where are the XML data columns?”

I don’t actually have the graphic on the database model to search for and wasn’t on the mood to create the database diagram to search visually for the XML columns.

Then, I’ve got the idea of searching on the catalog for that. It should be simple to do (and it was!) but worth the post, as many people may have the need to use the same thing, not only on AdventureWorks, but on large (I mean many tables) databases:

Here is the script:

SELECT t.name, c.name, ty.name
  FROM sys.tables t INNER JOIN sys.columnsON
          (t.object_id = c.object_id)
      INNER JOIN sys.systypes ty ON
          (c.system_type_id = ty.xtype)
WHERE ty.name = ‘xml’

With this script, you can create a procedure that returns the table name and the column name that uses a type that’s passed by a parameter. Or even create a PowerShell function to achieve this. Let’s see the latter:

param([string] $typeName, [string] $server, [string] $database)
$sqlConnection = New-Object System.Data.SqlClient.SqlConnection "server=$server;database=$database;Integrated Security=sspi"
$sqlConnection.Open()
$sqlCommand = $sqlConnection.CreateCommand()
$sqlCommand.CommandText = "SELECT t.name [Table], c.name [Column]
                                                  FROM sys.tables t INNER JOIN sys.columns c
                                                          ON (t.object_id = c.object_id) 
                                                                           INNER JOIN sys.systypes ty 
                                                          ON (c.system_type_id = ty.xtype)
                                               WHERE ty.name = ‘$typename ‘"
$sqlReader = $sqlCommand.ExecuteReader()
$dataTable = New-Object System.Data.DataTable
$dataTable.Load($sqlReader);
$sqlConnection.Close()
Write-Output $dataTable

Interesting, huh?





MCTS: SQL Server 2005

16 06 2009

Bem, um pouquinho tarde, mas enfim, passei nesse sábado na prova 70-431: Microsoft SQL Server 2005 – Implementation and Maintenance, inaugurando a minha intenção de me especializar em banco de dados.

A prova é composta de duas partes, uma com 35 questões objetivas, e outra com 12 questões de simulação. A parte objetiva é bem tradicional, e pelo menos as questões que foram selecionadas na minha prova foram bem distribuídas nos assuntos. Houveram questões de XML, de desenvolvimento com CLR, backup/restore, … acho que só não caiu de Service Broker. Na parte prática, tive sorte e das 12 questões, 4 foram sobre backup/restore (para configurar um backup de acordo com algumas características pedidas).

Agora é estudar pra atualizar pra MCTS: SQL Server 2008!





Backup no SQL Server 2008

25 04 2009

Este vai ser um post sobre um tema introdutório para administradores de banco de dados. Uma tarefa comum que deve ser realizada de tempos em tempos e pela sua importância, é importante que ocorra com frequência, para que se tenha segurança com relação a algum desastre que possa acontecer… ninguém sabe quando um erro pode ocorrer, ou quando os dados podem ficar corrompidos, por esse ou aquele motivo.

Dentro do SQL Server 2008, os backups podem ser feitos de algumas formas:

  • Full
    • Faz o backup de todo o banco de dados. Isso inclui não somente o arquivo de dados mas também o log de transações, e com isso representam todo o banco de dados num determinado momento do tempo.
    • Sintaxe: BACKUP DATABASE <NOME_DO_DATABASE> TO DISK =<CAMINHO_PRO_ARQUIVO_DE_BACKUP>;
    • Ex.: BACKUP DATABASE teste TO DISK = N’C:\Backups\teste.bak’;
  • Differential
    • Não confundir com backup incremental. Este backup diz respeito as diferenças ocorridas no banco de dados após o último full backup. Um backup incremental armazenaria as diferenças entre o momento atual e o último backup (que não necessariamente seria full);
    • De acordo com o que foi exposto acima, não é possível então, fazer um backup diferencial sem antes ter feito um backup full;
    • Por manipularem somente as diferenças entre um backup full e o estado atual, tendem a ser sempre backups mais rápidos de serem executados, e menores no espaço em disco ocupado;
    • Sintaxe: BACKUP DATABASE <NOME_DO_DATABASE> TO DISK <CAMINHO_PRO_ARQUIVO_DE_BACKUP> WITH DIFFERENTIAL;
    • Ex.: BACKUP DATABASE teste TO DISK = N’C:\Backups\teste.bak’ WITH DIFFERENTIAL;
  • Log Full
    • Realiza o backup total do log de transações;
    • Sintaxe: BACKUP LOG <NOME_DO_DATABASE> TO DISK <CAMINHO_PRO_ARQUIVO_DE_BACKUP>;
    • Ex.: BACKUP LOG teste TO DISK = N’C:\Backups\teste.trn’ WITH DIFFERENTIAL;
  • Log Differential
    • Realiza o backup diferencial do log de transações;
    • Sintaxe: BACKUP LOG <NOME_DO_DATABASE> TO DISK <CAMINHO_PRO_ARQUIVO_DE_BACKUP> WITH DIFFERENTIAL;
    • Ex.: BACKUP LOG teste TO DISK = N’C:\Backups\teste.trn’ WITH DIFFERENTIAL;

Apesar de usarmos as extensões bak e trn, não há obrigatoriedade dessas extensões, sendo somente uma boa prática as que foram usadas nos exemplos.

No SQL Server 2008 foi introduzida uma novidade que é a compressão de backup. Por default este é um recurso que está desativado. Para poder usar como um recurso padrão para todos os backups, primeiro é preciso reconfigurar a base de dados, com:

sp_configure ‘backup compression default’, 1;
go

reconfigure;

Com isso, habilitamos no servidor a compressão de backup por default, o que significa que todo banco de dados terá backups comprimidos. Foi então adicionada a query de backup a opção do with COMPRESSION ou NO_COMPRESSION, para que se possa escolher na query se se deseja um backup comprimido ou não.

Além destas formas, também é possível usar a simples estratégia de Attach/Detach que é extremamente conveniente, quando se pode deixar o banco off-line por algum tempo.

[1] White Paper sobre compressão de backup no SQL Server 2008
[2] Backing Up and Restoring How-to Topics
[3] Copy-Only Backups
[4] Full Database Backups
[5] Differential Database Backups





Windows Vista Performance Roundtable

18 04 2009

With the launch of Windows Vista SP1 giving some significant fixes on performance issues on the operating system, Microsoft tries to take off the slow adjective from the mouth of users who tried Windows Vista.

Personally, SP1 really had improved performance, but much more can be done to take it better.

Below is a round table with Microsoft specialists, that’s very interesting to understand what can be done to take the performance of day-to-day operations better.

Springboard Series Virtual Roundtable: Windows Vista Performance





Microsoft Experience

18 04 2009

Bem, parece que estou começando a descobrir alguns outros projetos para aprendizado da Microsoft Brasil.

Hoje descobri o Microsoft Experience, que é similar aos programas Desenvolvedor 5 Estrelas (MSDN) [3] e Profissional 5 Estrelas (TechNet) [4], com conteúdo ministrado em vídeo por especialistas em várias tecnologias e provas a serem realizadas on-line. Os cursos disponíveis são os seguintes:

TechNet Experience:

  • Colaboração e Produtividade
  • Windows Vista
  • SQL / BI
  • Suporte Nível 1
  • Suporte Nível 2
  • Windows Server 2008
  • Segurança
  • InfraWeb

MSDN Experience

  • Office Development
  • SQL Server
  • Visual Studio Team System
  • Web Development

Já começei o meu curso de SQL Server hoje, e já passei na primeira prova. Acho que não vou ficar só nisso, e recomendo que vc faça o mesmo!

[1] TechNet Experience – http://technet.microsoft.com/pt-br/events/cc716281.aspx

[2] MSDN Experience – http://msdn.microsoft.com/pt-br/dd366110.aspx

[3] Desenvolvedor 5 Estrelas – http://www.mslatam.com/brasil/dce/

[4] Profissional 5 Estrelas – http://technet.microsoft.com/pt-br/events/tn.cincoestrelas.aspx





Powershell.com Videos

16 04 2009

PowerShell.com is promoting some videos ‘bout Windows PowerShell there are very interesting to see. Is a list of five videos (the fifth is in being built still) that shows the use of PowerShell into some environments that Microsoft had integrated with. Here’s the list:

  1. Getting To Know PowerShell;
  2. PowerShell for Active Directory;
  3. PowerShell for Exchange Server 2007;
  4. PowerShell for SQL Server 2008;
  5. PowerShell for Windows Servers & Clients.

Worth to see! [here to go]





Microsoft Faculty Connection

16 04 2009

Good news for the ones who search for good (and free) content ‘bout recent technology. Microsoft has released the Microsoft Faculty Connection [1] which works like a virtual Faculty, with videos and other resources ‘bout Microsoft Technologies, like SQL Server, Windows Server, Active Directory.

Not only technologies are there, but some software engineering topics, like the MSF [2](Microsoft Solutions Framework) and its connection with other processes and methodologies (CMMI [3] included).

All the videos are in portuguese, (all my students are screaming: Thank God, this is in portuguese!!! =D) and are very complete, coming from academic basics to the use of the technology in most of the cases.

Update: I’ve found today too the english version [4] of the site (but it doesn’t have the same content).

Enjoy!

===================================================

Boas notícias para os que buscam bons (e gratuitos) conteúdos sobre tecnologias recentes. A Microsoft lançou o Microsoft Faculty Connection [1], que funciona como uma faculdade virtual, com vídeos e outros recursos sobre tecnologias Microsoft, como o SQL Server, Windows Server, Active Directory.

Não só as tecnologias estão aí, mas alguns tópicos de engenharia de software, como a MSF [2] (Microsoft Solutions Framework) e sua conexão com outros processos e metodologias (CMMI [3] incluído).

Todos os vídeos são em Português, (todos os meus alunos estão gritando: Graças a Deus, isto é em Português! =D) e são muito completos, começando no mais básico visto de forma acadêmica, até a utilização da tecnologia na maioria dos casos.

Atualização: Encontrei hoje também a versão em inglês do site (mas ela não tem o mesmo conteúdo).

Aproveitem!!

 

[1] Microsoft Faculty Connection

[2] Microsoft Solutions Framework

[3] CMMI

[4] Microsoft Faculty Connection (English)





There’s a new Windows Server coming!

26 02 2009

Today (24/02/2009), Steve Ballmer had [1] [2] referenced about the new version of the Windows Server which is going to come, the Foundation Server. Let’s wait to see what comes next on these news!

Update (26/02/2009): Windows Server 2008 and Windows Vista Service Pack 2 is on the way to launch. On [3] the announcement was made. I hope I can write a post about the bug fixes made on SP2 later.

 

[1] http://blogs.technet.com/windowsserver/archive/2009/02/24/new-server-joining-the-windows-server-family.aspx

[2] http://blogs.zdnet.com/microsoft/?p=2131

[3] http://blogs.technet.com/windowsserver/archive/2009/02/25/announcing-the-release-candidate-of-windows-server-2008-and-windows-vista-service-pack-2-sp2.aspx





Sharepoint update

17 02 2009

This week I was assigned to Install MOSS (Microsoft Office SharePoint Services) 2007 over WSS (Windows SharePoint Services) 3.0.

The thing i’ve never thought it would be a trouble was the fact that my WSS was english and my MOSS was Portuguese. When I installed MOSS, over WSS, it all look like that was ok, but, when any item of a list went to be edited, the feature was broken. It repeated in all other sites, in all other lists.

To make it useful again, I’ve deactivated the Spell Checker Service. It’s a workaround, and doesn’t solve the problem. When a feature of MOSS 2007 is seen, the name is messy.

Solution: Install the Language Pack feature.

Update: The language pack really makes some critical features to work, but doesn’t solve all the problems. If you are going to create a new site part, you’ll see that the web part names are all messy. In a lack of a better solution, backup all the sites, uninstall SharePoint, install it again correctly, then restore again the sites. This really is gonna work.