docker 安装 oracle11g

博客介绍了Oracle相关操作,包括拉取镜像、运行容器、进入容器、修改密码等步骤,还涉及编辑 /etc/profile 文件配置ORACLE环境变量、创建软连接以及登录sqlplus等信息技术操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

拉取镜像

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

运行容器

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

进入容器

docker exec -it oracle11g /bin/bash

修改密码

[root@centos7 ~]# docker exec -it oracle11g /bin/bash
[oracle@79a99e56edfd /]$ su root
Password: helowin
[root@79a99e56edfd /]# su - oracle
[oracle@79a99e56edfd ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sat Oct 29 14:51:20 2022

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> SELECT * FROM ALL_USERS;


SQL> alter user SYSTEM account unlock;

User altered.

SQL> alter user SYSTEM  identified by system;

User altered.

SQL> alter user scott account unlock;

User altered.

SQL> alter user scott identified by scott;

User altered.

SQL> 

编辑 /etc/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

创建软连接

ln -s $ORACLE_HOME/bin/sqlplus /usr/bin
source /etc/profile

登录sqlplus

sqlplus /nolog
conn /as sysdba

sql

alter user 用户名 account unlock; --------- 解除锁定(必须带“;”号,注意用英文字符)

alter user 用户名 identified by 密码; -------------修改密码

查看某个用户是否被锁:

select LOCK_DATE,username from dba_users where username='用户名';

LOCK_DATE为空说明没有锁定,非空为锁定。
Oracle sys密码的重置方法:
在系统运行中输入:sqlplus/nolog
在命令窗口分别执行:conn/as sysdba

//查询所有用户
SELECT * FROM ALL_USERS;
//查询用户下的所有表
select * from all_tables where owner='用户名';
//删除表
drop table 表名;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值