在Linux 下安装Oracle
我的安装环境:
Redhat Enterprise linux 5.4 版本
硬件要求:
内存要求:
Oracle Database 官方指定最少512M (后面会警告)建议1GB
磁盘空间要求:
Swap 交换分区为1.5GB
/tmp 目录中的磁盘空间为400MB
Oracle 软件需要1.5GB
Database 需要1.5GB
预配置的数据库需要1.2GB (可选)
快速恢复去需要2.4GB (可选)
操作系统:
具有1GB 以上RAM 和1.5GB 交换空间或者更高配置的计算机上可以实现标准安装
安装过程:
1. Login as root
2. Oracle的安装需要在图形化界面安装
3. 打开Xwindows,允许所有主机显示本主机上的X windows
[root@node1 ~]# xhost + ====== è oracle 模拟远程用户在本机安装,这步必须执行。
access control disabled, clients can connect from any host
4. 检查系统要求
物理内存最少为1G
[root@node1 ~]# grep MemTotal /proc/meminfo
Swap 分区建议为1.5G 以上
[root@node1 ~]# grep SwapTotal /proc/meminfo
/tmp 分区建议大于400M
[root@node1 ~]# df -lh /tmp
Filesystem> /dev/mapper/vol0-root
37G 5.7G 29G 17% /
查看cpu 是否符合安装Oracle
Note:
This command displays the processor type. Verify that the processor architecture matches the Oracle software> [root@node1 ~]# grep "model name" /proc/cpuinfo
model name : Intel(R) Core(TM)2 Duo CPU T6570 @ 2.10GHz
5. 检查所需软件包是否安装齐全
我们的内核版本应该为4.0或者更新的,但是不能太新了,否则下面实验时会报错,我们可以将自己的内核版本稍为改改(我这里将5.4给为4.4),骗骗系统,呵呵
[root@node1 ~]# vim /etc/issue
[root@node1 ~]# cat /etc/issue
Red Hat Enterprise Linux Server> Kernel \r on an \m
RH033
我们需要确保系统已经安装过以下软件包:
Red Hat Enterprise Linux 4.0:
Gmake-3.80-5 gcc-3.4.3-22.1 gcc-ppc32-3.4.3-22.1 gcc-c++-3.4.3-22.1 gcc-c++-ppc32-3.4.3-22.1 glibc-2.3.4-2.9 glibc-2.3.4-29 (64-Bit) libgcc-3.4.3-9.EL4 libgcc-3.4.3-9.EL4.ppc64.rp libstdc++-3.4.3-9.EL4 libstdc++-devel-3.4.3-9.EL4 libaio-0.3.103-3 libaio-0.3.103-3 (64-Bit) libaio-devel-0.3.103-3 (64-Bit) compat-libstdc++-33-3.2.3-47.3 binutils-2.15.92.0.2-13 我的系统是32位的,这里我只安装32位的,大家根据自己系统的情况自己选择 注意:
以上的包都是官方4.0系统安装Oracle需要安装的包,我们不能照着他的来,我们需要使用rpm -q package-name 一个一个查看以上的包是否已安装,呵呵,需要点耐心啊!做学问嘛,就是这样,同志们别急啊!经我测试,我的系统已经全部安装,大家,别偷懒啊,一个一个慢慢测试下,不然,后面会有大麻烦找你的!
6. 配置 Name Resolution
[root@ song ~]# cat /etc/nsswitch.conf | grep hosts ====== 输出如下为正确
#hosts: db files nisplus nis dns
hosts: files dns
[root@ song ~]# domainname ===== 输出必须如下,一字不差为正确
(none)
[root@ song ~]#vim /etc/sysconfig/network
[root@ song ~]#vim /etc/hosts
[root@ song ~]# hostname
song.example.com
格式类似即可,但/etc/hosts 中的名字和/etc/sysconfig/network 中名字一定要是一样的
7 .创建用户oracle,附加组dba,oper ,oinstall组
属主是oracle
# /usr/sbin/useradd -g oinstall -G dba,oper oracle # passwd oracle # /usr/sbin/groupadd dba # /usr/sbin/groupadd oinstall # /usr/sbin/groupadd oper #>uid=505(oracle) gid=505(oracle) groups=505(oracle),509(dba),510(oper)
我们可以用一下命令来检测
8. 编辑 /etc/sysctl.conf 文件,添加编辑如下
kernel.shmall = 2097152kernel.shmmax = 2147483648kernel.shmmni = 4096kernel.sem = 250 32000 100 128fs.file-max = 65536net.ipv4.ip_local_port_range = 1024 65000net.core.rmem_default = 1048576net.core.rmem_max = 1048576net.core.wmem_default = 262144net.core.wmem_max = 262144 [root@node1 oracle]# sysctl -p
9.设置shell limits for oracle user #vim /etc/security/limits.conf oracle soft nproc 2047oracle hard nproc 16384oracle soft nofile 1024oracle hard nofile 65536#Vim /etc/pam.d/login 添加 session required /lib/security/pam_limits.so#vim /etc/profile file 添加 if [ $USER = "oracle" ]; then if [ $SHELL = "/bin/ksh" ]; then ulimit -p 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fifi
设置oracle用户的环境变量如下:
[oracle@song ~]# su – oracle
[oracle@song ~]$ vim ~/.bash_profile
PATH=$PATH:$HOME/bin:/u01/app/oracle/product/10.2.0/db_1/bin
ORACLE_BASE=/u01/app/oracle
export ORACLE_BASE
ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
export ORACLE_HOME
echo PATH
10.创建oracle挂载安装目录,并修改其权限: # mkdir -p /u01/app/oracle/oradata # chown -R oracle:oinstall /u01/app/oracle/oradata # chmod -R 775 /u01/app/oracle/oradata 11. 下在oracle软件包,并解压缩 [root@song oracle]# ls 10201_database_linux32.zip [root@song oracle]# unzip 10201_database_linux32.zip [root@song oracle]# ls 10201_database_linux32.zip database[root@song oracle]# unzip 10201_database_linux32.zip 12. 安装oracle实例 [root@song database]# su - oracle [oracle@song ~]$ ls 10201_database_linux32.zip database[oracle@song ~]$ cd database/ [oracle@song database]$ ls doc install response runInstaller stage welcome.html[oracle@song database]$ ./runInstaller 出现以下图,我们作如下选择
[root@song db_1]# pwd
/u01/app/oracle/product/10.2.0/db_1
[root@song db_1]# ./root.sh
[root@song db_1]#cd /home/oracle/oralnventory/orainstRoot.sh
[root@song db_1]#./orainstRoot.sh
用以下命令开启配置数据库服务器图形化界面
[oracle@song ~]$ emctl start
[oracle@song ~]$ dbca
记着如图的地址,要用
在地址栏中填写刚才的地址,出现如下画面
正确的登录画面如下及表示创建成功
问题总结
1. 在使用emctl 和dbca 命令时出现没有命令:
解决方法:重新检查环境变量的设置
2.
可能是以下问题:
I. 无LISTERNER
a)[oracle@song ~]$netca =======è创建一个LISTENER
II. 监听器未启动
b) [oracle@song ~]$lsnrctl start
III.. 侦听器未启动
c) [oracle@song ~]$emctl start dbconsole
IV. 数据库未打开
d )[oracle@song ~]$sqlsplus / as sysdba
sql>show sya;
sql>alter database mount;
sql>alter database open;
V. 主机名解析问题
e) [oracle@song ~]$vim /etc/hosts
开启 127.0.0.1 localhost 这行
3.
[oracle@song config]$ pwd
/u01/app/oracle/product/10.2.0/db_1/sysman/config
[oracle@song config]$ vim emd.properties =======追加以下内容
agentTZRegion=Asia/Shanghai
其他的问题咱是还没有遇到,等遇到了再贴出来。
运维网声明
1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网 享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com