Sql Server Sad Agent

Sql server hepimizin bildigi Microsoft tarafindan gelistirilen veritabani yonetim sistemidir.

Sad Agent

Sql serverda birden fazla ozellik vardir bunlardan biri olan Sql Agent bugun onu inceleyecegiz. Sql Agent veritabani yonetimi ile ilgili zamanlanmis islemleri otomatize eden bir aractir.

Microsoft.SqlAutoAdmin.SqlAutoAdmin

Sql Agent islemlerini yapan dll Microsoft.SqlAutoAdmin.SqlAutoAdmin.dll bu dll smartbackup,jobs vs ozellikleri barindiran dll.

LoadTaskAgentAssembly

SmartAdminManager’de bulunan LoadTaskAgentAssembly metoduna bakalim.

private Assembly LoadTaskAgentAssembly(SmartAdminManager.TaskAgentDescriptor taskAgentDescriptor)
		{
			Assembly assembly = null;
			string text = taskAgentDescriptor.binaryName;
			if (!string.IsNullOrEmpty(taskAgentDescriptor.binaryPath))
			{
				text = taskAgentDescriptor.binaryPath + "\\" + text;
			}
			try
			{
				this.DebugLog("SmartAdminManager: Trying to load task assembly from " + text + "\n");
				assembly = Assembly.LoadFrom(text);
			}
			catch (FileNotFoundException)
			{
				this.DebugLog("SmartAdminManager: Assembly not found at " + text + "\n");
			}
			if (null == assembly)
			{
				FileInfo fileInfo = new FileInfo(Assembly.GetExecutingAssembly().Location);
				text = fileInfo.DirectoryName + "\\" + taskAgentDescriptor.binaryName;
				try
				{
					this.DebugLog("SmartAdminManager: Trying again to load task assembly from " + text + "\n");
					assembly = Assembly.LoadFrom(text);
				}
				catch (FileNotFoundException)
				{
					this.DebugLog("SmartAdminManager: Assembly not found at " + text + "\n");
				}
				if (null != assembly)
				{
					taskAgentDescriptor.binaryPath = fileInfo.DirectoryName;
					this.UpdateTaskAgentPath(taskAgentDescriptor);
				}
			}
			return assembly;
		}

Burada kodu incelemeye baslamadan once dikkat etmemiz gereken TaskAgentDescriptor nested struct var onda da bakalim.