CentOS 5.3 installation and configuration Oracle 10g Manual start and self-start service

Source: Internet
Author: User
Tags oracle database installation

CentOS 5.3 installation and configuration Oracle 10g Manual start and self-start service

The following is a text description of the installation process on Oracle 10g, CentOS 5.3

1. Download and decompress 10201_database_linux32.zip to the database file, memory, and swap. Check other articles if they are suitable.

2. In the database directory, you can view the Quick Installation GuideQuick of Documentation in the welcom.html document.
See the above document.

3. Check the dependency file. Check the file. If there is no yum, you don't have to worry about it. libXp is required for the GUI during installation, here yum-y install libXp first

4. Create a user and a group. If there is a group, the following commands will not conflict.
$ Su-
# Groupadd oinstall
# Groupadd dba
# Useradd-g oinstall-G dba oracle
# Passwd oracle

5. Install the kernel parameters to be modified.
When you execute the following command, first compare the requirements in the document.
# Vi/etc/sysctl. conf
Kernel. shmall = 2097152
Kernel. shmmax = 2147483648
Kernel. shmmni = 4096
Kernel. sem = 250 32000 100 128
Net. ipv4.ip _ local_port_range = 1024 65000
Net. core. rmem_default = 4194304
Net. core. rmem_max = 4194304
Net. core. wmem_default = 262144
Net. core. wmem_max = 262144

Modified
/Sbin/sysctl-p
Click

6. Security Restrictions
# Add

# Use for oracle
Oracle soft nproc 2047
Hard nproc 16384
Oracle soft nofile 1024
Oracle hard nofile 65536

# Add

# Use for oracle
Session required/lib/security/pam_limits.so

# Add at the end of vi/etc/profile

# Use for oracle
If [$ USER = "oracle"]; then
If [$ SHELL = "/bin/ksh"]; then
Ulimit-p 16384
Ulimit-n 65536
Else
Ulimit-u 16384-n 65536
Fi
Fi

7. modify. bash_profile I have installed oracle in the/home/oracle/10G directory. If you want to install www.bkjia.com IN THE/oracle/10G directory, use root user mkdir/oracle; mkdir/oracle/10G; chown-R oracle: oinstall/oracle
Modify ORACLE_BASE =/oracle in the following configuration file.

Su-oracle
Cd
Change vi. bash_profile

Umask 022
ORACLE_BASE =/home/oracle
ORACLE_HOME = $ ORACLE_BASE/10G
ORACLE_SID = orcl
PATH = $ PATH: $ HOME/bin: $ ORACLE_HOME/bin

Export ORACLE_BASE
Export ORACLE_HOME
Export ORACLE_SID
Export PATH

After vi, run source. bash_profile.

8. If you modify the release version, centos does not pass the oracle Authentication, but it seems that it can also pass without modification.
Vi/etc/RedHat-release
Change CentOS release 5.3 (Final) to redhat-4
After the installation is complete, change it back.

9. Install oracle

Su-oracle
Cd to the oracle database installation directory

Export LANG = en. UTF8
This command modifies the language environment to solve the following display problems.
Avoid warnings and garbled characters of zh. GB2312.

./RunInstaller or sh runInstaller

This is the graphical installation interface. During the installation process, if the configuration is not passed, oracle will not allow installation. for errors, refer to the official document and change it first. During the installation process, you are required to use the root user to execute the commands root. sh and orainstRoot. sh. Follow the prompts to complete the path.

After the installation is complete, oracle is started by default. Then you can access the following address. Replace yourIP with your host name, 127.0.0.1, or your IP address. We recommend 127.0.0.1.
ISQL * Plus URL:
Http: // yourIP: 5560/isqlplus

ISQL * Plus dba url:
Http: // yourIP: 5560/isqlplus/dba

Enterprise Manager 10g Database Control URL:
Http: // yourIP: 1158/em

8. oracle is not started by default. Once restarted, oracle needs to be started manually:

Su-oracle

Start the database. The password is the one you entered during installation.
Sqlpuls/nolog

SQL> conn sys/password as sysdbasql> startup
SQL> exit

The specific sqlpuls path is $ ORACLE_HOME/bin/sqlplus.
Start listening
Lsnrctl start

The specific lsnrctl path is $ ORACLE_HOME/bin/lsnrctl.

The above just started the basic services of the database and listener
To start the above three services with web addresses, perform the following operations:

Isqlplusctl start iSQL * Plus, which can access http: // 127.0.0.1: 5560/isqlplus
Or http: // 127.0.0.1: 5560/isqlplus/dba addresses. If yes, make sure iSQL * Plus has been started.
The specific isqlplusctl path is $ ORACLE_HOME/bin/isqlplusctl.

Emctl start dbconsole start Enterprise Manager 10g Database Control
You can access http: // 127.0.0.1: 1158/em to enable this function. Then, make sure that Enterprise Manager 10g Database Control is enabled. This service is a little slow to start.
The specific emctl path is $ ORACLE_HOME/bin/emctl.

Of course, oracle also has the launch script dbstart and the disable script dbshut.
First modify vi/etc/oratab
Change N from the last line to Y
Then modify the $ ORACLE_HOME/bin/dbstart content.

ORACLE_HOME_LISTNER = $ ORACLE_HOME

Su-oracle

Dbstart can be used to start oracle. This is only used to start the basic services of oracle Database and listener, without three web services. It is equivalent to the above two operations: sqlplus and lsnrctl start.

Dbshut can stop oracle.

However, it should be noted that startup. log and shutdown. log should be checked whether their owner is an oracle
It is best to chown oracle. oinstall startup. log
Chown oracle. oinstall shutdown. log, or some errors will be reported when the service is started.

9. Add oracle as the self-starting service dbstart. the root user performs the following operations:
Su-root
Cd/etc/rc. d/init. d/
Gedit dbstart

Copy the following Script 1 or script 2 to the dbstart file: Script 1 includes the Database and basic listening services, iSQL * Plus, and Enterprise Manager 10g Database Control for all services

Script 1 (start all services)

#! /Bin/bash

# Chkconfig: 345 99 10

# Description: Startup Script for oracle Databases

#/Etc/rc. d/init. d/dbstart


Export ORACLE_BASE =/home/oracle

Export ORACLE_HOME =/home/oracle/10G

Export ORACLE_SID = orcl

Export PATH = $ PATH: $ ORACLE_HOME/bin


ORA_OWNR = "oracle"

# If the executables do not exist -- display error

If [! -F $ ORACLE_HOME/bin/dbstart-o! -D $ ORACLE_HOME]

Then

Echo "Oracle startup: cannot start"

Exit 1

Fi

# Depending on parameter -- startup, shutdown, restart

# Of the instance and listener or usage display

Case "$1" in

Start)

# Oracle listener and instance startup

Echo-n "Starting Oracle :"

Su-$ ORA_OWNR-c "$ ORACLE_HOME/bin/dbstart"

Touch/var/lock/oracle

Su-$ ORA_OWNR-c "$ ORACLE_HOME/bin/isqlplusctrl start"

Su-$ ORA_OWNR-c "$ ORACLE_HOME/bin/emctl start dbconsole"


Echo "OK"

;;

Stop)

# Oracle listener and instance shutdown

Echo-n "Shutdown Oracle :"

Su-$ ORA_OWNR-c "$ ORACLE_HOME/bin/emctl stop dbconsole"

Su-$ ORA_OWNR-c "$ ORACLE_HOME/bin/isqlplusctrl stop"

Su-$ ORA_OWNR-c "$ ORACLE_HOME/bin/dbshut"

Su-$ ORA_OWNR-c "$ ORACLE_HOME/bin/lsnrctl stop"

Rm-f/var/lock/oracle

Echo "OK"

;;

Reload | restart)

$0 stop

$0 start

;;

*)

Echo "Usage: 'basename $ 0' start | stop | restart | reload"

Exit 1

Esac

Exit 0

Script 2: (only start the database and listen)


#! /Bin/bash

# Chkconfig: 345 99 10

# Description: Startup Script for oracle Databases

#/Etc/rc. d/init. d/dbstart

Export ORACLE_BASE =/home/oracle

Export ORACLE_HOME =/home/oracle/10G

Export ORACLE_SID = orcl

Export PATH = $ PATH: $ ORACLE_HOME/bin

Case "$1" in

Start)

Su oracle-c $ ORACLE_HOME/bin/dbstart

Touch/var/lock/oracle

Echo "OK"

;;

Stop)

Echo-n "Shutdown oracle :"

Su oracle-c $ ORACLE_HOME/bin/dbshut

Rm-f/var/lock/oracle

Echo "OK"

;;

*)

Echo "Usage: 'basename $ 0' start | stop"

Exit 1

Esac

Exit 0

If the above two scripts

Export ORACLE_BASE =/home/oracle

Export ORACLE_HOME =/home/oracle/10G

The path is different from the path of the oracle database you installed. For details, see modify the path and


Chown oracle. oinstall/etc/rc. d/init. d/dbstart

Chmod 775/etc/rc. d/init. d/dbstart

/Sbin/chkconfig -- add dbstart

/Sbin/chkconfig -- list dbstart
Running result:
Dbstart 0: Disable 1: Disable 2: Disable 3: Enable 4: Enable 5: Enable 6: Disable
Yes
/Sbin/service dbstart start
See if it can be started

Restart
Then you can test whether all oracle services are started.
You can test three web addresses.
Sqlplus Logon

Well, this article is just for me to solve the forgotten records. I forgot a lot in a few days. I hope it will be helpful to you. If errors occur during installation, google or baidu will be the most important, linux requires 100 google and 200 baidu every day.

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.