Skip to content

Instantly share code, notes, and snippets.

@jpina
Last active April 14, 2023 17:08
Show Gist options
  • Save jpina/3a5360188cf4b02c070e to your computer and use it in GitHub Desktop.
Save jpina/3a5360188cf4b02c070e to your computer and use it in GitHub Desktop.
Start Oracle 11g Express in a docker container

Oracle 11g Express in a docker container

Start the container:

docker run -d --name oracle -p 49160:22 -p 49161:1521 \
-e ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe \
-e ORACLE_SID=xe \
-e TNS_ADMIN=$ORACLE_HOME/network/admin \
-e SQLPLUS=$ORACLE_HOME/bin/sqlplus \
wnameless/oracle-xe-11g

Fix the password expiration

docker exec -i oracle bash -c 'echo "ALTER PROFILE DEFAULT LIMIT PASSWORD_REUSE_TIME UNLIMITED;" | /u01/app/oracle/product/11.2.0/xe/bin/sqlplus system/oracle@localhost:1521'

docker exec -i oracle bash -c 'echo "ALTER PROFILE DEFAULT LIMIT FAILED_LOGIN_ATTEMPTS UNLIMITED;" | /u01/app/oracle/product/11.2.0/xe/bin/sqlplus system/oracle@localhost:1521'

docker exec -i oracle bash -c 'echo "ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;" | /u01/app/oracle/product/11.2.0/xe/bin/sqlplus system/oracle@localhost:1521'

docker exec -i oracle bash -c 'echo "ALTER PROFILE DEFAULT LIMIT PASSWORD_GRACE_TIME UNLIMITED;" | /u01/app/oracle/product/11.2.0/xe/bin/sqlplus system/oracle@localhost:1521'

docker exec -i oracle bash -c 'echo "ALTER USER system IDENTIFIED BY temp_password;" | /u01/app/oracle/product/11.2.0/xe/bin/sqlplus system/oracle@localhost:1521'

docker exec -i oracle bash -c 'echo "ALTER USER system IDENTIFIED BY oracle;" | /u01/app/oracle/product/11.2.0/xe/bin/sqlplus system/temp_password@localhost:1521'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment