简体   繁体   English

在 Linux 上安装 Oracle 数据库

[英]Install Oracle DB on Linux

I'm trying to install Oracle DB on Linux.我正在尝试在 Linux 上安装 Oracle DB。 This is my first attempt, so don't judge me too hard.这是我的第一次尝试,所以不要对我太苛刻。

I've run into a problem when creating a DB via DBCA:我在通过 DBCA 创建数据库时遇到了一个问题:

Error starting Database Control.启动数据库控制时出错。 Please execute the following command(s).请执行以下命令。

1) Set the environment variable ORACLE_UNQNAME to Database unique name 1) 将环境变量ORACLE_UNQNAME设置为数据库唯一名称

2) /u01/app/oracle/product/11.2.0/dbhome_1/bin/emctl start dbconsole 2) /u01/app/oracle/product/11.2.0/dbhome_1/bin/emctl start dbconsole

Am I doing something wrong?难道我做错了什么? Shall I continue or step back and do something?我是继续还是退一步做点什么?

Why I'm asking: I see that installation program hasn't set ORACLE_HOME variable as echo $ORACLE_HOME under oracle user displays an empty string.为什么我问:我看到安装程序没有设置ORACLE_HOME变量,因为在 oracle 用户下echo $ORACLE_HOME显示一个空字符串。 I remember that on Windows it is set automatically.我记得在 Windows 上它是自动设置的。 So, am I missing a step here?那么,我在这里错过了一步吗?

In common: on installing oracle software and DB, shall I perform specific steps to set ORACLE-related environment variables?共同点:在安装oracle软件和DB时,需要具体的步骤来设置ORACLE相关的环境变量吗? Or it should be set automatically?还是应该自动设置?

Before doing install, take some time to read installation guide for your platform and Oracle version (32bit or 64bit).在安装之前,请花一些时间阅读适用于您的平台和 Oracle 版本(32 位或 64 位)的安装指南。
Here are just some hints这里只是一些提示
As it is your first installation, simplify things as much as possible.由于这是您的第一次安装,请尽可能简化。
You do not need database control or enterprise manager.您不需要数据库控制或企业管理器。 Go 1st time without all bells and whistles.第一次没有所有的花里胡哨。
For database creation, chose only character set and block size - any other parameter and option can be changed after installation.对于数据库创建,只选择字符集和块大小 - 安装后可以更改任何其他参数和选项。 If you chose AL32UTF8, do not take already prepared installation, but chose custom install.如果你选择AL32UTF8,不要选择已经准备好的安装,而是选择自定义安装。

根据igr,必须手动设置ORACLE_HOME 和相关变量。

Using this guide I've installed Oracle DB 18c many times.使用本指南,我已多次安装 Oracle DB 18c。 But in my case to make $ORACLE_HOME/bin/ commands available through PATH, I've changed PATH in ~/.bash_profile to:但是在我的情况下,为了通过 PATH 提供$ORACLE_HOME/bin/命令,我已将~/.bash_profile PATH 更改为:

export PATH=/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/oracle/.local/bin:/home/oracle/bin:$ORACLE_HOME/bin

In your case you could change it to:在您的情况下,您可以将其更改为:

export PATH=$PATH:$ORACLE_HOME/bin

Then, being root, I change user to oracle user by command:然后,作为 root,我通过命令将用户更改为 oracle 用户:

# su - oracle

But before it you should have some variables exported:但在此之前,您应该导出一些变量:

# Oracle Settings
export TMP=/tmp
export TMPDIR=$TMP

export ORACLE_HOSTNAME=ol7
export ORACLE_UNQNAME=cdb1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/18.3.0/dbhome_1
export ORA_INVENTORY=/u01/app/oraInventory
export ORACLE_SID=cdb1
export PDB_NAME=pdb1
export DATA_DIR=/u02/oradata

Of course, values could be changed to reflect your settings.当然,可以更改值以反映您的设置。

Also, by following guides take a note about $ and # symbols, running commands under [oracle@host]$ user or under [root@host]# user as it is described in your guide.此外,按照指南注意$#符号,在[oracle@host]$用户或[root@host]#用户下运行命令,如指南中所述。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM