Skip to content

Commit b05073d

Browse files
committed
added basic support for Oracle.
1 parent 63a6ce1 commit b05073d

15 files changed

+730
-260
lines changed

ORACLE.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
Testing hints for Oracle with testcontainers
2+
============================================
3+
4+
Follow the guideline:
5+
6+
https://blogs.oracle.com/oraclemagazine/deliver-oracle-database-18c-express-edition-in-containers
7+
8+
for setting up an Oracle docker image.
9+
10+
11+
The initial setup of the image (due to large downloads) will probably take around 30 mins.
12+
13+
Oracle docker images repository:
14+
15+
https://github.com/oracle/docker-images
16+
17+
Since the [Oracle-XE Module](https://www.testcontainers.org/modules/databases/oraclexe/)
18+
from [testcontainers](https://www.testcontainers.org/) doesn't work properly,
19+
a custom [OracleContainer](src/test/java/com/findinpath/connect/nestedset/jdbc/testcontainers/OracleContainer.java)
20+
has been developed for test purposes.
21+
22+
The `system` user is a restricted Oracle user and when trying to connect with this user
23+
the following exception will be thrown:
24+
25+
```
26+
ORA-12526, TNS:listener: all appropriate instances are in restricted mode
27+
```
28+
29+
30+
Workaround:
31+
32+
Set a breakpoint on
33+
`org.testcontainers.containers.JdbcDatabaseContainer.createConnection`
34+
35+
and after the database within the testcontainers test has started, execute the following script:
36+
37+
```bash
38+
docker exec -it --user=oracle ${oracle_image_name} bash
39+
```
40+
41+
```sqlplus
42+
sqlplus /nolog
43+
conn sys as sysdba
44+
password: oracle
45+
alter system disable restricted session;
46+
```

0 commit comments

Comments
 (0)