用于集成测试的嵌入式或托管 Oracle 实例
对于 MySQL,MXJ 连接器可以非常轻松地启动托管 MySQL 实例。
我知道 Oracle 提供了 Oracle XE 用于快速设置,但我'我们只找到了需要安装的 RPM 发行版。是否有一个打包整齐的 jar,我可以将其放入类路径中并通过调用特定的 JDBC url(如 HSQLDB 或 MXJ)来启动?
我有兴趣让开发人员在本地以及我们的持续集成服务器上使用它来运行测试。
For MySQL, the MXJ connector makes it very easy to launch a managed MySQL instance.
I know that Oracle provides Oracle XE for quick setup, but I've only found an RPM distribution that needs to be installed. Is there a neatly packaged jar that I can just drop in the classpath and start up by calling a specific JDBC url, a la HSQLDB or MXJ?
I'm interested in having developers use this locally for running tests, as well as on our continuous integration server.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
简短的回答是否定的。Oracle 是数据库的一大块。除此之外,它通常希望自己由自己的特殊用户而不是客户端用户运行。
为简单起见,最好的选择是一个单独的数据库服务器,每个开发人员在数据库中都有自己的用户名/密码(因此有自己的独立架构)。
The short answer is No. Oracle is a big meaty chunk of database. Amongst other things, it generally expects itself to be run by its own special user rather than the client user.
For simplicity, your best bet is a separate DB server with each of your developers having their own username/password (and hence their own independent schema) in the database.
尽管 Oracle 不提供嵌入式数据库,但运行 Oracle XE 的本地 Docker 容器可能是适应 Oracle 特定的本地集成测试的理想方式。由于 Docker 容器在设计上本质上是短暂的,因此数据库也可以根据需要完全拆除,以提供干净的沙箱。
我发现 DockerHub 上的
alexeiled/docker-oracle-xe-11g
映像具有特别清晰的设置和文档说明:https://hub.docker.com/r/alexeiled/docker-oracle-xe-11g/启动 Docker 后容器,请务必:
重置密码...
。否则可能会抛出以下错误 尝试在 Oracle 11.2.0.2.0(64 位)中获取连接时出现 java.lang.ArithmeticException正如文档所述,
docker run
命令还可以设计为在容器启动时自动运行 SQL 脚本,这在 CI/集成测试工作流程中也非常有价值。希望这有帮助!
Although Oracle does not provide an embedded database, spinning up a local Docker container running Oracle XE might be an ideal way to accommodate Oracle-specific local integration tests. Since Docker containers are ephemeral in nature by design, the database could also be completely torn down as desired providing clean sandboxing.
The
alexeiled/docker-oracle-xe-11g
image on DockerHub I found has particularly clear setup and documentation instructions: https://hub.docker.com/r/alexeiled/docker-oracle-xe-11g/After spinning up the Docker container, be sure to:
Reset Password...
first. Otherwise the following error may be thrown java.lang.ArithmeticException when attempting to get connection in Oracle 11.2.0.2.0 (64 bit)As the documentation describes, the
docker run
command can also be designed to automatically run SQL scripts on the container's startup, which could also be very valuable in the CI/integration testing workflow.Hope this helps!