1. Query plug-in
docker search orcalce
What we pulled is the second orcale-12c.
2. Pull
docker pull docker.io/sath89/oracle-12c
This is a bit slow, and the file is relatively large, but it reduces the installation and can be run.
3. Create the attached file directory
mkdir -p /var/local/oracle
chmod -R 777 /var/local/oracle # 有可能docker没有权限, 所以加上这一句
4. Start
docker run -d -p 2122:22 -p 9090:8080 -p 1521:1521 -v /var/local/oracle/:/u01/app/oracle/ --name orcalce sath89/oracle-12c
5. View the log
docker logs -f xxxxx
Comparison of first startup time It is long and needs to be initialized, so you need to wait.
6. Initialization
docker exec -it 867a9abf25a5 /bin/bash #867a9abf25a5是我的容器id
7. Use oracle user
su oracle #切换到oracle用户
8. Operation user
$ $ORACLE_HOME/bin/sqlplus / as sysdba #进入sqlplus
SQL>> ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED; #密码有效期修改
SQL>> alter user SYSTEM account unlock #解锁用户
9. Connection information
hostname: localhost
port: 1521
sid: xe
username: system
password: oracle
The password is default, but can be modified.
Recommended related tutorials: docker tutorial
The above is the detailed content of Can docker use oracle?. For more information, please follow other related articles on the PHP Chinese website!