I've been running SQL Server Express 2019 on our Linux Server, and I am currently planning our disaster recovery setup.
I was already able to backup the database automatically, but I can't seem to restore the database to a SQL Server on Windows. I've been using a localDB instance to test it, but I seem to be unable to restore the database to it
Note: the .bak file came from Linux SQL Server.
Every time I try to restore the database it says that the sysfiles1 is corrupted, but when I try to restore a database from a Windows SQL Server, it works fine. I also tried to restore the Linux database back to itself and that works, too.
There have been many articles that show how to migrate from Windows to Linux but I can't find any that shows how to migrate from Linux to Windows.
The reason I want to test if I can go back to Windows is that we only have one server that runs Linux in the office and a lot of Windows computers.
TLDR: I want to know if its possible to migrate database from Linux to Windows
The problem is LocalDB. I got same error each time I tried to restore database from linux. Then I made same restore in another server (SQL Server Standart is installed) and it successfully restored database. Then I restored to my local machine from that SQL Server Standart backup.
Related
I have SQL Server 2012 (64-bit) (MSSQL11)
running on Windows 2012 R2 (64-bit) (NT 6.3)
with .NET framework 4.0.
It has a database called db_X and since this is a live production database it is always running and stopping it is not an option.
This is the only SQL Server database server that I practically have.
I want to take a backup (i.e. a full backup) of db_X (which I know how to do) and restore that backup (that .bak file) under a different name (say db_Y) in the same SQL Server database server.
I created a new database called db_Y, then right clicked db_Y then went to Tasks --> Restore --> Database...
Then I gave the path to that .bak file (as source) and tried to restore it by giving db_Y as destination (with the option - overwrite the existing database i.e. WITH REPLACE)
But this is not working. It is giving an error.
It says restore of database db_Y failed. System.Data.SqlClient.SqlError: The file C:...\db_X1.mdf cannot be overwritten. It is being used by database db_X. Microsoft.SqlServer.SmoExtended.
But I still believe that this can be done using the Management Studio. Or at least using a script. (as this is a common requirement.)
Why is it trying to restore on db_X, when I have clearly given db_Y as my destination? Isn't this a bit scary as db_X is my live database (because I might lose some data)?
How is it possible to (have a copy of an existing and running database under a different name in SQL Server or in other words) restore a backup of an existing and running database with a different name in SQL Server 2012?
I am grateful if someone could kindly explain how this can be done using the Management Studio or at least using a script.
When you are restoring the database, you need to rename the database to something other than the name of the original:
And then click the Files section and makes sure the file names are different than the original database:
In our company we have to support a large legacy system built on Microsoft Access 2010 as frontend and SQL Server 2008 R2 as backend. The backend SQL server runs on Windows Server 2008 R2. Currently our users works on Terminal Server sessions on a Windows Server 2008 R2. A couple of days ago we started to test Windows Server 2019 and Notebooks with the latest version of Windows 10. We recognized a big performance difference while executing the same Access databases on the different environments.
For instance the creation of a report takes 27 seconds (new environment) instead of 7 seconds (old environment). The database.accdb is identical, the backend is identical (still Windows 2008 R2 Server with SQL Server 2008 R2 and SP2), only the execution environment (Windows) changed.
Does anyone of you have an idea how to explain this?
In Access 2010 the SQL server tables are linked using System-DSN data sources. On the old environment ODBC is used (Driver: SQL Server, Version: 6.01.7601.17514).
On the new environment I tested the following drivers:
ODBC Driver 11 for SQL Server (2014.120.5543.11)
ODBC Driver 17 for SQL Server (2017.173.01.01)
SQL Server (10.00.17763.01)
SQL Server Native Client 10.0 (2009.100.4000.00)
SQL Server Native Client 11.0 (2011.110.5058.00)
I created a new System-DSN using the different drivers and updated the linked tables in Access. But in any case the performance is still bad. I also tested the latest version of Access which comes with Office 2019, but again it is slow.
Sounds like your terminal sessions are getting throttled. Despite the fact that you have a SQL Server back end, Access is still doing a fair bit of thunking with the result sets, so any resource throttling differences between your Server 2008 and Server 2019 policies could be choking Access in the new server.
I think your answer is going to be found in Windows System Resource Manager. The page says it's not being maintained, but following the "Recommended Version" link leads to a generic Server 2019 page. Here's another article about how WSRM might be throttling sessions: Using WSRM to control RDS Dynamic Fair Share Scheduling.
Compare the Weighted_Remote_Sessions policy in 2008 and 2019 servers. There's either been a change to the default settings or behavior or the 2008 server policy was modified in the past to get to the current performance level.
Ok, a number of things to check.
First thing to check:
Launch the ODBC manager and check if SQL log tracing is on. I don’t know why, but I see sql logging turned on.
You NEED to be 100% sure it is turned off.
You MUST launch the ODBC manager from the command line or start menu, since the one in the control panel is for the x64 bit version, and you are using Access x32 (I assume).
So launch this version:
c:\Windows\SysWOW64\odbcad32.exe
So VERY important to launch the x32. It is assumed you are using a FILE dsn. So check these two settings:
(Make sure they are un-checked).
Next up?
Link access using the IP address of the sql server.
So, place of say:
myServer\SQLEXPRESS
Use:
10.50.10.101\SQLEXPRESS
(Of course use the IP address of sql server, not the above “example” IP).
The above things are quite easy to check.
Still no performance fix?
Then disable the fire wall on your new Terminal server (I seen this REALLY cause havoc).
And, disable windows defender on the new TS server if running.
The above tips should fix your issues.
If above don’t work, then next would be to check the priority settings for the TS server (GUI over server).
However, I am betting the above checks should restore your performance.
I am working with big SQL database which is located in hard drive(D:) and uses almost 80% of the space, so there is no space for backup files. I use SSMS v17.3 to manage SQL Server. I have windows 10 on SSD (C:), I wan't to reinstall it.
How to make sure that I will be able to connect to the database after refreshing windows?
I am wondering if it is possible to create an image of an already installed SQL server on my machine?
The issue is as follows:
I have SQL server developer 2014 and 2016 with all components installed on my machine (Sql server, SSIS, SSRS, SSAS), my OS is Windows 10 pro (upgraded from windows 8.1), and recently I had windows 10 anniversary update and I am having a lot of issues since this then, so I want to reset Windows (resetting resolved same issues I had with my other computers).
I know I can use configuration file installation, but this will not include all the components and will not have setting for things like Management Data Warehouse and SSAS query history.
So I am asking if there is a way to generate an image of the already installed SQL server and it's components and just re-install that image again after resetting windows?
Thank you.
There is no built in SQL Server tool to do this (Oracle does have such a tool) and many dbas think because they can restore a database they have done enough in the area of backup. You can use VMWARE (Virtual Machine Converter) to create an image of your machine or you have to backup all the databases (including the system dbs) that are installed on your machine, all the binaries (programs both SQL Server and non-SQL Server utils such as antivirus) and all the settings at the system level (especially accounts).
The best way to check is to do a bare metal restore and see if the machine matches what you have exactly.
I've just installed MS SQL Server Express 2014 and SQL Server Management Studio 2014 under Windows 10. I'm following the official Microsoft tutorial on database fundamentals, which uses the Adventureworks DW2008 database. I have tried to restore this dB using the Restore GUI, but it fails every time, as shown here:
AdventureWorks restore failure
I have verified the backup media, but it still fails. I have also restored a different dB, and that worked fine, so I know I am following the correct procedure. I have the file (AdventureworksDW2008Big.bak) in the following location:
C:\Program Files\Microsoft SQL Server\MSSQL12.SQLEXPRESS\MSSQL\Backup
Yes, I have thoroughly researched this, but still apologies if there is already an answer on here - I couldn't find it.
The DW in the filename is for Data Warehouse and only works on that edition of SQL Server. As you only installed SQL Express you cannot use it.
Why not try Adventure Works 2014 Full Database Backup.zip instead. If you really need 2008/R2 try the none-DW from here:
AdventureWorks2008R2_Database.zip
AdventureWorks2008_Database.zip
I do not know if it will solve your problem or not,
but I had same problem. I mean I am using SQL SERVER 2017 and I wanted to restore AdventureWorks2012.
I received restore failed error, and I decided to restore AdventureWorks2017. my queries on AdventureWorks2012 in an older system in university led to the same results as my queries in AdventureWorks2017 in my system. if you are using a version of SQL SERVER and trying to restore an older or another version of AdventureWorks, you can try the same way.
I mean restoring a version of AdventureWorks which is the same as the version of your SQL SERVER.
Best to run SSMS as an administrator to avoid access denied errors (do this by right click on SSMS and choose More -> administrator)
copy adventureworksxx.bak into the sql server DATA directory where by
default all databases are usually located. ( Note: if it is in other directory
the restore may not find it OR may cause errors later)
Restore the database