Current location - Loan Platform Complete Network - Big data management - How to install oracle on linux
How to install oracle on linux
Hardware resources required:

At least 512 MB of physical memory

At least 1.5 times the physical memory required for the interactive space

At least 400 MB of temporary directory space in the /tmp directory

Oracle software requires 1.5 GB to 3.5 GB of disk space

Default database requires 1.2 GB

Cat /etc/issue or cat /etc/redhat-release to see the OS version

uname -r to see the kernel version

grep MemTotal /proc/meminfo to see the total size of MEM

grep SwapTotal /proc/meminfo to see the total size of Swap

grep "model name" /proc/cpuinfo to see the CPU model

df to see partition mounts and utilization

Checks and preparations before installation:

rpm -q make

rpm -q gcc

rpm -q glibc

rpm -q glibc-devel

rpm -q compat-db

rpm -q compat-gcc

rpm -q compat-gcc-c++

rpm -q compat-libstdc++

rpm -q compat-libstdc++-devel

rpm -q openmotif22

rpm -q setarch

rpm -q libaio

rpm -q libaio-devel

rpm -q libXp-devel

rpm -q libXau-devel

rpm -q libXp

(install if package is not installed)

Preparation for creating a database installation:

1. user/group;

groupadd dba

groupadd oinstall

useradd oracle -g oinstall -G dba

(Initial group oinstall, additional group dba one is to control the installation of the software, patch installation, etc.; the other is to control the creation of the database, the database, and so on. The other controls database creation, database administration, and so on. You can authorize both permissions to the dba group, and just create the dba group)

passwd oracle

If the nobody user doesn't exist (id nobody command to view it), then create:

useradd nobody

( First of all nobody is an ordinary, non-privileged user. The purpose of using the nobody username is so that anyone can log on to the system, but its UID and GID provide no privileges, i.e., that uid and gid can only access files that everyone can read and write. Second, many systems routinely create a nobody by default, trying to limit its privileges to the minimum possible, and when the server serves outbound, it may allow clients to log in as nobody)

2, create the oracle installation folder (sample);

mkdir -p /u01/oracle/ product/10g

mkdir /u01/oracle/database

chown -R oracle.oinstall /u01/oracle

chmod 755 -R /u01/oracle

3, Configure environment variables;

To use Oracle products, you should or must set several environment variables.

If you have multiple Oracle products or databases installed on the same server, the ORACLE_HOME, ORACLE_SID, and PATH variables may change.

The ORACLE_BASE variable should not be changed and can be set in your logon configuration file if needed.Oracle provides a utility called oraenv to set other variables.

For database servers, it is recommended that you set the following environment variables:

Logging in as the Oracle user:

su - oracle

vi ~/.bash_profile

The following is the contents of the configuration file

export ORACLE_BASE=/ u01/oracle/

export ORACLE_HOME=/u01/oracle/product/10g

export ORACLE_SID=orcl

export PATH=$ORACLE_HOME/bin:$PATH

After the configuration is complete, use the source .bash_profile command to make the configuration take effect

4. Setting System Parameters;

Oracle Database 10g requires the kernel parameter settings shown below.

The values given there are minimum values, so do not change them if your system uses larger values.

su - root

A) Modify /etc/sysctl.conf (vi /etc/sysctl.conf), add:

kernel.shmmax = 2147483648

kernel.shmmni = 4096

kernel.shmall = 2097152

kernel.sem = 250 32000 100 128

fs.file-max = 65536

net.ipv4.ip_local_port_range = 1024 65000

net.core.rmem_default = 262144

net.core.rmem_max = 262144

net.core.wmem_default = 262144

net.core.wmem_max = 262144

net.core. p>Run the command "/sbin/sysctl -p" to make the kernel changes take effect immediately;

A brief explanation of each parameter value is provided.

(1) shmmax: This parameter defines the maximum size (in bytes) of the *** enjoyment memory segment. The default is 32M, which is too low for oracle and is usually set to 2G.

(2) shmmni: This kernel parameter is used to set the maximum number of system-wide ****-enjoyed memory segments. The default value for this parameter is 4096. It does not usually need to be changed.

(3) shmall: This parameter indicates the total amount of ****-enjoyed memory (in pages) that the system can use at one time. The default value is 2097152, which does not usually need to be changed.

(4) sem: This parameter indicates the amount of signals set.

(5) file-max: This parameter indicates the maximum number of file handles. The file handle setting indicates the number of files that can be opened in a linux system.

B) Setting oracle requirements for files:

b.1 Edit the file: vi /etc/security/limits.conf Add the following statement:

oracle soft nproc 2047

oracle hard nproc 16384

oracle soft nofile 1024

oracle hard nofile 65536

limits.conf has the following format:

username|@groupname type resource limit

username|@groupname: set the username that needs to be limited, add @ in front of the group name to distinguish it from the username. You can also use the wildcard * to do all users limit.

type: soft, hard and -. soft refers to the current system settings. hard indicates the maximum value that can be set in the system. soft limit cannot be higher than hard limit. A - indicates that both soft and hard are set.

resource:

core - Limit kernel file size

date - Maximum data size

fsize - Maximum file size

memlock - Maximum locked memory address space

nofile - Maximum number of open files

rss - Maximum persistent setup size

stack - maximum stack size

cpu - maximum CPU time in minutes

noproc - maximum number of processes

as - address space limitation

maxlogins - maximum number of logins this user is allowed to log in

b.2 Edit the file: vi /etc/pam.d/login

Linux operating system login configuration file.

session required /lib/security/pam_limits.so

session required /lib/security/pam_limits.so

This is the file that tells Linux that after the user finishes logging in to the system, it should call the This tells Linux to call the pam_limits.so module after the user has logged in to set the maximum limits on the number of resources (including the maximum number of files the user can open) that the system can use, and the pam_limits.so module reads the configuration from the /etc/security/limits.conf file to set these limits. Save this file after modifying it

5. Mount the CD-ROM drive

Select the oracle 10g ISO file in the virtual machine

mount /dev/hdc /mnt (by default it will be mounted under /media, but make sure to mount it under /mnt manually)

Change the /etc/redhat- release version 5.4 to 3.4

root user to execute xhost +

su - oracle

oracle user to execute /mnt/runInstaller

6, login and start the database operation.

[oracle@oracle oracle]$ sqlplus /nolog

SQL> connect / as sysdba

Connected.

SQL> shutdown immediate Shut down database (OR " dbshut" command)

SQL> startup; Start the database

7,

alter user scott account unlock;scott user unlocked

alter user scott identified by oracle;user scott set password

grant dba to scott;give dba role to scott

connect scott/oracle

select table_name from user_tables;

Hope this will solve your problem.