Tag Archives: SQL

Set multiple SQL databases Recovery MODE to Simple

It is always handy to have an automated script to perform task for you. Manual click vis SSMS could be tedious and prone to error.

I came out with a simple SQL which allow me to set recovery mode of all database in one instance to Simple or Full.

GO
DECLARE @name varchar(255),@sql varchar (500)
DECLARE databases CURSOR FOR
SELECT name FROM sys.databases where name not in (‘master’,’tempdb’,’model’,’msdb’)

OPEN databases

— Perform the first fetch.
FETCH NEXT FROM databases
INTO @name
— Check @@FETCH_STATUS to see if there are any more rows to fetch.
WHILE @@FETCH_STATUS = 0
BEGIN
— This is executed as long as the previous fetch succeeds.
SET @sql =
‘USE [‘+@name+’];
ALTER DATABASE [‘+ @name + ‘] SET RECOVERY SIMPLE;’
+ ‘DBCC SHRINKFILE([‘+@name+’_log], 1)’
print @sql
exec(@sql)
FETCH NEXT FROM databases
INTO @name
END

CLOSE databases
DEALLOCATE databases
GO

 

Note that if you are doing Log Shipping, you need to use FULL recovery mode or Bulk-logged

SharePoint 2013 – System Requirements

Hardware Requirement

Web and App server or Single Server Farm.

Processor: 64 bit, 4 cores
Ram: 8 GB for production use. 4 GB for developer or evaluation use (same as SharePoint 2010 =))
Hard Disk: 80 GB free for system drive. Maintain 2x free space as available RAM.

Database Server

Processor: 64 bit, 4 cores for Small deployments. 8 cores for Medium deployment
Ram: 8 GB for Small, 16 GB for Medium
Hard Disk: 80 GB. But this depends on how your environment.

Software Requirement

Web and App server

64 bit editionĀ of Windows Server 2008 R2 Service Pack 1 (SP1) Standard, Enterprise, Data Center or Web Server

.NET Framework version 4.0

Database Server

64 bit edition of Microsoft SQL Server 2008 R2 Service Pack 1
64 bit edition of Windows Server 2008 R2 Service Pack 1 (SP1) Standard, Enterprise, Data Center or Web Server

2005 SQL Server, 2008 SQL Server is not supported!!!

Windows 2008 is also Not SUPPORTED!!!

If you wish to go SQL Server 2012, use RTM version.

Browser Compatibility

As usual, Google Chrome, FireFOX and others are supported WITH LIMITATION. (not clear)

IE 7 is not tested. IE8 IE9 in 32 Bits is good to go

Using Powershell to make MS SQL query

Making SQL query is pretty simple, hope the following give you a quickest way to get sql data without using SQL Management Tool. (Note: Windows 7 does come with Powershell 2.0, Hurray!)


$sql = New-Object System.Data.SqlClient.SqlConnection
$sql.ConnectionString = "Server=localhostsqlexpress;Integrated Security=true;"
$sql.Open()
$cmd = $sql.CreateCommand()
#Here is where you insert your own sql query
$cmd.CommandText = "exec sp_databases"
$cmd.ExecuteScalar()