Last active
June 24, 2021 12:41
-
-
Save rponte/9de866defd848f488e59faeaa4ca5eb8 to your computer and use it in GitHub Desktop.
Docker: list of useful commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# executing htop in host machine | |
docker run --name "htop" --rm -it --pid host jess/htop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# Oracle 11G XE NON-Official | |
# All instructions are here: https://hub.docker.com/r/epiclabs/docker-oracle-xe-11g | |
## | |
# running Oracle 11G XE container (some examples) | |
docker run --name oracle-xe -d -p 1521:1521 -e ORACLE_ALLOW_REMOTE=true -e ORACLE_PASSWORD=manager epiclabs/docker-oracle-xe-11g | |
docker run --name oracle-xe -d -p 1521:1521 -e ORACLE_ALLOW_REMOTE=true -e ORACLE_PASSWORD=manager -e RELAX_SECURITY=1 epiclabs/docker-oracle-xe-11g | |
docker run --name oracle-xe -d -p 1521:1521 -e ORACLE_ALLOW_REMOTE=true -e ORACLE_PASSWORD=manager -e RELAX_SECURITY=1 -v "$PWD/oracle-data":/u01/app/oracle epiclabs/docker-oracle-xe-11g | |
# ...with memory constraints | |
docker run --name oracle-xe -d --memory=1g -p 1521:1521 -e ORACLE_ALLOW_REMOTE=true -e ORACLE_PASSWORD=manager -e RELAX_SECURITY=1 epiclabs/docker-oracle-xe-11g | |
# tuning database | |
docker exec -it oracle-xe /bin/bash | |
echo "ALTER SYSTEM SET processes=200 scope=spfile;" | sqlplus -s SYSTEM/manager | |
echo "ALTER SYSTEM SET FILESYSTEMIO_OPTIONS=ASYNCH SCOPE=SPFILE;" | sqlplus -s SYSTEM/manager | |
echo "ALTER SYSTEM SET disk_asynch_io=TRUE SCOPE=SPFILE;" | sqlplus -s SYSTEM/manager | |
service oracle-xe restart | |
# installing htop | |
docker exec -it oracle-xe /bin/bash | |
apt-get -y install htop | |
# executing htop | |
docker exec -it oracle-xe htop | |
# stopping container | |
docker stop oracle-xe | |
# destroying container | |
docker container rm oracle-xe | |
# ...with SIGKILL | |
docker container rm -f oracle-xe | |
# ...with SIGKILL and removes volumes associated with the container | |
docker container rm -fv oracle-xe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# Oracle 11G XE Official | |
# All instructions are here: https://github.com/oracle/docker-images/tree/master/OracleDatabase/SingleInstance | |
## | |
# building Oracle 11G XE image | |
git clone https://github.com/oracle/docker-images.git | |
cd docker-images/OracleDatabase/SingleInstance/dockerfiles | |
cp ~/workspace/databases/oracle/oracle-xe-11.2.0-1.0.x86_64.rpm.zip 11.2.0.2/ | |
./buildDockerImage.sh -v 11.2.0.2 -x | |
# running Oracle 11G XE container (some examples) | |
docker run --name oracle-xe-official -d --shm-size=1g -p 1521:1521 -e ORACLE_PWD=manager oracle/database:11.2.0.2-xe | |
docker run --name oracle-xe-official -d --shm-size=1g -p 1521:1521 -p 8086:8080 -e ORACLE_PWD=manager oracle/database:11.2.0.2-xe | |
docker run --name oracle-xe-official -d --shm-size=1g -p 1521:1521 -p 8086:8080 -e ORACLE_PWD=manager -v "$PWD/oracle-data":/u01/app/oracle/oradata oracle/database:11.2.0.2-xe | |
# ...with memory constraints | |
docker run --name oracle-xe-official -d --memory=1g --shm-size=1g -p 1521:1521 -p 8086:8080 -e ORACLE_PWD=manager oracle/database:11.2.0.2-xe | |
# ...with memory constraints and timezone | |
docker run --name oracle-xe-official -d --memory=1g -e TZ="America/Fortaleza" --shm-size=1g -p 1521:1521 -p 8086:8080 -e ORACLE_PWD=manager oracle/database:11.2.0.2-xe | |
# tuning database | |
docker exec -it oracle-xe-official /bin/bash | |
echo "ALTER SYSTEM SET processes=200 scope=spfile;" | sqlplus -s SYSTEM/manager@//localhost:1521/XE | |
echo "ALTER SYSTEM SET FILESYSTEMIO_OPTIONS=ASYNCH SCOPE=SPFILE;" | sqlplus -s SYSTEM/manager@//localhost:1521/XE | |
echo "ALTER SYSTEM SET disk_asynch_io=TRUE SCOPE=SPFILE;" | sqlplus -s SYSTEM/manager@//localhost:1521/XE | |
service oracle-xe restart | |
# installing htop | |
docker exec -it oracle-xe-official /bin/bash | |
yum -y install htop | |
# executing htop | |
docker exec -it oracle-xe-official htop | |
# stopping container | |
docker stop oracle-xe-official | |
# destroying container | |
docker container rm oracle-xe-official | |
# ...with SIGKILL | |
docker container rm -f oracle-xe-official | |
# ...with SIGKILL and removes volumes associated with the container | |
docker container rm -fv oracle-xe-official | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# showing logs | |
docker logs oracle-xe-official | |
# ...and following it | |
docker logs --follow oracle-xe-official | |
# showing statistics | |
docker stats --no-stream | |
docker stats --no-stream oracle-xe-official | |
# ...interactively | |
docker stats | |
docker stats oracle-xe-official | |
# cleaning a volume | |
docker volume rm -f my_volume | |
# clearing ALL volume | |
docker volume prune | |
# ...without prompting for confirmation | |
docker volume prune -f |
Podemos usar o serviço composerize para ajudar a gerar docker-compose.yml
a partir do comando docker run ...
Blog do Vlad Mihalcea: 9 High-Performance Tips when using Oracle with JPA and Hibernate
Since Unix-based operation systems have their own page cache, it’s important to mound the data and index partitions using Direct I/O (e.g., O_DIRECT) to avoid storing the same page in both the OS cache and the Buffer Pool.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Performance Tips
I got a better performance using
DIRECTIO
instead ofASYNC
:Surprisingly , I also got a better performance using emulated
ASYNC
(which in turn also works when mouting volumes on Windows 7):So, using
DIRECTIO
or even emulatedASYNC
is way better than using the nativeASYNC
. By the way, all tests were made with Docker Engine v18.09.5 on Windows 7.