现在的位置: 首页 > 综合 > 正文

oracle Linux 6.3 安装 oracle11g安装过程详解

2013年12月11日 ⁄ 综合 ⁄ 共 5597字 ⁄ 字号 评论关闭
文章目录

oracle Linux 6.3  安装oracle11g安装过程详解

好久没有写帖子了,今天终于按耐不住了!

先给讲故事:这前几天我的电脑突然黑屏了,用了好多年了也该换了。由于Tinkpad太贵了但是我又对其情有独钟,于是我就在58上看中了是二手的IBM说是T420 什么I7配置8G内存,由于我太想要了因为价格还好于是就让在北京的朋友帮忙代收;事前我给他了两个软件来验货;谁想到他没有用我给的鲁大师,图方便就用自带的谁想都已经被高手改过了。都已经这样了咱也不能怪人家吧。

拿到手里我进行了全面检测原来就是T43翻新的内存512 cpu tm750 唉亏死掉。那卖家早已不见踪影。

买了就买了吧,我吧我自己电脑修好先用这等工作了在去入手白富美吧。

虽然被骗了但是我也不能吧这点那浪费了呀,于是我花费30元买了个cpu tm770(780性价比太低) 内存加了1g。配置总算是马马虎虎了。我就用这台电脑来操练linux系统和oracle数据库吧。

前期准备:

下载操作系统(oracle linux 6):这个操作系统是oracle官方提供的是基于red hat 6进行修改的。集成了oracle数据库所需的包比较方便。

下载oracle11g安装包在官网下载的是两个文件。我下载的linxu企业版x86

开始安装数据库:

1.在linux root帐号下创建oinstall,dba 用户组 创建oracle用户并添加到创建的组中设置数据库密码:orcl(我的)

[root@ydcun 桌面]# groupadd oinstall
[root@ydcun 桌面]# groupadd dba
[root@ydcun 桌面]# useradd -g oinstall -g dba oracle
[root@ydcun 桌面]# passwd oracle
更改用户 oracle 的密码 。
新的 密码:
无效的密码: 过短
无效的密码: 过于简单
重新输入新的 密码:
passwd: 所有的身份验证令牌已经成功更新。

2.关闭防火墙

[root@ydcun 桌面]# service iptables stop
iptables:清除防火墙规则:                                 [确定]
iptables:将链设置为政策 ACCEPT:filter                    [确定]
iptables:正在卸载模块:                                   [确定]

3.在root账户下对/home/oracle 中的.bash_profile 文件进行修改

[root@ydcun 桌面]# cd /home
[root@ydcun home]# ls
oracle  ydcun
[root@ydcun home]# ls -a
.  ..  oracle  ydcun
[root@ydcun home]# cd oracle
[root@ydcun oracle]# ls -a
.   .bash_logout   .bash_profile.swo  .bashrc  .mozilla
..  .bash_profile  .bash_profile.swp  .gnome2
[root@ydcun oracle]# vim .bash_profile

在末尾添加如下内容

export ORACLE_SID=orcl
export ORACLE_BASE=/u01 
export ORACLE_HOME=/u01/oracle
export PATH=$ORACLE_HOME/bin:$PATH

orcl是以后数据库实例的sid u01为oracle 基本地址  /u01/oracle是数据home
这两个目录用root帐号创建并将权限付给oracle用户

[root@ydcun oracle]# mkdir /u01
[root@ydcun oracle]# mkdir /u01/oracle
[root@ydcun oracle]# chown -R oracle.oinstall /u01

4.修改/etc/sysctl.conf文件 在末尾加上如下内容

[root@ydcun oracle]# vim /etc/sysctl.conf
kernel.shmall = 2097152
kernel.shmall = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 1048576
net.core.wmem_max = 1048576

修改后刷新文件使其配置生效

[root@ydcun oracle]# sysctl -p

5.修改hosts文件

[root@ydcun oracle]# vim /etc/hosts

在hosts文件中添加一行  127.0.0.1    主机名

6.将下载好的两个数据库文件间用unzip命令进行解压在oracle用户下解压

[oracle@ydcun oracle]# unzip wenjianming.zip

7.运行解压文件加中的安装程序

[oracle@ydcun 桌面]$ cd /home/oracle
[oracle@ydcun ~]$ ll
总用量 60
-rw-r-----. 1 oracle dba 15558 11月 23 19:43 config.html
drwxr-xr-x. 8 oracle dba  4096 8月  19 2009 database
drwxr-xr-x. 3 oracle dba  4096 11月 23 17:42 oradiag_oracle
drwxr-xr-x. 2 oracle dba  4096 11月 23 11:04 zysong
drwxr-xr-x. 2 oracle dba  4096 11月 23 00:17 公共的
drwxr-xr-x. 2 oracle dba  4096 11月 23 00:17 模板
drwxr-xr-x. 2 oracle dba  4096 11月 23 00:17 视频
drwxr-xr-x. 2 oracle dba  4096 11月 23 00:17 图片
drwxr-xr-x. 2 oracle dba  4096 11月 23 00:17 文档
drwxr-xr-x. 2 oracle dba  4096 11月 23 00:17 下载
drwxr-xr-x. 2 oracle dba  4096 11月 23 00:17 音乐
drwxr-xr-x. 2 oracle dba  4096 11月 24 01:03 桌面
[oracle@ydcun ~]$ cd database
[oracle@ydcun database]$ ls
doc  install  response  rpm  runInstaller  sshsetup  stage  welcome.html
[oracle@ydcun database]$ ./runInstaller

如果出来的界面是有中文乱码就去去下载字库安装上重新运行就解决了,或者是在命令行中临时讲环境变量进行修改

1.下载字体(将字体拷贝到/usr/share/fonts/zh_CN/TrueType/zysong.ttf)之后双击进入安装

2.修改环境变量用英文临时的命令行关闭后失效

export LANG=en

3.之后就和win下安装一样的了。

4.在安装玩oracle软件后我们开始创建oracle实例

5.在安装过程成会有一些检查环境检查,对应的具体数字会啊在操作系统中不一样(对应的参数就是第四步骤中的参数名与参数至)

4.修改/etc/sysctl.conf文件 在末尾加上如下内容

[root@ydcun oracle]# vim /etc/sysctl.conf

kernel.shmall = 2097152
kernel.shmall = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
 net.core.wmem_default = 1048576
net.core.wmem_max = 1048576

打开创建oracle实例的工具dbca(database configuration assistant)

[oracle@ydcun 桌面]$ dbca

打开创建监听的工具

创建监听
[oracle@ydcun 桌面]$ netmgr

进入监听
[oracle@ydcun 桌面]$ lsnrctl 

LSNRCTL> start

或者

[oracle@ydcun 桌面]$ lsnrctl start
[oracle@ydcun 桌面]$ lsnrctl stop
[oracle@ydcun 桌面]$ lsnrctl status

通过上面一系列的操作就顺利装上了oracle

oracle 的开启和关闭

[oracle@ydcun 桌面]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.1.0 Production on Sun Nov 24 01:33:46 2013

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

SQL> conn /as sysdba
Connected to an idle instance.
SQL> shutdown abort
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area  631914496 bytes
Fixed Size		    1338364 bytes
Variable Size		  419431428 bytes
Database Buffers	  205520896 bytes
Redo Buffers		    5623808 bytes
Database mounted.
Database opened.
SQL> exit;
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@ydcun 桌面]$ lsnrctl

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 24-NOV-2013 01:36:31

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Welcome to LSNRCTL, type "help" for information.

LSNRCTL> start
TNS-01106: Listener using listener name LISTENER has already been started
LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ydcun.ibm.com.cn)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                23-NOV-2013 23:59:42
Uptime                    0 days 1 hr. 37 min. 25 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/oracle/network/admin/listener.ora
Listener Log File         /u01/diag/tnslsnr/ydcun/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ydcun.ibm.com.cn)(PORT=1521)))
Services Summary...
Service "orcl" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
LSNRCTL> 

SQL> col tablespace_name for a15
SQL> select tablespace_name,block_size,status,contents,logging from dba_tablespaces;

TABLESPACE_NAME BLOCK_SIZE STATUS    CONTENTS  LOGGING
--------------- ---------- --------- --------- ---------
SYSTEM		      8192 ONLINE    PERMANENT LOGGING
SYSAUX		      8192 ONLINE    PERMANENT LOGGING
UNDOTBS1	      8192 ONLINE    UNDO      LOGGING
TEMP		      8192 ONLINE    TEMPORARY NOLOGGING
USERS		      8192 ONLINE    PERMANENT LOGGING

SQL> 


通过这样的步骤我们就完成了linuxoracle 操作系统上安装oracle 

http:blog.csnd.net/ydcun和大家一起交流沟通!

抱歉!评论已关闭.