Skip to content

Instantly share code, notes, and snippets.

@kgust
Last active April 26, 2016 14:11
Show Gist options
  • Save kgust/49a8950b9c0e54b4d25e9bd6f5b488fd to your computer and use it in GitHub Desktop.
Save kgust/49a8950b9c0e54b4d25e9bd6f5b488fd to your computer and use it in GitHub Desktop.
Install Oracle 11g (contains tablespace resize)

Install Oracle 11g - works awesome

docker pull wnameless/oracle-xe-11g

Run with 22 and 1521 ports opened:

docker run -d -p 49160:22 -p 49161:1521 wnameless/oracle-xe-11g

Connect database with following setting:

hostname: localhost
port: 49161
sid: xe
username: system
password: oracle

Password for SYS

oracle

Login by SSH

ssh root@localhost -p 49160
password: admin

Check size of vm

ssh into machine 
find /var/lib/jbossas/domain -maxdepth 2 -type d -exec du -sh {} \;
find / -maxdepth 1 -type d -exec du -sh {} \;

delete the oracle install file from /tmp (to save some space)

To extend oracle tablespace

--check possble dbf
--find /u01/app/oracle/oradata -iname *.dbf

--login as sys dba in sql client and run these

ALTER TABLESPACE USERS
ADD DATAFILE '/u01/app/oracle/oradata/XE/users-x1.dbf' 
SIZE 300M
AUTOEXTEND ON NEXT 4M
MAXSIZE 8G;

--extend UNDO Space
ALTER TABLESPACE UNDOTBS1
ADD DATAFILE '/u01/app/oracle/oradata/XE/undotbs1-x1.dbf' 
SIZE 100M
AUTOEXTEND ON NEXT 4M
MAXSIZE 2G;f

--extend SYSTEM Space
ALTER TABLESPACE SYSTEM
ADD DATAFILE '/u01/app/oracle/oradata/XE/system-x1.dbf' 
SIZE 100M
AUTOEXTEND ON NEXT 4M
MAXSIZE 3G;

CREATE BIGFILE TABLESPACE CTEST1
DATAFILE '/u01/app/oracle/oradata/XE/ctest1.data' 
SIZE 300M
AUTOEXTEND ON NEXT 4M;

CREATE BIGFILE TABLESPACE GTEST1
DATAFILE '/u01/app/oracle/oradata/XE/gtest1.data' 
SIZE 300M
AUTOEXTEND ON NEXT 4M;
  • NOTE: YouCANNOT create another SID on xe version (it only allows ONE)
  • To RESTART ORacle XE
  • ssh into container and as root
 sudo /etc/init.d/oracle-xe status
 sudo /etc/init.d/oracle-xe restart

To delete all images from local docker

sudo docker rm `sudo docker ps -a -q`
sudo service docker restart
sudo docker rmi `sudo docker images -a -q`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment