Can docker use oracle?

王林
Release: 2020-04-04 14:06:18
Original
3512 people have browsed it

Can docker use oracle?

1. Query plug-in

docker search orcalce
Copy after login

Can docker use oracle?

What we pulled is the second orcale-12c.

2. Pull

docker pull docker.io/sath89/oracle-12c
Copy after login

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
Copy after login
chmod -R 777 /var/local/oracle  # 有可能docker没有权限, 所以加上这一句
Copy after login

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
Copy after login

5. View the log

docker logs -f xxxxx
Copy after login

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
Copy after login

7. Use oracle user

su oracle #切换到oracle用户
Copy after login

8. Operation user

$ $ORACLE_HOME/bin/sqlplus / as sysdba #进入sqlplus
Copy after login
SQL>> ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED; #密码有效期修改
Copy after login
SQL>> alter user SYSTEM account unlock #解锁用户
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template