当前位置:网站首页>安装Oracle EE
安装Oracle EE
2022-07-01 08:39:00 【sirwsl】
前期
进入自己需要设置的目录,创建文件夹,文件夹授权
mkdir xxx
chmod o+w /oracle/oradata
chmod 777 /oracle/oradata
安装ORACLE EE
1:查找镜像
docker search oracle19c
2:选择适合的镜像
docker pull heartu41/oracle19c
3:运行
docker run -p 1521:1521 -p 5500:5500 \
--name oracletest \
--privileged=true \
--restart=always \
-e ORACLE_SID=ORCL \
-e ORACLE_PDB=ORCLTEST \
-e ORACLE_PWD=123456 \
-e ORACLE_CHARACTERSET=AL32UTF8 \
-e ORACLE_BASE=/opt/oracle \
-e ORACLE_EDITION=standard \
-e ORACLE_HOME=/opt/oracle/product/19c/dbhome_1 \
-e ORACLE_ALLOW_REMOTE=true \
-e TZ=Asia/Chongqing \
-e PATH=/opt/oracle/product/19c/dbhome_1/bin:/opt/oracle/product/19c/dbhome_1/OPatch/:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
-e NLS_LANG=AMERICAN_AMERICA.AL32UTF8 \
NLS_DATE_LANGUAGE
-it \
-v /data/oracle/oradata:/opt/oracle/oradata \
-d f59790109034
查看:
docker logs -ft oracletest
4:查看设置时区是否生效
docker exec -it oracletest date +"%Z %z"
5:进入容器
docker exec -it oracletest /bin/bash
6:修改密码
./setPassword.sh 123456
7:设置PDB
grep $ORACLE_HOME /etc/oratab | cut -d: -f1
export ORACLE_SID=ORCL
8:连接数据库
sqlplus / as sysdba
10:取消受限模式
alter system disable restricted session;
9:执行
alter session set "_ORACLE_SCRIPT"=true;
9:查看
show pdbs;

10:创建模式后授权表空间
ALTER USER 用户名 QUOTA UNLIMITED ON 表空间
11 如果需要修改字符集或者环境变量
查询:
SELECT USERENV('language') FROM dual;
则安装vim
docker exec -it --user root oracletest /bin/bash
yum install vim
编辑文件
vim ~/.bash_profile
添加
export NLS_LANG="SIMPLIFIED CHINESE_CHINA".ZHS16GBK
or
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
or
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
加载文件
source ~/.bash_profile
修改oracle参数形式
select * from v$nls_parameters;

创建用户表空间
-- 移除表空间
DROP TABLESPACE HTHSETEMP INCLUDING CONTENTS AND DATAFILES
-- 移除用户
drop user HSE_TEMP CASCADE
-- 创建表空间
CREATE TABLESPACE NTHSETESTPSPACE
DATAFILE '/opt/oracle/oradata/ORCL/ORCLTEST/NTHSETESTPSPACE.dbf'
SIZE 20G AUTOEXTEND ON next 4G
-- 创建用户
CREATE USER HSE_TEMP IDENTIFIED BY 000000
--- 修改密码
alter user 用户名 identified by 新密码;
-- 修改用户表空间
ALTER USER HSE_TEMP quota unlimited ON HTHSETEMP
-- 实际应用
create user <username> identified by <password>
default tablespace <tablespace_name> -- 默认表空间
temporary tablespace temp -- 临时表空间
quota unlimited on <tablespace_name> -- 表空间额度
-- 权限设设置
grant create session to HSE_TEMP
grant create table to HSE_TEMP
grant create tablespace to HSE_TEMP;
grant create any view to HSE_TEMP;
grant connect,resource to HSE_TEMP;
grant create any sequence to HSE_TEMP;
grant create any table to HSE_TEMP;
grant delete any table to HSE_TEMP;
grant insert any table to HSE_TEMP;
grant select any table to HSE_TEMP;
grant unlimited tablespace to HSE_TEMP;
grant execute any procedure to HSE_TEMP;
grant update any table to HSE_TEMP;
-- 查看当前用户的权限
select * from role_sys_privs;
常用命令
startup mount #启动
shutdown immediate; 关闭
sqlplus / as sysdba 进入
lsnrctl status 查看监听状态
lsnrctl start 开启监听
lsnrctl reload 重启
lsnrctl stop 停止
其余问题
问题
cannot mount database in EXCLUSIVE mode
解决:
cd $ORACLE_HOME/dbs
ls lk*
rm lk*
问题
ORA-00205: error in identifying control file, check alert log for more info : (
解决
ipcs -s
ipcrm -s semid-NO.
问题
ORA-00214: control file '/opt/oracle/oradata/ORCL/control01.ctl' version 2647
inconsistent with file '/opt/oracle/oradata/ORCL/control02.ctl' version 2613
解决
cd /opt/oracle/oradata/ORCL/
ls
cp control01.ctl control02.ctl
边栏推荐
- R语言入门
- 基础:3.opencv快速入门图像和视频
- Principle and application of single chip microcomputer - principle of parallel IO port
- R语言观察日志(part24)--初始化设置
- 《MATLAB 神经网络43个案例分析》:第30章 基于随机森林思想的组合分类器设计——乳腺癌诊断
- 固定资产管理系统让企业动态掌握资产情况
- Qt的模型与视图
- The era of low threshold programmers is gone forever behind the sharp increase in the number of school recruitment for Internet companies
- The meaning of yolov5 training visualization index
- 中断与其他函数共享变量、临界资源的保护
猜你喜欢

AES简单介绍

【无标题】

Bimianhongfu queren()
![[JS reverse] MD5 encryption parameter cracking](/img/06/0610045d287f646479d6eb5021a067.png)
[JS reverse] MD5 encryption parameter cracking

Properties of 15MnNiNbDR low temperature vessel steel, Wugang 15MnNiDR and 15MnNiNbDR steel plates

《微机原理》—总线及其形成

MD文档中插入数学公式,Typora中插入数学公式

What are the differences between the architecture a, R and m of arm V7, and in which fields are they applied?

C语言指针的进阶(下)

The use of word in graduation thesis
随机推荐
Qt的模型与视图
C语言学生信息管理系统
1.jetson与摄像头的对接
MD文档中插入数学公式,Typora中插入数学公式
《微机原理》-绪论
"Analysis of 43 cases of MATLAB neural network": Chapter 30 design of combined classifier based on random forest idea - breast cancer diagnosis
TypeError: __init__() got an unexpected keyword argument ‘autocompletion‘
In depth learning training sample amplification and tag name modification
Do you know how data is stored? (C integer and floating point)
3. Detailed explanation of Modbus communication protocol
日常办公耗材管理解决方案
《单片机原理与应用》——并行IO口原理
嵌入式工程师面试-常问问题集
Differences among tasks, threads and processes
中考体育项目满分标准(深圳、安徽、湖北)
Personal decoration notes
Properties of 15MnNiNbDR low temperature vessel steel, Wugang 15MnNiDR and 15MnNiNbDR steel plates
Programming with C language: calculate with formula: e ≈ 1+1/1+ 1/2! …+ 1/n!, Accuracy is 10-6
Centos7 shell脚本一键安装jdk、mongo、kafka、ftp、postgresql、postgis、pgrouting
Bimianhongfu queren()