how to take sql backup without login - sql

I need some help as I am unable to log into a database.
Some Error is coming like...
unable to start service MS SQL SERVER ON SERVER SERVER.(MSCORLIB)
A network-related or instance-specific error occurred while establishing a connection to sql server.
The server was not found or was not accessible. verify that the instance name is correct and that sql server is configured to allow remote connections.(provider: name pipes provider, error 40 could not open a connection to sql server) (Microsoft sql server, error :2)
My question is how can I take the backup now because I am unable to login into the sql.

As you have event in 9003 in your Event Log it indicates that you have corrupted master datatbase and you will need to rebuild it.
First check your disks for errors and fix them.
Then you will need to rebuild the master database:
For SQL Server 2005 check this:
http://www.sqlcoffee.com/Troubleshooting007.htm
or
http://thedbavault.blogspot.cz/2013/01/ms-sql-server-2005-rebuild-master.html
Also some recommend to use database file from another instance of the same version of SQL Server.
http://blogs.technet.com/b/fort_sql/archive/2011/02/01/the-easiest-way-to-rebuild-the-sql-server-master-database.aspx
Then you should be able to restore non-corrupted backup copy of your master database.
If you do not have backup of your master database, then you will have to recreate all logins, users, roles, permissions etc.
To backup data without running SQL Server you can only backup database files .mdf, .ldf.

Related

Processing SSAS Tabular model Fails Remote Server

I'm trying to create a SSAS Project and deploy to a remote server.
The Data Source is a Database in the same server, but the project must be made in my laptop.
The remote server is not in a domain environment, so to login in SSAS, I used runas /netonly mothod using Server's Administrator Account, which works fine to connect to SSAS Server through SSMS.
I created SSAS Project using Workspace Server and connection is successful.
I am also able to connect to same Server using SQL Server Database Data Source, using Impersonate Service Account, but after I select the tables I need, the processing fails and gives me this Error:
Failed to save modifications to the server. Error returned: 'OLE DB or ODBC error: [DataSource.Error] Microsoft SQL: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - The wait operation timed out.).
And as result I get all tables without data, just column names.
If I create a project using Integrated Workspace, I am able to get Data from Source, but the same Error occurs when I try to Deploy the Project. The metadata deploys successfully, but all processing fails with the same Error.
I tried to Increase Timeout, but the same thing happens even after waiting 30 minutes.
This process does not fail if I create and execute the project inside the Server.
Enable the TCP/IP in both Server NetWork and Client protocols;
Set TCP port:1433;
And then try it again.
Please reference this: troubleshoot-connecting-to-the-sql-server-database-engine

Invalid drive specification and how to restore with other server

I've created an agent job in SQL Server 2008 with steps:
Backup
Transfer File (to another server)
Restore (to another server)
Step 1 backup has been successful, but when process transfers the file, it fails with message
invalid drive specification
I've added IP of destination server on Windows credential, and I try to run the syntax in CMD it works:
exec xp_cmdshell 'xcopy D:\folder\file_name*.ext \\desination_IP\folder\'
When I try with SQL Server 2017, it works. Is there any difference between 2008 and 2017? Please let me know
Then go to the next step restore, what I want is to restore the database from server A to server B. Example I have 2 servers with the name A server and B server i put the job in A server and the job consists of step backup, step transfer file and step restore. I transfer db to B server then i want to restore database in B server from A server with agent.
The question is, is that possible? Can somebody help me with the query to restore a database from another server? Thanks
Check to see what user the SQL Agent service is running as, if it is Local System, you'll need to change it to an account that has access to the destination folder.

Access another SQL Server through stored procedure

I want to access another SQL Server to import and update data of that server's database through a stored procedure.
For that I created linked server using sp_addlinkedserver.
EXEC sp_addlinkedserver
#server = N'LINKEDSERVER'
,#srvproduct=N''
,#provider=N'SQLOLEDB'
,#datasrc=N'[DB-Instance.cuprxxxlj.ap-xxxxxxx-x.rds.amazonaws.com]';
Then try to access by SQL query
SELECT *
FROM [LINKEDSERVER].[DATABASE].[dbo].[TABLE]
And getting errors like
OLE DB provider "SQLNCLI11" for linked server "LINKEDSERVER" returned message "Login timeout expired".
OLE DB provider "SQLNCLI11" for linked server "LINKEDSERVER" returned message "A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.".
Msg 53, Level 16, State 1, Line 0
Named Pipes Provider: Could not open a connection to SQL Server [53].
I had created database instance on amazon server and another is also on the amazon server and both are publicly accessible but don't know why I'm getting Server is not found or not accessible. Am I missing any server site setting or something else?
Please guide me if I am going in wrong direction.
I found the answer. The problem was an instance, I had created "Amazon RDS for SQL Server" which is currently not supporting to "Linked servers".
So I create a new AWS EC2 instance for Windows Server 2012 R2 and then I create Linked servers in it and tried to assess remotely. Now its working fine as I wanted.
Here is detailed document to Running SQL Server Linked Servers on AWS
Thanks.
Maybe try changing the timeout settings?
sp_configure 'remote query timeout', 0
go
reconfigure with override
go
This article explains in detail how to link one AWS Sql Server to another (https://aws.amazon.com/blogs/apn/running-sql-server-linked-servers-on-aws/). I am not certain what is wrong in your case, but this has a lot of steps that I do not see in your description.
And the one thing that does jump out at me is that you haven't configured any login security/access control. So unless the target server is open to the world, I would guess that you have to add that as a minimum.

Unable to connect SSMS, Microsoft SQL Server, Error: 53

SQL Server Management Studio is not connecting on my database server machine at production server.
Whereas production sites accessing database. When I tried to connect database from SSMS, I get this error:
Cannot connect to 111.11.11.11.
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or
was not accessible. Verify that the instance name is correct and that
SQL Server is configured to allow remote connections. (provider: Named
Pipes Provider, error: 40 - Could not open a connection to SQL Server)
(Microsoft SQL Server, Error: 53)
I was using this SSMS last couple of years,n this SSMS is running fine since more then year on production database server n i didn't closed ever, now when i connecting this SSMS but facing this issue, whereas my sites which accessing this database is working fine.
I also tried to access database from sqlcmd but no luck n facing facing this error:
HResult 0x35, Level 16, State 1
Named Pipes Provider: Could not open a connection to SQL Server [53].
Sqlcmd: Error: Microsoft SQL Server Native Client 10.0 : A network-related or instance-specific error has occurred while establishing a connection to SQL Server.
Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online..
I thinks we resolved the issues.
1. Active Directory server was not behaving, so
2. SQL server couldn't run without credentials and
3. they found another SQL server issue and fixed it.
We started looking into the SQL connections that my team had found and it lead us to find that the Active Directory server had basically crashed. It was allowing us to log in however it wasn't able to access the majority of the AD functionality. We ended up rebooting the AD server which corrected the issue however we were still seeing issues with the SQL cluster manager and SQL itself was rejecting connections on a somewhat regular basis.
After the AD server was rebooted we were able to log into the SQL cluster manager but with limited capabilities, since it had been erroring due to the AD issue we restarted the cluster service to see if this would correct the issue. This caused the SQL service to fail over to the passive server and caused SQL to start rejecting even more connections than it had been. The cluster service started working with this restart however the SQL connections were getting worse. We found that the IPv6 protocol was enabled for the SQL service which causes problems, like the ones we were seeing, in SQL clusters, to disable this we had to reboot the 2 SQL servers. We rebooted them one at a time and once they were back up everything was working properly.

Cannot login to sql server 2008 R2 after rebooting server

I am using Windows-server-2008 with Microsoft SQL Server 2008.
And there are a lot of questions about this, but nothing on the internet solved it.
The problem is that i can't connect to the my SQL Server 2008 R2 after rebooting my server.
I placed some new memory in my server, and after rebooting my client/server application didn't work anymore because it cannot reach the database.
So i tried to get in SQL Server Management Studio (SSMS), and tried to loggin with Administrator and another user but both do not work.
When i logg in the following message is displayed:
Cannot connect to (local)
A network-related or instance-specific error occurred while establishing a connection
to SQL Server. The server was not found or was not accessible. Verify that the instance
name is correct and that SQL Server is configured to allow remote connections.
(provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
(Microsoft SQL Server, Error: 2)
I Tried a lot of different things like:
Rebooting server
Try to start the server manually from Sql Server Configuration Manager
Named Pipes - Enabled
TCP/IP - Enabled
Tried to create an new system user or database user as described in the following article: Click Here
Can somebody please help me? I am really confused because i need to get this online. Otherwise i have to reinstall the database server but i do not have a back-up. (is there some folder with a back-up of the settings/tables/columns are stored and can be imported from reinstall?
I was having the exact same problem. net start mssqlserver was giving me the blurb about a failed login attempt. The problem was that I had recently changed the password for the administrator account, and the new password didn't get updated in services.
Here's how I fixed it:
First locate SQL Server from the list here:
Right click and select properties, and navigate to the Log On tab:
Then I typed the new password, and like magic I was able to start SQL Server right through the services manager.
I also did this for any other processes which were marked as "stopped" even though Startup Type was marked as "automatic" (namely, SQL Server Agent).
Is it a named instance or default? Also, is this a local instance? (I see the "(local)" but just wanted to make sure.)
Start the sql server services from services.msc and try to connect