Prerequisites:
1. Yum Source
2. Ensure that the IP address on the Internet is static
3. IP address and host name write/etc/hosts
vim/etc/hosts-->192.168.159.129?? Centos6
4. The Oracle installation package is decompressed and placed under/root.
Package: p13390677_112040_linux-x86-64_1of7.zip,p13390677_112040_linux-x86-64_2of7.zip,pdksh-5.2.14-30.x86_64.rpm, rlwrap-0.37-1.el6.x86_64.rpm
1. Installing VMware Tools
Mount/media/vmware TOOLS,DF View
cd/media/vmware\ Tools/-->ls
Tar xvf? vmwaretools-10.0.0-2977863.tar.gz-c/tmp? #解压缩
cd/tmp/vmware-tools-distrib/
./vmware-install.pl? #运行脚本
Reboot??? #重启
2. Install Oracle
①unzip p13390677_112040_linux-x86-64_1of7.zip;unzip p13390677_112040_linux-x86-64_2of7.zip? #解压缩
②vim orainst_11g.sh
#!/bin/bash
Pkg= "
UnixODBC
Unixodbc-devel
Binutils
Compat-libstdc++-33
Elfutils-libelf
Elfutils-libelf-devel
Elfutils-libelf-devel-static
Gcc
Gcc-c++
glibc
Glibc-common
Glibc-devel
Glibc-headers
Kernel-headers
Ksh
Libaio
Libaio-devel
libgcc
Libgomp
Libstdc++
Libstdc++-devel
Make
Numactl-devel
Sysstat
"
Packinstall=
In $PKG;d o
? ? Rpm-q $PACKAGE | | Packinstall= "$PACKINSTALL $PACKAGE"
Done
Echo
If [-Z ' $PACKINSTALL '];then
????? true
?? else
?? echo "The followling packages would be install: $PACKINSTALL"
??? read-p "Continue? (y/n): "Answer
?? case $answer in
? ? ? ? ([yy]| [Yy] [Ee] [Ss])
??????? Echo 1
??????. yum-y install $PACKINSTALL;;
? ? ? ? (*);;
?? esac
Fi
Cat/etc/group |grep oinstall &>/dev/null | | /usr/sbin/groupadd Oinstall
Cat/etc/group |grep dba &>/dev/null | | /usr/sbin/groupadd DBA
ID Oracle &>/dev/null?
? ? ? ? If [$? = 0];then
????? Groups Oracle | grep dba &>/dev/null | | /USR/SBIN/USERMOD-G oinstall-g dba Oracle
? ? ? ? Else
?????/usr/sbin/useradd-g oinstall-g dba Oracle
????? Echo Oracle |PASSWD--stdin Oracle
? ? ? ? Fi
kelnum=$ (cat/etc/sysctl.conf |grep-v ^# |grep-v ^$ |grep-e "fs.aio-max-nr|fs.file-max|kernel.shmall|kernel.shmmax| Kernel.shmmni|kernel.sem|net.ipv4.ip_local_port_range|net.core.rmem_default|net.core.rmem_max|net.core.wmem_ Default|net.core.wmem_max "|awk ' {print '} ' |sort-u |wc-l)
If [$KELNUM-lt];then
Cat >>/etc/sysctl.conf <<eof
FS.AIO-MAX-NR = 1048576
Fs.file-max = 6815744
Kernel.shmall = 2097152
Kernel.shmmax = 536870912
Kernel.shmmni = 4096
Kernel.sem = 250 32000 100 128
Net.ipv4.ip_local_port_range = 9000 65500
Net.core.rmem_default = 262144
Net.core.rmem_max = 4194304
Net.core.wmem_default = 262144
Net.core.wmem_max = 1048586
Eof
/sbin/sysctl-p
Fi
grep oracle/etc/security/limits.conf &>/dev/null?
? If [$?! = 0];then
Cat >>/etc/security/limits.conf << EOF
Oracle??????? Soft?? Nproc?? 2047
Oracle??????? Hard?? Nproc?? 16384
Oracle??????? Soft?? Nofile? 1024
Oracle??????? Hard?? Nofile? 65536
Oracle??????? Soft?? Stack?? 1024
Eof
? fi
grep pam_limits.so/etc/pam.d/login &>/dev/null
? If [$?! = 0];then
Cat >>/etc/pam.d/login <<eof
Session Required Pam_limits.so
Eof
? Fi
[-d/u01/app] | | (Mkdir-p/u01/app/; chown-r oracle:oinstall/u01/app/; Chmod-r 775/u01/app)
Grep-i Oracle ~oracle/.bash_profile &>/dev/null
? If [$?! = 0];then
Cat >> ~oracle/.bash_profile <<eof
Export Oracle_base=/u01/app/oracle
Export oracle_home=\ $ORACLE _base/11.2.0/db_1
Export ORACLE_SID=ORCL
Export path=\ $PATH: \ $ORACLE _home/bin
Eof
? Fi
Xhost +
[-D ~oracle/database] | | Mv/root/database ~oracle?
CD ~oracle;su-oracle-c ' Database/runinstaller '
Bash./orainst_11g.sh
③ into the Oracle installation interface
Remove the I wish to receive security updates via My Oracle surrport option and click Next.
?
Select Install database software only, click Next.
Select Single Instance database installation and click Next.
In Available languages Select Chinese, Simplified Chinese, click on the middle of two boxes, add the selected language to the right of the selected languages, and then click Next.
Select the Enterprise version.
Fill in Oracle's software path and basic path, such as:
Select the DBA group.
Before this step, you need to modify the physical memory and install the rpm-ivh?pdksh-5.2.14-30.x86_64.rpm, as prompted to modify.
Adjust kernel parameters: vim/etc/sysctl.conf-->Kernel.shmmax = 536870912-->sysctl-p Make it effective ?
Executes two scripts, close ends.
④ into the database for creation
Installation is required in the graphical interface (in the console or with CRT Tools software). Open a terminal window and execute the following command: DBCA, as shown in:
The Database Configuration Assistant graphical interface is started, such as:
Create a database.
Select First, Next.
Set the user name.
Turn on the 1521 listening port.
Enable archiving? Determines whether or not a selection is made based on the actual need to archive logs. The default is checked.
Then click the OK button to start creating the database as shown in:
The database is created.
3. Simple verification
Sqlplus/as sysdba? #进入oracle数据库
Conn/as sysdba;? ? #连接用户
Alter user Scott identified by Tiger account unlock; #解锁用户
Conn Scott/tiger
Sql> select * from dept;? ? #列出所有列
? ? DEPTNO dname????? LOC
---------- -------------- -------------
? ? ? ? Ten ACCOUNTING??? NEW YORK
? ? ? ? A.???? DALLAS
? ? ? ? The SALES????? CHICAGO
? ? ? ? OPERATIONS??? BOSTON
See which tables are under the user
Sql> select * from tab;
Tname??????????????????? Tabtype? Clusterid
------------------------------ ------- ----------
Countries??????????? TABLE
Departments?????????? TABLE
EMPLOYEES??????????? TABLE
Emp_details_view???????? VIEW
JOBS??????????????? TABLE
Job_history?????????? TABLE
LOCATIONS??????????? TABLE
Regions???????????? TABLE
8 rows selected.
Installing Oracle 11g