Oracle Database Installation and startup in Linux

Source: Internet
Author: User
Tags oracle database installation
So far, oracle databases are the most difficult to install among the many software I have installed in linux. Fortunately, just after I successfully installed oracledatabase

So far, oracle databases are the most difficult to install among the many software I have installed in linux. Fortunately, just after I successfully installed oracle database

So far, Oracle databases are the most difficult to install among the many software I have installed in linux. Fortunately, I just successfully installed oracle database on linux OS. In retrospect, it is not difficult to install an oracle database. Maybe I will install oracle in the future. Next I will briefly recall my installation process to remind myself and my friends who will install oracle on linux for the first time.

First, let's take a look at my software environment:

HOST: Ubuntu 10.04 (lucid. This has many advantages. Of course, there is also a slight increase in system resources, but the consumption of these increases is completely worthwhile. Vm software I chose vbox (a very good open-soruce software)

GUEST (vm): CentOS 5.5. As we all know, there are many releases of linux. We have to select a release to install oracle. In this case, we 'd better select the releases mentioned in the oracle Installation manual, such as Asianux, Oracle Enterprise Linux, Red Hat Enterprise Linux, and SUSE Linux Enterprise Server. The installation is much simpler.

DATABASE: Oracle Database 11g Release 2

Install steps as follows:

Step 1. Create a user and a group (# indicates root identity, $ indicates normal user identity)

The following is a passage in the oracle database document. Follow the instructions below to create or modify the users and groups required for the database:

The following local operating system groups and users are required if you are installing Oracle Database:

* The Oracle Inventory group (typically, oinstall)

* The OSDBA group (typically, dba)

* The Oracle software owner (typically, oracle)

* The OSOPER group (optional. Typically, optional)

To determine whether these groups and users already exist, and if necessary, to create them, follow these steps:

1. To determine whether the oinstall group exists, enter the following command:

# More/etc/oraInst. loc

If the output of this command shows the oinstall group name, then the group already exists.

If the oraInst. loc file exists, then the output from this command is similar to the following:

Inventory_loc =/u01/app/oraInventory

Inst_group = oinstall

The inst_group parameter shows the name of the Oracle Inventory group, oinstall.

2. To determine whether the dba group exists, enter the following command:

# Grep dba/etc/group

If the output from this commands shows the dba group name, then the group already exists.

3. If necessary, enter the following commands to create the oinstall and dba groups:

#/Usr/sbin/groupadd oinstall

#/Usr/sbin/groupadd dba

4.

To determine whether the oracle user exists and belongs to the correct groups, enter the following command:

# Id oracle

If the oracle user exists, then this command displays information about the groups to which the user belongs. the output shoshould be similar to the following, indicating that oinstall is the primary group and dba is a secondary group:

Uid = 440 (oracle) gid = 200 (oinstall) groups = 201 (dba), 202 (region)

5. If necessary, complete one of the following actions:

* If the oracle user exists, but its primary group is not oinstall or it is not a member of the dba group, then enter the following command:

#/Usr/sbin/usermod-g oinstall-G dba oracle

* If the oracle user does not exist, enter the following command to create it:

#/Usr/sbin/useradd-g oinstall-G dba oracle

This command creates the oracle user and specifies oinstall as the primary group and dba as the secondary group.

6. Enter the following command to set the password of the oracle user:

# Passwd oracle

Step 2: Enter the db decompression directory and execute runInstaller. The following is my current operation:

[Oracle @ DBServer ~] $ Ls

Desktop linux_11gR2_database

[Oracle @ DBServer ~] $ Cd linux_11gR2_database/

[Oracle @ DBServer linux_11gR2_database] $ ls

Doc install response rpm runInstaller sshsetup stage welcome.html

[Oracle @ DBServer linux_11gR2_database] $./runInstaller

The next step is the complete graphic interface operation. There is nothing to say here.

Step3. install missing software and modify system configuration parameters

You can follow the instructions in the installation documentation for this step. However, there is a simpler method. The installer will check the system configuration parameters. When some parameters do not meet the Configuration Requirements, You must fix them and re-check them, at this time, the installer generates a repair script and prompts you where the script is located and how you want to operate it. For software missing from the system, the repair script will not be installed, and you need to manually install it. When all the software configuration parameters are met, you can continue to next without any further difficulties.

At the beginning, I chose to install only the database software, so now I need to create a listener and database. The following ORACLE_HOME needs to be in the configuration file (~ /. Bash_profile) manually set, of course, it is best to add $ ORACLE_HOME/bin to the PATH, so that we can directly enter the command anywhere.

[Oracle @ DBServer ~] $ Cd $ ORACLE_HOME

[Oracle @ DBServer dbhome_1] $ pwd

/Home/oracle/app/oracle/product/11.2.0/dbhome_1

[Oracle @ DBServer dbhome_1] $ cd bin/

[Oracle @ DBServer bin] $ netca

Note: netca configuration listening, graphical interface

[Oracle @ DBServer bin] $ dbca

Note: dbca creates a database and graphic interface

After the preceding step is executed, the database can be used.


The following describes how to start and shut down a database. We only discuss one of the simplest methods:

By default, oracle in linux does not start with the system. When we reboot the system, we can start our db with the following steps:

[Oracle @ DBServer ~] $ Lsnrctl start Note: start the listener

LSNRCTL for Linux: Version 11.2.0.1.0-Production on 10-DEC-2010 11:05:02

Copyright (c) 1991,200 9, Oracle. All rights reserved.

Starting/home/oracle/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.1.0-Production

System parameter file is/home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener. ora

Log messages written to/home/oracle/app/oracle/diag/tnslsnr/DBServer/listener/alert/log. xml

Listening on: (DESCRIPTION = (ADDRESS = (PROTOCOL = tcp) (HOST = DBServer) (PORT = 1521 )))

Listening on: (DESCRIPTION = (ADDRESS = (PROTOCOL = tcps) (HOST = DBServer) (PORT = 2484 )))


Connecting to (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = DBServer) (PORT = 1521 )))

STATUS of the LISTENER

------------------------

Alias LISTENER

Version TNSLSNR for Linux: Version 11.2.0.1.0-Production

Start Date 10-DEC-2010 11:05:02

Uptime 0 days 0 hr. 0 min. 0 sec

Trace Level off

Security ON: Local OS Authentication

SNMP OFF

Listener Parameter File/home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener. ora

Listener Log File/home/oracle/app/oracle/diag/tnslsnr/DBServer/listener/alert/log. xml

Listening Endpoints Summary...

(DESCRIPTION = (ADDRESS = (PROTOCOL = tcp) (HOST = DBServer) (PORT = 1521 )))

(DESCRIPTION = (ADDRESS = (PROTOCOL = tcps) (HOST = DBServer) (PORT = 2484 )))

The listener supports no services

The command completed successfully

[Oracle @ DBServer ~] $ Dbstart Note: Start the database

ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener

Usage:/home/oracle/app/oracle/product/11.2.0/dbhome_1/bin/dbstart ORACLE_HOME

Processing Database instance "orcl": log file/home/oracle/app/oracle/product/11.2.0/dbhome_1/startup. log

The following steps closes the db:

[Oracle @ DBServer ~] $ Dbshut Note: Shut down the database

ORACLE_HOME_LISTNER is not SET, unable to auto-stop Oracle Net Listener

Usage:/home/oracle/app/oracle/product/11.2.0/dbhome_1/bin/dbshut ORACLE_HOME

Processing Database instance "orcl": log file/home/oracle/app/oracle/product/11.2.0/dbhome_1/shutdown. log

[Oracle @ DBServer ~] $ Lsnrctl stop Note: Disable listening

LSNRCTL for Linux: Version 11.2.0.1.0-Production on 10-DEC-2010 11:06:50

Copyright (c) 1991,200 9, Oracle. All rights reserved.

Connecting to (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = DBServer) (PORT = 1521 )))

The command completed successfully

[Oracle @ DBServer ~] $

Unfortunately, if we do this for the first time, we may fail because we can find it in the dbstart script. I will extract the useful content as follows:

# This script will start all databases listed in the oratab file

# Whose third field is a "Y". If the third field is set to "Y" and

# There is no ORACLE_SID for an entry (the first field is *),

# Then this script will ignore that entry.

After reading this section, I think you have understood how to do it. Correct, modify the content in/etc/oratab:

Orcl:/home/oracle/app/oracle/product/11.2.0/dbhome_1: N

Change 'n' to 'y'

The problem of starting this database has been solved, so we can use our database with confidence in the future. GOOK LUCK

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.