![]() ![]() Perform the tests that require performing. To perform a test, no additional set up nor any tear down is required. They will find the database objects and data that was part of the baseline image. Spinning up a container from the base line image is now done with: docker run -d -p 49160:22 -p 49161:1521 -e ORACLE_ALLOW_REMOTE=true -name oracle-xe-testbed Īfter a few seconds, the database has started up and remote database clients can start interacting with the database. The original container can now be stopped (or killed) and even removed. This command returns an id, the identifier of the Docker image that is now created for the current state of the container - our base line. The steps and the principles remain exactly the same.Īt this point, create an image of the baseline - that consists of the vanilla database with the current application release’s DDL and DML applied to it: docker commit -pause=true oracle-xe These actions represent the complete database installation of your application - that may consists of hundreds or thousands of objects and MBs of data. ![]() After 5–20 seconds, the database is created and started and can be accessed from an external database client.įrom the database client, prepare the database baseline, for example: create user newuser identified by newuser create table my_data (data varchar2(200)) insert into my_data values ('Some new data '||to_char(sysdate,'DD-MM HH24:MI:SS')) commit This will spin up a container called oracle-xe. Įxecute this statement on the Docker host: docker run -d -p 49160:22 -p 49161:1521 -e ORACLE_ALLOW_REMOTE=true -name oracle-xe wnameless/oracle-xe-11g The initial Docker container was created using an Oracle Database 11gR2 XE image. ![]() For running automated tests that require test data to be available in a known state, this is a nice way of working. Each container starts with a fresh setup. Here is a procedure for running an Oracle Database, preparing a baseline in objects (tables, stored procedures) and data, creating an image of that baseline and subsequently running containers based on that baseline image. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |