搜档网
当前位置:搜档网 › Oracle 10G Install on SuSE10

Oracle 10G Install on SuSE10

Oracle 10G Install on SuSE10
Oracle 10G Install on SuSE10

Oracle 10G Install on SuSE10

环境

anticell-suse:~ # uname -a

Linux anticell-suse 2.6.16.46-0.12-bigsmp #1 SMP Thu May 17 14:00:09 UTC 2007 i686 i686 i386 GNU/Linux

anticell-suse:~ # free -m

total used free shared buffers cached

Mem: 4048 1334 2714 0 56 1109

-/+ buffers/cache: 167 3880

Swap: 2055 0 2055

* Shared 为0,后面会碰到问题。花了2个小时查这个问题。

* swap 为2055,太小,OS检查无法通过,需要增加

Oracle安装过程

1、确认各种软件是否已安装

C/C++ Tool SuSE 默认安装的

gcc

libaio

2、创建DBA和OINSTALL用户组:

groupadd –g 202 dba

groupadd –g 201 oinstall

3.创建oracle用户

useradd -d /home/oracle –g oinstall -G dba -m -p oracle -u 1001 -s /bin/bash oracle

修改oracle 用户的密码

passwd oracle

修改安装软件以及数据库目录权限:

新建/opt/oracle目录

chown –R oracle:dba /opt/oracle

*其中默认NLS_LANG=AMERICAN,如果在中文OS下安装界面会产生乱码。建议在英文环境下安装。如果安装界面是乱码的话,到时可先export LC_CTYPE=en_US.UTF-8,再安装即可。

4、设置oracle环境变量

a、vi .profile最后加入以下

export ORACLE_BASE=/opt/oracle

export ORACLE_HOME=$ORACLE_BASE/products/10.2.0/db_1

export ORACLE_SID=test01

export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib

b、编辑/etc/sysctl.conf文件:(修改核心参数,如果没有这个文件,自己vi一个)oracle@linux:~> more /etc/sysctl.conf

# Disable response to broadcasts.

# You don't want yourself becoming a Smurf amplifier.

net.ipv4.icmp_echo_ignore_broadcasts = 1

# enable route verification on all interfaces

net.ipv4.conf.all.rp_filter = 1

# enable ipV6 forwarding

#net.ipv6.conf.all.forwarding = 1

###############

net.core.rmem_default = 262144

net.core.rmem_max = 262144

net.core.wmem_default = 262144

net.core.wmem_max = 262144

kernel.shmall = 2097152

kernel.shmmax = 2147483648

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

fs.file-max = 65536

net.ipv4.ip_local_port_range = 1024 65000

最大共享内存段尺寸(字节):

shmmax = xxxxx*1024*2(为内存的2倍,切换到字节。要是超过这个值,在运行dbca时会出现Ora

-27123:Unable to attach to shared memeroy segment)

----后来看到网上说官方文档建议是内存的1/2,Shmmni 最小共享内存4096KB.Shmall 所有内存大小,但是我照内存的2倍也能成功安装oracle。

#最小共享内存段尺寸(字节)

Shmmni

4个参数依次为SEMMSL(每个用户拥有信号量最大数);SEMMNS(系统信号量最大数);SEMOPM(每次semopm系统调用操作数);SEMMNI(系统辛苦量集数最大数).

注解:可以用sysctl –p来确认参数文件/etc/sysctl.conf中的内容,使用

#/etc/init.d/boot.sysctl start命令使参数文件中设置的参数生效,在这里要注意的一点是在系统重新启动之后不能自动读取刚才创建的文件。需要调整一下:

#chkconfig boot.sysctl on

c、编辑/etc/security/limits.conf文件, 设置oracle对文件的要求

linux:~ # vi /etc/security/limits.conf

# /etc/security/limits.conf

#Each line describes a limit for a user in the form:

#

#Where:

# can be:

# - an user name

# - a group name, with @group syntax

# - the wildcard *, for default entry

# - the wildcard %, can be also used with %group syntax, # for maxlogin limit

# can have the two values:

# - "soft" for enforcing the soft limits

# - "hard" for enforcing hard limits

# can be one of the following:

# - core - limits the core file size (KB)

# - data - max data size (KB)

# - fsize - maximum filesize (KB)

# - memlock - max locked-in-memory address space (KB) # - nofile - max number of open files

# - rss - max resident set size (KB)

# - stack - max stack size (KB)

# - cpu - max CPU time (MIN)

# - nproc - max number of processes

# - as - address space limit

# - maxlogins - max number of logins for this user

# - priority - the priority to run user process with

# - locks - max number of file locks the user can hold

#

#* soft core 0

#* hard rss 10000

#@student hard nproc 20

#@faculty soft nproc 20

#@faculty hard nproc 50

#ftp hard nproc 0

#@student - maxlogins 4

# End of file

#oracle soft nproc 2047

#oracle hard nproc 16384

#oracle soft nofile 1024

#oracle hard nofile 65536

#oracle hard nofile 65536

#oracle soft nofile 65536

oracle hard nproc 16384

oracle soft nproc 16384

d、修改/etc/profile文件

ulimit –n 102400

5、启动oracle的xwindows,需要将root注销,用oracle 用户登录启动xwindows:startx,不然无法启动oracle的xwindows,会提示说已经有用户启动xwindows。

错误提示如下

Fatal server error Server is already active for display 0 When you get an error like Fatal server error:

Server is already active for display 0

If this server is no longer running, remove /t m p/.X0-lock and start again.

如果你不注销root可以通过尝试方式

This is display number(0, default) and you can't run two display in same system with identical display number. If you wan't to check if any xserver is really running, invoke ps aux | grep `cat /tmp/.X0-lock` and this will yeild an output

164:foo 7977 0.0 0.1 3928 760 pts/1 S+ 23:21 0:00 grep -i --colour -n 14847

foo is user's name, the person running that startx session.

To run your session, you have two option

1) become superuser and kill the the corresponding PID

2) or, in a better way, start a different X-session by invoking a command like

startx -- :1 to start a server with display 1(I will prefer this option).

补充下:我是通过vnc安装的,如果是telnet过去的话,远程装的话,还需要xhost + 本机IP 6、用oracle用户减压软件包

unzip /tmp/oracle/10201_database_linux32.zip

7、运行./runInstaller –ignoresysprereqs开始安装Oracle, –ignoresysprereqs忽略对操作系统的认证,Oracle10g默认不能安装在SUSE Linux10上。当然也可以将安装文件拷贝到硬盘,修改database/install/oraparam.ini文件,将其中添加SuSE-10,这样可以不使用–ignoresysprereqs参数。但是这两种方法都只是在第一次OS认证时通过检测,在第二次时还是无法通过,第二次时需要手动选择这些没有通过的项目,就会变成“自己检测“而继续安装。

8、先选择安装oracle,不建db。

默认,点击“下一步“

如果验证结果有错误,需要修正后再重新验证。待验证通过后再继续。如果有内存太小等警告可以忽略继续。然后点击”下一步”。

这里报警swap 太小,所以按照Swap =2 phisical memory

扩展swap 从扩展到8096M,目前是2055M

dd if=/dev/zero of=/tmp/swap bs=1k count=6041000

mkswap /tmp/swap

swapon /tmp/swap

若要想使开机时自启用,则需修改文件/etc/fstab中的swap行:

/tmp/swap swap swap defaults 0 0

此时关掉安装界面重新开启后会报如下错误Oui-10030,因为我们之前装过一次,已经在

/opt/oracle下面产生文件夹products 和oraInventory。

先删除之前产生的文件夹/opt/oracle/products和/opt/oracle/oraInventory.

cd /opt/oracle/

rm –rf * --此命令要小心下,会删除/opt/oracle/下面所有的文件,如果还有有用的文件时,需要制定文件夹删除,rm –rf products

在安装的最后会要求以root用户执行两个脚本,如下图所示:

打开一个终端用root用户执行如下命令(脚本文件的目录要和图中所示一致):

sh /opt/oracle/oraInventory/orainstRoot.sh

sh /opt/oracle/10.2.0/root.sh

然后点击”确定”结束Oracle software的安装。

Oui-18001 此为oracle 10g 安装程序的bug

创建db过程

1、cd /opt/oracle/10.2.0/bin

2、运行./dbca

等待一会会出现界面,如下

step-1 欢迎界面

点击“下一步”

step-2

选择创建数据库,单击“下一步”

step-3

选择要创建数据库的类型,单击“下一步”,这里选择的是”一般用途”。

step-4

输入创建数据的SID和Global SID( 前面设置的ORACLE_SID环境变量是test01,这里输入test01

step-5

默认,下一步。

step-6

设置帐户密码,单击”下一步”

step-7

根据您的储存情况选择不同的存储机制,单击“下一步”,这里选择”文件系统”,选择不同的机制后面的界面会有所不同。

选择时候要创建“示例方案”,单击”下一步”

step-11

这里可以调整SGA,PGA,字符集等参数的值,默认或设置好后单击“下一步”。

在这里一个比较令人头疼的问题。图形化创建实例总是报告: ORA-27125:unable to create shared memory segment. 检查核心参数,没有发现问题。后来在网上得知是Linux 2.6内核有个特性:Huge TLB支持。该特性默认条件下是激活的。

相关解释:

By default only root has permission to allocate shared memory with this option (SHM_HUGETLB) and Oracle 10g defaults using it, so Oracle fails to allocate the SGA.This capability is supposed to be able to controlled with the setcaps program (CAP_IPC_LOCK), but I couldn't get it to work properly. The solution is either to set DISABLE_HUGETLBFS=1 before you start Oracle or to recompile the kernel without CONFIG_HUGETLB_PAGE and CONFIG_HUGETLBFS configuration parameters.

要解决该问题,在Oracle用户下执行$export DISABLE_HUGETLBFS=1 (初稿这里有误) 注(2004年9月19日):本文最初描述的有问题,一般来说执行如下的操作比较稳妥:linux: # cd $ORACLE_HOME/bin

linux: # mv oracle oracle.bin

cat >oracle <<"EOF"

#!/bin/bash

export DISABLE_HUGETLBFS=1

exec $ORACLE_HOME/bin/oracle.bin $@

EOF

linux: # chmod +x oracle

这是因为类似dbca这样的Java应用不能把DISABLE_HUGETLBFS=1传递给oracle执行程序。

step-12

选择相应的项,可以查看各种文件的信息。单击“完成“,然后会出来如下界面:

等待完成即可完成数据库的创建。

参考

OS使用内存+SGA+并发执行进程数*(sort_area_size+hash_ara_size+2M) < 0.7*总内存网4086*0.7=2860

4086 –200 (OS)=3886M -200

SGA =2048

PGA=394M

最重要的Shared Memory参数为SHMMAX,建议的设定值为(物理内存的一半)。例如我安装用的服务器内存为4GB,则SHMMAX可设为2048MB,换算方式如下:

256 MB = (1MB=1048576 bytes) *256= 268435456 bytes

2048=1048576*2048=2147483648

相关主题