当前位置:网站首页>安装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
边栏推荐
- 《MATLAB 神经网络43个案例分析》:第30章 基于随机森林思想的组合分类器设计——乳腺癌诊断
- SPL Introduction (I)
- 15Mo3 German standard steel plate 15Mo3 chemical composition 15Mo3 mechanical property analysis of Wuyang Steel Works
- V79.01 Hongmeng kernel source code analysis (user mode locking) | how to use the fast lock futex (Part 1) | hundreds of blogs analyze the openharmony source code
- Programming with C language: calculate with formula: e ≈ 1+1/1+ 1/2! …+ 1/n!, Accuracy is 10-6
- 电视机尺寸与观看距离
- Memory size end
- Matlab tips (16) consistency verification of matrix eigenvector eigenvalue solution -- analytic hierarchy process
- Audio-AudioRecord create(一)
- 《单片机原理及应用》-片外拓展
猜你喜欢

Advanced C language pointer (Part 2)

嵌入式工程师面试题3-硬件

FreeRTOS learning easy notes

R语言入门

The data analyst will be ruined without project experience. These 8 project resources will not be taken away

Matlab tips (16) consistency verification of matrix eigenvector eigenvalue solution -- analytic hierarchy process

Do you know how data is stored? (C integer and floating point)

"Analysis of 43 cases of MATLAB neural network": Chapter 30 design of combined classifier based on random forest idea - breast cancer diagnosis

Redis publish subscription

2022.2.15
随机推荐
Redis源码学习(29),压缩列表学习,ziplist.c(二)
Shell脚本-位置参数(命令行参数)
C语言学生信息管理系统
Embedded Engineer Interview Question 3 Hardware
Only in China! Alicloud container service enters the Forrester leader quadrant
Vscode customize the color of each area
Properties of 15MnNiNbDR low temperature vessel steel, Wugang 15MnNiDR and 15MnNiNbDR steel plates
一文纵览主流 NFT 市场平台版税、服务费设计
The era of low threshold programmers is gone forever behind the sharp increase in the number of school recruitment for Internet companies
Public network cluster intercom +gps visual tracking | help the logistics industry with intelligent management and scheduling
Glitch free clock switching technology
19Mn6 German standard pressure vessel steel plate 19Mn6 Wugang fixed binding 19Mn6 chemical composition
任务、线程、进程 区别
Introduction to R language
MySQL8.0学习记录17 -Create Table
MATLAB小技巧(23)矩阵分析--模拟退火
Foundation: 2 The essence of image
内存大小端
What is 1cr0.5mo (H) material? 1cr0.5mo (H) tensile yield strength
又到年中,固定资产管理该何去何从?