Recently we had an issue with one of our farms, were adding a new content DB using stsadm –o addcontentdb threw the message:

 

Procedure or function ‘proc_SetDatabaseInformation’ expects parameter ‘@Value’, which was not supplied.

image

 

The database did get attached and we ignored the message. Later when performing basic site operations, like adding a site collection administrator etc we started getting ‘Exception from HRESULT: 0x80040E14’

 

clip_image002

 

When we check the stored procedures, they two were different from the DB’s which were previously attached to the web application.

We opened a case with Microsoft and found that:

 

Under the folder C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\SQL\ the below files were different across the farm:

  1. STORE.SQL
  2. STOREUP.SQL
  3. STOREUPDDL.SQL

 

We took a backup of these files and then replaced them with the files from other web front end servers which had new version.

 

image

 

After replacing these files with the latest version, we are now able to attach new content database without any issues.

In Test farms, operations like detaching databases are common. Central Administration giving a 404 page is a sign of content database being detached.

Even if the content db hosting central administration is detached, you would still be able to run stsadm commands. To verify the database attached to the central administration application use the below command

stsadm.exe -o enumcontentdbs –url <http://centraladminURL:port>

You can identify the content database by connecting through SQL Management studio – it will have a name like ‘Sharepoint_AdminContent_<GUID>’

In this scenario adding contentdb through stsadm -o addcontentdb will result in ‘Access Denied’ error.

This will happen even if you are using the service account and even if it is part of local administrator. The way to correct this is by using:

Stsadm -o updatefarmcredentials -userlogin <Domain\account> -password <password>

While this command will give a message like “The site http://<http://centraladminURL:port> could not be found in the Web application SPAdministrationWebApplication Parent=SPWebService Name=WSS_Administration”.

You will now be able to add the CA contentdb.

Sharepoint site in browser connects to the web front end server which retrieves content from the SQL server and returns it to the browser. Certain types of files can be cached on the WFE servers so that they need not be retrieved from the SQL Server every time. This has huge performance benefit especially in case large media files.

Blob caching also allows to specify caching related headers for HTTP response from the server, which can control the caching on the browser side. This setting too reduces the number of requests on the server and improves performance.

 

Implementation:

While the blob caching is disabled by default, a simple change in the web.config of any web application can turn on the blob cache.

 

<BlobCache location="E:\blobCache" path="\.( gif|jpg|jpeg|jpe|bmp|ico|png|css|js|asf|avi|flv|m4v|mov|mp3|mp4|mpeg|mpg|wmv)$" maxSize="10" enabled="true" max-age="14400" />

 

Here the maxSize is the size in GB, by default the extensions are fewer and the enabled is set to false. Max-age is the parameter which tells the browser to use the local cache of the browser for the specified seconds.

 

So in the above example where the max-age is set to 14400, it tells the browser to use its local cache of the image files for the next four hours, only then check for changes to the image. This is highly beneficial when roll over images are implemented and by default every change causes a 304 request. This is because without the default value of max-age is 0 when blobcache is disabled. With max-age set to zero browser checks with the server if the image has changed during every load of the image.

 

One word of caution – we have seen Blob cache to not work well with web applications have a huge number of site collections. This is because of the internal checks it has to make with every site collections which has cached images. I would not recommend to use blob caching for any web application housing more than 5000 site collections.

Below powershell script can be used to send email with file attachment, it can also be scheduled as discussed in my last post: Schedule execution of Powershell Script

 

$filename = “C:\Folder\File.log”
$smtpServer = “SMTPServer.Domain.COM”

$msg = new-object Net.Mail.MailMessage
$attach = new-object Net.Mail.Attachment($filename)
$smtp = new-object Net.Mail.SmtpClient($smtpServer)

$msg.From = “rajiv.dattani@onenote.us”
$msg.To.Add(“author@onenote.us”)
$msg.Subject = Get-Date -format d
$msg.Body = “Content of email”
$msg.Attachments.Add($attach)

$smtp.Send($msg)

Powershell script can be scheduled to run from a batch file by using the below command syntax

 

powershell -command "& {C:\Folder\Script.ps1 }"

 

i.e. this command can be saved as a “.bat” file and can be scheduled from Windows Scheduled Tasks

In Sharepoint 2007 when deleting subsites you may see an error message like below:

 

“Error deleting Web site "/sites/test". You can’t delete a site that has subsites.   at Microsoft.SharePoint.Library.SPRequestInternalClass.DeleteWeb(String bstrUrl)
   at Microsoft.SharePoint.Library.SPRequest.DeleteWeb(String bstrUrl)”

 

You will get the same error even by using the stsadm command deleteweb

“Error deleting Web site "/sites/ecftest/rajiv3/one". You can’t delete a site that has subsites”

 

The way to delete the such site is using the stsadm extensions which can be downloaded from link, then use the command

 

stsadm -o gl-deleteweb2 -url http://abc.domain.com/sites/test -recurse

Start Exceed:

clip_image002

On the server set:

export DISPLAY="172.30.246.205:0.0"

clip_image004

Where the IP Address is the IP address of the client machine where exceed is running.

Test by running the xclock, on Linux the location of xclock is in /usr/X11R6/bin.

Java Messaging Service is used for asynchronous messaging between applications. The Participants of communication are Producer – server – Consumer.

There are two types of messaging

  1. Point-to-Point
  2. Publisher subscriber

Point-to-Point is one to one messaging. The sender sends a message which is placed in a queue there are listeners listening on this queue. One messaged is picked only by one receiver.

In publisher subscriber model there are many publishers and many subscribers. Publishers publish their message which are sent to topics. several subscribers can listen on topics for messages.

Queues and topics are together called destinations and they reside within the server.

Persistance – It is the storing of messages in a file or database to ensure Guaranteed Message Delivery (GDM). Once the messages are stored in persistant stores they are marked as delivered to the publisher. Subscriber can then pick these messages up at any point of time. messages are considered delivered to publisher once acknowledgment is received from them.

A message is composed of

  1. Connection
  2. Session &
  3. Destination

A client looks up the JNDI for connection factory to obtain a connection. Connection is a link to JMS server. Session identifies the sender and reciver for the server. Queues and topics are the destinations.

Weblogic 10 Creation order I use: JMS Server, JMS Modules, Subdeployments, Queues, Topics, Connection Factory.

@REM Created by Rajiv Dattani
@REM The address to be checked can be provided as arguments to the scripts to be run from cluster machines. The script validates and prompts user if the address is not provided
@ECHO OFF

SET ARGNAME=%1

IF “%ARGNAME%”==”" (
GOTO :END
) ELSE (
java utils.MulticastTest -N ServerA -A “%ARGNAME%”
)
GOTO :OVER

:END

ECHO Please provide a address not used by any of the running clusters

:OVER

ECHO done

The “Test Pool” command on Weblogic Admin Console doesn’t always provide the correct “Connection Pool State”. Also we have faced issues where our servers themselves don’t come up when DB connectivity can’t be established. Under such circumstances when Database Connectivity requires to be tested, ‘utils.dbping’ command can be used.

    The prerequisite to run the command would be that the CLASSPATH should be set to /server/lib/Weblogic.jar & PATH should point to ‘java.exe’.

      The format is:

        java utils.dbping ORACLE_THIN username password HOST:PORT:DBNAME

        If the connection is established fine it returns a success


          Otherwise it throws the specific ORA / DB error code