按照README创建Oracle数据库,执行Docker连接命令遇ORA-01034错误求助
Hey Mike, let's work through this error together. The ORA-01034: ORACLE not available and ORA-27101: shared memory realm does not exist messages tell us your instant client can't establish a connection to a running Oracle instance. Here's how to troubleshoot and fix this step by step:
Step 1: Verify the Database Container is Running
First, check if your InfraDB container is actually up and running:
docker ps
Look for a container named InfraDB with a status of Up. If it's stopped, start it with:
docker start InfraDB
Step 2: Confirm Network Connectivity Between Containers
Since you're using the SampleNET network, make sure both the database container and your instant client container are attached to it:
- Check the database container's network association:
You should seedocker inspect InfraDB | grep -A 5 NetworksSampleNETlisted under its networks. - Test if the client can reach the database container:
Run the instant client container in interactive bash mode first:
Then pingdocker run -it --network=SampleNET --rm store/oracle/database-instantclient:12.2.0.1 bashInfraDBto confirm connectivity:
If ping fails, manually attach the database container to the network:ping InfraDBdocker network connect SampleNET InfraDB
Step 3: Check if the Oracle Instance is Started
Even if the container is running, the Oracle instance might not have finished initializing or could be stopped. Enter the InfraDB container to verify:
- Access the container's shell:
docker exec -it InfraDB bash - Log in to SQL*Plus locally as SYSDBA:
sqlplus / as sysdba - Check the instance status:
If the status is notSELECT status FROM v$instance;OPEN, start the instance (this may take a few minutes):STARTUP;
Step 4: Validate Your Connection String
Double-check your connection parameters for accuracy:
- Service name
mindshift: Verify it's registered with the Oracle listener. In theInfraDBcontainer, run:
Look forlsnrctl statusmindshiftunder the "Services Summary" section. If it's missing, you may need to adjust the database'sservice_nameparameter or listener configuration. - SYSDBA privileges: Ensure the
SYSuser has remote SYSDBA access. Run this query locally in SQL*Plus:
TheSELECT username, sysdba FROM v$pwfile_users WHERE username = 'SYS';sysdbacolumn should showTRUE. If not, recreate the password file with SYSDBA privileges enabled.
Step 5: Check Client-Database Version Compatibility
Your instant client is version 12.2.0.1. Oracle clients can connect to newer database versions (e.g., 18c, 19c) but may have issues with extremely old or cutting-edge versions. If all other steps fail, confirm your InfraDB database version is compatible with 12.2.0.1.
内容的提问来源于stack exchange,提问作者Mike3355




