Linked server infinite load/wait after server name change - sql-server-2008

I have been stumped on this for this whole day now. I use MS SQL Server 2008. I have alinked server pointing to a DB2 database using an ODBC connection that has been running fine for years. Today I decided to change the name of the server and now whenever I run an openquery, run a job that connects to this linked server or when I try to see the tables of this linked server the query/job will run permanently and the tables forever say [Expanding...] but they never actually show. When I try to cancel a query that is stuck, it will never finish canceling. The only way I have found to actually stop queries is to log my account out and end my session forcefully (MS SQL server will tell me it cannot shut down but I can log my Windows account out get past it).
We already tried to recreate this exact linked server by scripting it and using a different linked server name but this gave the same result. I also tried recreating this linked server on another actual server and that worked fine. The server where the linked server is "stuck" on, works perfectly fine as long as I don't try to connect/communicate to these broken linked servers.
My question is basically, what in the world happened when I just changed the name of this server and does anyone have any suggestions on resolving this? I have pondered about a complete server restart, but since this concerns a production server this would be my absolute last resort. I however see no other options right now.

Solution was to do a complete server restart and to back up to an earlier date. We have done the exact same thing after that and everything worked fine, so it seemed like it was a one time critical anomaly.

Related

How do I restart a MySQL local instance in MySQL workbench?

I've recently gotten into databases for a class I'm currently in, and I need a little bit of help. I've managed to create a database, and even populate a table with data which I was then able to grab from a node.js project I've made in Atom. Wonderful! When I went to shut it down, all seemed normal but now it won't restart. As in, when I'm in the homepage section of MySQL I double click the local instance I made(I can only assume this is opening the connection to the local instance where my database is stored) but it won't start up. I don't know what I'm doing wrong. Here is an image of the error I'm getting. I can only assume it's because the actual server isn't on but I don't know how to turn it on.
Any help is much appreciated!
Thank you!
As according to the users ikiK, P.Salmon, and Y4glory the issue I was having was that I wasn't actually turning on the server. I was able to do so by going through my Window's Services application, finding the MySQL server and starting it there instead of trying to do so through the workbench.
Once again, thank you to those who commented as that was really helpful!!
I have tried every other way mentioned here and other related posts, but it did not solve my problem, the service just wont start, but the below approach with the mysql-installer did.
For this to work you need to have your installer which you have used earlier to install MySql.
Start your windows mysql installer. For me it was "mysql-installer-community-8.0.20.0"
Then remove/uninstall the SQL Server and remove all configurations
Manually delete the SQL Server folder from "C:\Program Files\MySQL\MySQL Server 8.0."
Start your mysql installer again and install the SQL Server again
You can check now that the MySqL Server has started.
Hope it helps someone.

AWS MySQL Database Disappearing

I have a MySQL database running on AWS RDS. I have a node.js server that queries the MySQL database. Everything is fine for most days but around once a week, my node server says "Unknown database."
I try to query the database with MySQL Workbench and receive the same message. I have checked my instance and it is running fine with the status being "available."
To fix the issue, I have to recreate the database which means I lose all my data.
Has anyone had issues with this? This is very frustrating since I have no idea what would cause this problem.
We‘re running MySQL RDS databases since AWS launch and never had such an issue. Are you sure the created database is really gone? Do you maybe have a job running at an interval that doesn’t work as intended? What do the RDS logs say?
To debug the issue you can
have a look at RDS server logs
enable query logging to table and analyze queries fired at the server
run a small instance which is not touched for the period to proof it’s not a RDS-related isssue
A few years later...lol. I had the same problem and realised you have to be connected to the same domain in AWS as your database. If you know the connection string of your database, find the domain it is in. Then in the top right hand side of the aws console you should see a drop down that shows the current domain you are logged into. My guess is the two are not the same. Change the value of the drop down and you should see your database.

How do I migrate a SQLAnywhere 9 db running in a remote server into a mysql server on my machine?

I am working at a company that has some CRM software running in a remote Windows XP server that uses a SQLAnywhere 9 db to store its data; I have access to this remote server with an administrator account.
I would like to extract the db into a .sql file so that I can run the db locally on my machine without affecting the running db in the server (since it is key for the company's day to day operation).
The reason I need this is that we are going to test some BI Software and we need data from this database to test it, but we don't know the structure of the database since the developers of the CRM software didn't give us any documentation on it. So we need to have the database locally so that, without affecting the running CRM, we can:
understand the structure by looking at the DDL
make queries to it to get sample data
I researched a bit, and the most common solution to my problem was to use dbunload on the remote server to unload the db into a reload.sql file that contained what I needed. But most tutorials on the subject mention that I have to stop the db first (which would be catastrophic). If this is the only option, then I guess I am willing to do it on the weekend when the CRM is not used, but I wanted to know if there was another solution first.
If there is no other solution, can you point me to where I can find the proper and safer way to do this?
I have researched a lot, but prior to this day I have never even heard of SQLAnywhere, so I really need all the help I can get. My main concern is doing something that impacts negatively the CRM software.
Thank you.
You can run dbunload across the network, you just have to tell it to do an "external" unload. The default is to do an internal unload which would only work from the machine where the database server is running.
I don't have SQL Anywhere 9 documentation right now to look up the exact switch, but dbunload -? should show you all the possible switches.
Edit:
-an will create a new database and load the data and schema from another data
-xi switch will do external unload and internal reload.
-c parameters to connect to your remote database

Using MySQL workbench I can't create new connections

I have a freshly installed workbench 6.3 version and a 5.1 mysql Server version.
I already have connections created. Namely, I can successfully connecto to local Instance MySQL56, which I assume is a default connection. I have two, way older connections that have appeared even though last time I used this program (and later uninstalled) was months ago, with another version.
I've read what I've found and felt could help
MySQL Workbench 5.2 CE, Windows 7, "Can't connect to MySQL Server on 127.0.0.1 (10061)"
MySQL Workbench: "Can't connect to MySQL server on 127.0.0.1' (10061)" error
And tried every option. Nothing works. I try to create a connection with this steps:
Database -> manage connections -> bottom left corner: New
Then I give it a name, leave everything as default, put a pw into the vault, and try to test it. Does not work. Whatever combination I try, it does not work. Yes server is running, I've tried 3 different ways of checking.
I do not understand at all how something I've done in the past is taking me so many hours, I do not know what I'm missing, but I can't create a new connection.
Also to be noted, in case it's useful: On default schema, I write the name of a schema I previously created. Thing is, as I said, I've tried every combination. But when I've tried to save said schema in a folder, workbench has instantly crashed. Twice already.
I'm all out of ideas, so if anyone can tell me what to do, it'd be of great help, I find nothing following guides out there.

SQL Server 2008 R2 database not accessible after instance started

This is a bit of a problem! I had shut down an instance on SQL Server and today I started it up again.
However one of the databases (the main one that I work with) is not accessible.
When I attempt to expand the database in SSMS to view tables, I get the error:
The database is not accessible. (objectExplorer)
I found this article which looked like it may solve the issue (assuming that it is a permissions issue) but that did not work either: http://sqlserver-help.com/2012/02/08/help-i-lost-sa-password-and-no-one-has-system-administrator-sysadmin-permission-what-should-i-do/
In the SQL Server error logs I am seeing:
FCB:Open failed: Could not open file E:\\.mdf for file number 1. OS error: 32 The process cannot access the file because it is being used by another process.
There is plenty disk space and so I am stuck with what the issue is.
I do have a recent backup so I'm not overly concerned about losing this database but still - I would like to be able to recover it if at all possible.,
Any help appreciated.
UPDATE - I used ProcessExplorer which showed that sqlservr.exe is using the file EVEN AFTER STOPPING THE SERVICE!
When I attempt to detach the database I get an error about Primary files do not match or that log file is from different database. Confusing!
Thanks.
No idea what the issue was still - but it was resolved by rebuilding the log file.