Cisco CallManager Administration Guide, Release 4.0(1)
Removing a Subscriber Server from Cisco CallManager

Table Of Contents

Removing a Subscriber Server from Cisco CallManager

Remove SQL Replication Information

Run RemoveServerFromDB.bat Script on Publisher

Run RemoveSubscription.bat Script on Subscriber

Remove Redundant DCD Replication Agreements

Contents of the RemoveServerFromDB.bat Script File

Contents of the RemoveSubscription.bat Script File


Removing a Subscriber Server from Cisco CallManager


You delete a subscriber server from the Cisco CallManager cluster by using the Server Configuration window in Cisco CallManager Administration. This deletion, however, deletes the server from the Cisco CallManager Administration database, but not all of the server dependencies get deleted.

To fully delete a server from the system, you must perform the following steps:

1. Remove all dependencies from the server; for example, delete the Cisco CallManager service. See the "Deleting a Server" section.

2. Remove the server from Cisco CallManager Administration. See the "Deleting a Server" section.

3. Run a script file that removes the SQL replication information from the database. See the "Remove SQL Replication Information" section.

4. Run a script file that removes the DCD replication agreements from the publisher if Cisco CallManager cluster is integrated with local DCDirectory. See the "Remove Redundant DCD Replication Agreements" section.

Remove SQL Replication Information

After the server is removed by using Cisco CallManager Administration, run the script file to remove the SQL replication information. A script file exists for the publisher server and one for the subscriber server.

Run RemoveServerFromDB.bat Script on Publisher

Execute the RemoveServerFromDB.bat script file from the Cisco CallManager publisher server that you want to remove. This script runs from the command prompt from any directory.


Tip To view the procedure that runs the script, run the script with no parameters.


From any directory on the publisher server, enter the following command:

<path where you saved the script>:\RemoveServerFromDB "server" "database" "name_of_server_to_delete_from_ProcessNode.Name"

When this command gets run from the command prompt, errors display; no separate error log file gets generated.

To view the contents of the script file, see the "Contents of the RemoveServerFromDB.bat Script File" section.

Run RemoveSubscription.bat Script on Subscriber

Execute the RemoveSubscription.bat script file from the Cisco CallManager subscriber server that you want to remove. This script runs from the command prompt from any directory.


Tip To view the procedure that runs the script, run the script with no parameters.


From any directory on the subscriber server, enter the following command:

<path where you saved the script>:\RemoveSubscription "server" "database"

When this command runs from the command prompt, errors display; no separate error log file gets generated.

To view the contents of the script file, see the "Contents of the RemoveSubscription.bat Script File" section.

Remove Redundant DCD Replication Agreements

After the subscriber server is removed from the cluster, clean its DCD replication information from the publisher DCD by running the clean_publisher script. The script file only executes on the publisher server.

You can access the script on Cisco CallManager release 3.3 and above. It gets installed on the Cisco CallManager server during installation of Cisco Directory component.

From any directory on the publisher server, enter the following command:

c:Clean_publisher.cmd

The script file removes the replication agreements to all nonexistent subscribers from the publisher DCD. It does not delete or modify existing data.


Note If administrator removes the server without running the Clean_publisher.cmd script and then adds the server back with the same host name into the same cluster from where it was removed, the DCD script that is used to configure the subscriber DCD will clean up the previous DCD replication agreement from the publisher DCD database during the Directory installation of the Cisco CallManager installation on the server.


Contents of the RemoveServerFromDB.bat Script File

Example B-1 displays the contents of the script file that removes the SQL replication information from the publisher server.

Example B-1 Script File Contents

@echo off
@if "%3x" == "x" goto Usage
echo Install stored procedure in database %2
echo USE %2 temp.sql 
echo GO temp.sql
echo DROP PROCEDURE dblRemoveServerFromDB temp.sql
echo GO temp.sql
echo CREATE PROCEDURE [dblRemoveServerFromDB] temp.sql
echo (@servername NVARCHAR(50),@ispublisher NVARCHAR(50)) AS temp.sql
echo BEGIN TRANSACTION temp.sql
echo DECLARE @nodeid NVARCHAR(50), @deviceid NVARCHAR(50), @pnsid NVARCHAR(50) temp.sql
echo -- temp.sql
echo PRINT 'Get the Node ID' temp.sql
echo SELECT @nodeid=pkid from ProcessNode where name=@servername temp.sql
echo -- temp.sql
echo PRINT 'Delete associated Device and MediaMixer' temp.sql
echo WHILE (SELECT COUNT(*) FROM Device WHERE fkProcessNode=@nodeid) ^> 0 temp.sql
echo BEGIN temp.sql
echo     SELECT @deviceid=pkid from Device where fkProcessNode=@nodeid temp.sql
echo     PRINT 'Delete MediaMixer' temp.sql
echo     DELETE FROM MediaMixer WHERE fkDevice=@deviceid temp.sql
echo     PRINT 'Delete MOHServer' temp.sql
echo     DELETE FROM MOHServer WHERE fkDevice=@deviceid temp.sql
echo     PRINT 'Delete Device' temp.sql
echo     DELETE FROM Device WHERE pkid=@deviceid temp.sql
echo END temp.sql
echo -- temp.sql
echo PRINT 'Delete associated CallManager records' temp.sql
echo DELETE FROM CallManagerGroupMember FROM CallManagerGroupMember AS M temp.sql
echo   JOIN CallManager AS C ON C.pkid=M.fkCallManager WHERE C.fkProcessNode=@nodeid 
temp.sql
echo DELETE FROM CallManager WHERE fkProcessNode=@nodeid temp.sql
echo -- temp.sql
echo PRINT 'Delete associated ProcessConfig records' temp.sql
echo DELETE FROM ProcessConfig WHERE fkProcessNode=@nodeid temp.sql
echo -- temp.sql
echo PRINT 'Delete associated AlarmConfig records' temp.sql  
echo DELETE FROM AlarmConfig FROM AlarmConfig AS A JOIN ProcessNodeService temp.sql  
echo   AS S ON A.fkProcessNodeService=S.pkid WHERE S.fkProcessNode=@nodeid temp.sql  
echo PRINT 'Delete associated ProcessNodeService records' temp.sql
echo DELETE FROM ProcessNodeService WHERE fkProcessNode=@nodeid temp.sql
echo -- temp.sql
echo PRINT 'Delete associated ComponentVersion records' temp.sql
echo DELETE FROM ComponentVersion WHERE fkProcessNode=@nodeid temp.sql
echo -- temp.sql
echo PRINT 'Delete the node' temp.sql
echo DELETE FROM ProcessNode WHERE pkid=@nodeid temp.sql
echo -- temp.sql
echo COMMIT TRANSACTION temp.sql
echo GO temp.sql
echo -- Execute procedure on server %1                                                                                                                
echo exec dblRemoveServerFromDB '%3' temp.sql                           
osql -S %1 -d %2 -E -e -i temp.sql                                                                                             
del temp.sql                                                                                                                   
echo USE %2 temp1.sql 
echo sp_dropsubscription @publication = %2, @subscriber = '%3', @article='all' temp1.sql
echo GO temp1.sql
osql -S %1 -d %2 -E -e -i temp1.sql                                                       
del temp1.sql
goto endd                                                                                                                      
:Usage
@echo Usage:   RemoveServerFromDB "server" "database" 
"name_of_server_to_delete_from_ProcessNode.Name" 
@echo Example: RemoveServerFromDB . CCM0300 fred.cisco.com 
:endd

Contents of the RemoveSubscription.bat Script File

Example B-2 displays the contents of the script file that removes the SQL replication information from the subscriber server.

Example B-2 Script File Contents

@echo off
@if "%2x" == "x" goto Usage
echo Install stored procedure in database %2

echo sp_removedbreplication @dbname = %2 temp1.sql
echo GO temp1.sql
osql -S %1 -d %2 -E -e -i temp1.sql                                                       

del temp1.sql

goto endd                                                                                                                                         
:Usage
@echo Usage:   RemoveSubscription "server" "database" 
@echo Example: RemoveSubscription . CCM0300 
:endd