Chinaunix首页 | 论坛 | 博客
  • 博客访问: 670419
  • 博文数量: 168
  • 博客积分: 2928
  • 博客等级: 中校
  • 技术积分: 1904
  • 用 户 组: 普通用户
  • 注册时间: 2010-01-04 09:56
文章分类

全部博文(168)

文章存档

2010年(168)

我的朋友

分类: Oracle

2010-04-27 17:04:45

1. 安装Solaris10

我的硬件选择的是30G空间,1G内存,2核(台式机是4核,闲着那么多核也没啥用)

这个步骤最简单,从SUN网站上下载后直接在VM里面设置为ISO启动就行了,其他的基本一路NEXT而已。(注意下硬盘分区,我删除了默认的/export/home,把20多G分给了根目录/,swap给了2048M)

下载地址(可能需要注册个ID):

选择IP地址配置的时候如下配置:

Networked: Yes
Use DHCP: No
IP Address: 192.168.10.120
Netmask: 255.255.255.0
Use IPV6: No

如果要设置上网的话,编辑如下两个文件,没有的话新建一个

bash-3.00# cat /etc/resolv.conf
nameserver 192.168.10.1 #这里设置的是我的路由器的地址
bash-3.00# cat /etc/nsswitch.conf |grep dns
hosts: files dns #就是在本来只有files后面加上个dns,然后reboot

2. 配置默认TEXT模式启动,SSH和VNCVIEWER

2.1 配置SSH:安装完毕后SSH服务就是默认启用的

bash-3.00# svcs -a|grep ssh
online 18:53:08 svc:/network/ssh:default

编辑SSH配置文件,然后重启SSH服务

bash-3.00# vi /etc/ssh/sshd_config
找到
PermitRootLogin no
改为
PermitRootLogin yes
然后
bash-3.00# svcadm restart ssh

2.2 设置默认文本模式启动(即禁用图形界面自动启动)
/usr/dt/bin/dtconfig -d

如果要Enable图形界面自动启动就用/usr/dt/bin/dtconfig -e
2.3 设置VNCserver
有可能默认安装的时候就安装完毕了,可以用pkginfo |grep vnc来验证下,有的话安装步骤就可以省了

从companion CD中找到SFWvnc文件夹(或者上SUN网站下载,注意要X86版本),拷贝到任意一个文件夹下,然后

bash-3.00# pkgadd -d . SFWvnc
设置环境变量,为避免下次登录再次输入同样内容,可以加到.profile文件中去
PATH=$PATH:/usr/local/bin:/usr/X11/bin:/usr/openwin/bin:/usr/openwin/lib:\
/usr/ccs/bin:/usr/ucb:/usr/dt/bin
export $PATH
bash-3.00# vncserver

设置一个登录密码,这样VNCViewer就可以从192.168.10.120:1使用图形界面了。

vnc默认是用twm,当然要改了(如果到服务器的网速很慢那就用twm)

改一下$HOME/.vnc/xstartup
vi $HOME/.vnc/xstartup
用CDE:
注释掉twm &,添加/usr/dt/bin/dtsession &

用JDS:
注释掉twm &,添加/usr/bin/gnome-session &

重启vncserver(命令是vncserver -kill :1)就能看到想用的X界面了。

3. 配置OS参数

3.1 RAM>512 MB,这里是1024MB

/usr/sbin/prtconf | grep “Memory size”

3.2 swap size 内存1.5G以下的时候设为2倍内存容量

/usr/sbin/swap -s

3.3 /tmp directory>400MB

df -k /tmp

3.4 空闲磁盘空间(只是Oracle安装文件,不包含数据文件)

Enterprise Edition >2.0 GB

3.5 /bin/isainfo -kv

输出应包含:

32-bit i386 kernel modules

这里有一点要注意,由于Solaris 10 客户机检测到主机的cpu支持64位时,将试图进入长模式(longmode),这样的话输出就变成

64-bit amd64 kernel modules

解决方法是在虚拟机的vmx文件中添加如下行:

monitor_control.disable_longmode = 1

重启虚拟机,问题解决

3.6 检查软件包和Patch的安装情况

pkginfo -i SUNWarc SUNWbtool SUNWhea SUNWlibm SUNWlibms SUNWsprot \

SUNWsprox SUNWtoo SUNWi1of SUNWi1cs SUNWi15cs SUNWxwfnt SUNWgcc

注意:SUNWsprox已经重命名为SUNWsprot,经常会报这个错然后在安装盘里又找不着,很让人晕

bash-3.00# pkgadd -d /cdrom/sol_10_509_x86/Solaris_10/Product SUNWsprot

3.7 创建OS user

mkdir /oracle
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba -s /usr/bin/bash -d /oracle oracle
passwd oracle
chown oracle:oinstall /oracle

3.8 内核参数设定

Install Guide上写的Solaris 10不用更改内核参数,Solaris会自己管理。不过不修改的话后面安装过程会报错,但是好像报了错也没啥影响。总而言之减少麻烦还是改了吧。

bash-3.00# vi /etc/system
set semsys:seminfo_semmni=100
set semsys:seminfo_semmns=1024
set semsys:seminfo_semmsl=256
set semsys:seminfo_semvmx=32767
set shmsys:shminfo_shmmax=4294967295
set shmsys:shminfo_shmmni=100

完了重启使参数生效

上述红色部分是不正确的,从solaris 10开始不再使用system参数文件来控制这些参数值,而是使用了resource control来管理一些资源。所以上述命令应该改成:

# prctl -n project.max-shm-memory -v 4096mb -r -i project user.root
# prctl -n project.max-sem-ids -v 100 -r -i project user.root
# prctl -n project.max-shm-ids -v 100 -r -i project user.root
# projadd -U oracle -G dba -c ‘Ora DB’ -p 100 user.oracle
# projmod -sK ‘project.max-shm-memory=(priv,4096mb,deny)’ user.oracle

也可以参考metalink Doc ID:429191.1

SUN Sparc Solaris version 10
——————————-
Generally speaking, information on setting kernel parameters in Solaris 10 is limited. There is a new project file that is used to set kernel parameters (or more generally – any resource control) for the Solaris 10 Operating System. The remainder of this white paper will be divided into 3 sections to aid in understanding the configuration of kernel parameters in Solaris 10.

Basics
Questions and Answers
Examples
Permanently Setting Kernel Parameters
Temporarily Setting Kernel Parameters

Basics on /etc/projects
===================
1. Specifying a limit in the /etc/project file extends that limit to all processes belonging to the project.

2. Now, before I show you an example of an /etc/project file containing IPC settings for both the oracle_oltp and oracle_dss projects, please allow me to emphasize that the “oracle_oltp:100:Oracle OLTP……..” line below is just one (1) single line with no linebreak. Likewise, the “oracle_dss:101:Oracle DSS…….” line below is just one (1) single line with no linebreak. It is only for readability in this whitepaper document that I break these lines up:

oracle_oltp:100:Oracle OLTP:oracle:: \
project.max-shm-memory=(privileged,51539607552,deny);\
process.max-sem-nsems=(privileged,300,deny)
oracle_dss:101:Oracle DSS:oracle:: \
project.max-shm-memory=(privileged,17179869184,deny)

This sets a limit of 48GB per shared memory segment and 300 semaphores for all processes in the
oracle_oltp project, and a 16GB shared memory segment limit for all processes in the oracle_dss project.

However, according to the solaris manual the process.max-sem-nsems
gives the maximum number of semaphores per semaphore set, not for the
entire project.

The issue is that project.max-shm-memory is not an exact equivalent of shmmax.
shmmax is the max size of an _individual_ segment.

project.max-shm-memory is the __total__ shared memory size for your project

– ie maximum total of all your segments.
()

The seminfo_semmns parameter which used to control the maximum number
of semaphores systemwide is obsolete and has been removed as a tunable
parameter.

So you may want to decrease this number. If you find you run out of these you can increase later.

3. The recommended method for modifying the /etc/project file is to use the “proj*” commands,
such as projadd(1) for creating a project and projmod(1) for modifying a project.
Examples of projadd and projmod
a.) # projadd -c “Oracle” ‘user.oracle’
b.) # projmod -s -K “project.max-shm-memory=(privileged,6GB,deny)” ‘user.oracle’

4. Resource Control assignments made in this way (in the /etc/project file) are permanent, and will survive a system re-boot. This is covered in much more detail in the example section below.

5. There is also an “on-the-fly” way to temporarily set Resource Control assignments using the prctl(1) command. However, unlike the /etc/project file, resource assignments made in this way will NOT survive a system re-boot. Again, this is covered in much more detail in the example section below.

6. Oracle support encourages the use of the “id -p” command. It shows the active and available projects for a user. If the limits (such as kernel parameters) that you establish within a project are not being activated for a particular user, the “id -p” will help you to see that the user is not using that project.

3.9 设置环境变量

su oracle

vi /home/oracle/.bash_profile

添加下面内容:

ORACLE_BASE=/oracle
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
ORACLE_SID=orcl
PATH=$ORACLE_HOME/bin:/bin:/sbin:/usr/ccs/bin:/usr/local/bin
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/network/lib:/usr/local/lib:/usr/lib
TMPDIR=/var/tmp
export ORALCE_BASE ORACLE_HOME ORACLE_SID PATH LD_LIBRARY_PATH TMPDIR
umask 022

export PS1=”[\u@\h \W]$ ”
export DISPLAY=192.168.10.2:0.0 #Windows IP address

4. 安装Oracle 10gR2

10.2.0.2的下载地址是(可能需要注册个ID):

10.2.0.4的PatchSet下载地址(需要MetalinkID):

4.1 上传这两个zip文件并解压缩,注意使用oracle用户操作

oracle@sola10[~]$ unzip 10202_database_solx86.zip
oracle@sola10[~]$ unzip p6810189_10204_Solarisx86.zip

4.2 打开vncviewer,图形界面安装Oracle数据库软件

root@sola10[/]$ xhost 192.168.10.2
root@sola10[/]$ su – oracle
oracle@sola10[~]$ cd /oracle/database
oracle@sola10[~/database]$ ./runInstaller

4.3 安装Oracle数据库软件并升级到10.2.0.4,和创建数据库,这个跟别的平台一样,就不写了

阅读(779) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~