RedHat install Oracle

Source: Internet
Author: User
Version Linux: RedHat5.6Oracle: 10.2 preparations before installation 1. modify the operating system version, oracle will verify the operating system version before installation if you do not know the version can not install vi/etc/redhat-release # comment out the original content, change the content to redhat-42. create oracle

Version

Linux: RedHat 5.6

Oracle: 1, 10.2

Preparations before installation

1. Modify the operating system version. Before oracle is installed, it will verify the operating system version. If you do not know the version, it cannot be installed.

  1. Vi/etc/redhat-release
  2. # Comment out the original content, change the content to redhat-4

2. Create an oracle user

2.1 create a user group

  1. Groupadd oinstall
  2. Groupadd dba
 

2.2 create a user 
  1. Useradd oracle-g oinstall-G dba
2.3 create a user's password
  1. Passwd oracle
Enter the password twice


3. Prepare the installation directory
3.1 create a directory

  1. Mkdir/usr/local/src/oracle10g
  2. Mkdir/usr/local/src/oracle10g/oradata
3.2 assign directory permissions to oracle users
  1. Chown-R oracle: oinstall/usr/local/src/oracle10g
  2. Chown-R oracle: oinstall/usr/local/src/oracle10g/oradata
  3. Chmod-R 755/usr/local/src/oracle10g
  4. Chmod-r 755/usr/local/src/oracle10g/oradata
4. Switch oracle users
This step is very important. Do not use su oracle. Log On As an oracle user after logging out of the current root user.
5. Set oracle user environment variables
5.1 modify Environment Variables
Edit ~ Path. bash_profile
  1. Vi. bash_profile
Add the following content to the end of the file:
  1. Export PATH
  2. Export ORACLE_BASE =/usr/local/src/oracle10g
  3. Export ORACLE_HOME = $ ORACLE_BASE/product/10.2.0/db_1
  4. Export ORACLE_SID = risespdb
  5. Export PATH = $ PATH: $ HOME/bin: $ ORACLE_HOME/bin
  6. Export LD_LIBRARY_PATH = $ ORACLE_HOME/lib:/usr/lib
5.2 effective environment variables
  1. Source ~ /. Bash_profile
Install oracle
1. Extract

If the oracle_installation file is 1021_database_linux32.zip

  1. Unzip 10201_database_linux32.zip 10201_database_linux32
  2. Cd 10201_database_linux32
  3. Chmod a + rwx-R database

2. Run and install Use the oracle user to log on from the graphic interface, If the current Redhat language environment is Chinese, the installation interface will see garbled characters. Just change the language environment.
  1. Export LANG = en
Run the installation in the database directory.
  1. ./RunInstall
There are various "Next Steps" until installation starts.
At the end of installation, two script files may fail to be executed due to permissions.
The Buddy couldn't remember the exact name. He wrote down where the two files were, and used the root user to log on to the directory where the files were located for execution.
  1. ./(Script file name). sh

3. Modify the file

  1. Vi/etc/oratab
Change content
  1. Orcl:/usr/local/src/oracle10g/product/10.2.0/db_1: Y
Note that orcl is the Instance name, which must be consistent with the instance name of your database.

4. Modify $ ORACLE_HOME/bin/dbstart

  1. Cd $ ORACLE_HOME
  2. Cd bin
  3. Vi dbstart
Set the following content
  1. ORACLE_HOME_LISTNER =/ade/vikrkuma_new/oracle

Change

  1. ORACLE_HOME_LISTNER = $ ORACLE_HOME
5. Start the database
  1. ./Dbstart

6. Create a STARTUP script for the LEDs service.

Create a file named led under the/etc/init. d directory
Add the following content to the sorted led file (the script is used to search for non-original files on the Internet)

  1. #! /Bin/bash
  2. # Chkconfig:-85 15
  3. # Description: oracle 10g is database. It is used to serve
  4. # File:/etc/init. d/LED
  5. # Run-level Startup script for the Oracle Instance, Listener, Web Interface
  6. Export ORACLE_BASE =/usr/local/src/oracle10g
  7. Export ORACLE_HOME = $ ORACLE_BASE/product/10.2.0/db_1
  8. Export ORACLE_SID = orcl
  9. ORA_OWNER = "oracle"
  10. # If the executables do not exist, then display error
  11. If [! -F $ ORACLE_HOME/bin/dbstart-o! -D $ ORACLE_HOME]
  12. Then
  13. Echo "oracle startup: can't start"
  14. Exit 1
  15. Fi
  16. # The oracle10g database depending on parameter -- start, shutdown, restart
  17. Case "$1" in
  18. Start)
  19. Echo-n "starting oracle :"
  20. Su $ ORA_OWNER-c "$ ORACLE_HOME/bin/dbstart"
  21. Touch/var/lock/oracle
  22. Echo "OK"
  23. ;;
  24. Stop)
  25. Echo-n "shutdown oracle :"
  26. Su $ ORA_OWNER-c "$ ORACLE_HOME/bin/dbshut"
  27. Rm-f/var/lock/oracle
  28. Echo "OK"
  29. ;;
  30. Reload | restart)
  31. $0 stop
  32. $0 start
  33. ;;
  34. *)
  35. Echo "Usage: 'basename $ 0' start | stop | restart | reload"
  36. Exit 1
  37. Esac
  38. Exit 0
7. Authorize the file and add the service
  1. Cd/etc/init. d
  2. Chmod 755 LEDs
  3. Chkconfig-add LEDs
  4. Service terminated led start
This is a comprehensive task.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.