Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

SPWebApplication.Status can be Ready or Offline.

Pleae note - This is SPWebApplication.Status, NOT content database

How can you set this via Central Admin and/or command line?

What effect does this have?

What reasons would you have to set this to Offline?

What operations could cause this to be set (e.g. CU not completing correctly)?

share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted

*SPWebApplication.Status is of enum type SPObjectStatus, hence it can take on the following enum values: Online, Disabled, Offline, Unprovisioning, Provisioning & Upgrading. As an example, I have tested some of the *SPWA.S values using SharePoint Manager (which showed all 6 enum values) and with PowerShell code (snippets shown below).

Some findings:

Setting the availbility values of the *Content Databases does not imply a change in the *SPWA.S value but there is a correlation between the *SPWA.S and the CDBs when the *SPWA.S is Online, Disabled & Offline. For e.g., in the 'Offline' case, new sites cannot be created in the **CDBs but old sites can be accessed.

To summarize, the *SPWA.S values show the various states of the SP Web App and is explained by the enum values of SPObjectStatus - perhaps, interim (temp) values when it is doing a longer task (Upgrading/Provisioning, etc). An example - like in Unprovisioning, the Admin leaves *SPWA.S in a disabled state, when the unprovisioning job has not completed yet & this may have little or nothing to do with CDBs. See SPObjectStatus for other enum values' descriptions (including Online/Offline/Disabled for *CDBs-related values). A related point is that a SPWebApp may have multiple CDBs and unavailability of one CDB would not mean the unavailability of the SPWebApp itself.

#some Posh code used to test out some SPWebApp Status values
    Get-SPWebApplication http://fooURL | select name, status
    Get-SPWebApplication http://fooURL  | ForEach {$_.ContentDatabases} | Select Name, Status
    Get-SPWebApplication http://fooURL  | ForEach {$_.ContentDatabases} | Set-SPContentDatabase –Status 0 or 1

    $setw = Get-SPWebApplication -Identity http://fooURL  
    $setw.set_Status('Online')
    $setw.Update()
share|improve this answer
add comment

UPDATED

The SPWebApplication.Status object is a property of type SPObjectStatus. Check the detailed info for SPObjectStatus in msdn. SPObjectStatus normally shows status of any SharePoint service and its possible values are Disabled, Offline, Online, Provisioning, Unprovisioning and Upgrading.

AFAIK, SPWebApplication.Status displays the database status whether offline or Ready.

When the database status is set to Readyin Central Admin, the database is available for hosting new Site Collections and when the database status is set to Offline, no new Site Collections can be created. The Online and Disabled values correspond respectively to the Ready and Offline values that can be selected through the Database status box on the Manage Content Database Settings page in SharePoint Central Administration.

share|improve this answer
    
This is NOT for the content database - its SPWebApplication.Status. –  Ryan Apr 24 '12 at 12:32
    
@Deepu - are you saying that the SPWebApplication.Status changes as per the Web App's associated content db availability? –  Supriyo SB Chatterjee Apr 24 '12 at 16:15
    
@Ryan - I think you have misunderstood. The SPWebApplication.Status object is a property of type SPObjectStatus, which normally shows status of any SharePoint service(Refer the link provided above). Then I have explained how SPWebApplication.Status changes, based on the content database availability. The status reflects the availability of the content db for the web application. Please clarify if there is any confusion. –  Deepu Nair Apr 25 '12 at 4:47
    
@sbc111 - Yes, that's what I've mentioned. –  Deepu Nair Apr 25 '12 at 4:47
    
Erm - "Then I have explained how SPWebApplication.Status changes, based on the content database availability. " I don't see that. In my testing setting content db's status isn't reflected in SPWebApplication.Status - are you sure about that - do you have any ref's? –  Ryan Apr 25 '12 at 9:38
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.