linux下安装oracle 11g

来源:互联网 发布:软件开发工程师 英语 编辑:程序博客网 时间:2024/05/19 01:29
一. 准备

1.下载oracle

地址:https://www.oracle.com/downloads/index.html

2.解压
#unzip linux_11gR2_database_1of2.zip#unzip linux_11gR2_database_2of2.zip
二. 安装

1Logging In to the System as root

2Checking the Hardware Requirements

Memory 1GB

Swap 2GB

TEMP   20GB

3To determine the RAM size, enter the following command

# grep SwapTotal /proc/meminfo

4To determine whether the system architecture can run the software, enter the following command:

 # uname -m

5To determine the size of the configured swap space, enter the following command:

 # grep SwapTotal /proc/meminfo

check package

compat-libstdc++-5.0.7

gcc-4.1.0

gcc-c++-4.1.2

glibc-2.4-31.63

glibc-devel-2.4-31.63

glibc-devel-32bit-2.4-31.63

ksh-93r-12.9

libaio-0.3.104

libaio-32bit-0.3.104

libaio-devel-0.3.104

libaio-devel-32bit-0.3.104

libelf-0.8.5

libgcc-4.1.2

libstdc++-4.1.2

libstdc++-devel-4.1.2

make-3.80

numactl-0.9.6.x86_64

sysstat-8.0.4-

#rpm –qa package

#yum install package

6Creating Required Operating System Groups and Users

# groupadd dba

#groupadd oinstall

#useradd –g oinstall –G dba oracle

#passwd oracle

 

7Configuring Kernel Parameters and Resource Limits

#vim /etc/sysctl.conf

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 = 1048576

 

8Enter the following command to change the current values of the kernel parameters:

 # /sbin/sysctl –p

Enter the command to confirm that the values are set correctly

# /sbin/sysctl –a

#vim /etc/security/limits.conf

oracle          soft    nofile          1024

oracle          hard    nofile          65536

oracle          soft    nproc           2047

oracle          hard    nproc           16384

oracle          soft    stack           10240

oracle          hard    stack           32768

#exit  #su – oracle 重新登入使变更生效

  • nproc(单个用户可用的最大进程数量)
  • nofile(可打开的文件描述符的最大数)
  • soft是软限制 ,用户可以超过这个设置的值,但一定不能超过hard 的值 

9 Creating Required Directories

# mkdir -p /mount_point/app/

# chown -R oracle:oinstall /mount_point/app/

# chmod -R 775 /mount_point/app/

 (10)
vim ~/.bash_profile

 export ORACLE_BASE=/u01/app/oracle

 export ORACLE_SID=wuhen

 export ORACLE_HOME=$ORACLE_BASE/product/10.1.0/db_1

 export PATH=$PATH:$ORACLE_HOME/bin
 source  ~/.bash_profile

11install

复制安装包到/orapp/

#unzip xxx

#cd /orapp/database

#./runInstaller

(11)连接与排错

#lsnrctl start

#sqlplus / as sysdba

#startup

#exit

 
三. 排错

问题一:

#lsnrctl status

Error:-bash: lsnrctl: command not found

1.故障原因

环境变量没有设好,

2.故障解决

#which lsnrctl

应该是找不到,
#vim ~/.bash_profile

$ORACLE_HOME/bin加到$PATH里面

#source ~/.bash_profile


问题二:
1.故障原因

 ORACLE_SID没有指定!

 确认系统当前的ORACLE_HOMEORACLE_SID环境变量

 #echo $ORACLE_HOME

 /oracle/app/oracle/product/10.2.0/db_1

# echo $ORACLE_SID

 可见,此时只设置了ORACLE_HOME环境变量,但ORACLE_SID此时为空,这就是该问题的真实原因。

2.故障处理

 给出ORACLE_SID,重新尝试登录。

# export ORACLE_SID=wuhen

# echo $ORACLE_SID

wuhen

 # sqlplus / as sysdba


问题三:
ORA-01078: failure in processing system parameters

LRM-00109: could not open parameter file '/u01/app/oracle/product/11.2.0/xe/dbs/initwuhen.ora'

故障原因:oracle默认将使用spfile启动数据库,如果spfile不存在,则就会出现上述错误。

故障处理:方法一:将$ORACLE_BASE/admin/orcl/pfile目录下的init.ora.0212012125517形式的文件copy$ORACLE_HOME/dbs目录下initwuhen.ora即可。(注:initwuhen.ora中的wuhen为你的实例名 ORACLE_SID,这里我的SID为:wuhen)

 方法二:将$ORACLE_HOME/dbs目录下spflieoracl.ora改名为spfilewuhen.ora即可。(注:spfilewuhen.ora中的wuhen为环境变量中设置的SID,我的是jiagulun

 

问题四:
windows 下无法访问虚拟机oracle,能ping通,虚拟就oracle 能连接
原因:防火墙阻止访问
故障解决:关闭防火墙
虚拟机下:
su - root
service iptables stop 
0 0
原创粉丝点击