viernes, 13 de diciembre de 2019

Inicio y Reinicio del agente del MS SQL Server

JOB control-m para;

1. Detectar el agente de MS SQL Server si esta abajo y subir el servicio.
2. Reiniciar el agente de MS SQL Server si esta arriba

Tipo de job: OS
Correr como command en 1 linea:

powershell.exe "if ((Get-Service -name SQLSERVERAGENT).Status -eq 'Stopped'){Start-Service SQLSERVERAGENT} if ((Get-Service -name SQLSERVERAGENT).Status -eq 'Running'){Restart-Service SQLSERVERAGENT}"

NOTA: Reemplazar SQLSERVERAGENT por el nombre del servicio de agente correcto
Fin

Job adicionales;
1. Listar servicios que contengan SQL y AGENT; powershell.exe "Get-Service | where-object {$_.name -like '*SQL*AGENT*'}"
2. Devolver el estado de un servicio; powershell.exe "Get-Service -name <NOMBRE_SERVICIO>"


www.axity.com



No hay comentarios.:

Publicar un comentario

Instalar MySQL en Linux Centos

sudo yum update yum install wget wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm sudo rpm -ivh mysql-community-rele...