![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a SQL Server 2000 cluster with Windows 2003 server. Periodically I run a job that deletes all of the files out of the P:\dallas_mrkt directory on the active node. This is active/passive cluster with two nodes. I would like to modify the job listed below so that it will test to see which server is the active node and delete the files from the P:\dallas_mrkrt\ directory. Thank You, DECLARE @BACKUPFILEPATH varchar(255) @BACKUPFILEPATH = 'del P:\dallas_mrkrt\' + '*.* /Q' exec master..xp_cmdshell @BACKUPFILEPATH |
#3
| |||
| |||
|
|
I have a SQL Server 2000 cluster with Windows 2003 server. Periodically I run a job that deletes all of the files out of the P:\dallas_mrkt directory on the active node. This is active/passive cluster with two nodes. I would like to modify the job listed below so that it will test to see which server is the active node and delete the files from the P:\dallas_mrkrt\ directory. Thank You, DECLARE @BACKUPFILEPATH varchar(255) @BACKUPFILEPATH = 'del P:\dallas_mrkrt\' + '*.* /Q' exec master..xp_cmdshell @BACKUPFILEPATH |
#4
| |||
| |||
|
|
select host_name() resolves to the cluster node. -- Hilary Cotter Looking for a SQL Server replication book? http://www.nwsu.com/0974973602.html Looking for a FAQ on Indexing Services/SQL FTS http://www.indexserverfaq.com "Joe K." <Joe K. (AT) discussions (DOT) microsoft.com> wrote in message news:FEB3A26A-9DA8-4DC0-9245-4EBFC5D0D4AB (AT) microsoft (DOT) com... I have a SQL Server 2000 cluster with Windows 2003 server. Periodically I run a job that deletes all of the files out of the P:\dallas_mrkt directory on the active node. This is active/passive cluster with two nodes. I would like to modify the job listed below so that it will test to see which server is the active node and delete the files from the P:\dallas_mrkrt\ directory. Thank You, DECLARE @BACKUPFILEPATH varchar(255) @BACKUPFILEPATH = 'del P:\dallas_mrkrt\' + '*.* /Q' exec master..xp_cmdshell @BACKUPFILEPATH |
#5
| |||
| |||
|
|
select host_name() resolves to the cluster node. -- Hilary Cotter Looking for a SQL Server replication book? http://www.nwsu.com/0974973602.html Looking for a FAQ on Indexing Services/SQL FTS http://www.indexserverfaq.com "Joe K." <Joe K. (AT) discussions (DOT) microsoft.com> wrote in message news:FEB3A26A-9DA8-4DC0-9245-4EBFC5D0D4AB (AT) microsoft (DOT) com... I have a SQL Server 2000 cluster with Windows 2003 server. Periodically I run a job that deletes all of the files out of the P:\dallas_mrkt directory on the active node. This is active/passive cluster with two nodes. I would like to modify the job listed below so that it will test to see which server is the active node and delete the files from the P:\dallas_mrkrt\ directory. Thank You, DECLARE @BACKUPFILEPATH varchar(255) @BACKUPFILEPATH = 'del P:\dallas_mrkrt\' + '*.* /Q' exec master..xp_cmdshell @BACKUPFILEPATH |
#6
| |||
| |||
|
|
Yeah, host_name() will return the workstation name from where it was run. One option would be to use the cluster.exe command line utility If I run the following command from the DOS prompt cluster clusterName res resourceName It returns Resource,Group,Node,Status Example: Say my cluster name is MyCluster and I want to know the node name for the resource SQLServer (Instance1) then the command will be cluster MyCluster res "SQL Server(Instance1)" The output will be Resource Group Node Status -------------------- -------------------- --------------- ------ SQL Server (Instance1) SQL1 NODE1 Online You can run the DOS command from Query Analyzer or stored proc using xp_cmdshell. See SQLServer Books Online for syntax. Best Regards, Uttam Parui Microsoft Corporation This posting is provided "AS IS" with no warranties, and confers no rights. Are you secure? For information about the Strategic Technology Protection Program and to order your FREE Security Tool Kit, please visit |
|
Microsoft highly recommends that users with Internet access update their Microsoft software to better protect against viruses and security |
|
http://www.microsoft.com/protect http://www.microsoft.com/security/guidance/default.mspx |
#7
| |||
| |||
|
#8
| |||
| |||
|
#9
| |||
| |||
|
|
Yeah, host_name() will return the workstation name from where it was run. One option would be to use the cluster.exe command line utility If I run the following command from the DOS prompt cluster clusterName res resourceName It returns Resource,Group,Node,Status Example: Say my cluster name is MyCluster and I want to know the node name for the resource SQLServer (Instance1) then the command will be cluster MyCluster res "SQL Server(Instance1)" The output will be Resource Group Node Status -------------------- -------------------- --------------- ------ SQL Server (Instance1) SQL1 NODE1 Online You can run the DOS command from Query Analyzer or stored proc using xp_cmdshell. See SQLServer Books Online for syntax. Best Regards, Uttam Parui Microsoft Corporation This posting is provided "AS IS" with no warranties, and confers no rights. Are you secure? For information about the Strategic Technology Protection Program and to order your FREE Security Tool Kit, please visit http://www.microsoft.com/security. Microsoft highly recommends that users with Internet access update their Microsoft software to better protect against viruses and security vulnerabilities. The easiest way to do this is to visit the following websites: http://www.microsoft.com/protect http://www.microsoft.com/security/guidance/default.mspx |
![]() |
| Thread Tools | |
| Display Modes | |
| |