For existing DB, build isolated test from scratch
install oracle XE
- connect to system instance
1 | connect system/password; |
the password that you entered during the installation.
- create user
create user username identified by ‘password’;
and also to give this user some privileges for creating tables, views and so on . .
- grant access
1 | grant dba,resource, connect to username; |
Obtain the DDL of the table needed
In dev Oracle DB
-
Install Oracle XE
-
using sql developer to export existing schema definition
-
in new database,
create required table space
create tablespace tablespacename datafile ‘datafilename.dbf’ size 40m online;
change tablespace’s autoextend pram
ALTER DATABASE DATAFILE ‘datafilename.dbf’ AUTOEXTEND ON MAXSIZE UNLIMITED; -
in SQL developer, connect to database using created user
Export existing schema definition using SQL Developer
Run in backuped database -
create same schema by create the user
create useridentified by ;
Issues
1 | <ErrorDesc>Child SQL exception ( HY000 2289 [IBM][ODBC Oracle Wire Protocol driver][Oracle]ORA-02289: sequence does not exist )</ErrorDesc> |
Reason
forgot to create trigger for the tables.
set up Oracle with Docker on Mac OS
https://www.esentri.com/blog/2017/05/15/create-and-use-a-docker-container-with-oracle-xe-on-macos/
https://github.com/oracle/docker-images/tree/master/OracleDatabase
1 | ./buildDockerImage.sh -v 12.2.0.1 -s -i |
1 | ORACLE PASSWORD FOR SYS, SYSTEM AND PDBADMIN: eVG7PQ0Dnxc=1 |
1 | docker container ps -a |
connect from SQL Developer
user pdbadmin
password eVG7PQ0DnxcI
port 1521
service name ORCLPDB1
data storage: ~/data/oracledata
shutdown the environment
1 | docker stop 35d6ef419dba |