将 Image 类型的数据从 SQL Server 2005 迁移到 Oracle 10g 中的 BLOB 列
我们需要帮助将 Image 类型的数据从 SQL Server 2005 迁移到 Oracle 10g 中的 BLOB 列。
SQL Server 2005 图像数据类型列包含从前端附加到系统的文件的数据。文件可以是 xls、jpg、txt 等。 我们需要将此附件显示在另一个应用程序的前端,该应用程序使用 ORACLE 10g 作为后端。
我们已经使用 Informatica 尝试过此操作,但无法查看文件内容。但它能够检测文件类型(xls、jpg、txt 等),但内容为空白。我们不确定在进行 Informatica 映射时是否需要使用任何特定选项。
We need help in migrating data of Image type from SQL Server 2005 to a BLOB column in Oracle 10g.
SQL Server 2005 column of image data type contains data for files attached to the system from front end. Files could be xls, jpg, txt etc.
We need this attachment to be displayed in the front end of another application, which uses ORACLE 10g as back end.
We have already tried this using Informatica but the content of the files could not be viewed. But it is able to detect the type of file (xls, jpg, txt etc) but the content is blank. We aren’t sure if any specific option needs to be used while doing Informatica mapping.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,BLOB 就是这样。一长串二进制数据。没有元信息详细说明数据所采用的格式(如果有)。
通常,如果 BLOB 源自文件,则文件名将记录在单独的列中。在许多情况下,文件名的后缀指示数据的性质。以“.xls”结尾的文件可能是 Excel 电子表格(但您可以轻松地重命名图像文件以以 .xls 结尾)。音频和视频文件更为复杂,因为虽然后缀可能会让您有所了解,但 MPG 文件内部可能使用不同的编解码器。因此,一台 PC 可能会喜欢播放某些 MPG,但不会喜欢其他 MPG,即使其他 MPG 在另一台机器上玩得很开心。
当您将文件发送到 Web 浏览器时,您会发送一个标题行,例如“Content-Type: application/msword”。这向浏览器建议应该使用什么应用程序来打开文件。浏览器接受该建议并打开它认为最合适的查看器(对于 PDF 可能是 Adobe Reader,但用户及其操作系统/环境设置可能会将其指向不同的阅读器,例如 FoxIt)。
我建议您首先将一些文件传输到操作系统。也许使用 BFILE 将它们写入服务器上的操作系统文件并通过 FTP 传输它们,最好使用原始文件名。然后查看本地/客户端计算机是否可以使用适当的应用程序打开该文件。
如果可以,则数据是干净的,问题出在应用程序上。您还应该能够使用校验和来确认迁移后的数据与迁移前的数据相同。
Firstly, a BLOB is just that. A long stream of binary data. There is no meta information detailing what format, if any, that data lives in.
Commonly if a BLOB has been sourced from a file, then the file name will have been recorded in a separate column. In many cases the suffix of the file name indicates the nature of the data. A file ending in ".xls" is PROBABLY an Excel spreadsheet (but you can quite easily rename an image file to end with a .xls). Audio and video files are more complicated matter as, while the suffix may give you an idea, MPG files might use different codecs internally. So a PC may be happy playing some MPGs but not others even if those others play quite happily on another machine.
When you throw a file to a web browser, you send a header line like "Content-Type: application/msword". This suggests to the browser what application should be be used to open a file. The browser takes that suggestion and opens what it thinks is the most appropriate viewer (it might be Adobe Reader for a PDF, but the user and their OS/environment settings might point it to a different reader, such as FoxIt).
I recommend you first transfer some of the files to the OS. Perhaps use a BFILE to write them to an OS file on the server and FTP them across, preferably with the original filename. Then see if the local/client machine can open the file with the appropriate application.
If it can, then the data is clean, and the issue is with the application. You should also be able to use checksums to confirm that the data after migration is the same as the data before migration.