Tuesday, October 2, 2012

User Profile Synchronization Service Stuck at "Starting"

Hi All,
              These days while working on "Enterprise Search" .I faced an error and when I went to User Profile Synchronization Service  which is in(Central admin->Application Management->Service Application->Manage Services on Server) it is in "Starting mode" . I binged in for this solution and many url's suggested to create new user profile and blah blah blah . Then I had a look on my Timer service and it too is fine, And  I remembered a time in the past where deploying updates jacked up the Timer service, making it appear as it was running when it really wasn't. I opened Powershell

1.$farm=Get-SPFarm
2.$farm.TimerService.Instances
After running second line I go ID of Timer Server and used it in below command
1.$timer=$farm.TimerService.Instances | where {$_.ID -like "4824-2425-2132-2442*"} 
2.$timer.Status = [Microsoft.SharePoint.Administration.SPObjectStatus]::Online
3.$timer.update()
  When I look back Manage Services on Server  which is in(Central admin->Application Management->Service Application->Manage Services on Server) it is in "Start" Mode.

 

Tuesday, August 28, 2012

Sql query to Restore Database

Hi All,
          These days i had come to a situation where i need  to restore large amount of DB .When I try restore Sql Sever GUI it is taking long time.Then with the help of below restore query it had almost saved lot if time


Restore DATABASE WSS_Content_ecdb178dc5434f4299f516abc83e48ed  From Disk = 'D:\sqldb.bak' With REPLACE
Go

Monday, July 2, 2012

SharePoint 2010 - HTTP Error 503 Service Unavailable

Hi All,
          503 errors are usually due to a temporary overloading or maintenance of the server.

 Check the application pool. If it is disabled it caused due to crashes a couple of times You need to manually re-enable the application pool in IIS Manager - that should resolves the problem.

Sunday, July 1, 2012

Sql Procedure to Migrate Sql Database to higer version

Respected All,
               -> I have work to Migrate Sql server 2000 data base to Sql Server 2008 r2 .I had taken  backup of Sql Database from Sql Server 2000 and  restored  the backup  Database into Sql Server 2008 R2.

            ->After restoring i had used Count(*) query in Sql Server 2000 to find the total number of records in the table "Department" and it showed me total number of records in table "Department" as 96.

           ->I used same Count(*) query to find  total number of records in the table "Department" in Sql Server 2008 R2  and it showed me total number of records in table "Department" as 82 .

          ->Like this in all tables I am loosing records and in some tables it shows more records in Sql Server 2008 R2 when compared to Sql Server 2000. I had done R&D but i don't find any solution to i.e Suddenly i  had used  the below procedure in Sql Server 2008 r2 after restoring  and it executed and solved the problem .



   Syntax: 
             
USE DatabaseName;
GO
DBCC UPDATEUSAGE (DatabaseName)
GO

     example                       
USE DBC;
GO
DBCC UPDATEUSAGE (DBC)
GO

Thursday, June 21, 2012

Sql Query to Take DB into offline

HI All,
         -> One of my friend told me i.e after  Moving Content t'Db  of SP 2007 to SP 2010 environment  he is getting error, when restoring Sql back up file of SP 2003 to SP 2010 sql  .
        ->I connected to his PC and seen the way he restores the backup file and i find him doing in right way.I goggled for i.e solution ,And finally I came to knew i.e before moving the content DB of SP 2003 we need to but the SP 2003 content db  into Offline mode ,But he doesn't have permissions to take backup
     ->When he tries to but the DB in offile line it shows error as "Don't have admin permission" I used the
below  query  and it it kept the DB in offline

           Syntax
                     alter database database-name  set offline with rollback immediate
         example
          alter database WSS_Content_18c0de26c5a14be08d9bc142c288c976 set offline with rollback immediate

Thursday, June 14, 2012

Print Grid View

Hi All,
         Few of my Blog Members asked me code related to Print Grid-view 



step 1:  Create  html button

<input type="button" value="Print " id="bbtnPrint" runat="Server" onclick="javascript:CallPrint('name')"  visible="false"/>

Step 2: in the div tag use  grid-view

<div id=”name”>
   <table>

   </table>
</div>

step 3:Function Call

<script type="text/javascript">
    function CallPrint(strid)
            {
          var prtContent = document.getElementById(strid);
        var WinPrint = window.open('', '', 'letf=0,top=0,width=600,height=500,toolbar=0,scrollbars=0,status=0');
        WinPrint.document.write(prtContent.innerHTML);
        WinPrint.document.close();
        WinPrint.focus();
        WinPrint.print();
        WinPrint.close();
    }

</script>

Tuesday, June 12, 2012

New Web Application in Disable mode

Hi All,
One of my friend works on SP 2010,He has come ac-crossed to a situation where the option of new web application in central admin is in disable mode.Actually if we open I.E in Admin Mode it should be in enable ,But it is still in disable mode.Then I came to knew i.e during the installation he hadn't allotted Admin Permissions.The I came knew i.e lo-gin person doesn't have permissions to create web Application.
Solution