简体   繁体   中英

Install Oracle DB on Linux

I'm trying to install Oracle DB on Linux. This is my first attempt, so don't judge me too hard.

I've run into a problem when creating a DB via DBCA:

Error starting Database Control. Please execute the following command(s).

1) Set the environment variable ORACLE_UNQNAME to Database unique name

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. I remember that on Windows it is set automatically. 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? 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).
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.

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

Using this guide I've installed Oracle DB 18c many times. But in my case to make $ORACLE_HOME/bin/ commands available through PATH, I've changed PATH in ~/.bash_profile to:

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:

# 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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