Centos7 安装Oracle19C--无图形化

目录

依赖插件安装

 准备Oracle rpm包

安装oracle

创建用户,配置环境变量

登入数据库

重启oracle数据库

oracle意外挂掉,重启oracle 步骤

重启oracle可能的报错及解决


依赖插件安装

[root@svn ~]# yum -y install binutils-* compat-libstdc* elfutils-libelf* elfutils-libelf-devel* 
[root@svn ~]# yum -y install gcc-* glibc* glibc-common* glibc-devel* glibc-headers* ksh* libaio-* 
[root@svn ~]# yum -y install libaio-devel* libgcc*  libstdc++*  libstdc++-devel* make* sysstat* unixODBC*

 准备Oracle rpm包

 1.下载安装包 oracle-database-ee-19c-1.0-1.x86_64.rpm
官网下载:
https://www.oracle.com/database/technologies/

没有Oracle账号的,烦请注册一个,保证收到邮件即可,其他的信息随便填
下载好的rpm包上传到linux服务器,文件比较大,需要等待一段时间

2.下载预安装包 oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
官网下载:http://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm

[root@svn ~]# wget http://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm

安装oracle

#前提:要把这两个rpm包上传到Linux服务器

[root@svn ~]# yum -y localinstall oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
[root@svn ~]# yum -y localinstall oracle-database-ee-19c-1.0-1.x86_64.rpm
Total size: 6.9 G
Installed size: 6.9 G
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : oracle-database-ee-19c-1.0-1.x86_64                                                                                                                     1/1 
[INFO] Executing post installation scripts...
[INFO] Oracle home installed successfully and ready to be configured.
To configure a sample Oracle Database you can execute the following service configuration script as root: /etc/init.d/oracledb_ORCLCDB-19c configure
  Verifying  : oracle-database-ee-19c-1.0-1.x86_64                                                                                                                     1/1 

Installed:
  oracle-database-ee-19c.x86_64 0:1.0-1                                                                                                                                    

Complete!

#初始化:漫长的过程,具体时间由环境(网络,服务器的cpu等)决定
[root@svn ~]# /etc/init.d/oracledb_ORCLCDB-19c configure
Configuring Oracle Database ORCLCDB.
Prepare for db operation
8% complete
Copying database files
31% complete
Creating and starting Oracle instance
32% complete
36% complete

40% complete
43% complete
46% complete
Completing Database Creation
51% complete
54% complete
Creating Pluggable Databases
58% complete
77% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
 /opt/oracle/cfgtoollogs/dbca/ORCLCDB.
Database Information:
Global Database Name:ORCLCDB
System Identifier(SID):ORCLCDB
Look at the log file "/opt/oracle/cfgtoollogs/dbca/ORCLCDB/ORCLCDB.log" for further details.

Database configuration completed successfully. The passwords were auto generated, you must change them by connecting to the database using 'sqlplus / as sysdba' as the oracle user.

#到此orcle安装成功

创建用户,配置环境变量

[root@svn ~]# groupadd dba

[root@svn ~]# groupadd oinstall  

[root@svn ~]# useradd -g oinstall  -G dba oracle

[root@svn ~]# su - oracle
执行命令 vim .bash_profile,在该文档里面追加以下内容:

export ORACLE_HOME=/opt/oracle/product/19c/dbhome_1
export PATH=$PATH:/opt/oracle/product/19c/dbhome_1/bin
export ORACLE_SID=ORCLCDB
stty erase ^h
export NLS_LANG="AMERICAN_AMERICA.UTF8"

[oracle@svn ~]$ source .bash_profile

登入数据库

[root@svn ~]# su - oracle

[oracle@svn ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Mon Aug 29 11:17:27 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 pdbs;

    CON_ID CON_NAME              OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
     2 PDB$SEED              READ ONLY  NO
     3 ORCLPDB1              READ WRITE NO
SQL> select * from dba_roles;

登入oracle数据库后,可以修改相应用户密码,如system 用户

SQL> alter user system identified by 123456;

重启oracle数据库

SQL> shutdown immediate            #立即关闭数据库服务
SQL> startup                                 #开启数据库服务

oracle意外挂掉,重启oracle 步骤

[root@svn ~]# su - oracle

查看数据库的监听器情况:

[oracle@svn ~]$ lsnrctl status

停止数据库的监听器

[oracle@svn ~]$ lsnrctl stop

进入数据库

[oracle@svn ~]$ sqlplus / as sysdba

SQL> shutdown immediate

开启数据库的监听器

[oracle@svn ~]$ lsnrctl start

查看数据库的监听器情况:

[oracle@svn ~]$ lsnrctl status

启动oracle数据库

[oracle@svn ~]$ sqlplus / as sysdba

SQL> startup

重启oracle可能的报错及解决

Oracle错误ORA-03113: end-of-file on communication channel处理办法

参考文档:

原文链接:https://blog.csdn.net/qq_35624642/article/details/53158139

安装oracle参考文档

https://blog.csdn.net/cizhao3600/article/details/121093749

你可能感兴趣的:(数据库,服务器,linux,运维)