Linux上oracle的安装

简介:
Linux版本:Red Hat Enterprise Linux5.0
Oracle版本:oracle 11g
 
Linux版本检查 #cat /etc/issue
 
首先检查自己安装的linux5.0上是否安装有以下包(参照oracle11g文档):
The following packages (or later versions) must be installed:
binutils-2.17.50.0.6-2.el5
compat-libstdc++-33-3.2.3-61
elfutils-libelf-0.125-3.el5
elfutils-libelf-devel-0.125
gcc-4.1.1-52
gcc-c++-4.1.1-52
glibc-2.5-12
glibc-common-2.5-12
glibc-devel-2.5-12
glibc-headers-2.5-12
libaio-0.3.106
libaio-devel-0.3.106
libgcc-4.1.1-52
libstdc++-4.1.1
libstdc++-devel-4.1.1-52.e15
make-3.81-1.1
sysstat-7.0.0
 
若是10g则需以下包:
make-3.79.1
gcc-3.2.3-34
glibc-2.3.2-95.20
glibc-devel-2.3.2-95.20
glibc-devel-2.3.2-95.20 (32 bit)
compat-db-4.0.14-5
compat-gcc-7.3-2.96.128
compat-gcc-c++-7.3-2.96.128
compat-libstdc++-7.3-2.96.128
compat-libstdc++-devel-7.3-2.96.128
gnome-libs-1.4.1.2.90-34.1 (32 bit)
openmotif21-2.1.30-8
setarch-1.3-1
libaio-0.3.96-3
libaio-devel-0.3.96-3
怎样检查是否安装呢?如检查 binutils-2.17.50.0.6-2.el5
[root@oracle11gdemo ~]# rpm -qa | grep binutils
binutils-2.17.50.0.6-2.el 5
说明binutils-2.17.50.0.6-2.el5已经安装。其它的依次检查。
将没有安装的包(去安装文件的server目录下找)上传到linux上,然后运行以下命令安装:
# rpm –ivh  *.rpm
 
下面的组和用户必须存在
The oinstall group (the oracle inventory group)
The dba group (the OSDBA group)
The oracle user (the oracle owner)
如果上面的组和用户不存在,用下面的步骤创建它们。
(1)先查看这些组和用户是否存在:
#grep oinstall /etc/group
#grep dba /etc/group
(2)创建安装oracle 所需的组和用户
#groupadd oinstall
#groupadd dba
 
 
bash: groupadd: command not found 错误解决:groupadd命令是要用ROOT用户来执行的,而出错的用户是用 su root切换到ROOT用户下,这个命令不会把环境带过去!!!!, 要用
 su   root 命令。
 
(3)建立一个目录作为oracle用户的缺省路径
创建目录:#mkdir –p /user01
建立一个缺省路径为/user01/oracle的用户oracle,同时oracle属于主组oinstall,和属于辅助组dba#useradd –g oinstall –G dba –d /user01/oracle oracle
 
将目录user01的属主改为oracle,属组改为oinstall
[root@oracle11gdemo /]# chown -R oracle.oinstall /user01
 
查看nobody是否存在:[root@oracle11gdemo user01]# id nobody
 
配置内核参数:
/etc/sysctl.conf 下通过 vi 添加如下参数
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 262144
net.ipv4.tcp_wmem = 262144 262144 262144
net.ipv4.tcp_rmem = 4194304 4194304 4194304
 
如下这些参数如法炮制
To increase the shell limits:
1.  Add the following lines to the  /etc/security/limits.conf  file:
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
2.  Add or edit the following line in the  /etc/pam.d/login  file, if it does not
already exist:
session required pam_limits.so
3.  Depending . the  oracle  user's default shell, make the following changes to the
default shell start-up file:
■  For the Bourne, Bash, or Korn shell, add the following lines to the
/etc/profile  file (or the file . SUSE Linux Enterprise Server systems
/etc/profile.local ):
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
■  For the C shell ( csh  or  tcsh ), add the following lines to the
/etc/csh.login  file (or the file . SUSE Linux Enterprise Server systems
/etc/csh.login.local ):
if ( $USER == "oracle" ) then
limit maxproc 16384
limit de.ors 65536
endif
 
 
oracle 用户名登录系统,配置oracle 用户的环境。以oracle 帐号用安装器来安装oracle,但是开始运行安装器之前,还得设定oracle用户的环境变量。
[oracle@oracle11gdemo ~]$ vi .bash_profile
vi打开.bash_profile,然后添加一下变量:
ORACLE_BASE=/user01
ORACLE_HOME=$ORACLE_BASE/oracle
ORACLE_SID=Wilson
PATH=$ORACLE_HOME/bin:$PATH
 
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH
 
oracle安装文件解压:
[root@oracle11gdemo user01]# unzip linux_11gR1_database_1013.zip
 
解压后将在当前目录生成一个database文件夹,将此文件夹移动的oracle用户的缺省路径的上一级路径:
[root@oracle11gdemo user01]# mv database/ /user01
 
将目录database的属主改为oracle,属组改为oinstall
[root@oracle11gdemo user01]# chown -R oracle.oinstall database/
 
 
oracle用户登录图像界面,运行database下的runInstaller:
./runInstaller
注:一定要用oracle用户登陆,不能用root,否则安装oracle时会出现错误:。。。。。 at least 256 color 。。。。。

如果用root登陆,要按以下操作:
# xhost + 
# su - oracle 
$ export DISPLAY= :0 
$ ./runInstaller.sh 
我建议用oracle 登陆,简单,直接到Disk1目录下安装即可
# ./runInstaller
如果是第一次安装的话,系统会提示用root用户运行一个脚本文件,新开一个consolesu  root后,按照提示运行即可。
之后的安装过程比较简单,一路next即可。
 
至此,oracle11g安装完毕。下面介绍怎么创建一个数据库实例:
首先配置一个Listener,启动linux图形界面,打开终端,输入netca,然后一路next
接着就可以配置数据库实例了,在终端中输入dbca,然后跳出dbca的图形界面,一路设置下去即可。
 
开启监听后才可以用PLSQL Developer连接。
开启监听命令: $ lsnrctl start
开启数据库实例命令:SQL> startup
 
错误解决:
1.Can't connect to X11 window server using '127.0.0.1:0.0' as the value of the DISPLAY variable.
解决:
在终端里   以root用户执行   #xhost   + 
然后su   -   oracle 
执行#export   DISPLAY=:0 
运行runinstaller
 
2.若想在本地通过plsql访问服务器的oracle,需先把服务器的防火墙关闭。
解决:
1) 重启后生效 
开启: chkconfig iptables 
关闭: chkconfig iptables off 
2) 即时生效,重启后失效 
开启: service iptables start 
关闭: service iptables stop
需要说明的是对于Linux下的其它服务都可以用以上命令执行开启和关闭操作。 

在开启了防火墙时,做如下设置,开启相关端口, 
修改/etc/sysconfig/iptables 文件,添加以下内容: 
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT 
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT









本文转自 yzzh9 51CTO博客,原文链接:http://blog.51cto.com/java999/124177,如需转载请自行联系原作者
目录
相关文章
|
5天前
|
缓存 Ubuntu Linux
Linux中yum、rpm、apt-get、wget的区别,yum、rpm、apt-get常用命令,CentOS、Ubuntu中安装wget
通过本文,我们详细了解了 `yum`、`rpm`、`apt-get`和 `wget`的区别、常用命令以及在CentOS和Ubuntu中安装 `wget`的方法。`yum`和 `apt-get`是高层次的包管理器,分别用于RPM系和Debian系发行版,能够自动解决依赖问题;而 `rpm`是低层次的包管理工具,适合处理单个包;`wget`则是一个功能强大的下载工具,适用于各种下载任务。在实际使用中,根据系统类型和任务需求选择合适的工具,可以大大提高工作效率和系统管理的便利性。
54 25
|
21天前
|
Ubuntu Java Linux
Linux 安装 Qualcomm ® SnapdragonTM Profiler
通过本文的详细介绍,您应该已经成功在 Linux 系统上安装并配置了 Qualcomm® Snapdragon™ Profiler,并能够连接 Android 设备进行性能分析。Snapdragon Profiler 提供了丰富的工具和功能,可以帮助开发者深入了解应用程序的性能瓶颈,从而进行优化。希望本文能对您有所帮助,让您在开发过程中更高效地使用 Snapdragon Profiler 进行性能分析和优化。
56 10
|
22天前
|
Linux
Linux安装svn并启动
Linux安装svn并启动
55 10
|
1月前
|
Oracle 关系型数据库 Linux
linux8安装oracle 11g遇到的问题记录
Oracle 11g在Linux 8上安装时会遇到link编译环节的问题。官方建议忽略安装中的链接错误,安装完成后应用DBPSU 11.2.0.4.240716补丁及一次性补丁33991024,再重新编译二进制文件,并配置监听器和数据库。但因11g已退出服务期,这些补丁需付费获取。网上信息显示22年1月的PSU补丁也可解决问题,找到该补丁后按常规方式打补丁即可。如有需求或疑问可咨询我。
83 20
|
1月前
|
弹性计算 运维 Ubuntu
os-copilot在Alibaba Cloud Linux镜像下的安装与功能测试
我顺利使用了OS Copilot的 -t -f 功能,我的疑惑是在换行的时候就直接进行提问了,每次只能写一个问题,没法连续换行更有逻辑的输入问题。 我认为 -t 管道 功能有用 ,能解决环境问题的连续性操作。 我认为 -f 管道 功能有用 ,可以单独创建可连续性提问的task问题。 我认为 | 对文件直接理解在新的服务器理解有很大的帮助。 此外,我还有建议 可以在非 co 的环境下也能进行连续性的提问。
79 7
|
2月前
|
Linux Python
Linux 安装python3.7.6
本教程介绍在Linux系统上安装Python 3.7.6的步骤。首先使用`yum`安装依赖环境,包括zlib、openssl等开发库。接着通过`wget`下载Python 3.7.6源码包并解压。创建目标文件夹`/usr/local/python3`后,进入解压目录执行配置、编译和安装命令。最后设置软链接,使`python3`和`pip3`命令生效。
|
2月前
|
Ubuntu Linux
Linux 各发行版安装 ping 命令指南
如何在不同 Linux 发行版(Ubuntu/Debian、CentOS/RHEL/Fedora、Arch Linux、openSUSE、Alpine Linux)上安装 `ping` 命令,详细列出各发行版的安装步骤和验证方法,帮助系统管理员和网络工程师快速排查网络问题。
244 20
|
2月前
|
NoSQL 关系型数据库 MySQL
Linux安装jdk、mysql、redis
Linux安装jdk、mysql、redis
238 7
|
3月前
|
Oracle Cloud Native 关系型数据库
Oracle Linux 9.5 正式版发布 - Oracle 提供支持 RHEL 兼容发行版
Oracle Linux 9.5 正式版发布 - Oracle 提供支持 RHEL 兼容发行版
112 10
Oracle Linux 9.5 正式版发布 - Oracle 提供支持 RHEL 兼容发行版
|
2月前
|
Unix Linux 编译器
UNIX/Linux 上的安装
UNIX/Linux 上的安装。
65 2