当前位置:网站首页>安装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
边栏推荐
- Introduction to 18mnmo4-5 steel plate executive standard and delivery status of 18mnmo4-5 steel plate, European standard steel plate 18mnmo4-5 fixed rolling
- Shell脚本-for循环和for int循环
- C language student information management system
- win7 pyinstaller打包exe 后报错 DLL load failed while importing _socket:参数错误
- Introduction to R language
- Screenshot tips
- 19Mn6 German standard pressure vessel steel plate 19Mn6 Wugang fixed binding 19Mn6 chemical composition
- Centos7 shell脚本一键安装jdk、mongo、kafka、ftp、postgresql、postgis、pgrouting
- Shell脚本-case in 和正则表达式
- SPL installation and basic use (II)
猜你喜欢

AVL树的理解和实现

Li Kou 1358 -- number of substrings containing all three characters (double pointer)

MAVROS发送自定义话题消息给PX4

如何做好固定资产管理?易点易动提供智能化方案

Matlab tips (23) matrix analysis -- simulated annealing

Introduction to R language

SPL installation and basic use (II)

FreeRTOS learning easy notes

3、Modbus通讯协议详解

The use of word in graduation thesis
随机推荐
MySQL8.0学习记录17 -Create Table
基础:3.opencv快速入门图像和视频
MAVROS发送自定义话题消息给PX4
[MFC development (16)] tree control
[deep analysis of C language] - data storage in memory
vscode自定义各个区域的颜色
Matlab tips (16) consistency verification of matrix eigenvector eigenvalue solution -- analytic hierarchy process
《单片机原理及应用》—定时器、串行通信和中断系统
【无标题】
Advanced C language pointer (Part 2)
中小企业固定资产管理办法哪种好?
[Yu Yue education] Shandong Vocational College talking about railway reference materials
Embedded Engineer Interview Question 3 Hardware
Serial port to WiFi module communication
电脑小技巧
AVL树的理解和实现
TypeError: __ init__ () got an unexpected keyword argument ‘autocompletion‘
《单片机原理及应用》-片外拓展
如何解决固定资产管理和盘点的难题?
I would like to know the process of stock registration and account opening by mobile phone? In addition, is it safe to open a mobile account?