How to shrink DB log files

Execute the SQL script below to shrink the log files of your database to save some disk space

 

USE [DB Name];
GO
— Truncate the log by changing the database recovery model to SIMPLE.
ALTER DATABASE [DB Name]
SET RECOVERY SIMPLE;
GO
— Shrink the truncated log file to 1 MB.
DBCC SHRINKFILE(‘DB Name_log’, 1)
DBCC SHRINKFILE(1, 1)
DBCC SHRINKFILE(2, 1)  — if there is a second ldf file
DBCC SHRINKFILE(3, 1) — if there is a third ldf file, and so on …..
GO
— Reset the database recovery model.
ALTER DATABASE [DB Name]
SET RECOVERY FULL;
GO

, ,

Leave a comment

Central administration service not available

 

 

to solve this problem:

  1. goto iis manager.
  2. goto Application Pool
  3. then choose Central Administration v4(it is stopped)
  4. from application Pool Tasks on right toolbar select start

 

 

Leave a comment

[SharePoint 2010] Add an item to site actions menu

<Elements xmlns=”http://schemas.microsoft.com/sharepoint/“>
  <CustomAction Id=”SiteActionsToolbar” GroupId=”SiteActions”
                Location=”Microsoft.SharePoint.StandardMenu”
                Sequence=”1000″
                Title=”Action title”
                ImageUrl=”Action image url”
                Description=”Action description”>
    <UrlAction Url=”Action here [url, javascript]”/>
  </CustomAction>
</Elements>

, ,

Leave a comment