Change SQL Server 2017 collation back - sql-server-collation

If we wanted to put back the collation for our SQL instance (server collation, not individual database) could we just restore backups of master and MSDB from when the old collation setting was in effect?

Related

Identify oracle Container Databases (CDB) without connecting

We have a custom inventory system, for tracking all of our database, including Oracle v12 and v19 based databases. But as our DBA team has work with Container Databases (CDB), we need to identify, which one is a standalone or container, but we don't have any option to connection to the, due to our security policy.
Is there any way to Identify oracle Container Databases (CDB), without connecting to them?
As after reviewing Oracle official documentation: https://docs.oracle.com/database/121/ADMIN/cdb_mon.htm#ADMIN14174.
It seems that it's not possible, as the documented clearly mentioning, that first, it's necessary to connect to the database, and only then to run the following command: SELECT CDB FROM V$DATABASE;
And if the CDB column returns YES, the current database is a CDB. and NO, if the current database is a non-CDB.

How do I connect to my local SQL instance in Visual Studio?

I've installed VS2010 Express and all associated SQL. I've got an instance running on my local machines of .\sqlexpress and I can connect to it with SSMS. I've created some tables etc.
I want to use Linq to SQL so I have created a new empty .dbml file in my solution. I assume the next step is to connect to the database, but I don't know how as I've never done this before.
I tried Add Connection as it suggests, and the Data Source I can choose Access Database, SQL Server Compact 3.5 or SQL Server Database File.
The Database File one says, "use it to connect to a local instance", so I click that. Then it asks for a database file name, new or existing. Surely I should be typing in the instance name not doing this file thing? If I do type something in, it crease a .mdf in my documents folder and it doesn't really help me much.
Any ideas how I can get this to work?
it's easier than you think.
you create a new database in SQL Management Studio, you call it
whatever, myDatabase...
from Visual Studio you select the SQL Provider and you select the
local instance and the myDatabase as db name.
everything is basically as you said except that you should have created a database and you should then select it in VS.
doing this from a new EF model, VS will store the connection string compatible with EF format in the app.config so you will be able to check it and see how such connection string is written.
I finally figured this out via a blog post or two somewhere online. With the express edition, the option to connect to a local database in the normal way via IP or ./sqlexpress is not present. You have to connect using a File, by finding the .mdf file on your hard disk (within the SQL server folder somewhere) that represents your database, and selecting it.
I have no idea what happens if you update your database schema in SSMS, or why they've restricted it to this bizarre method, but it works and I have been able to query my database.

SSMA (SQL Server Migration Assistant) for Oracle cannot find datatypes

I am trying to migrate my Oracle db to SqlServer 2008 using SSMA. I defined some type mappings for columns. When I synchronize after converting schema it gives errors like: "Cannot find datatype datetime" or bit. These datatypes are valid SQL Server datatypes.
Why I am getting these errors?
Just a guess, but it's quite hard to provide more than that before you give more details... (the code being synchronized to SQL Server, first of all).
Do you have case-sensitive collation on your SQL Server? I believe SSMA may have problems in this case. Try synchronizing to case-insensitive DB.
Also you may try running generated SQL Server (translated) code in the Management Studio and then find the problem with generated SQL or DB setup from that point. Again, it's most likely possible to figure out the problem solely by looking at your generated SQL if it's indeed corrupted due to some bug in SSMA.

How to copy data encrypted by dbms_obfuscation_toolkit.DESEncrypt

I have an Oracle (10.2.0.4) database table with a column which is encrypted by dbms_obfuscation_toolkit.DESEncrypt tool kit.
Some of our data has been messed up by it getting re-encrypted with another key.
I want to do some testing on this data to try and recover it. Therefore, I want to copy the data from our live system and into a test system.
I've tried simply exporting the data from SQL Developer (in various text based formats), but the "binary" nature of the encrypted data seems to break the file format.
I tried exp, but this reported errors (although I'm not sure if this is to do with the encrypted data or not).
How can I copy just this one table's data from one database to another?
Thanks.
The errors I got when exporting the table are below. I was doing this from my local machine connecting to a remote database:
c:\>exp <user>/<password>#<sid> FILE=export.dmp TABLES=(TABLE1)
Export: Release 11.1.0.6.0 - Production on Thu Oct 14 20:46:51 2010
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit
Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export done in WE8ISO8859P1 character set and AL16UTF16 NCHAR character set
server uses WE8ISO8859P15 character set (possible charset conversion)
About to export specified tables via Conventional Path ...
. . exporting table TABLE1
EXP-00008: ORACLE error 904 encountered
ORA-00904: "MAXSIZE": invalid identifier
I would try with a database link. If you can't create a database link, you could try the COPY command of SQL*Plus, although I'm not sure if it would work with encrypted columns (it looks like this command is deprecated in the newest releases).
If this fails, the best tool to export/import data from Oracle to Oracle would probably be Data Pump (included in the DB).
It turned out that my Windows test database had a slightly different character set encoding when compared to our live (unix) system - WE8ISO8859P1 -v- WE8ISO8859P15. I did a character set conversion on my test database, using the instructions here and then I was able to import the data.

MS CRM can't add users after database restore

We have restored an old ms CRM database over a newer version. But when I try and add users which were already existed in newer version I get an error.
If I delete the users from our of active directory and then try to add them to CRM it works fine.
Is it possible that CRM is storing user information in the MSCRM_CONFIG. And can this be removed in a supported way?
Have a look at the SystemUser in the MSCRM_CONFIG table, I think i need to remove the users from this table. but I can't do a delete statement as it's not supported. :)
Did you restore this database using the Deployment Manager tool or simply by doing a SQL Restore? Doing this directly from SQL would cause issues. You'll need to delete the organization in the deployment manager and then delete the database in SQL. Then you should attach the database and recreate the organization from the deployment manager, pointing it to the existing database.
Restoring just the org DB can lead to issues as some user info is stored in the config DB as well. In fact, there are entries in there mapping the user to the org (SystemUserOrganizations), so when you restore the Org DB, this mapping is now out of date.
You would need to either go the Delete/Import route or manually do some unsupported cleansing of the Config DB Tables.

Resources