I need to setup an email alerts with Jobs errors ( with error logs is it possible ) on nightly basis.
example:
Job name : Full backup | Status : Error | error log : 'The job failed 12........'
Job name : Delta Backup| Status : Error | error log : 'The job failed 123........'
Job name : Cleanup DB | Status : Error | error log : 'The job failed 1234........'
I am trying to send out notifications when jobs complete (fail or succeed). I have database mail working fine on my DEV server, but I am having issues with it on my PROD server. I am currently having people look into if McAfee may be blocking it.
I am able to send out a test email from SSMS>Management>Database Mail, but when I set a Notification for a job, the job will complete and in the history, it will say "NOTE: Failed to notify 'User' via email."
I have created an Operator and set up Profiles and Accounts, just as I did on my DEV server.
when i open my computer and want to use SQL SERVER and when iam connecting it this error will occur "A network related or instance specific Error in SQL SERVER 2012" Then aim going to Services and Find SQLSERVER and start the services and it will connect..My Question is that why every time iam going to Start the services..I want to connect Automatically when i click on connect button in sql server its very rediculous to go evrytime in Services. i update my window 8.1 to windows 10 before it will connect automatically no need to go in services to start the SQLSERVER.
In the notifications tab of the job I have e-mail operator selected. Click on the box with the elipses to enter the email addresses. It will let me enter 2 email addresses in the e-mail name field. It looks like the field has a limited length...is there a way to manually enter several addresses?
I can't use the SQL Server Mail but I heard if I have an exchange server with SMTP I can still use SQL Server Stored Procs to send emails . can someone please explain or direct me to it
Hi, My name is Vinh, I am a new bee in SQL Server 2005. I am using template script (see below) from SQL Server to create account but when I am right click in database mail for testing email and I got the message, could not connect to mail server.
Below I am trying to use smtp to connect but I know in my company we are using Exchange Mail Server. will that make a lot different?
Please help me,
Thank you very much,
sp_configure 'database mail xps', 1 GO reconfigure GO
------------------------------------------------------------- -- Database Mail Simple Configuration Template. -- -- This template creates a Database Mail profile, an SMTP account and -- associates the account to the profile. -- The template does not grant access to the new profile for -- any database principals. Use msdb.dbo.sysmail_add_principalprofile -- to grant access to the new profile for users who are not -- members of sysadmin. -------------------------------------------------------------
-- Profile name. Replace with the name for your profile SET @profile_name = 'TestProfile';
-- Account information. Replace with the information for your account.
SET @account_name = 'vdang'; SET @SMTP_servername = 'smtp.cgdnow.com'; SET @email_address = 'vdang@cdgnow.com'; SET @display_name = 'Vinh, Dang';
-- Verify the specified account and profile do not already exist. IF EXISTS (SELECT * FROM msdb.dbo.sysmail_profile WHERE name = @profile_name) BEGIN RAISERROR('The specified Database Mail profile (<profile_name,sysname,SampleProfile>) already exists.', 16, 1); GOTO done; END;
IF EXISTS (SELECT * FROM msdb.dbo.sysmail_account WHERE name = @account_name ) BEGIN RAISERROR('The specified Database Mail account (<account_name,sysname,SampleAccount>) already exists.', 16, 1) ; GOTO done; END;
-- Start a transaction before adding the account and the profile BEGIN TRANSACTION ;
IF @rv<>0 BEGIN RAISERROR('Failed to create the specified Database Mail account (<account_name,sysname,SampleAccount>).', 16, 1) ; GOTO done; END
-- Add the profile EXECUTE @rv=msdb.dbo.sysmail_add_profile_sp @profile_name = @profile_name ;
IF @rv<>0 BEGIN RAISERROR('Failed to create the specified Database Mail profile (<profile_name,sysname,SampleProfile>).', 16, 1); ROLLBACK TRANSACTION; GOTO done; END;
-- Associate the account with the profile. EXECUTE @rv=msdb.dbo.sysmail_add_profileaccount_sp @profile_name = @profile_name, @account_name = @account_name, @sequence_number = 1 ;
IF @rv<>0 BEGIN RAISERROR('Failed to associate the speficied profile with the specified account (<account_name,sysname,SampleAccount>).', 16, 1) ; ROLLBACK TRANSACTION; GOTO done; END;
Hi, My name is Vinh, I am a new bee in SQL Server 2005. I am using template script (see below) from SQL Server to create account but when I am right click in database mail for testing email and I got the message, could not connect to mail server.
Below I am trying to use smtp to connect but I know in my company we are using Exchange Mail Server. will that make a lot different?
Please help me,
Thank you very much,
sp_configure 'database mail xps', 1 GO reconfigure GO
------------------------------------------------------------- -- Database Mail Simple Configuration Template. -- -- This template creates a Database Mail profile, an SMTP account and -- associates the account to the profile. -- The template does not grant access to the new profile for -- any database principals. Use msdb.dbo.sysmail_add_principalprofile -- to grant access to the new profile for users who are not -- members of sysadmin. -------------------------------------------------------------
-- Profile name. Replace with the name for your profile SET @profile_name = 'TestProfile';
-- Account information. Replace with the information for your account.
SET @account_name = 'vdang'; SET @SMTP_servername = 'smtp.cgdnow.com'; SET @email_address = 'vdang@cdgnow.com'; SET @display_name = 'Vinh, Dang';
-- Verify the specified account and profile do not already exist. IF EXISTS (SELECT * FROM msdb.dbo.sysmail_profile WHERE name = @profile_name) BEGIN RAISERROR('The specified Database Mail profile (<profile_name,sysname,SampleProfile>) already exists.', 16, 1); GOTO done; END;
IF EXISTS (SELECT * FROM msdb.dbo.sysmail_account WHERE name = @account_name ) BEGIN RAISERROR('The specified Database Mail account (<account_name,sysname,SampleAccount>) already exists.', 16, 1) ; GOTO done; END;
-- Start a transaction before adding the account and the profile BEGIN TRANSACTION ;
IF @rv<>0 BEGIN RAISERROR('Failed to create the specified Database Mail account (<account_name,sysname,SampleAccount>).', 16, 1) ; GOTO done; END
-- Add the profile EXECUTE @rv=msdb.dbo.sysmail_add_profile_sp @profile_name = @profile_name ;
IF @rv<>0 BEGIN RAISERROR('Failed to create the specified Database Mail profile (<profile_name,sysname,SampleProfile>).', 16, 1); ROLLBACK TRANSACTION; GOTO done; END;
-- Associate the account with the profile. EXECUTE @rv=msdb.dbo.sysmail_add_profileaccount_sp @profile_name = @profile_name, @account_name = @account_name, @sequence_number = 1 ;
IF @rv<>0 BEGIN RAISERROR('Failed to associate the speficied profile with the specified account (<account_name,sysname,SampleAccount>).', 16, 1) ; ROLLBACK TRANSACTION; GOTO done; END;
I have XP Pro SP2 with MDAC 2.8.1022. It had a problem so I tried to reinstall MDAC and got a Fatal Setup Error. This setup does not support installing on this operating system. I downloaded MDAC 2.8 1177 and get the same error.
I thought of uninstalling/reinstalling SP2, but this is a 2 month old Dell Latitude 610 with factory installed XP. There is no Windows Service Pack 2 option listed in the Control Panel > Add/Remove Programs.
There's some other strange things, so I wonder if they are related.
1) I have Paul set up as an administrator account. Some folders like MSSQL show that account with no permissions. I grant all the permissions to Paul for that folder. I come back later and the permissions are gone.
2) I deleted 20 files in Explorer, but 7 of them did not go away. I deleted those 7 again and they instatnly reappeared. I deleted those 7 again and then they finally went away.
3) I get a slow reaction time for things like Windows Explorer and opening and closing programs. This is suprising since it has 2 gig of RAM and 2.3 Gig processor. Could it be a memory handling problem that's causing OS problems. Probably, the memory didn't handle the OS installation well and the whole system is compromised now.
I'm trying to install SQL Server Management studio 2012 on my Windows 7 (x64) standalone laptop. When I click "New SQL stand-alone installation..." it runs a Setup Support Rules check and always fails "Setup Account Privileges". I've looked into the error and I keep getting that I need to change security rules but I don't have that option in window 7. How do I get around this without having to resort to a computer running Windows Server?
I have Visual Studio 2013 premium installed along with Localdb v11. I just want to connect and manage my database engine through SSMS when developing any application.
I have just started to use Integration Services Catalog with SQL Server Agent. After I deploy a new version of the project the any Server Agent job that uses any of dstx still uses the old one. How do I fix this?
As part of my backup routine, I have a SQL job for each DB which which is called "DB-NAME - Backup Job"
I need to put a script together to check that each database has a backup job associated to it.
select * From sys.sysdatabases where name not in ('msdb','model', 'master', 'Tempdb', 'DBA') order by name desc
select * from msdb.dbo.sysjobs order by name desc
I know all the details i need are in there, but i cant figure out the best way to tackle it. Do I need to do a cursor to go through each DB name, put it into a variable, then select the job name where name like '$variable%' ?
After observing brute force attacks on our VPS myhosting instance against the SA login, I change the SA login name. Now my two new backup jobs are failing. The agent service logs in as NT ServiceSQLSERVERAGENT. Nothing changed there (so far as I know and I'm the only one who should be on the VPS). The job owner was SA and after changing the SA account that was reflected in the SSMS gui; job owner 'newsaname'. I'm sure I can just rebuild the maintenance plans but I'd like to know what happened.
Also, I would like to learn more about the brute force attacks and how to determine what port they are comming in on. I see an IP address associated with them. Does that mean they are coming in on 1433 or 1434?
SQL 2012 Standard VPS Windows 2012 Server Standard
I need to have a process extract some data, export it to CSV and then send it as a plain (non-MIME) message, or as a single-part MIME message. Multi-part MIME messages can't be used.
This process will be called about 20 times daily with different subsets of data.
I am trying to transfer all jobs from one instance to another by using data tools. However, once i tried to make smo connection i am getting this error;
A network-related or instance-specific error occurred while establishing a connection to SQL Server.
In order to solve this issue i have tried these solutions;
1. SQL Server should be up and running. (OK) 2. Enable TCP/IP in SQL Server Configuration (OK) 3. Open Port in Windows Firewall (FW ACCEPTS ALL LOCAL PORTS) 4. Enable Remote Connection (CHECK OUT THE sp_configure SETTINGS, i even right-click instance then see from properties ) 5. Enable SQL Server Browser Service (sql server browser has been restarted) 6. Create exception of sqlbrowser.exe in Firewall (FW ACCEPTS ALL PROGRAMS) 7. I tried windows and sql authentication which has sysadmin role 8. INSTANCE name is also chekced millions of times
I have a really odd one here. We have a production server which is running SQL 2000 Enterprise Edition SP3. It has a number of databases which are backed up nightly. Last night all of the back-up jobs failed with the following error: -
Msg 913, Sev 16: Could not find database ID ##. Database may not be activated yet or may be in transition. [SQLSTATE 42000]
The databases are in good shape - no issues to report. When I run the Agent Job code within a Query Analyser session it works fine.
When I try and re-start the back-up from the Agent Job it continues to fail with the same error.
I have to create a SQL job which will run around 50 queries and email results when the query gets some results.These are like quality checks which run to check errors in the system so if any query(out of 50 queries) returns some results an email with the details will be sent .So if 5 queries return results 5 emails with the details will be sent .
I think of something like A table which has one column as the query .What will be the best way of handling such a scenario , may be need an SSIS package with steps ?
I want to send an email two ice a day, from database. So I have planned to make a storedproce which will be called by a job (which will select some record from one table and put it in other table based on a flag) but I want to run it in a transaction so that if email is send successfully then only it should commit else it should rollback.
How can i find that "Mail queued" now i should commit.
In one of my environments, I need to grant the ability to view all the logins and agent jobs to an account, but I don't want to give him "sysadmin" or "securityadmin".
Lets say for example I have a table named Drier_Lot_Recipients with columns grower_id int, crop_year int, and email_address varchar(100). This table contains users that would like to receive an SSRS report I created on daily basis.
I created the SSRS report and it is deployed on a reporting services server. The name of the report is Drier_Lot_Report.rdl.
I am not sure what would be the best way to go about this. Should I do it all in SSIS or a stored procedure in SQL Server?OR maybe a combination of both.
Do I need to have calls made to the RS.EXE utility? Do I need to setup database mail in SQL Server?We have two SMTP servers.
So the end solution must call the Drier_Lot_Report and pass in two parameters (Grower_id and Crop_Year). The output must be PDF and either have the grower_id included in the output filename OR generic filename
We have (running SQL 2012 Std) and have enabled trace flag 1204 and 1222 for capturing deadlock through extended events. I have enabled deadlock notification through email .But it only send deadlock event occurred notification from the sql server error log . I was wondering if its possible to email the deadlock details they get generated in extended events via DB mail.
I'm setting up my first pair of Sql 2012 servers using AlwaysOn. I set up backups to run on the primary and I understand that you can set up backups to run on both the primary and secondary servers but the secondary will fail. Is there a way I can stop the secondary server from sending out error messages about failed backups? Is it possible to script it so that the server looks at whether it's primary or secondary and turns on or off alerts based on that?
Working with a brand new environment. During install (both SQL 2012 and 2014) on any one of four servers, they all fail on the service accounts page with a "RPC server is unavailable" error and "The SQL Server service account login or password is not valid."
I've verified that RPC server is unavailable is related to only the agent, and the account invalid is only for the engine. Verified this by trying each one separately and putting the other back to default. For the latter (account login or password is not valid), that's definitely not accurate being that I can use that account & password successfully elsewhere.
The best article I've found so far is here - [URL] .....
I've verified all 5 are in place and changed the group policy. Still errors out every time. Even if I can fix the RPC issue, not sure what's wrong with the engine account? I think both issues still stem back to the RPC, even though the engine doesn't report it in the setup. In the detail log, I'm assuming "Slp: Sco.User.OpenRoot - root DirectoryEntry object already opened for this computer for this object" is the core of my problem.
Here's a full output of a failed run:
(08) 2015-04-27 18:28:19 Slp: Sco: Attempting to determine if the password is required for account 'MyDomainsvcSQLEngine' (08) 2015-04-27 18:28:19 Slp: Sco: Attempting to determine if the account 'MyDomainsvcSQLEngine' is Virtual Account (08) 2015-04-27 18:28:19 Slp: Sco: Attempting to get account sid for user account MyDomainsvcSQLEngine (08) 2015-04-27 18:28:19 Slp: Sco: Attempting to get sid for user account MyDomainsvcSQLEngine
We have an existing SQL Server 2012 Enterprise cluster with 2 nodes (active-active) and uses Windows 2008 R2 OS. We are looking for a way to increase HA as well as offload backups to secondary server and it was suggested that AlwayOn could be an option.
The questions I have are:
1) Is it possible to turn on AalwaysOn feature on an existing cluster?
2) If yes to above, does the secondary replica need to exist as a node on the same cluster or can it be on a completely different cluster?
3) If the secondary replica is on the same cluster (i.e. we add a 3rd node to existing 2 node cluster), can that node be provisioned with storage from a completely different SAN? (i.e. Node 1 and Node 2 accesses LUNs on SAN1 and Node 3 accesses LUNs on SAN2).