SQL Server crash - sql-server

I had SQL Server 2016 in one of our servers, then I decided to install SSIS AND SSAS for Bi purpose, and I tried to install these two services (SSAS AND SSRS) in another instance.
After installing the second Instance, I noticed that: I can't connect to the first instance SQL databases (It has been somehow replaced by the second instance).
I get this message when I connect to database:
I get this message while restarting the service:
In SQL Server configuration manager there no service for the first Instance:
That's the last records in my SQL log file:
2020-08-23 14:46:11.87 Backup RESTORE DATABASE successfully processed 96898 pages in 21.859 seconds (34.631 MB/sec).
2020-08-23 17:35:02.25 Server SQL Server is terminating because of a system shutdown. This is an informational message only. No user action is required.
2020-08-23 17:35:02.32 spid12s Always On: The availability replica manager is going offline because SQL Server is shutting down. This is an informational message only. No user action is required.
2020-08-23 17:35:02.53 spid40s Service Broker manager has shut down.
2020-08-23 17:35:02.53 spid40s Error: 17054, Severity: 16, State: 1.
2020-08-23 17:35:02.53 spid40s The current event was not reported to the operating system error log. Operating system error = (null). You may need to clear the operating system error log if it is full.
2020-08-23 17:35:02.53 spid12s .NET Framework runtime has been stopped.
2020-08-23 17:35:09.04 spid12s [INFO] Database ID: [18]. Cleaning up StorageArray. LastClosedCheckpointEndTs: '55'
Questions:
How can I get back to my previous state of SQL Server (the mdf and ldf files exist in their location but I can't find masterdb files)?
Is there a way to restore users and SQL jobs?

Related

Setting Up Multi-Server Administration---SQL Server Account

I am trying to set up Multi Server Administration so that I can easily update multiple instances of the same database across our network with ease. Where I am getting lost is how to set up the SQL SERVER AGENT service on the target machines.
Right now the SQL SERVER AGENT services on the machines are set to log on as NTSERVICE\SQL SERVER AGENT.
My SQL Server Agent process is set to log in as LocalSystem
My overall goal here is to figure out why I can't set any target servers from my machine, as I always run into the following error:
TITLE: Microsoft.SqlServer.Smo
------------------------------
MSX enlist failed for JobServer 'MYPC'.
For help, click: https://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=15.0.18206.0+((SSMS_Rel).191029-2112)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=MSX+enlist+JobServer&LinkId=20476
------------------------------
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
The enlist operation failed (reason: SQLServerAgent Error: Unable to connect to MSX 'MYPC'.) (Microsoft SQL Server, Error: 22026)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=14.00.2027&EvtSrc=MSSQLServer&EvtID=22026&LinkId=20476
------------------------------
BUTTONS:
OK
------------------------------
When looking at the log on my machine I see the following error when trying to enlist the target machine:
Login failed. The login is from an untrusted domain and cannot be used with Integrated authentication.
I'm not clear on the service accounts you have configured. At one point you state that it uses NTSERVICE\SQL SERVER AGENT but then you state "set to log in as LocalSystem "
From the Docs page , When the SQL Server Agent service is run under the Local System account, master server-target server operations are supported only if both the master server and the target server reside on the same computer.
You mention that this is across a network, therefore you should be using Domain Accounts for your SQL Agent service
LocalSystem has far too many permissions to be a secure choice - especially with a MultiServer configuration where a single server compromise may open all your servers. Whenever a local or virtual account is used then the network communications occur as the Computer Domain Account - e.g. if my server was named s1 in the MyDomain then the computer account would be MyDomain\S1$
I recommend that you configure SQL Agent to use a dedicated domain account, following the guide for permissions here. Additionally, to use multiserver job processing, the SQL Server Agent service account must be a member of the msdb database role TargetServersRole on the master server. The Master Server Wizard automatically adds the service account to this role as part of the enlistment process.

Error in Restoring backup to secondary database using log shipping

I'm trying log shipping between two SQL VMs. The backup is getting generated properly but its not getting restore on secondary database. The error says that the restore job is not able to open the .bak file of the database.
Below are the error details:
TITLE: Microsoft SQL Server Management Studio
------------------------------
SQL Server Management Studio restore database 'TestDB1'
------------------------------
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (SqlManagerUI)
------------------------------
Cannot open backup device '\\vm-p\NetworksharepathTlogs\TestDB1.bak'. Operating system error 5(Access is denied.).
RESTORE FILELIST is terminating abnormally. (Microsoft SQL Server, Error: 3201)
There were 3 sections when configuring log shipping so the first step that was primary backup setting was successful. And backup got generated in the folder. I have given full control to the users involves read, write ,etc. But still my log shipping is failing coz of this error.
In second step of log shipping two actions were performed one was restoring database to secondary server and other is saving secondary destination configuration . So I separately run the jobs and found that restoring database to secondary is causing an issue. This error is thrown on that step failure.
Please help me to solve this issue.
Thanks in advance.

SQL Mirroring. Error while configuring SQL Server -The remote copy of database "Mirroring" does not exist

While configuration SQL server mirroring I got below error.
I started SQL Server and Analysis services with same account on both servers. SQL server Agent service also started in both servers but reporting service was not installed in Principal server,will this conflict?
Firewall also stopped.
Error:
An error occurred while starting mirroring.
ADDITIONAL INFORMATION:
Alter failed for Database 'Data Base'
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
The remote copy of database "Data Base" does not exist. Check the database name and reissue the command. (Microsoft SQL Server, Error: 1448)
Following steps was used by me for Mirroring:
Full and Transaction Log backup of Mirror DB have been taken from principal server.
Copied into Mirror server and Restored successfully with No Recovery option
Starting Mirroring into the Principal server
Rightclick the DB--> click on Tasks--> click on Mirror--> Click on Config Security buttion--> Next... after creation of Endpoint finally click on start Mirroring. Here it's throwing error.

SQL server 2014 fails on start attempt, Error 17054

The error I'm running into first occurred when I tried to connect to my SQl server database in Toad for SQl Server. The error message stated The System cannot find the file specified.
I opened SQL Server configuration manager and the SQL Server was stopped. I tried to start it but it failed. Here is the error in the log:
2016-07-07 08:52:09.01 Server SQL Server is terminating because of a system shutdown. This is an informational message only. No user action is required
2016-07-07 08:52:10.25 spid20s Service Broker manager has shut down.
2016-07-07 08:52:10.25 spid20s Error: 17054, Severity: 16, State: 1.
Check the service account.
It might be invalid, wrong password or lack right to logon as a service.
Try login as localsystem just to eliminate this possibility.
Also check the SPNs.
Check if the SQL Browser service is running. If yes then stop it and
disable (if you are using only one default instance.)
I had the same issue and after stopping/disabling the SQL Browser
service; it worked for me.
The SQL Server Browser Service is installed often in Disabled state (It is preferred to be disabled unless required).
It is only required for named instances or instances listening on non-default ports.
Your application installer should only restart the Browser service if needed, and certainly should check for a disabled service and ask an administrator permission to enable the service .

Issue With Web Synchronization & Merge Replication Microsoft SQL Server / 2008 r2

I am extending our network by placing a xenserver box at a remote location to reduce outages for our web resources. All our servers are on xenserver, with MS Server 2008r2 and SQL Server 10. I must add I am a developer, not a sysadmin, so I have never done a db replication setup before.
I have successfully got one server working as publisher / distributor(SVR-DBDISTRIB) and another working as subscriber (SVR-DBREPLICA). They are happy to update each other with no faults. As one server has to go off site, I am planning to use web synchronization from one of our ms web servers (Server 2008r2 / IIS 7.5). I have added all the repl_merge, etc passwords, self-certified certificate, installed the SQL connectivity, etc features to the IIS box and I have got replisapi.dll working with certificates saved to trusted certificate root on the subscriber (so no certificate warnings come up when I call https://server.domain/SQLReplication/replisapi.dll). I have run the replisapi.dll?diag when logged in using the web servers admin password and everything is working. I can also log in with the IISSQLRepl password I have set up to hit the web server on basic authentication from the subscriber (again with no certificate issue). There are no proxies set up on the system.
When I create a new web synchronization publication on SVR-DBDISTRIB that works with non-web replication, the subscriber on SVR-DBREPLICA can communicate with the publisher as the subscription shows up in SVR-DBDISRIB. The agents at the distributor have no error messages but no table updates appear at the subscriber, although I do get the following (rather unhelpful) error message:
The system cannot find the file specified
Here is the job history:
Date 12/12/2013 18:42:28
Log Job History (SVR-DBDISTRIB-test-web-test-web-full-SVR-DBREPLICA-test-web- repl- 0)
Step ID 1
Server SVR-DBREPLICA
Job Name SVR-DBDISTRIB-test-web-test-web-full-SVR-DBREPLICA-test-web-repl- 0
Step Name Run agent.
Duration 00:00:01
Sql Severity 0
Sql Message ID 0
Operator Emailed
Operator Net sent
Operator Paged
Retries Attempted 0
Message
2013-12-12 18:42:28.987 Copyright (c) 2008 Microsoft Corporation
2013-12-12 18:42:28.987 Microsoft SQL Server Replication Agent: replmerg
2013-12-12 18:42:28.987
2013-12-12 18:42:28.987 The timestamps prepended to the output lines are expressed in terms of UTC time.
2013-12-12 18:42:28.987 User-specified agent parameter values:
-Publisher SVR-DBDISTRIB
-PublisherDB test-web
-Publication test-web-full
-Subscriber SVR-DBREPLICA
-SubscriberDB test-web-repl
-SubscriptionType 1
-SubscriberSecurityMode 1
-Distributor SVR-DBDISTRIB
-XJOBID 0x03CFDF8BD2749449A5E4D81AF5270A97
-XJOBNAME SVR-DBDISTRIB-test-web-test-web-full-SVR-DBREPLICA-test-web-repl- 0
-XSTEPID 1
-XSUBSYSTEM Merge
-XSERVER SVR-DBREPLICA
-XCMDLINE 0
-XCancelEventHandle 0000000000000160
-XParentProcessHandle 000000000000064C
2013-12-12 18:42:29.022 Connecting to Subscriber 'SVR-DBREPLICA'
2013-12-12 18:42:29.127 Connecting to Subscriber 'SVR-DBREPLICA'
2013-12-12 18:42:29.206 The upload message to be sent to Publisher 'SVR-DBDISTRIB' is being generated
2013-12-12 18:42:29.210 The merge process is using Exchange ID '8E8BFAE7-B280-4016- AB07-517DC4961361' for this web synchronization session.
2013-12-12 18:42:29.240 **The system cannot find the file specified.**
2013-12-12 18:42:29.242 Category:NULL
Source: Merge Process
Number: -2147221502
Message: The system cannot find the file specified.
2013-12-12 18:42:29.244 Category:NULL
Source: Merge Process
Number: -2147199373
Message: The Merge Agent failed to connect to the Internet proxy server for user 'repl_merge' during Web synchronization. Ensure that the proxy server settings are correctly configured in Internet Explorer, or specify the -InternetProxyServer parameter when starting the Merge Agent.
2013-12-12 18:42:29.245 Category:NULL
Source: Merge Process(Web Sync Client)
Number: -2147024896
Message: The Merge Agent could not connect to the URL 'https://server.domain/SQLReplication/replisapi.dll' during Web synchronization. Please verify that the URL, Internet login credentials and proxy server settings are correct and that the Web server is reachable.
I understand that there is a 'verbose' setting and I am not sure if this is the verbose output. All the MS technet documentation talks about using SQL Enterprise Manager (discontinued from server 2000) to do this.
Any help or advice on where to look would be appreciated - this is the last job I need to finish before pushing it out the door and I have spend 2 days on this now...
if your networks are connected use network share instead of ftp or web sync. Much easier to maintain and you don;t need extra web server ;)

Resources