沧海仓忙忙,
看代码坑坑。
年轻就是好,
能抗坑能坑。


需要的知识越来越多,又要摘在ORACLE之中

入门oracle scott是必不可少的,所有问题就出现了

docker真是个好东西,能省下不事情,之前安装oracle反而失败了,只能重装,可怜巴巴!


环境
docker19
oracle11G
ubuntu20


1、进入docker oracle容器命令中

sudo docker exec -it oracle11 /bin/bash

2、先cd到oracle home中,进入放oracle sql脚本目录

cd $ORACLE_HOME
cd rdbms/admin

​ls -a​​ 之后就有一堆的sql脚本

3、​​ls -l scott.sql​​ 命令搜索scott用户脚本

ls -l scott.sql

docker oracle 11G 没有scott用户_oracle


  • 如果没有也不用担心,等会用 ​​utlsampl.sql​​脚本整
  • 如果有就 ​​pwd​​ 赋值一下这个路径

4、用一个账号登录进去oracle,并导入 ​​utlsampl.sql​​ 脚本


  • ​sqlplus ​
  • ​账号:`tina` 密码:`tinaroot` ​

docker oracle 11G 没有scott用户_docker_02

5、导入脚本

如果没有哦​​scott.sql​​就导入这个,导入成功会自动退出当前账号

@/u01/app/oracle/product/11.2.0/xe/rdbms/admin/utlsampl.sql

6、登录​​scott​​​用户,默认密码​​tiger​

sqlplus
账号: `scott`
密码: `toger`

查询一下当前表

select * from user_tables;

docker oracle 11G 没有scott用户_oracle_03

基本就搞定了

7、使用idea连接试试

docker oracle 11G 没有scott用户_docker_04

8、附带一下 解锁 scott 用户以及密码,要在 dba权限的用户哦

alter user scott account unlock;
alter user scott identified by tiger