当前位置:网站首页>Oracle19c安装图文教程
Oracle19c安装图文教程
2022-08-02 02:15:00 【夜光小兔纸】
一、安装前环境配置
1.基本信息
OS | DB | HostName | DB Name | IP |
---|---|---|---|---|
oracle linux 7.7 | Oracle 19C | STUDY | win | 192.168.2.98 |
2.配置/etc/hosts
[[email protected] /]# echo '192.168.2.98 STUDY' >> /etc/hosts
3.关闭防火墙和Selinux
[[email protected] etc]# systemctl stop firewalld.service
[[email protected] etc]# systemctl disable firewalld.service
[[email protected] etc]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux
4.配置系统参数
[[email protected] etc]# vi /etc/sysctl.conf
添加如下内容:
kernel.shmmni=4096
kernel.sem=250 32000 100 128
fs.file-max=6815744
fs.aio-max-nr=1048576
net.ipv4.ip_local_port_range=9000 65500
net.core.rmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048576
kernel.shmmax=53687091200
kernel.shmall=52780232
[[email protected] etc]# vi /etc/pam.d/login
添加如下内容:
session required /lib64/security/pam_limits.so
session required pam_limits.so
[[email protected] etc]# vi /etc/security/limits.conf
添加如下内容:
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 32768
说明:
生产环境注意这两个参数,需要根据服务器的内存大小调整
kernel.shmmax:内核共享内存段最大值
kernel.shmall:所有内存(单位是页 4096)
[[email protected] etc]#sysctl -p --使上面参数生效
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
kernel.shmmax = 53687091200
kernel.shmall = 52780232
5.创建用户oracle用户和组
[[email protected] etc]# groupadd oinstall
[[email protected] etc]# groupadd dba
[[email protected] etc]# groupadd oper
[[email protected] etc]# useradd -g oinstall -G dba,oper oracle
[[email protected] etc]# passwd oracle
Changing password for user oracle.
New password:
BAD PASSWORD: The password fails the dictionary check - it is too simplistic/systematic
Retype new password:
passwd: all authentication tokens updated successfully.
[[email protected] etc]# id oracle
uid=1000(oracle) gid=1000(oinstall) groups=1000(oinstall),1001(dba),1002(oper)
6.创建安装目录
[[email protected] etc]# mkdir -p /u01/app/oracle/product/19.3/dbhome_1
[[email protected] etc]# chown -R oracle:oinstall /u01/app
[[email protected] etc]# chmod -R 775 /u01/app
7.配置yum
[[email protected] etc]# cd /etc/yum.repos.d
[[email protected] etc]# vi local-oraclelinux.repo
8.配置oracle 用户环境变量
[[email protected] etc]# su – oracle
[[email protected] ~]$ vi /home/oracle/.bash_profile
添加如下内容:
umask 022
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/19.3/dbhome_1
ORACLE_SID=win
PATH= P A T H : PATH: PATH:HOME/.local/bin: H O M E / b i n : HOME/bin: HOME/bin:ORACLE_HOME/bin
export PATH ORACLE_BASE ORACLE_HOME ORACLE_SID
[[email protected] ~]$ source /home/oracle/.bash_profile
9.服务器上VNC安装与配置
#yum -y install tigervnc-server-1.8.0-17.el7.x86_64.rpm
# vi /etc/sysconfig/vncservers
添加:
VNCSERVERS=“1:root”
VNCSERVERARGS[2]=“-geometry 800x600 -nolisten tcp -localhost”
[[email protected] sysconfig]# vncserver --启动vnc服务
You will require a password to access your desktops.
Password:
Verify:
Would you like to enter a view-only password (y/n)? y
Password:
Verify:
xauth: file /root/.Xauthority does not exist
New 'STUDY:1 (root)' desktop is STUDY:1
Creating default startup script /root/.vnc/xstartup
Creating default config /root/.vnc/config
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/STUDY:1.log
[[email protected] sysconfig]# service vncserver status --查看服务开启状态
Redirecting to /bin/systemctl status vncserver.service
Unit vncserver.service could not be found.
# vi /root/.vnc/xstartup --修改配置文件,激活图形界面
注释掉倒数三行,并在末尾 增加:
gnome-session &
[[email protected] sysconfig]# xhost +
xhost: unable to open display ""
[[email protected] sysconfig]# export DISPLAY=192.168.2.98:1.0
[[email protected] sysconfig]# xhost +
access control disabled, clients can connect from any host
[[email protected] dbhome_1]# su - oracle
[[email protected] dbhome_1]$ export LANG=en_US --避免安装界面是中文时出现乱码
二、安装数据库软件
1.数据库软件准备
[[email protected] etc]# mkdir /u01/app/soft
--已将数据库软件上传到/u01/app/soft
[[email protected] etc]# chown oracle:oinstall /u01/app/soft/LINUX.X64_193000_db_home.zip
[[email protected] etc]$ su - oracle
[[email protected] ~]$ cd /u01/app/soft
[[email protected] soft]$ unzip LINUX.X64_193000_db_home.zip -d /u01/app/oracle/product/19.3/dbhome_1 --解压到$ORACLE_HOME目录
2.数据库软件安装
[[email protected] dbhome_1]$ ./runInstaller
安装过程记录如下:
[[email protected] soft]# yum -y install libaio-devel-0.3.109-13.el7.x86_64.rpm
[[email protected] soft]# yum -y install smartmontools-7.0-1.el7.x86_64.rpm
[[email protected] soft]# yum -y install ksh-20120801-139.0.1.el7.x86_64.rpm
ksh包可以忽略
3.创建数据库
[[email protected] ~]$ dbca
[[email protected] dbhome_1]$ ps -ef|grep smon
oracle 109287 1 0 18:18 ? 00:00:00 ora_smon_win
oracle 110364 105048 0 18:29 pts/0 00:00:00 grep --color=auto smon
[[email protected] dbhome_1]$ ps -ef|grep ora
root 105047 104986 0 17:51 pts/0 00:00:00 su - oracle
oracle 105048 105047 0 17:51 pts/0 00:00:00 -bash
root 105804 105786 0 18:00 pts/1 00:00:00 su - oracle
oracle 105805 105804 0 18:00 pts/1 00:00:00 -bash
oracle 105826 105805 0 18:00 pts/1 00:00:00 sqlplus as sysdba
oracle 105827 105826 0 18:00 ? 00:00:00 oraclewin (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle 109242 1 0 18:18 ? 00:00:00 ora_pmon_win
oracle 109244 1 0 18:18 ? 00:00:00 ora_clmn_win
oracle 109246 1 0 18:18 ? 00:00:00 ora_psp0_win
oracle 109249 1 1 18:18 ? 00:00:07 ora_vktm_win
oracle 109253 1 0 18:18 ? 00:00:00 ora_gen0_win
oracle 109255 1 0 18:18 ? 00:00:03 ora_mman_win
oracle 109259 1 0 18:18 ? 00:00:00 ora_gen1_win
oracle 109262 1 0 18:18 ? 00:00:00 ora_diag_win
oracle 109264 1 0 18:18 ? 00:00:00 ora_ofsd_win
oracle 109267 1 0 18:18 ? 00:00:01 ora_dbrm_win
oracle 109269 1 0 18:18 ? 00:00:00 ora_vkrm_win
oracle 109271 1 0 18:18 ? 00:00:00 ora_svcb_win
oracle 109273 1 0 18:18 ? 00:00:00 ora_pman_win
oracle 109275 1 0 18:18 ? 00:00:01 ora_dia0_win
oracle 109277 1 0 18:18 ? 00:00:00 ora_dbw0_win
oracle 109279 1 0 18:18 ? 00:00:00 ora_dbw1_win
oracle 109281 1 0 18:18 ? 00:00:00 ora_lgwr_win
oracle 109283 1 0 18:18 ? 00:00:00 ora_ckpt_win
oracle 109285 1 0 18:18 ? 00:00:00 ora_lg00_win
oracle 109287 1 0 18:18 ? 00:00:00 ora_smon_win
oracle 109289 1 0 18:18 ? 00:00:00 ora_lg01_win
oracle 109291 1 0 18:18 ? 00:00:00 ora_smco_win
oracle 109293 1 0 18:18 ? 00:00:00 ora_reco_win
oracle 109295 1 0 18:18 ? 00:00:00 ora_w000_win
oracle 109297 1 0 18:18 ? 00:00:00 ora_lreg_win
oracle 109299 1 0 18:18 ? 00:00:00 ora_w001_win
oracle 109301 1 0 18:18 ? 00:00:00 ora_pxmn_win
oracle 109305 1 0 18:18 ? 00:00:01 ora_mmon_win
oracle 109307 1 0 18:18 ? 00:00:00 ora_mmnl_win
oracle 109310 1 0 18:18 ? 00:00:00 ora_d000_win
oracle 109312 1 0 18:18 ? 00:00:00 ora_s000_win
oracle 109314 1 0 18:18 ? 00:00:00 ora_tmon_win
oracle 109319 1 0 18:18 ? 00:00:00 ora_m000_win
oracle 109321 1 0 18:18 ? 00:00:02 ora_m001_win
oracle 109327 1 0 18:18 ? 00:00:00 ora_tt00_win
oracle 109329 1 0 18:18 ? 00:00:00 ora_tt01_win
oracle 109331 1 0 18:18 ? 00:00:00 ora_tt02_win
oracle 109336 1 0 18:18 ? 00:00:00 ora_aqpc_win
oracle 109340 1 0 18:18 ? 00:00:00 ora_p000_win
oracle 109342 1 0 18:18 ? 00:00:00 ora_p001_win
oracle 109344 1 0 18:18 ? 00:00:00 ora_p002_win
oracle 109346 1 0 18:18 ? 00:00:00 ora_p003_win
oracle 109348 1 0 18:18 ? 00:00:00 ora_p004_win
oracle 109350 1 0 18:18 ? 00:00:00 ora_p005_win
oracle 109352 1 0 18:18 ? 00:00:00 ora_p006_win
oracle 109354 1 0 18:18 ? 00:00:00 ora_p007_win
oracle 109356 1 0 18:18 ? 00:00:00 ora_p008_win
oracle 109358 1 0 18:18 ? 00:00:00 ora_p009_win
oracle 109360 1 0 18:18 ? 00:00:00 ora_p00a_win
oracle 109362 1 0 18:18 ? 00:00:00 ora_p00b_win
oracle 109364 1 0 18:18 ? 00:00:00 ora_p00c_win
oracle 109366 1 0 18:18 ? 00:00:00 ora_p00d_win
oracle 109368 1 0 18:18 ? 00:00:00 ora_p00e_win
oracle 109370 1 0 18:18 ? 00:00:00 ora_p00f_win
oracle 109372 1 0 18:18 ? 00:00:00 ora_p00g_win
oracle 109374 1 0 18:18 ? 00:00:00 ora_p00h_win
oracle 109376 1 0 18:18 ? 00:00:00 ora_p00i_win
oracle 109378 1 0 18:18 ? 00:00:00 ora_w002_win
oracle 109380 1 0 18:18 ? 00:00:00 ora_p00j_win
oracle 109382 1 0 18:18 ? 00:00:02 ora_cjq0_win
oracle 109384 1 0 18:18 ? 00:00:00 ora_p00k_win
oracle 109388 1 0 18:18 ? 00:00:00 ora_p00l_win
oracle 109390 1 0 18:18 ? 00:00:00 ora_p00m_win
oracle 109392 1 0 18:18 ? 00:00:00 ora_p00n_win
oracle 109394 1 0 18:18 ? 00:00:00 ora_p00o_win
oracle 109396 1 0 18:18 ? 00:00:00 ora_p00p_win
oracle 109398 1 0 18:18 ? 00:00:00 ora_p00q_win
oracle 109400 1 0 18:18 ? 00:00:00 ora_p00r_win
oracle 109402 1 0 18:18 ? 00:00:00 ora_p00s_win
oracle 109404 1 0 18:18 ? 00:00:00 ora_p00t_win
oracle 109406 1 0 18:18 ? 00:00:00 ora_p00u_win
oracle 109408 1 0 18:18 ? 00:00:00 ora_p00v_win
oracle 109638 1 0 18:18 ? 00:00:00 ora_m002_win
oracle 109662 1 0 18:18 ? 00:00:00 ora_w003_win
oracle 109695 1 0 18:18 ? 00:00:00 ora_w004_win
oracle 109697 1 0 18:18 ? 00:00:00 ora_qm02_win
oracle 109701 1 0 18:18 ? 00:00:00 ora_q002_win
oracle 109703 1 0 18:18 ? 00:00:00 ora_q003_win
oracle 109771 1 0 18:19 ? 00:00:00 ora_w005_win
oracle 109797 1 0 18:19 ? 00:00:00 ora_w006_win
oracle 109908 1 0 18:21 ? 00:00:00 ora_m003_win
oracle 110277 1 0 18:28 ? 00:00:00 ora_m004_win
oracle 110283 1 0 18:28 ? 00:00:00 ora_w007_win
oracle 110287 1 0 18:28 ? 00:00:00 ora_w008_win
oracle 110292 1 0 18:29 ? 00:00:00 ora_w009_win
oracle 110299 1 0 18:29 ? 00:00:00 ora_w00a_win
oracle 110304 1 0 18:29 ? 00:00:00 ora_w00b_win
oracle 110308 1 0 18:29 ? 00:00:00 ora_w00c_win
oracle 110313 1 0 18:29 ? 00:00:00 ora_w00d_win
oracle 110317 1 0 18:29 ? 00:00:00 ora_w00e_win
oracle 110321 1 0 18:29 ? 00:00:00 ora_w00f_win
oracle 110326 1 0 18:29 ? 00:00:00 ora_w00g_win
oracle 110330 1 0 18:29 ? 00:00:00 ora_w00h_win
oracle 110335 1 0 18:29 ? 00:00:00 ora_w00i_win
oracle 110339 1 0 18:29 ? 00:00:00 ora_w00j_win
oracle 110344 1 0 18:29 ? 00:00:00 ora_w00k_win
oracle 110348 1 0 18:29 ? 00:00:00 ora_w00l_win
oracle 110353 1 0 18:29 ? 00:00:00 ora_w00m_win
oracle 110357 1 0 18:29 ? 00:00:00 ora_w00n_win
oracle 110362 1 0 18:29 ? 00:00:00 ora_w00o_win
oracle 110368 1 0 18:29 ? 00:00:00 ora_w00p_win
oracle 110372 1 0 18:29 ? 00:00:00 ora_w00q_win
oracle 110376 105048 0 18:29 pts/0 00:00:00 ps -ef
oracle 110377 105048 0 18:29 pts/0 00:00:00 grep --color=auto ora
[[email protected] dbhome_1]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Wed Jul 27 18:30:09 2022
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> show con_name
CON_NAME
------------------------------
CDB$ROOT
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 OCP READ WRITE NO
SQL> select name,open_mode from v$database;
NAME OPEN_MODE
--------- --------------------
WIN READ WRITE
SQL> show user
USER is "SYS"
SQL> SELECT SYS_CONTEXT('USERENV','CON_NAME') FROM dual;
SYS_CONTEXT('USERENV','CON_NAME')
--------------------------------------------------------------------------------
CDB$ROOT
SQL> alter session set container=ocp;
Session altered.
SQL> SELECT SYS_CONTEXT('USERENV','CON_NAME') FROM dual;
SYS_CONTEXT('USERENV','CON_NAME')
--------------------------------------------------------------------------------
OCP
SQL> alter session set container=CDB$ROOT;
Session altered.
SQL> SELECT SYS_CONTEXT('USERENV','CON_NAME') FROM dual;
SYS_CONTEXT('USERENV','CON_NAME')
--------------------------------------------------------------------------------
CDB$ROOT
--新建用户
SQL> alter session set container=ocp;
Session altered.
SQL> create user rui identified by rui;
User created.
SQL> grant dba to rui;
Grant succeeded.
基础命令
–查看当前数据库
SQL> select name,open_mode from v$database;
–查看PDB信息
col pdb_name format a20
col status format a20
select pdb_id,pdb_name,dbid,status,creation_scn from dba_pdbs;
或者 show pdbs
–查看当前环境
SELECT SYS_CONTEXT(‘USERENV’,‘CON_NAME’) FROM dual;
–容器切换
alter session set container=weisipdb;
alter session set container=CDB$ROOT;
–完全卸载oracle
rm -f /etc/oratab
rm -f /etc/oraInst.loc
rm -rf $ORACLE_BASE
rm -rf /u01/app/oraInventory
参考视频:
https://www.bilibili.com/video/BV17r4y1m7fh/?spm_id_from=333.788&vd_source=7136aeca6f3fea14755a76ed47e74308
边栏推荐
- Chengdu openGauss user group recruit!
- LeetCode 213. Robbery II (2022.08.01)
- Redis 持久化 - RDB 与 AOF
- 2022年NPDP考完多久出成绩?怎么查询?
- Redis for distributed applications in Golang
- AWR分析报告问题求助:SQL如何可以从哪几个方面优化?
- MySQL8 download, start, configure, verify
- bool框架::PosInGrid (const简历:关键点kp, int &posX, int诗句)
- AI target segmentation capability for fast video cutout without green screen
- Check if IP or port is blocked
猜你喜欢
MySQL8 下载、启动、配置、验证
The state status is displayed incorrectly after the openGauss switch
2022-08-01 mysql/stoonedb slow SQL-Q18 analysis
From 2023 onwards, these regions will be able to obtain a certificate with a score lower than 45 in the soft examination.
A good book for newcomers to the workplace
Reflex WMS Intermediate Series 7: What should I do if I want to cancel the picking of an HD that has finished picking but has not yet been loaded?
Fundamentals of Cryptography: X.690 and Corresponding BER CER DER Encodings
Outsourcing worked for three years, it was abolished...
MySQL optimization strategy
typescript30 - any type
随机推荐
Constructor instance method inheritance of typescript37-class (extends)
Hiring a WordPress Developer: 4 Practical Ways
Fly propeller power space future PIE - Engine Engine build earth science
2022-07-30 mysql8 executes slow SQL-Q17 analysis
【LeetCode每日一题】——103.二叉树的锯齿形层序遍历
Moonbeam and Project integration of the Galaxy, bring brand-new user experience for the community
Analysis of volatile principle
LeetCode brushing diary: 53, the largest sub-array and
LeetCode刷题日记:34、 在排序数组中查找元素的第一个和最后一个位置
Electronic Manufacturing Warehouse Barcode Management System Solution
【 wheeled odometer 】
nacos启动报错,已配置数据库,单机启动
"NetEase Internship" Weekly Diary (3)
The underlying data structure of Redis
AOF rewrite
雇用WordPress开发人员:4个实用的方法
个人博客系统项目测试
How to adjust the cross cursor too small, CAD dream drawing calculation skills
[LeetCode Daily Question] - 103. Zigzag Level Order Traversal of Binary Tree
数据链路层的数据传输