一、CentOS 安装
1. 启动
su - oracle
lsnrctl start
lsnrctl status
sqlplus /nolog
SQL> conn /as sysdba
SQL> startup
2. 停止
SQL> shutdown
SQL> quit
lsnrctl stop
二、Docker 安装
docker安装Oracle 11g docker搭建oracle开发环境
1. 创建容器
docker pull registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g
docker run -id --name = oracle -p 1521 :1521 '镜像ID'
mkdir /root/oracle
docker cp oracle:/home/oracle/app/oracle/oradata/ /root/oracle/
docker cp oracle:/home/oracle/app/oracle/flash_recovery_area/helowin/ /root/oracle/
docker rm -f oracle
docker run -d --name = oracle_1 -p 1521 :1521 \
-v /root/oracle/oradata:/home/oracle/app/oracle/oradata \
-v /root/oracle/helowin:/home/oracle/app/oracle/flash_recovery_area/helowin \
'镜像ID'
oracle 11.0.2 64bit
企业版的实例名: helowin
推荐使用 docker-compose
管理。
2. 创建用户
docker exec -it 容器ID /bin/bash
source /home/oracle/.bash_profile
sqlplus /nolog
connect /as sysdba
create user qs identified by 123456 ;
grant connect,resource,dba to qs;
3. 登陆容器
docker exec -it 容器ID /bin/bash
su
password:helowin
su - oracle
sqlplus qs/123456
4. 容器异常
locale
locale -a LANG = C.UTF-8
source /etc/profile
export LANG = C.UTF-8
SQL> show linesize
SQL> set linesize
SQL> column name format a15
SQL> column age format 999999
SQL> column name heading userename