MOSS 2007 Unable to Connect to Database after Config Database Move - database

I am in the process of moving all our SharePoint DB's from a SQL 2005 server to a new 2008 server, and after moving the config database, everything seems ok, except when I click on "Timer Job Status" (under Central Admin > Operations > Global Configuration) I receive a "Unable to connect to database. Check database connection information and make sure the database server is running." error.
I get the following entries in the log regarding this:
12/03/2010
13:51:41.80
w3wp.exe
(0x09E0)
0x09AC
Windows SharePoint Services
General
8e2r
Medium
Possible mismatch
between the reported error with code =
0x8107053b and message: "Unable to
connect to database. Check database
connection information and make sure
the database server is running." and
the returned error with code
0x81020024.
12/03/2010
13:51:45.61
OWSTIMER.EXE
(0x0744)
0x0DD8
Windows SharePoint Services
Database
6f8e
Critical
SQL Database
'SP_Test_Config' on SQL Server
instance 'test-server' not found.
Additional error information from SQL
Server is included below. Cannot open
database "SP_Test_Config" requested by
the login. The login failed.
It should be noted that in order to ensure that it was no longer using the config database on the old server, I detached the original SP_Test_Config database in SQL Management Studio.
Obviously there are still references to the old SP_Test_Config database on the old 2005 server. How do I remove these references? Or, barring that, how do I move the config database in such a way that no references to the old 2005 server will remain?
Thank you in advance!

Not really an answer, but what we ended up doing (basically start from scratch using SQL Aliases):
First, create the SQL Server alias. This will make it so if you need to move the databases again in the future, you can just migrate all the databases to the new SQL Server, and change your SQL Server alias to point at that server. This should save you a lot of trouble and heartache in the future.
Run SQL Server Client Configuration Utility at: C:\Windows\System 32\cliconfig.exe.
Under the Alias tab, create a SQL Server Alias for the new SQL Server.
Now, recreate the farm.
Run stsadm -o preparetomove on all content DB's Backup all content DB's and copy to new SQL server
Remove all servers from farm using SharePoint Configuration Wizard
Recreate farm using SharePoint Configuration Wizard with the alias of the SQL Server you created above
Recreate all web apps with temp content DB's
Run stsadm -o deletecontentdb on all temp content databases created in step 4
Run stsadm -o addcontentdb using copied production databases as content database
Troubleshoot ad nauseum

Related

GoldenGate on Microsoft SQL Server

I'm trying to to the GoldenGate on Microsoft SQL Server. The thing is stopping me from moving forward with the implementation, there is a error I always get when trying to create the cdc Cleanup setup job file from the GGSCI. Only, please feel free to participate. the error bellow, keep in mind I have done all the requirements that appears in the error.
( Command: createJob
Neither the SQL Server Change Data Capture job nor Replication Log Reader Agent are found in database test1.
Ensure that supplemental logging is enabled for database 'test1' and that either the SQL Server Change Data Capture job or the Replication Log Reader Agent exists, if the database is Published for Transactional Replication, and re-run this program.
Also, ensure that the SQL Server login is a member of the sysadmin server role.)
I was expecting the createJob file to be created on the SSMS.

Unable to run sql file in SSMS with 2 Database Engine connections(1 is a Server connection and the other is a local database engine)

I have set up 2 separate Database Engine connections in SSMS 2017. One connection is to the company server databases and the other is for my local database instance. Now, when I open SQL files with code referring to the Server Instance (#1), it fails to run because it doesn't recognize the tables or the attributes. I have to right click on the Server Name in the Object Explorer and open A New Query page, copy the code from the SQL file and paste it onto the new Query page and then run it.
How do I get the SQL file to run by opening it and clicking on Execute?
If you are trying to reach a different database instance from your local hosted instance, you will need to create a linked server.
Once you have that in place you can mix the database connections from a single sql file by using 4 part naming conventions [Server].[Database].[Schema].[Table].

Specifying schema in SQL server connection

I have a JBoss application that I copied from our production system running in local. This application connects to a SQL server database. I copied also this database in local and can browse it with MS SQL server studio. After a long fight with the users and TCP connections settings in the SQL server. Now I can see how the connection between the JBoss and my copy of the DB is done in local.
However, the problem I am facing is that I get lots of exceptions like
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid
object name 'table_name'.
Obviously the table_name exists in the SQL database as I can browse it, from SQL studio, using the same user JBoss is using to connect. One interesting thing is that when I browse the tables I see their names are in the form of: 'schemaName.table_name' so my only guess is that the schema is expected for the queries sent from JBoss. This is perhaps a problem with the configuration in the SQL because the JBoss is the same, the jars in the JBoss are also the same and the only thing that may be different is the creation of the users for the SQL database.
Does any one in the forum has any idea about what the problem could be or how can I specify the default schema for a certain user, so it is used in the JDBC connection?
To assign a user a default schema:
In SQL Server Management Studio go to Security / Logins / YourUser / UserMapping. There you can set the default schema for each database so you don't have to type the schema before the table names.

Migrate SQL Server CE to Azure

I have finished my first complete Orchard CMS website, developed locally in SQL Server CE. I want to publish it to Azure, but I am having difficulty with the WebMatrix Migrate function.
I have a SQL Server instance in Azure with an blank Orchard database already there (I want to use the replace option late in the migration to just nuke the existing db). I have added my IP to the server firewall rule.
In WebMatrix 3 I can connect to my Azure database using:
Server: myserver.database.windows.net
Database: orchard-db
Username: admin#myserver
Password: mypassword
I can view the tables in WebMatrix.
When I select my CE sdf file (Orchard.sdf) and click the Migrate button and enter the exact same details I get the following (can provide full stack trace if needed):
We were unable to connect using the connection details provided.
Microsoft.SqlServer.Management.Common.ConnectionFailureException:
Failed to connect to server . ---> System.Data.SqlClient.SqlException:
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)
---> System.ComponentModel.Win32Exception: The network path was not found
I'm really not sure what the issue is. I have tried various configurations of the details but nothing seems to work. If I connect as my database user (i.e. not a server admin) I get a different error:
The server principal "orchard_user" is not able to access the database "master" under the current security context.
I went and had something to eat, and now I can get to the next step of the migration. When I select replace database I get the following error:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Microsoft.SqlServer.Management.Common.ConnectionFailureException: Failed to connect to server . ---> System.Data.SqlClient.SqlException: Login failed for user 'admin'.
EDIT: I have come to the conclusion WebMatrix is not going to migrate my SQL Server CE database to my Azure SQL Server database. I installed SQL Server Express and migrated it to that, when I get home from work I will use the SQL Server Migration Assistant to move it to Azure.
I ended up installing SQL Server Express, using WebMatrix to migrate the SQL Server CE database to that. I then ran the Deploy Database to Microsoft Azure Database Wizard in SSMS to push my database to Azure.
I can't be certain, but it seems that WebMatrix can't migrate CE to Azure. According to Azure doco:
It is recommended that you always use the latest version of Management Studio to remain synchronized with updates to Microsoft Azure and SQL Database. Update SQL Server Management Studio.
I guess WebMatrix is behind or something. Hopefully this helps someone in my situation.

Microsoft OLE DB Provider for SQL Server error '80040e14' Could not find stored procedure

I am migrating a classic ASP web app to new servers. The database back end is migrating from SQL Server 2000 to SQL Server 2008, and the app is moving from Win2000 x86 to Win2003R2 x64. I am getting the above error on every single stored procedure call within the application.
I have verified:
Yes, the SQL user is set up, using correct username and password
Yes, the SQL user has execute permissions on the stored procedures in the database
Yes, I have updated the TypeLib references to the new UUID
Yes, I have logged into the database via SSMS with the SQL user id and it can see and execute the stored procedures just fine in SSMS, but not from the web app.
Yes, the SQL user has the database set as its default database.
The most frustrating thing is it works fine on the DEV server, but not on the production server. I have gone through every IIS setting 5 or 6 times and the web app is set up precisely the same in both environments. The only difference is the database server name in the connection string (DEV vs prod)
EDIT: I have also tried pointing the prod web box at the dev database server and get the same error so I'm fairly sure the issue isn't on the database side.
Are you sure that you are really connected to the instance and database you think you are (in the App)? It only takes the wrong DB in the connection string to override the default database for the user.
Can you execute some inline SQL on the connection like:
SELECT ##SERVERNAME AS SERVERNAME
,DB_NAME() AS [DB_NAME]
,CURRENT_USER AS [CURRENT_USER]
It might be the schema. Have you set the default schema of your user in the database you are using?

Resources