SQL Server not geting rows from OraOLEDB linked server - sql-server

I have two Windows 2008 Server 64x machines. One running Oracle 10.2.x.x.x (Express Edition) and other SQL Server 2008 R2 with ODAC 12c (12.1.0.2.4).
I had created linked server, tested connection and it passes. I can see all Oracle tables, but when I query them, for example:
SELECT *
FROM ORACLE..USER.PERSON
All I get back are columns without no rows. If I run query from Oracle SQL Developer I get around 13000 rows.
What could be problem? I thought it was problem with backward compatibility, but according to this link it is not. It could be something with permissions/security?

Well it was nothing to do with linked server configuration. I didn't know that after every insert I need to commit changes.
SQL> commit;

Related

Restoring Database SQL Server - data is null this method or property cannot be called on null values

I am trying to copy 2 databases from SQL Server 2012 to a new VM SQL Server 2017.
One of the databases was restored successfully but the other is giving me the below issues.
Databases both restored successfully, however 1 of the databases when I try to access the tables I am getting this error in SSMS "data is null this method or property cannot be called on null values"
Appreciate any help.
SQL Server 2017 has numerous features that aren't present in SQL Server 2012 and it is likely your version of SSMS doesn't support the newer version of SQL Server.
It's probable that when you open the database in SSMS it is trying to load Database Diagrams (now deprecated).
Are you able to run:
USE [databasename]
GO
SELECT * FROM sys.objects
and see if your expected tables are in there?

SQL Server linked server performance on Oracle after upgrade 2008->2016

I have had a running SQL Server 2008 instance for years where I have several interfaces to an ora11 database exchanging data day for day, everything has been running correctly.
For few days now since upgrading from SQL Server 2008R2 to 2016 and importing the whole SQL Server 2008 database into our new SQL Server 2016 instance.
We were re-establishing our interfaces and everything looked good. I had created the linked server with an ora11 client connecting to the ora11-db. connected worked fine.
But since then, the stored-procedures which I was using in my interfaces, took a lot of more time for running. On SQL Server 2008R2, the linked server updates to ora11 took about a few minutes. The completely same procedure now takes about a few hours for the same number of rows updating to oracle.
My interface procedures almost look like this:
collect local data using a cursor
iterate through the cursor, looking in the remote database using linked server if the record exists
insert the missing record using linked server in Oracle db
close everything and complete
Why is it suddenly that much slower using the exactly the same source? Is there anything new in SQL Server 2016 which needs to be configured properly?
What is wrong?

How do I move data between databases using different version of SQL Server Management Studio?

I have a database deployed on a testing machine and a production machine. There is some data (columns of a table) in the testing database that I would like to copy over to production.
When I try to restore a backup onto the production box I get the following error:
System.Data.SqlClient.SqlError: The database was backed up on a server running version 10.50.1600. That version is incompatible with this server, which is running version 10.00.4000. Either restore the database on a server that supports the backup, or use a backup that is compatible with this server. (Microsoft.SqlServer.Smo)
Is there an alternate way to get the data into the table?
This answer ONLY if you need the data (from here: http://sqlserverlearner.com/tag/the-database-was-backed-up-on-a-server-running-version-10-50-1600-that-version-is-incompatible-with-this-server):
Script the object you want (table and data) under tasks, generate scripts, select the object, and make sure to include all the data (possibly the schema as well). Take this to a new query window and save the SQL file, then execute it on your other server.
You could
Generate INSERT statements for the data in question
Create a linked server from the test to the other server and run sql statements against that
Upgrade the target server to 2008 R2 (this is not something to take lightly)
You should keep your environments at the same version / rev. SQL Server restores are not backward compatible.
Use generate scripts with data, you can select the version of MSSQL. Then run the outputted SQL on the server you want it.
Ideally you'd upgrade your production server to match your test environment, otherwise your tests may not always be representative.
If they are different versions though, you can't restore a database to an older version of SQL server, you should either use the generate scripts command to create the new table and insert the data, or use a tool like SQL compare/Data Compare from RedGate which will do all of this for you.
This is the problem with the sqlserver version mismatch while restoring the database. It means It couldn't possible to restore the database server 2008 to 2005. It wouldn't support higher version to lowerr version.
The following options are available,
You can link the servers and move the table from one server to other server
Generate the sql script and execute in the target database
Use the below URL to generate the insert script and execute generated script into target server.
http://www.codeproject.com/Articles/5598/Generating-INSERT-statements-in-SQL-Server
you can use redgate toolbelt tool kit to sync data between different version of sql server or sql server to sql azure or sql azure to sql server database . it is very very easy to use .

How to remove system tables or other tables in SQL Server Link Server

Good day everyone!
I have a link server set up in SQL Server 2008 SP3 on Windows 7 64 for Oracle 11G Express.
I am using Oracle SQL Developer as a database application/Management system.
All is working well except for the long list of tables that's also in the Table tree.
There is a Filter function in SQL Developer, but I do not see the table APEX listed there.
Is there a way to configure SQL Server to that I see onle a specified table in the Link Server?
Here is an image of what I am referring to:
Thanks for the knowledge - you are making a great difference!
Guy
edit your account under security and go to user mapping untick master.
reconnect to sql server.
hope this helps.
or this link
http://msdn.microsoft.com/en-us/library/ms190644.aspx

Upgrade database from SQL Server 2005 to 2008 — and rebuild full-text indexes?

I upgraded from Sql Server 2005 to Sql Server 2008. I backed up the data in SQL Server 2005, and then I restored in SQL Server 2008. Next, I found the catalog under "Storage->Full Text Catalogs", and I right-clicked on it, and am trying to rebuild the Full-Text Catalog. The database is only 600mb. However, it keeps running for hours, and never semes to finish.
It appears that SQL Server 2008 has lousy Full-Text search because it is more tightly integrated into the database. There are some workarounds, but it isn't that great.
It can take a long time to complete, I'd look at the FTLOGs (.log files) for the catalogs - if they are big I'd say it is having a problem indexing your documents. Is this RTM 2008?
Things you can try.
Drop the indexes and create from
scratch, dont use the interface - run
this in a script.
Check the Logs for possible
errors.
Ensure the Fulltext daemon is
running and indexing your
documents , an issue with a CTP meant
the daemon stopped.

Resources