Ubuntu Oracle Installation __oracle

Source: Internet
Author: User
Tags addgroup chmod dba
Ubuntu installation Oracle 10g
Directory
1. Installation Preparation
1.1. Set up user
1.2. Create a directory and set permissions
1.3. Change Configuration
1.4. Installation
1.5. Start/Stop Oracle
1. Installation Preparation
Before installation begins, verify that your system meets the minimum Oracle installation requirements:

MB of Memory
1 GB Swap partition
Confirm that you have installed GCC, make, binutils, Lesstif2, Libc6, and rpm
* It is best to confirm that DNS and/or your/etc/hosts files have been properly configured to ensure that your IP address and hostname are properly parsed.
1.1. Set up user
We need to create an Oracle user and two groups for the installer. First check to see if they already exist:
$grep Oinstall/etc/group
$grep Dba/etc/group
$grep Nobody/etc/group
If they are not yet in the system, then create them.
#addgroup Oinstall
#addgroup DBA
#addgroup Nobody
#useradd-G oinstall-g dba-p passwd-d/home/oracle-s/bin/bash Oracle
#usermod-G Nobody nobody
1.2. Create a directory and set permissions
NOTE: The Oracle default directory is/u01 and/u02. For better compatibility with FHS, we changed to/opt/oracle and/opt/oradata:
#mkdir-P/opt/oracle
#mkdir-P/opt/oradata
#chown-R oracle:oinstall/opt/ora*
#chmod-R 775/opt/ora*
1.3. Change Configuration
Add the following line to the/etc/sysctl.conf file:
Kernel.shmall = 2097152
Kernel.shmmax = 2147483648
Kernel.shmmni = 4096
Kernel.sem = 250 32000 100 128
Fs.file-max = 65536
Net.ipv4.ip_local_port_range = 1024 65000
Update system, run:
#sysctl-P
Add the following line to the/etc/security/limits.conf file:
* Soft Nproc 2407
* Hard Nproc 16384
* Soft Nofile 1024
* Hard Nofile 65536
To establish a soft connection:
#ln-S/usr/bin/awk/bin/awk
#ln-S/usr/bin/rpm/bin/rpm
#ln-S/usr/bin/basename/bin/basename
By creating a new file/etc/redhat-release and adding the following line, deceive the installer to make it think our system is Redhat:
Red Hat Linux Release 2.1 (Drupal)
1.4. Installation
Log in with an Oracle user to copy the installation files to a temporary directory.
#su Oracle
$CP-R/installer/files/here/' mktemp-d '
Start the Setup program. Note: If the system says to display variable errors, try restarting GDM (Gnome display manager) and log on with an Oracle user.
$./runinstaller
When it is running correctly, you will see a GUI window interface. During installation, the installer will remind you two times to stop and run the script with root privileges. When it first reminds you, let it go, it just sets the appropriate permissions, and the second time it requires running the root.sh script, you need to do the following:
#mkdir/ETC/RC.D
#ln-S/ETC/RC0.D/ETC/RC.D/RC0.D
#ln-S/ETC/RC2.D/ETC/RC.D/RC2.D
#ln-S/ETC/RC3.D/ETC/RC.D/RC3.D
#ln-S/ETC/RC4.D/ETC/RC.D/RC4.D
#ln-S/ETC/RC5.D/ETC/RC.D/RC5.D
#ln-S/ETC/RC6.D/ETC/RC.D/RC6.D
#ln-S/ETC/INIT.D/ETC/RC.D/INIT.D
#/path/to/root.sh
Oracle installs a INIT.CSSD service in the system. The root.sh script will wait 600 seconds (10 minutes) for the service to start, and when it is waiting, you need to make some settings. The console message displays: Expecting the CRS daemons to being up within seconds. You need to do three things, first, modify the/etc/inittab file, and change the run level from the Redhat and SuSE defaults to the (Debian default):
 
Will:
H1:35:RESPAWN:/ETC/INIT.D/INIT.CSSD Run >/dev/null 2>&1
Change into
H1:23:RESPAWN:/ETC/INIT.D/INIT.CSSD Run >/dev/null 2>&1
Then, Inittab will run/ETC/RC.D/INIT.D/INIT.CSSD. Exit this script, modify line 83rd, and replace:
su= "/bin/su-l"
For
su= "/bin/su"
Finally, restart the service:
#init Q
Root.sh will continue to run until successful, the graphical installation interface will display the end.
1.5. Start/Stop Service
Here we need to add another init script to enable Oracle to start automatically after restarting the system, first of all, to remove some corrupted connections created by the installer.
#rm/etc/rc2.d/[sk]96*
#rm/etc/rc3.d/[sk]96*
#rm/etc/rc5.d/[sk]96*
#update-RC.D INIT.CSSD Defaults 96
In this init script below, I have customized the start/Stop Oracle instance, listener mode, and Enterprise Manager Web interface for our needs.
#!/bin/bash
#
#/etc/init.d/oracledb
#
# run-level Startup script for the Oracle Instance, Listener, and
# Web Interface
Export Oracle_home=/your/oracle/home/goes/here
Export Oracle_sid=oraclesidgoeshere
Export path= $PATH: $ORACLE _home/bin
Ora_ownr= "Oracleownergoeshere"
# If the executables does 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 "$" in
Start
# Oracle Listener and instance startup
Echo-n "Starting Oracle:"
Su $ORA _ownr-c "$ORACLE _home/bin/lsnrctl start"
Su $ORA _ownr-c $ORACLE _home/bin/dbstart
Touch/var/lock/oracle
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/lsnrctl Stop"
Su $ORA _ownr-c $ORACLE _home/bin/dbshut
Rm-f/var/lock/oracle
Su $ORA _ownr-c $ORACLE _home/bin/emctl Stop Dbconsole
echo "OK"
;;
Reload|restart)
$ stop
$ start
;;
*)
echo "Usage: ' basename $ ' start|stop|restart|reload"
Exit 1
Esac
Exit 0
Place the file in the specified location and make it executable, connecting it to all run levels:
#chmod 755/etc/init.d/oracledb
#update-RC.D oracledb Defaults 99
Before we run this configuration file, we need to do some customization work. The following files need to change their environment variables for our setup program:
/usr/local/bin/dbhome--Change orahome, Orasid, and Oratab (/etc/oratab)
$ORACLE _home/bin/dbhome--ditto
$ORACLE _home/bin/dbstart--Change Oratab
$ORACLE _home/bin/dbshut--ditto
If you want to start all of the database instances you created when the system starts, you need to modify the/etc/oratab file. Here is an example:
Oracle:/opt/oracle/:n
Amended to
Oracle:/opt/oracle:y
Now you can start running. Reboot your system first by setting Oracle_home, Oracle_sid, and PATH variable variables (or user profiles, such as. bashrc) via the command line; You can try running Sqlplus or using the Web login Management interface (HTTP://URLHERE.COM:5500/EM) to test
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.