Tutorial environment: ORACLE11GR2, CENTOS6.2 32-bit version removes the need to modify the redhat Yum source, ipset to 192.168.233.10, NAT Network), VM8.0 version
For installation instructions, refer to the official website documents and some articles, and complete configuration parameters as much as possible. The invalid experiment is also corrected.
First, build the environment. The Minitop installed by centos by default is configured with FTP and network, which is relatively simple and not described. The download of the 11G version is also relatively simple and will not be described ., Support thunder download, do not register http://929044991.blog.51cto.com/1758347/1068460
1. settings of related services after Linux installation:
1. Disable the Firewall Service, email service, and NTP time synchronization service.
[Root @ leonarding1 etc] # chkconfig -- list iptables view Firewall service operation level setting parameters
Iptables 0: off 1: off 2: on 3: on 4: on 5: on 6: off 2345 boot
Root @ leonarding1 etc] # chkconfig -- list sendmail
Sendmail 0: off 1: off 2: on 3: on 4: on 5: on 6: off 2345 boot all start
[Root @ leonarding1 etc] # service iptables stop temporarily disables the Firewall service
[Root @ leonarding1 etc] # service sendmail stop temporarily closes the mail service
Shutting down sm-client: [OK]
Shutting down sendmail: [OK]
[Root @ leonarding1 etc] # chkconfig -- level 35 iptables off specified 35 running level boot not started
[Root @ leonarding1 etc] # chkconfig -- level 35 sendmail off specified 35 running level boot not started
[Root @ leonarding1 etc] # chkconfig -- list iptables check whether setting is successful 35 run-level startup not started
Iptables 0: off 1: off 2: on 3: off 4: on 5: off 6: off
[Root @ leonarding1 etc] # chkconfig -- list sendmail check whether setting is successful 35 run-level startup not started
Sendmail 0: off 1: off 2: on 3: off 4: on 5: off 6: off
Root @ leonarding1 app] # service ntpd status check ntp service status, Disabled
Root @ leonarding1 app] # service ntpd stop temporarily disables the ntp service
[Root @ leonarding1 app] # chkconfig ntpd off specifies that the ntp service is not started
2. Modify the hosts file (delete the default content and add the following two sentences)
The "/etc/hosts" file mustcontain a fully qualified name for the server.
<IP-address> <fully-qualified-machine-name> <machine-name>
127.0.0.1 localhost
192.168.233.10 oracleinstall
3. Set and take effect of Kernel Parameters
# Vim/etc/sysctl. conf
Kernel. core_uses_pid = 1
Kernel. shmall = 2097152 # ipcs-m 4G * 1024*1024/4 K = 1048576 (page)
Kernel. shmmax = 2147483648 2G * 1024*1024*1024 = 2147483648 (bytes)
Kernel. shmmni = 4096
Kernel. sem = 250 32000 100 128
Fs. file-max = 65536
Fs. suid_dumpable = 1
Net. ipv4.ip _ local_port_range = 9000 65000
Net. core. rmem_default = 4194304
Net. core. rmem_max = 4194304
Net. core. wmem_default = 262144
Net. core. wmem_max = 1048586
Make it take effect
#/Sbin/sysctl-p
4. Modify shell restrictions of Oracle users
4.1 # vim/etc/security/limits. conf
Add the following content:
Oracle soft nproc 2047
Hard nproc 16384
Oracle soft nofile 1024
Oracle hard nofile 65536
4.2 # vim/etc/pam. d/login
Add the following content:
[Session required/lib/security/pam_limits.so this line is not required for 64-bit operating systems]
Session required pam_limits.so I only need to add this line to a 64-bit system.
# Ulimit-a Check Configuration
5. Add the following content to the/etc/security/limits. conf file:
Oracle soft nproc 2047
Hard nproc 16384
Oracle soft nofile 4096
Oracle hard nofile 65536
Oracle soft stack 10240
6. Create groups and users
Groupadd-g 501 oinstall
Groupadd-g 502 dba
Groupadd-g 503 running
Groupadd-g 504 asmadmin
Groupadd-g 506 asmdba
Groupadd-g 505 asmoper
Useradd-u 502-g oinstall-Gdba, asmdba, external oracle
Passwd oracle
7. Create a directory and grant permissions
Mkdir-p/u01/app/oracle/product/11.2.0/db_1
Chown-R oracle: oinstall/u01
Chmod-R 775/u01
8. Install the RPM package
8.1 check whether related RPM packages are installed:
# Rpm-q binutils compat-libcap1 compat-libstdc ++ 33 gcc-c ++ glibc-devel ksh libgcc libstdc ++ libaio-devel make sysstat
9. Install the keyboard Enhancement Tool in the sqlplus command line. You can use the upper, lower, and left backspace keys normally.
# Yum install rlwrap
Ii. User Environment Variable Configuration:
1. Modify the. bash_profile environment variable of an oracle user
# Su-oracle login to oracle users
[Oracle @ leonarding1 ~] $ Vim. bash_profile modify. bash_profile
Add the following environment variables
# Oracle Settings #
Export TMP =/tmp specifies the temporary directory
Export TMPDIR = $ TMP specifies the temporary directory path
Export ORACLE_BASE =/u01/app/oracle ORACLE base Directory
Export ORACLE_HOME =/u01/app/oracle/product/11.2.0/db_1 ORACLE Home Directory
Export ORACLE_SID = orcl oracle Instance name
Export ORA_CRS_HOME =/u01/app/product/crs_1 (Optional). This is the cluster registration service directory.
Export ORACLE_ADMIN = $ ORACLE_BASE/admin dump directory of ORACLE
Export LD_LIBRARY_PATH = $ ORACLE_HOME/lib:/usr/lib
Error Message
Export ORACLE_TERM = xterm specifies the type of the ORACLE terminal to be installed
Export PATH =/usr/sbin:/usr/bin:/usr/local/bin: $ ORACLE_HOME/jdk/bin: $ PATH
[Oracle @ leonarding1 ~] $ Source. bash_profile: Reload the environment variable to make it take effect
4. Start database installation and switch to Oracle user installation)
1. Import the language export LANG = en_US before installation. Otherwise, garbled characters will appear in the graphic interface for installation.
2. decompress the compressed file to the appropriate location
# Unzip file-r/path decompressing. Zip software to the corresponding directory
3./runInstaller start to install the oracle database software
$ Cd database/enter the installation directory
$ Pwd
/Home/oracle/database
$./RunInstaller
-------------------------------------
V. Example of self-starting DB upon startup
5.1 modify the value of/etc/oratab to Y
Gg1:/u01/app/oracle/product/11.2.0.3/db_1/bin> ll/etc/oratab
-Rw-r -- 1 oracle oinstall 722 Jan 3020: 36/etc/oratab
Gg1:/u01/app/oracle/product/11.2.0.3/db_1/bin> cat/etc/oratab
#
Gg1:/u01/app/oracle/product/11.2.0.3/db_1: Y
5.2 modify dbstart's ORACLE_HOME_LISTNER and point it to $ ORACLE_HOME:
# First argument is used to bring up listen lenet Listener
ORACLE_HOME_LISTNER = $ ORACLE_HOME
5.3 Add the following content in rc. local as the root user:
[Root @ gg1 ~] # Cat/etc/rc. local
#! /Bin/sh
#
# This script will be executed * after * allthe other init scripts.
# You can put your own initialization stuffin here if you don't
# Want to do the full Sys V style initstuff.
Touch/var/lock/subsys/local
Su-oracle-c "/u01/app/oracle/product/11.2.0/db_1/bin/dbstart"
Su-oracle-c "/u01/app/oracle/product/11.2.0/db_1/bin/emctl start dbconsole"
Note that the oracle user must be used to start the script.
5.4 set up an Oracle database
1. Set the SQLPLUS command line prompt Style
[Oracle @ leonarding1 ~] $ Vim $ ORACLE_HOME/sqlplus/admin/glogin. SQL log on to the glogin. SQL global configuration file.
Add the following content at the end of the glogin. SQL file:
Set sqlprompt "_ user' @ '_ connect_identifier>"
[Oracle @ leonarding1 ~] $ Sqlplus/as sysdba test setting effect
SYS @ LEO1> User Name @ connection string name
Note: in this way, we can easily know which user is logged on to which database, avoiding confusion.
5.5 Verification
Oracle @ leonarding1 ~] $ Ps-ef | grep ora _ check that the DB process also exists.
[Oracle @ leonarding1 ~] $ Lsnrctl status check the listening status is successful
SQL> select * from v $ version; query the database version
5. tablespace usage
Select df. tablespace_name "tablespace name", totalspace "total space M", freespace "remaining space M", round (1-
Freespace/totalspace) * 1024/1024) "usage %" from (select tablespace_name, round (sum (bytes)/) totalspace
From dba_data_files group by tablespace_name) df, (select tablespace_name, round (sum (bytes)/1024/1024)
Freespace from dba_free_space group by tablespace_name) fs where df. tablespace_name = fs. tablespace_name order
By df. tablespace_name; -- tablespace usage
This article is from the "wushuang City" blog and is not reposted!