Import Oracle dump tables to Oracle Database in docker

1.5k Views Asked by At

OS is Ubuntu 20.04. I have a Oracle Database 19c which is in docker. In details, In /opt, I create oracle folder with subfolders and give them grant. You see them in following:

sudo chmod 777 /opt/oracle/admin/
sudo chown -R root /opt/oracle/admin/
sudo chmod 777 /opt/oracle/oradata/
sudo chown -R root /opt/oracle/oradata/
sudo chmod 777 /opt/oracle/scripts/startup/
sudo chown -R root /opt/oracle/scripts/startup/
sudo chmod 777 /opt/oracle/scripts/setup/
sudo chown -R root /opt/oracle/scripts/setup/

Then I run the Oracle Docker image with this command:

sudo docker run --name oracledb --shm-size=4g -p 1521:1521 -p 5500:5500 -e ORACLE_SID=testdb -e ORACLE_PDB=testpdb -e ORACLE_PWD=Oracle123 -v /opt/oracle/oradata:/opt/oracle/oradata -v /opt/oracle/admin:/opt/oracle/admin -v /opt/oracle/scripts/startup:/opt/oracle/scripts/startup -v /opt/oracle/scripts/setup:/opt/oracle/scripts/setup oracle:19.3.0

After running Oracle, I open sqlnet.ora in /opt/oracle/oradata/dbconfig/TESTDB of the host and change its content. After making change, it is like this:

SQLNET.AUTHENTICATION_SERVICES=(ALL)
NAMES.DIRECTORY_PATH= (EZCONNECT, TNSNAMES, HOSTNAME)
SQLNET.ALLOWED_LOGON_VERSION_CLIENT=8
SQLNET.ALLOWED_LOGON_VERSION_SERVER=8
SQLNET.ALLOWED_LOGON_VERSION=8

Other two file are like this: listener.ora

 LISTENER =
  (DESCRIPTION_LIST =
   (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
   )
  )

tnsnames.ora

TESTDB=localhost:1521/TESTDB
TESTPDB=
  (DESCRIPTION =
   (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
   (CONNECT_DATA =
     (SERVER = DEDICATED)
     (SERVICE_NAME = TESTPDB)
   )
  )

DEDICATED_THROUGH_BROKER_LISTENER=ON DIAG_ADR_ENABLED = off

It is run without problem. I install Bbvis and create a User, but I cannot import any ".dmp" table. Even though I can create user in Dbvis, UI Oracle does not work. I cannot see any thing in localhost:5500/em. It is strange for me. Also, I install Sql developer to import the tables, but I cannot connect to database at all. I receive this error:

Status : Failure -Test failed: IO Error: Got minus one from a read call

I try to use impdp in docker like this:

docker exec -it id_container impdp user/password DUMPFILE=cst.dmp

but I receive this error:

ORA-27101: shared memory realm does not exist

Moreover, when I run this command:

sudo docker exec -ti 6e277a00b558 sqlplus system/Pass@TESTPDB

It wants me to enter user-name and password. I enter "system" and its password. But it is not accepted and I receive this error:

ERROR:
 ORA-01034: ORACLE not available
 ORA-27101: shared memory realm does not exist
 Linux-x86_64 Error: 2: No such file or directory
 Additional information: 4376
 Additional information: -179270649
 Process ID: 0
 Session ID: 0 Serial number: 0

I search a lot and test every way to import the dump files into Oracle Docker in Ubuntu. Even, I install squirrelsql, but It can import CSV files which I do not have.

Any help is really appreciated.

0

There are 0 best solutions below