docker 安装oracle11gR2

1.拉去oracle数据库镜像

docker pull registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g 


2.启动oracle  自动启动镜像 --restart=always

docker run -p 1521:1521 --name oracle_11g -d --restart=always registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g


3.启动服务

docker start oracle_11g


4.进入控制台设置用户信息 

docker exec -it oracle_11g bash


5.切换到root用户模式下

su root


输入密码helowin
6.编辑profile文件配置ORACLE环境变量  命令:vi /etc/profile

export ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_2
export ORACLE_SID=helowin
export PATH=$ORACLE_HOME/bin:$PATH


7.重启配置文件服务 命令:source /etc/profile


8.建立sqlplus软连接

ln -s $ORACLE_HOME/bin/sqlplus /usr/bin

注:或者重新启用 profile文件
9.切换到oracle用户,修改oracle的相关账号密码

su oracle


登录sqlplus并修改sys、system用户密码

sqlplus /nolog
conn /as sysdba
alter user system identified by oracle;
alter user sys identified by oracle;
ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;

10.配置listen.ora文件,此处贴出代码

# listener.ora Network Configuration File: /home/oracle/app/oracle/product/11.2.0/dbhome_2/network/admin/listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = helowin)
      (ORACLE_HOME = /home/oracle/app/oracle/product/11.2.0/dbhome_2)
      (GLOBAL_DBNAME = helowin)
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST =localhost )(PORT = 1521))
    )
  )

ADR_BASE_LISTENER = /home/oracle/app/oracle

.配置tnsnames.ora文件,此处贴出代码

# tnsnames.ora Network Configuration File: /home/oracle/app/oracle/product/11.2.0/dbhome_2/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

LISTENER_HELOWIN =
  (ADDRESS = (PROTOCOL = TCP)(HOST =127.0.0.1)(PORT = 1521))

HELOWIN =
  (DESCRIPTION=
    (ADDRESS = (PROTOCOL = TCP)(HOST =127.0.0.1)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = helowin)
    )
  )

 

你可能感兴趣的:(docker 安装oracle11gR2)