最近做了些数据库转换工作,主要是从Sql Server转换到Oracle,过程中遇到很多问题,现进行一个小小总结,方便有同样需求的朋友们。 需要对数据库结构、数据、自定义函数、存储过程等数据库元素进行转换,由于Sql Server和Oracle数据库语言本身的差异非常大,
最近做了些数据库转换工作,主要是从Sql Server转换到Oracle,过程中遇到很多问题,现进行一个小小总结,方便有同样需求的朋友们。
需要对数据库结构、数据、自定义函数、存储过程等数据库元素进行转换,由于Sql Server和Oracle数据库语言本身的差异非常大,所以自定义函数和存储过程的转换是比较困难的一件事情,市面上也很少有这方面的工具,几乎都想直接写工具了,后来却找到了个国外的一个叫做“SwissSQL-SQL Server To Oracle”这样的工具,此工具可以在http://www.swissql.com/站点上下载,使用方法有两种,一种是转换TSQL脚本到PLSQL,一种是通过JDBC连接到SQLServer数据库进行转换,转换后的结果都保存为PLSQL脚本,要导入Oracle需要运行这些脚本。此软件是用Java语言编写在安装之前必须先安装JDK,在试用过程中发现此工具存在这么几个问题:
1、此工具在转换数据结构的过程中把varchar的数据类型都转换成varchar2(1)了而不管原谅数据有多长统一都转换成1个长度,我不知道这么简单的BUG有没有其他设置的地方,反正后来我们没用它转数据结构也就没怎么研究了。
2、此工具为试用版本,我们也没找到注册版,而试用版只能前后转换共2000行SQL语句,而要购买这个软件也不太实际,费用高不说,还是外国的买起来也麻烦,软件为转换这么几个存储过程去耗费这么大的资金在我们这些用盗版的人看来是不可取的,我们的数据库对象那么多,显然这是不好办的问题,那么能否用欺骗的手法蒙混过关呢?下面就是具体的欺骗手法了:
-记得以前用过一个软件叫着“完美卸载”此软件可以记录安装程序时对磁盘进行的更改,有了这个我们就可以安装软件的时候记录好此软件对磁盘所写入的文件,看看有什么异样这样我们就能理解共享软件在那个文件写入了注册信息。
-通过跟踪发现在安装软件的时候,安装程序除了对安装目录写入信息和少量的注册表信息外没有对磁盘做任何更改,别急,我们继续跟踪,跟踪到第一次运行软件的时候,就有了异样,发现此软件在Windows目录下写入了这个文件,赶忙备份此文件,转换了几行语句后,关闭软件,果然此文件再次被修改,这就说明很有可能此文件就是记录的软件试用的行数。当我们第二次使用的时候把备份的文件覆盖了原文件,但此事软件所有按钮都禁用了,说明软件还有其他的地方可以判断用户是否使用过软件。重新安装软件(其实就是把安装目录里的文件重置一下),结果又可以使用2000行了。这就是软件欺骗的全部过程,也是可当作破解软件的土办法,只是麻烦一点的是需要先备份安装目录和那个dll文件,注意那个dll文件不能通用,必须要程序生成的本机的dll文件。当快要用完试用行数的时候通过覆盖文件的方式欺骗软件,从而可以继续试用,就这么简单。
另外在转换数据库的过程中应该还要注意以下几个问题:
-在Oracle数据库中命名不能大于30个英文字符,无论是表名、存储过程名等等,统统不能大于30个字符。
-在Oracle数据库中,存储过程的定义更侠义一些,而不像SqlServer那样开放。特别像返回结果集这些操作上存在很多差异,在SQLServer可以直接试用select语句返回结果集,而Oracle只能把存储过程封装到包中设置Out参数的Cursor数据类型来达到返回结果集的目的,在存储过程内部不能直接试用Select语句返回结果集,很是不便。
-在使用单纯的SQL语句的时候,如果是多条语句,调用Oracle数据库就必须封装在begin/end语句块中。
-手动对Oracle数据库查询时可以选用PL/SQL Developer这个工具,蛮好用的。

InnoDBBufferPool reduces disk I/O by caching data and indexing pages, improving database performance. Its working principle includes: 1. Data reading: Read data from BufferPool; 2. Data writing: After modifying the data, write to BufferPool and refresh it to disk regularly; 3. Cache management: Use the LRU algorithm to manage cache pages; 4. Reading mechanism: Load adjacent data pages in advance. By sizing the BufferPool and using multiple instances, database performance can be optimized.

Compared with other programming languages, MySQL is mainly used to store and manage data, while other languages such as Python, Java, and C are used for logical processing and application development. MySQL is known for its high performance, scalability and cross-platform support, suitable for data management needs, while other languages have advantages in their respective fields such as data analytics, enterprise applications, and system programming.

MySQL is worth learning because it is a powerful open source database management system suitable for data storage, management and analysis. 1) MySQL is a relational database that uses SQL to operate data and is suitable for structured data management. 2) The SQL language is the key to interacting with MySQL and supports CRUD operations. 3) The working principle of MySQL includes client/server architecture, storage engine and query optimizer. 4) Basic usage includes creating databases and tables, and advanced usage involves joining tables using JOIN. 5) Common errors include syntax errors and permission issues, and debugging skills include checking syntax and using EXPLAIN commands. 6) Performance optimization involves the use of indexes, optimization of SQL statements and regular maintenance of databases.

MySQL is suitable for beginners to learn database skills. 1. Install MySQL server and client tools. 2. Understand basic SQL queries, such as SELECT. 3. Master data operations: create tables, insert, update, and delete data. 4. Learn advanced skills: subquery and window functions. 5. Debugging and optimization: Check syntax, use indexes, avoid SELECT*, and use LIMIT.

MySQL efficiently manages structured data through table structure and SQL query, and implements inter-table relationships through foreign keys. 1. Define the data format and type when creating a table. 2. Use foreign keys to establish relationships between tables. 3. Improve performance through indexing and query optimization. 4. Regularly backup and monitor databases to ensure data security and performance optimization.

MySQL is an open source relational database management system that is widely used in Web development. Its key features include: 1. Supports multiple storage engines, such as InnoDB and MyISAM, suitable for different scenarios; 2. Provides master-slave replication functions to facilitate load balancing and data backup; 3. Improve query efficiency through query optimization and index use.

SQL is used to interact with MySQL database to realize data addition, deletion, modification, inspection and database design. 1) SQL performs data operations through SELECT, INSERT, UPDATE, DELETE statements; 2) Use CREATE, ALTER, DROP statements for database design and management; 3) Complex queries and data analysis are implemented through SQL to improve business decision-making efficiency.

The basic operations of MySQL include creating databases, tables, and using SQL to perform CRUD operations on data. 1. Create a database: CREATEDATABASEmy_first_db; 2. Create a table: CREATETABLEbooks(idINTAUTO_INCREMENTPRIMARYKEY, titleVARCHAR(100)NOTNULL, authorVARCHAR(100)NOTNULL, published_yearINT); 3. Insert data: INSERTINTObooks(title, author, published_year)VA


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SublimeText3 English version
Recommended: Win version, supports code prompts!

SublimeText3 Chinese version
Chinese version, very easy to use

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software