Showing posts with label ole. Show all posts
Showing posts with label ole. Show all posts

Wednesday, March 7, 2012

Cube with oracle + sql server data

Hello,

I have a cube with 1 fact table from SQL Server and 1 dimension from Oracle.

when I process the cube I get this error:

OLE DB error: OLE DB or ODBC error: Cannot initialize the data source object of OLE DB provider "OraOLEDB.Oracle.1" for linked server "(null)".; 42000; The OLE DB provider "OraOLEDB.Oracle.1" for linked server "(null)" reported an error. The provider did not give any information about the error.; 42000.

when I remove the fact table of SQL Server and replaced it with a fact from oracle, the cube will process fine.

The system specs is:

Windows 2003 sp1 X64 (AMD CPU)

SQL Server 2005 SP1

Oracle 10.02g with support to 64 bit.

Thanks in advance,

Yoav.

My guess about your situation:

When you trying to create a cube that is based on 2 datasources at some point Analysis Server is trying to figure out better way to construct SQL queries against the relational database.

In some complex situations it might decide it cannot send queries separately to each data source. At this moment Analysis Server constructs a query using OPENROWSET semantics. So it would send a query to SQL Server asking for partial results brought from Oracle. You can trace these SQL queries in your processing dialog. And you'd see OPENROWSET that is failing for you.

There are several solutions. For one you can define linked server in SQL Server pointing to Oracle table/s. This way you can make sure you test connectivity to Oracle ahead of time instead of relying on OPENROWSET. This solution also eliminates the need for 2 datasources.

Second, you can look at your cube design, and try to simplify your measure group-dimension relationships so Analysis Server wouldnt be sending OPENROWSET.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

Cube Processing Error - OLE DB error: OLE DB or ODBC error: Class not registered.

Problem

I get the above error when trying to process the cube.

Environment

Server OS - Windows 2003 64Bit

SQL Server 2005 64Bit

Database - Teradata

Connectivity - OLE DB for Teradata

Testing

- Have successfully tested OLE DB connectivity using Hyperion, connecting using an OLE DB Connection file.

- Get the same error when trying to process a sample MS Access database or Teradata

- Uninstalled and reinstalled SQL Server 2005

If anyone has any idea’s it would be greatly appreciated, thanks.

It might be that the provider (in the connection string of the datasource) is set to the 32bit version (if you used BI Development Studio or SQL Management Studio on a client 32bit machine). Then you deploy and, during processing, the AS2005 server tries to instantiate the provider and fails (because you have the 64bit version of the provider installed on the server machine).

Adrian

|||

Thanks,

I used Visual Studio 2005 to develop a Test Cube on the Server after the installation.

Back Ground

I originally installed SQL Server 2005 using a Local Account but it was then decided that it was best done under a Domain account (Up until this point I could process AS2005 cubes). So I uninstalled SQL Server 2005 and reinstalled using the domain account.

I think somewhere along the way a Registry File has become corrupt. Is there any way to test this?

Next Step

If I am unable to resolve this issue I will re-image the server and hopefully this will remove any corrupt Registry files.

Any other Idea's?

Thanks

Sunday, February 19, 2012

CTE in OLE DB Command Data Flow Transformation

I am trying to use a CTE in an OLE DB Command data flow transformation object. However, when I enter the cte and corresponding query in the SqlCommand field of the OLE DB command editor dialog, I get a syntax error. Can CTE's be used data flow objects? I have been able to use them in an Execute SQL Control Flow Item, but not in any data flow item.

I was able to paste a query using a CTE inside of the OLE DB Command with no problem(just a quick copy and paste- no parameters invloved); then I think CTEs are not the problem. May be is the parameter mapping or something else. Could you post the query and the error so folks around here can get a better picture of the problem.|||

Thank you for your reply. I was able to successfully use a CTE in an OLE DB Source data flow component. I had a silly syntax error.

I am now running into a problem using a CTE in an OLEDB command object. There are two levels of the problem.

1. I can use a straight forward CTE in an OLEDB command object if I use the "Native OLE DB\SQL Native Client" provider.

For example, this works:

/**BEGIN QUERY**/

with TestCTE2(prod_id) as
(
select ProductID from Production.Product p
where p.ProductID = 321
)

select prod_id from TestCTE2

/**END QUERY**/

but if I try to modify and use a parameter, like:

/**BEGIN QUERY**/

with TestCTE2(prod_id) as
(
select ProductID from Production.Product p
where p.ProductID= ?
)

select prod_id from TestCTE2

/**END QUERY**/

I get the following error:

Error 2 Validation error. Data Flow Task: OLE DB SQL Native Client [863]: An OLE DB error has occurred. Error code: 0x80004005. An OLE DB record is available. Source: "Microsoft SQL Native Client" Hresult: 0x80004005 Description: "Syntax error, permission violation, or other nonspecific error". Package.dtsx 0 0

2. If I try and use a CTE in an OLE DB Command data flow object using the "Native OLE DB\Microsoft OLE DB Provider for SQL Server" provider

I can't enter the first query from above at all, i get the following error message:

Error 1 Validation error. Data Flow Task: OLE DB provider for SQL Server [875]: An OLE DB error has occurred. Error code: 0x80040E14. An OLE DB record is available. Source: "Microsoft OLE DB Provider for SQL Server" Hresult: 0x80040E14 Description: "Statement(s) could not be prepared.". An OLE DB record is available. Source: "Microsoft OLE DB Provider for SQL Server" Hresult: 0x80040E14 Description: "Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon.". An OLE DB record is available. Source: "Microsoft OLE DB Provider for SQL Server" Hresult: 0x80040E14 Description: "Incorrect syntax near the keyword 'with'.". Package.dtsx 0 0

which I find curious, because there is no previous stataments.

The above queries are going against the adventureworks database.

Any further insight? Thanks for your help.

Kyle Key

|||

Kyle,

That was the test I performed in my initial post; and you are right, as soon as you add a parameter it throws an error.

Just out of curiosity; what is your ultimate goal when trying to combine a CTE and an OLEDB command? Are you trying to update rows or what?

For performance reasons, I try to stay away of OLE DB Commands. In some cases, you could replace the OLE DB Command by a OLEDB Destination that point to a staging table and then in control flow you can use a Execute SQL task to execute the same SQL statement using staging table as a reference to constraint which rows should be affected. The advantage of this procedure is to execute the sql statement only once; instead of 1 per row when an OLE DB command is used.

This does not answer your question but could give you other options

|||

I'm using the CTE to flatten out a hierarchy. I can get a list of nodes in a hierarchy, and was hoping to use the OLE DB Command transformation to loop through those nodes to get the leaf nodes and update those leaf nodes. I was going under the assumption that using a staging/temporary table would be costly to performance, but I may have to rethink my approach. I guess getting it done is better than spinning my wheels.

Do you know if the problem I'm seeing is a bug or functioning as designed? I was going to install the latest CTP for SP2 and see if the behavior is any different.

|||

I actually don't know if that would be fixed in SP2. But I found a work around; just place the SQL Statement inside of a stored procedure and then called it from the OLE DB Command.

I ran a test against AdventureWorks, see here for more details:

http://rafael-salas.blogspot.com/2006/12/passing-parameters-to-ole-db-command.html

Pleas, let me know if you found a diffrent approach.

thanks

|||

Kyle Key wrote:

I'm using the CTE to flatten out a hierarchy. I can get a list of nodes in a hierarchy, and was hoping to use the OLE DB Command transformation to loop through those nodes to get the leaf nodes and update those leaf nodes. I was going under the assumption that using a staging/temporary table would be costly to performance, but I may have to rethink my approach. I guess getting it done is better than spinning my wheels.

Do you know if the problem I'm seeing is a bug or functioning as designed? I was going to install the latest CTP for SP2 and see if the behavior is any different.

Kyle,

This probably isn't the optimum way of going about this. As Rafael says the OLE DB Command is not at all performant (we can elaborate as to why if needs be).

In your case it does seem as though using T-SQL will be a better bet. If you really do want to execute this functionality in the data-flow and not have to operate on the data row-by-row a la the OLE DB Command then you could use an asychsronous script component.

It would help to understand the problem better. How are your values in the data-flow being used to update the existing data?

-Jamie