Oracle for Linux is a very popular enterprise-level database software that is often used to process large amounts of data. This article will provide a detailed Oracle for Linux installation tutorial to help you install and configure the software in the Linux operating system. This article explains how to download software packages, set environment variables, create database instances, start and stop Oracle instances, and more.
1. Download the Oracle for Linux installation package
First, you need to download the Oracle for Linux installation package from Oracle's official website. Before downloading, you need to register an Oracle account and log in to the account. The specific steps are as follows:
- Visit Oracle’s official website https://www.oracle.com/index.html
- In the upper right corner of the homepage, click the “Sign In” button. And enter your account number and password to log in.
- After successful login, find the "Database" option under the "Products and Services" menu on the left side of the page, and then select "Oracle Database Standard Edition 2" to enter the download page.
- In the download page, select the installation package that suits you according to your operating system. In this article, we will use the Linux x86-64 installation package for demonstration.
- After the download is complete, unzip the installation package to a folder you like, such as "/opt/Oracle".
2. Set environment variables
Before you start installing Oracle for Linux, you need to set some environment variables to ensure that Oracle can run correctly. The specific steps are as follows:
- Open the terminal and enter the root user.
- Enter the /etc/profile.d/ directory and create a new sh file:
cd /etc/profile.d/
touch oracle_env.sh
Copy after login
- Edit the sh file and add the following environment variables:
export ORACLE_HOME=/opt/Oracle/database
export ORACLE_SID=orcl
export PATH=$PATH:$ORACLE_HOME/bin
Copy after login
Note: In the above code, ORACLE_HOME should point to your Oracle for Linux installation directory (that is, the folder path where you unzipped the installation package), and ORACLE_SID is the name of the database instance you want to create. In the above code, we specified the instance name as "orcl", but you can modify it according to your needs.
- Save the file and run the following command to ensure that the environment variables take effect:
source /etc/profile.d/oracle_env.sh
Copy after login
- Check that your environment variables are set correctly:
echo $ORACLE_HOME
echo $ORACLE_SID
echo $PATH
Copy after login
3. Create a database instance
After successfully setting the environment variables, you can start creating your Oracle database instance. The specific steps are as follows:
- Run the following command to start the Oracle installation wizard:
cd /opt/Oracle/database
./runInstaller
Copy after login
- In the installation wizard page that appears, select "Create and configure database ".
- In the "Select Installation Options" page, select "Typical Installation".
- In the "System Class" page, select "Server Class".
- In the "Grid Installation Options" page, select "No".
- In the "Oracle Standard Edition General Purpose" page, select "Single-machine database installation".
- In the "Software Location" page, set the installation path of Oracle to the path you want to install and click "Next".
- In the "Database Edition" page, select the Oracle version you want to install (Enterprise Edition, Standard Edition, etc.).
- In the "Configuration Options" page, select "Create Database".
- In the "Database Identification" page, enter the name and password of the database instance you want to create.
- In the "Database Storage" page, select whether to use ASM storage management, and then specify the data storage path of the Oracle database.
- In the "Recovery Configuration" page, select the backup and recovery options you want to implement.
- In the "Database Content" page, select the database components you want to install, such as data dictionary, sample tables, toolkits, etc.
- Check your settings and click the "Install" button to install.
- After the installation is completed, click the "Finish" button to close the installation wizard.
4. Starting and stopping the Oracle instance
After you successfully install Oracle for Linux, you can use the following commands to start and stop the Oracle instance:
- Start instance:
su - oracle
sqlplus / as sysdba
startup
exit
Copy after login
- Stop instance:
su - oracle
sqlplus / as sysdba
shutdown immediate
exit
Copy after login
You have successfully installed and configured Oracle for Linux. You can use Oracle Database in a Linux operating system to meet your enterprise-level needs by setting environment variables, creating database instances, and starting and stopping Oracle instances.
The above is the detailed content of oracle for linux installation tutorial. For more information, please follow other related articles on the PHP Chinese website!