在**工VPS上的Ubuntu 18.04安装oracle 11g,并用navicat远程连接。

一、安装Oracle镜像的过程

1、**工vps安装 OS:Ubuntu 18.04

2、已安装了Docker(安装doccker参照:https://www.runoob.com/docker/ubuntu-docker-install.html

二、安装Oracle镜像的过程

1、切换到root账号下,如果是普通账号,下面操作指令前面加sudo

2、搜索oracle镜像

          docker search oracle

3.下载oracle镜像

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

4.查看镜像

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

5.从下载的镜像创建并启动容器

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

           这里把新建的容器命名为oracle11

6.查看当前运行的容器

            docker ps

7.进入已经启动的Oracle的容器

           docker exec -it oracle11 bash

8、切换到oracle数据库的root 用户下
           容器用户名密码:  root / helowin        

                                         su     root

                                         helowin        
                       

9、编辑profile文件配置ORACLE环境变量:vi /etc/profile

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

9、创建软连接

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

10、切换到oracle 用户

             su  - oracle

11、进入sqlplus

   sqlplus /nolog

12、使用sysdba角色登录sqlplus

  Conn sys/oracle as sysdba

13、 oracle数据库的位数与navicat位数一致

         select from v$version; 

  

14、修改 sys 和 system 的密码并且修改密码的有效时间为无限:

alter user system identified by oracle;           --修改system用户账号密码;

alter user sys identified by oracle;                 --修改sys用户账号密码;

alter user  scott   identified by oracle;               --修改 scott 用户账号密码;

alter profile default limit password_life_time unlimited;                  --修改密码规则策略为密码永不过期;(会出现坑,后面讲解)

alter system set processes=1000 scope=spfile;                           --修改数据库最大连接数据;

alter user scott account unlock;            --注意这里记得后面的分号,不然后面会出现一个2,用户已更改,这样就完成解锁操作

alter user scott account lock;                           --注意这里记得后面的分号,这样就完成锁定账户操作

15、退出sqlplus

  exit

16、退出容器

  exit 或Ctrl+D

17、如果容器停用了,则重新启动, 用你实际的容器ID代替下面的container_ID

  docker start container_ID

18、停用正在运行的容器

  docker stop container_ID

19、navicat 15 连接 oracle  数据库system,scott用户等,Navicat 15不用再设置 “”instantclient_11_2“” Navicat自带有了,方便很多了)

 

 20、Navicat 15 for Oracle工具怎么连接oracle数据库的sys用户?Navicat 15不用再设置 “”instantclient_11_2“” Navicat自带有了,方便很多了。)

     

原文地址:https://www.cnblogs.com/brianlai/p/13449248.html