LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Attaching a Citadel DB - 'Failed to attach associated relational database'

I have a Citadel_DB folder with .cdpg, .cdib, .ldf, .mdf, .elog, .elog.ckpt1, .elod.cpct, .cdih, .cdin files. (the folder totals 23 GB)

 

This folder was simply copied and pasted from another PC.

(I did not detach the database as instructed here: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000kHPeSAM&l=en-CH)

The original PC is currently in another country and attempting the linked instructions may need some coordination. However, I am curious if my issue lies elsewhere.

 

I am using LabVIEW 2016 along with DSC, Realtime Module, VISA, and cRIO Drivers. A mirror of the original PC apart from an etherCAT driver.

 

When attempting to attach a database I get the error in the attached png: "Failed to attach associated relational database"

Could this be an issue with the SQL Server 2008 R2? I suggest this as the installation was buggy and I had to end the installation early as outlined here: https://superuser.com/questions/205492/sql-server-setup-hangs-on-install-with-sqlengineconfigaction-.... This being said I received no errors upon installation.

 

 

 

 

0 Kudos
Message 1 of 5
(1,418 Views)

I may have figured out the cause. Still need some time to play around with it.

I think the mssql.ldf and mssql.mdf files in the folder were not supposed to be there leading me to believe the file copying was done poorly or while the cRIO system was still communicating.

0 Kudos
Message 2 of 5
(1,333 Views)

Hi, 

I am having the same problem.

Using the DSC Module I created the database and through Microsoft SQL Server Management Studio I can have access to it. However, now I am trying to see the database data using the "Historical Data Viewer" of NI Max and I get exactly the same error as yours.

Did you solved it?

Thanks,

Adriana.

EngHyCo - Adriana Oliva
0 Kudos
Message 3 of 5
(1,284 Views)

Yes, I did in fact solve it. My issue lied directly within those extra mssql.ldf and mssql.mdf files, which were located in the folder/directory you choose when attaching a database. I think those files were created when the cRIO system was still communicating data to Citadel_DB. This being said I never actually 'detached' the database as is suggested (https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000kHPeSAM&l=en-CH) I simply just copy and pasted the data (probably not good practice though).

 

I had a bunch of different backup versions of the Citadel DB files so I was able to find one which didn't have these extra files. Then when I attached it, it worked just fine.

 

Not sure if that helps but ye

0 Kudos
Message 4 of 5
(1,274 Views)

Hi,

I think that my problem is that the database that I created using the DSC Modle is a SQL OLE DB Database, not a Citadel Database. This is why I cannot trace the data values with the Historical Data Viewer.

But thank you for your fast reply!

EngHyCo - Adriana Oliva
0 Kudos
Message 5 of 5
(1,242 Views)