Export (0) Print
Expand All

nscontrol repair Command

SQL Server 2005

Updated: 5 December 2005

Updates the metadata information for the specified instance of SQL Server 2005 Notification Services.


nscontrol repair 
    [-nologo]
    [-help]
        -name instanceName
        -database instanceDatabaseName
        -schema instanceSchemaName
    [-server databaseServer]
    [-sqlusername sqlUserName -sqlpassword sqlPassword]

-nologo

Suppresses the product and version statement that appears when you run an nscontrol command.

-help

Displays the command syntax.

-name instanceName

Specifies the name of the instance of Notification Services for which the metadata information needs to be repaired.

-database instanceDatabaseName

Specifies the name of the database that contains the Notification Services instance data. Notification Services will examine the specified database to construct the metadata for the instance of Notification Services.

If you specified a database name in the instance configuration, use that database name. Otherwise, use the default instance database name, which is a concatenation of instanceName and applicationName, such as FlightInstanceFlight.

-schema instanceSchemaName

Specifies the name of the schema for the instance metadata. If you specified a schema name in the instance configuration, use the specified schema name. Otherwise, use the default schema of dbo.

-server databaseServer

Specifies the name of the server that hosts the instance and application databases. Provide this argument only if the instance is not registered on the local computer. If the instance is registered and you provide the -server argument, the registry values for the instance are ignored.

If you are using a named instance of SQL Server to host the instance database, specify the server name and the instance name using the format servername\instancename.

-sqlusername sqlUserName

Specifies the SQL Server logon ID used to connect to SQL Server.

ms162780.note(en-US,SQL.90).gifImportant:
When possible, use Windows Authentication.

If you are using SQL Server Authentication to connect to SQL Server, specify a login using this argument. Also specify a password using the -sqlpassword argument.

If you are using Windows Authentication do not specify the -sqlusername and -sqlpassword arguments.

-sqlpassword sqlPassword

Specifies the password that is associated with the -sqlusername login. This argument must be used together with the -sqlusername argument.

When you create an instance of Notification Services, information about the instance is recorded in internal tables stored in the msdb database. A public view called msdb.NS90.NSInstances is provided over this table. It can be used to discover instances on the server.

If you attach a database that contains instance or application data to a server, such as when you rebuild a server or move an instance of Notification Services, the metadata stored in msdb does not contain information about the instance. As a result, certain functions of SQL Server Management Studio, the nscontrol command-prompt utility, and Notification Services Management Objects (NMO) might not work as expected.

Use the nscontrol repair command to repair this information for an instance of Notification Services.

Members of the db_owner database role and the sysadmin and dbcreator fixed server roles can run nscontrol repair.

The account also must also have permission to execute the Notification Services binary files; this permission is granted to members of the Administrators and SQLServerNotificationServicesUser Windows groups.

If you are not using the –server argument, the account that you use to run nscontrol repair must be able to read the registry.

The following examples illustrate how to repair the information for an instance of Notification Services in the msdb database.

A. Default Database and Schema Names

The default database name for an instance of Notification Services is the instance name plus "NSMain", and the default schema is dbo. This example shows how to repair instance information for the StockInstance instance. This instance is contained in the dbo schema of the StockInstanceNSMain database.

nscontrol repair -name StockInstance -database StockInstanceNSMain 
    -schema dbo

B. Named Database and Schema

When you configure an instance of Notification Services, you can specify a database and schema for instance information. This example shows how to repair instance information for the StockInstance instance of Notification Services. This instance is contained in the stock schema of the StockDB database.

nscontrol repair -name StockInstance -database StockDB 
    -schema stock

C. Unregistered Instance

If you run the nscontrol repair command on a server where the StockInstance instance is not registered, you must provide the name of the database server using the -server argument. This example shows how to repair instance information for an instance that is in the stock schema of the StockDB database on the nsuetest server.

nscontrol repair -name StockInstance -database StockDB 
    -schema stock -server nsuetest

D. SQL Server Authentication

This example shows how to repair instance information when you must connect to the Database Engine using SQL Server Authentication.

nscontrol repair -name StockInstance -database StockDB 
    -schema stock -sqlusername SqlUser -sqlpassword sQl-P@sWd

Release History

5 December 2005

New content:
  • Added information about the SQLServerNotificationServicesUser Windows group.

Community Additions

ADD
Show:
© 2014 Microsoft