关键字
Solaris、Oracle、Sparc
操作环境
Fujitsu PRIMEPOWER450 2x SPARC64 V
Solaris 10 u3 sparc
Oracle 10g Release 2
综合知识
参考资料
安装帮助:B19306-01.zip内:
B19306_01\install.102\b15690\toc.htm
Sun ISV:http://isv.sun.com.cn/techdocs/0604/Solaris10_oracle.jsp
下载文件(PC机)
doc: http://www.oracle.com/technology/documentation/database10gr2.html
data: http://www.oracle.com/technology/software/products/database/oracle10g/htdocs/10201sol64soft.html
B19306-01.zip
10gr2_db_sol.cpio.gz
准备安装文件
解压:
10gr2_db_sol.cpio.gz
上传到服务器:
10gr2_db_sol.cpio
提取:
? cpio -idmv < 10gr2_db_sol.cpio
检查系统环境
用root登录服务器
查看系统版本(要求5.10 64-bit sparcv9)
? uname -a
SunOS jwcdb 5.10 Generic_118833-33 sun4us sparc FJSV,GPUZC-M
? isainfo -kv
64-bit sparcv9 kernel modules
查看物理内存(要求1024MB以上)
? /usr/sbin/prtconf | grep "Memory size"
Memory size: 4096 Megabytes
查看交换文件(视内存情况)
? /usr/sbin/swap -lh
swapfile dev swaplo blocks free
/dev/dsk/c0t0d0s1 32,129 16 12286064 12286064
临时文件空间(要求400M以上)
? df -h /tmp
Filesystem size used avail capacity Mounted on
swap 7.4G 88K 7.4G 1% /tmp
查看硬盘空间(要求2G以上)
? df -h
Filesystem size used avail capacity Mounted on
/dev/dsk/c0t0d0s0 12G 3.7G 7.7G 33% /
/devices 0K 0K 0K 0% /devices
ctfs 0K 0K 0K 0% /system/contract
proc 0K 0K 0K 0% /proc
mnttab 0K 0K 0K 0% /etc/mnttab
swap 7.4G 1.1M 7.4G 1% /etc/svc/volatile
objfs 0K 0K 0K 0% /system/object
fd 0K 0K 0K 0% /dev/fd
swap 7.4G 88K 7.4G 1% /tmp
swap 7.4G 64K 7.4G 1% /var/run
/dev/dsk/c1t1d0s6 67G 2.9G 64G 5% /data -for oracle data
/dev/dsk/c1t0d0s0 67G 11G 55G 17% /main -for oracle software
/dev/dsk/c0t0d0s7 50G 2.7G 47G 6% /export/home
查看以下软件包是否存在
? pkginfo -i SUNWarc SUNWbtool SUNWhea SUNWlibm SUNWlibms SUNWsprot \
> SUNWsprox SUNWtoo SUNWi1of SUNWi1cs SUNWi15cs SUNWxwfnt
system SUNWarc Lint Libraries (usr)
system SUNWbtool CCS tools bundled with SunOS
system SUNWhea SunOS Header Files
system SUNWi1of ISO-8859-1 (Latin-1) Optional Fonts
system SUNWlibm Math & Microtasking Library Headers & Lint Files (Usr)
system SUNWlibms Math & Microtasking Libraries (Usr)
system SUNWsprot Solaris Bundled tools
system SUNWtoo Programming Tools
system SUNWxwfnt X Window System platform required fonts
ERROR: information for "SUNWi1cs" was not found
ERROR: information for "SUNWi15cs" was not found
ERROR: information for "SUNWsprox" was not found
这里需要安装两个包:SUNWi1cs和SUNWi15cs
加载DVD安装镜像:
? lofiadm -a /main/solaris10u3/sol-10-u3-ga-sparc-dvd.iso
/dev/lofi/1
? mount -F hsfs -o ro /dev/lofi/1 /mnt/iso
安装这两个包
? pkgadd -d /mnt/iso/Solaris_10/Product/ SUNWi1cs
? pkgadd -d /mnt/iso/Solaris_10/Product/ SUNWi15cs
由10版本已将SUNWsprox合并到SUNWsprot,所以不必该程序包了。
卸载加载的文件
? umount /mnt/iso/
? lofiadm -d /dev/lofi/1
由于使用的Solaris 10 u3比较新,就不打补丁了。
检查网络配置
确保files出现在hosts行:
? cat /etc/nsswitch.conf | grep hosts
# DNS for hosts lookups, otherwise it does not use any other naming service.
# "hosts:" and "services:" in this file are used only if the
hosts: files dns
# before searching the hosts databases.
主机名:
? hostname
jwcdb
域名(不应该有任何值):
? domainname
查看是否使用了全限定主机名:
? cat /etc/hosts | grep 'jwcdb'
61.144.43.227 jwcdb jwcdb.pyp.edu.cn loghost
创建用户和组
创建Oracle Inventory组
如果已安装Oracle,可以查看到如下输出:
? more /var/opt/oracle/oraInst.loc
inventory_loc=/main/oracle/oraInventory
inst_group=oinstall
如果需要,创建oinstall组:
? groupadd oinstall
创建OSDBA组
? groupadd dba
如果OSOPER组
? groupadd oper
创建oracle用户:
查看是否存在oracle用户
? id -a oracle
创建
? useradd -g oinstall -G dba,oper -d /export/home/oracle -s /usr/bin/bash -c 'Oracle Software Owner' -m oracle
设置密码
? passwd -r files oracle
保证nobody用户存在:
? id -a nobody
uid=60001(nobody) gid=60001(nobody) groups=60001(nobody)
配置系统参数
? vi /etc/system
set noexec_user_stack=1
查看有没有为oracle创建资源项目:
? vi /etc/project | grep oracle
如果没有,如下创建:
? projadd -U oracle -c "oracle database" user.oracle
? projmod -sK "roject.max-shm-memory=(priv,10G,deny)" user.oracle
切换到Oracle检查一下:
% prctl -n project.max-shm-memory -i project user.oracle
创建所需目录
程序目录
? mkdir -p /main/oracle
? chown -R oracle:oinstall /main/oracle
? chmod -R 775 /main/oracle
数据目录
? mkdir -p /data/oracle
? chown -R oracle:oinstall /data/oracle
? chmod -R 775 /data/oracle
备份目录
? mkdir -p /main/oracle/flash_recovery_area
? chown -R oracle:oinstall /main/oracle/flash_recovery_area
? chmod -R 775 /main/oracle/flash_recovery_area
配置环境参数
用oracle登录
? su - oracle
设置环境参数
? vi .profile
umask 022
ORACLE_BASE=/main/oracle
ORACLE_SID=ORCL
export ORACLE_BASE ORACLE_SID
重新登录查看
% umask
0022
% env | more
-bash-3.00$ env | more
......
ORACLE_SID=ORCL
ORACLE_BASE=/main/oracle
......
重启系统
? reboot
开始安装过程
确保系统可以运行图形界面或可以远程运行图形界面,在此使用的远程桌面是X Manager 2.0
打开XBrowser,输入服务器的IP地址即可连上。
用oracle用户登录
运行database目录下的runInstaller
Select Installation Method
Advanced Installation
Specify Inventory directory and credentials
/opt/oracle/oraInventory
oinstall
Select Installation Type
Enterprise Edition
Sepcify Home Details
Name: OraDb10g_home1
Path: /main/oracle/oracle/product/10.2.0/db_1
Product-Specific Prerequisite Checks
全部通过即可!
Select Configuration Option
Create a database
Select Database Configuration
General Purpose
Specify Database Configuration Options
Global Database Name:cdtdb SID:ORCL
Select Database Character set: Simplified Chinese ZHS16GBK
选中Create database with sample schemas
Select Database Management Option
选中Use Database Control for Database Management
Enable Email Notification
61.144.43.235
sunkist@pyp.edu.cn
Specify Database Storage Option
选中File System
location:/main/oracle/oradata
Specify Backup and Recovery Options
选中Automated backups
location:/main/oracle/flash_recovery_area
Specify Database Schema Passwords
统一使用一个密码:***
Summary
Execute Configuration Scripts
按照提示,用root用户运行脚本
安装完成!
数据库实例安装日志:
/main/oracle/oracle/product/10.2.0/db_1/cfgtoollogs/dbca/ORCL
iSQL*Plus URL:
http://jwcdb:5560/isqlplus
iSQL*Plus DBA URL:
http://jwcdb:5560/isqlplus/dba
Enterprise Manager 10g Database Control URL:
http://jwcdb:1158/em
用sys用户以sysdba身份登录
完成服务配置
用oracle登录
? su - oracle
修改配置文件
% vi .profile
# This is the default standard profile provided to a user.
# They are expected to edit it to meet their own needs.
MAIL=/usr/mail/${LOGNAME:?}
PS1='% '
umask 022
ORACLE_BASE=/main/oracle
export ORACLE_BASE
ORACLE_SID=ORCL
export ORACLE_SID
ORACLE_HOME=$ORACLE_BASE/oracle/product/10.2.0/db_1
export ORACLE_HOME
NLS_LANG="simplified chinese"_china.zhs16gbk --如果想使用英文,注释掉此行
export NLS_LANG
PATH=/usr/bin:/usr/sbin:$ORACLE_HOME/bin:/usr/sadm/bin:/usr/sfw/bin:/usr/ucb:/etc:.
export PATH
执行脚本:
% sqlplus "/ AS SYSDBA"
SQL> @?/rdbms/admin/utlrp.sql
开机自动运行
正确配置数据库实例入口
% vi /var/opt/oracle/oratab
ORCL:/main/oracle/oracle/product/10.2.0/db_1:Y
修正dbstart脚本:
% vi /main/oracle/oracle/product/10.2.0/db_1/bin/dbstart
将 ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle
改为 ORACLE_HOME_LISTNER=$ORACLE_HOME
将 ORATAB=/etc/oratab
改为 ORATAB=/var/opt/oracle/oratab
创建自动运行脚本
% vi /etc/init.d/oracle
"/etc/init.d/oracle" 24 lines, 911 characters
#!/bin/sh
ORA_HOME=/main/oracle/oracle/product/10.2.0/db_1
ORA_OWNER=oracle
if [ ! -f $ORA_HOME/bin/dbstart ]
then
echo "Oracle startup: cannot start"
exit
fi
case "$1" in
'start') # Start the Oracle databases and listeners
echo "Start Oracle Database 10g Release 2"
su - $ORA_OWNER -c "$ORA_HOME/bin/dbstart"
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"
su - $ORA_OWNER -c "$ORA_HOME/bin/emctl start dbconsole"
su - $ORA_OWNER -c "$ORA_HOME/bin/isqlplusctl start"
;;
'stop') # Stop the Oracle databases and listeners
echo "Stop Oracle Database 10g Release 2"
su - $ORA_OWNER -c "$ORA_HOME/bin/isqlplusctl stop"
su - $ORA_OWNER -c "$ORA_HOME/bin/emctl stop dbconsole"
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop"
su - $ORA_OWNER -c "$ORA_HOME/bin/dbshut"
;;
esac
建立符号连接
? ln -s /etc/init.d/oracle /etc/rc2.d/S99oracle
? ln -s /etc/init.d/oracle /etc/rc0.d/K10oracle
Showing posts with label Oracle. Show all posts
Showing posts with label Oracle. Show all posts
Friday, May 01, 2009
Install Oracle 10g Release 2 on Solaris 10 x86 u1
关键字
Solaris、Oracle
操作环境
Dell 2850
Solaris 10 u1 x86
Oracle 10g Release 2
Bash shell
综合知识
Solaris 10 x86 u1会在Dell 2850下以64位模式运行。
Oracle 10g Release 2就是64位架构
参考资料
安装文件10201_database_solx86_64.zip内的帮助文档
http://www.dbspecialists.com/presentations/oracle10gsolaris.html
http://download-west.oracle.com/docs/html/B13972_01/toc.htm
下载文件
http://www.oracle.com/technology/software/products/database/oracle10g/index.html
注册后点击
Oracle Database 10g Release 2 (10.2.0.1.0) for Solaris Operating System (x86-64)
下载
10201_database_solx86_64.zip
检查系统环境
确保系统可以运行图形界面或可以远程运行图形界面,在此使用的远程桌面是X Manager 2.0
打开XBrowser,输入服务器的IP地址即可连上。
查看系统版本(要求5.10 64-bit)
? uname -a
SunOS javasvr 5.10 Generic_118844-26 i86pc i386 i86pc
? isainfo -kv
64-bit amd64 kernel modules
查看物理内存(要求512MB以上,按具体情况)
? /usr/sbin/prtconf | grep "Memory size"
Memory size: 2048 Megabytes
查看交换文件(要求1G以上)
? /usr/sbin/swap -l
swapfile dev swaplo blocks free
/dev/dsk/c0t0d0s1 55,65 8 4192952 4192952
临时文件空间(要求400M以上)
? df -h /tmp
Filesystem size used avail capacity Mounted on
swap 3.1G 8K 3.1G 1% /tmp
这里的物理内存为2G,理论上为2G*1.5=3G合适,这里再添加512MB
创建一个512MB的交换文件:
# mkfile 512M /export/home/swapone
添加刚创建的交换文件:
# swap -a /export/home/swapone
检查一下:
# swap -l
swapfile dev swaplo blocks free
/dev/dsk/c0d0s1 102,1 8 1056376 1056376
/export/home/swapone - 8 1048568 1048568
下面设置交换文件在重启后自动加载使用:
# vi /etc/vfstab
/export/home/swapone - - swap - no -
查看硬盘空间(要求3.7G以上)
df -h
Filesystem size used avail capacity Mounted on
/dev/dsk/c0t0d0s0 29G 3.1G 25G 12% /
......
swap 3.1G 636K 3.1G 1% /etc/svc/volatile
......
/dev/dsk/c0t0d0s7 27G 6.3G 20G 24% /export/home
查看以下软件包是否存在
? pkginfo -i SUNWarc SUNWbtool SUNWhea SUNWlibm SUNWlibms SUNWsprot SUNWtoo SUNWi1of SUNWi1cs SUNWi15cs SUNWxwfnt
system SUNWarc Lint Libraries (usr)
system SUNWbtool CCS tools bundled with SunOS
system SUNWhea SunOS Header Files
system SUNWi1of ISO-8859-1 (Latin-1) Optional Fonts
system SUNWlibm Math & Microtasking Library Headers & Lint Files (Usr)
system SUNWlibms Math & Microtasking Libraries (Usr)
system SUNWsprot Solaris Bundled tools
system SUNWtoo Programming Tools
system SUNWxwfnt X Window System platform required fonts
ERROR: information for "SUNWi1cs" was not found
ERROR: information for "SUNWi15cs" was not found
这里需要安装两个包:SUNWi1cs和SUNWi15cs
这里从下载的安装镜像文件安装
加载存放镜像文件分区
? mkdir /mnt/storage
? mount -F pcfs /dev/dsk/c0t0d0p4:1 /mnt/storage
以块设备加载镜像文件
? lofiadm -a /mnt/storage/solaris10/sol-10-u1-ga-x86-dvd.iso
/dev/lofi/1
? mount -F hsfs -o ro /dev/lofi/1 /mnt/isoimg
安装这两个包
? pkgadd -d /mnt/isoimg/Solaris_10/Product SUNWi1cs
? pkgadd -d /mnt/isoimg/Solaris_10/Product SUNWi15cs
卸载加载的文件
? umount /mnt/isoimg/
? lofiadm -d /dev/lofi/1
? umount /mnt/storage/
由于使用的Solaris 10 u1比较新,就不打补丁了。
创建用户和组
需要创建两个组oinstall和dba,两个用户oracle和nobody
先查看是否已存在
? grep oinstall /etc/group
? grep dba /etc/group
? id -a oracle
? id -a nobody
uid=60001(nobody) gid=60001(nobody) groups=60001(nobody)
创建组
? groupadd oinstall
? groupadd dba
创建用户
? useradd -g oinstall -G dba -d /export/home/oracle -s /usr/bin/bash -c 'Oracle software owner' -m oracle
? id -a oracle
uid=107(oracle) gid=104(oinstall) groups=105(dba)
设置密码
? passwd oracle
***
创建所需目录
需要创建两个目录oracle和oradata,一个用来存储程序文件,一个用来存储数据文件
查看磁盘空间
? df -kh
创建目录oracle(需要3G以上)
? mkdir -p /opt/oracle
? chown -R oracle:oinstall /opt/oracle
? chmod -R 775 /opt/oracle
创建目录oradata(需要1.2G以上)
? mkdir -p /export/home/oradata
? chown -R oracle:oinstall /export/home/oradata
? chmod -R 775 /export/home/oradata
调整内核参数
备份配置文件
? cp /etc/system /etc/system.orig
修改配置文件,添加如下几行
? vi /etc/system
* for install oracle 10g
set noexec_user_stack=1
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_shmmin=1
set shmsys:shminfo_shmmni=100
set shmsys:shminfo_shmseg=10
重启系统
? reboot
准备安装文件
解压安装文件:
? unzip 10201_database_solx86_64.zip
得到文件夹database
配置环境参数
用oracle登录
? su - oracle
设置环境参数
? vi .profile
umask 022
ORACLE_BASE=/opt/oracle
ORACLE_SID=cdtdb
export ORACLE_BASE ORACLE_SID
重新登录查看
-bash-3.00$ umask
0022
? env | more
-bash-3.00$ env | more
......
ORACLE_SID=cdtdb
ORACLE_BASE=/opt/oracle
......
开始安装过程
用Xmanager登录到服务器
用oracle用户
运行database目录下的runInstaller
Select Installation Method
Advanced Installation
Specify Inventory directory and credentials
/opt/oracle/oraInventory
oinstall
Select Installation Type
Enterprise Edition
Sepcify Home Details
Name: OraDb10g_home1
Path: /opt/oracle/oracle/product/10.2.0/db_1
Product-Specific Prerequisite Checks
全部通过即可!
Select Configuration Option
Create a database
Select Database Configuration
General Purpose
Specify Database Configuration Options
Global Database Name:cdtdb SID:cdtdb
Select Database Character set: Simplified Chinese ZHS16GBK
选中Create database with sample schemas
Select Database Management Option
选中Use Database Control for Database Management
Enable Email Notification
61.144.43.235
chenliqun@pyp.edu.cn
Specify Database Storage Option
选中File System
location:/export/home/oradata
Specify Backup and Recovery Options
选中Do not enable Automated backups
Specify Database Schema Passwords
统一使用一个密码:***
Summary
Execute Configuration Scripts
按照提示,用root用户运行脚本
安装完成!
安装日志:
/opt/oracle/oracle/product/10.2.0/db_1/cfgtoollogs/dbca/cdtdb
iSQL*Plus URL:
http://192.168.200.11:5560/isqlplus
iSQL*Plus DBA URL:
http://192.168.200.11:5560/isqlplus/dba
Enterprise Manager 10g Database Control URL:
http://192.168.200.11:1158/em
用sys用户以sysdba身份登录
完成服务配置
用oracle登录
? su - oracle
修改配置文件
? vi .profile
stty istrip
PS1='# '
umask 022
MAIL=/usr/mail/${LOGNAME:?}
PATH=/usr/bin:/usr/sbin:/usr/sadm/bin:/usr/sfw/bin:/usr/local/bin:/usr/ucb:/etc:.
ORACLE_SID=cdtdb
ORAENV_ASK=NO
ORACLE_BASE=/opt/oracle
export PS1 PATH ORACLE_BASE ORACLE_SID ORAENV_ASK
. oraenv
正确配置数据库实例入口
? vi /var/opt/oracle/oratab
cdtdb:/opt/oracle/oracle/product/10.2.0/db_1:Y
创建自动运行脚本
? vi /etc/init.d/oracle
#!/bin/sh
ORA_HOME=/opt/oracle/oracle/product/10.2.0/db_1
ORA_OWNER=oracle
if [ ! -f $ORA_HOME/bin/dbstart ]
then
echo "Oracle startup: cannot start"
exit
fi
case "$1" in
'start') # Start the Oracle databases and listeners
su - $ORA_OWNER -c "$ORA_HOME/bin/dbstart"
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"
su - $ORA_OWNER -c "$ORA_HOME/bin/emctl start dbconsole"
su - $ORA_OWNER -c "$ORA_HOME/bin/isqlplusctl start"
;;
'stop') # Stop the Oracle databases and listeners
su - $ORA_OWNER -c "$ORA_HOME/bin/isqlplusctl stop"
su - $ORA_OWNER -c "$ORA_HOME/bin/emctl stop dbconsole"
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop"
su - $ORA_OWNER -c "$ORA_HOME/bin/dbshut"
;;
esac
建立符号连接
? ln -s /etc/init.d/oracle /etc/rc2.d/S99oracle
? ln -s /etc/init.d/oracle /etc/rc0.d/K10oracle
其它配置和错误排除
解决em和isqlplus中文按钮乱码问题
# cd $ORACLE_HOME/jre/1.4.2/lib
# cp font.properties font.properties.orig
# cp font.properties.zh_CN_UTF8 font.properties
# cd $ORACLE_HOME/jdk/jre/lib/
# cp font.properties font.properties.orig
# cp font.properties.zh_CN_UTF8 font.properties
清除缓存的文件
# cd $ORACLE_HOME/oc4j/j2ee/oc4j_applications/applications/em/em/cabo/images/cache/zhs
# rm *.*
# cd $ORACLE_HOME/oc4j/j2ee/oc4j_applications/applications/isqlplus/isqlplus/cabo/images/cache/zhs
# rm *.*
排除tnslsnr启动错误:
错误信息:Failed to auto-start Oracle Net Listene using /ade/vikrkuma_new/oracle/bin/tnslsnr
这里的Listene应该是Listener吧!
# vi $ORACLE_HOME/bin/dbstart
将 ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle
改为 ORACLE_HOME_LISTNER=$ORACLE_HOME
可见,这是由于Oracel工程师手误引起!非常不应该!
启动Oracle时启动Apache出错
查看错误提示
# vi /var/adm/messages
Mar 30 08:31:50 javasvr svc.startd[7]: [ID 652011 daemon.warning] svc:/network/http:apache2: Method "/
lib/svc/method/http-apache2 start" failed with exit status 1.
? svcs -a | grep apache2
maintenance Mar_31 svc:/network/http:apache2
上面说明apache2没有正常运行
应该是Oracle安装时,想启动Apache2,但Apache2作为SMF服务,不允许外部程序单独启用。
如果不需要Apache2服务,关闭它
? svcadm disable http:apache2
如果需要,就启用它
? svcadm disable http:apache2
? svcadm enable http:apache2
注意,em和isqlplus使用的是oc4j服务器。
Solaris、Oracle
操作环境
Dell 2850
Solaris 10 u1 x86
Oracle 10g Release 2
Bash shell
综合知识
Solaris 10 x86 u1会在Dell 2850下以64位模式运行。
Oracle 10g Release 2就是64位架构
参考资料
安装文件10201_database_solx86_64.zip内的帮助文档
http://www.dbspecialists.com/presentations/oracle10gsolaris.html
http://download-west.oracle.com/docs/html/B13972_01/toc.htm
下载文件
http://www.oracle.com/technology/software/products/database/oracle10g/index.html
注册后点击
Oracle Database 10g Release 2 (10.2.0.1.0) for Solaris Operating System (x86-64)
下载
10201_database_solx86_64.zip
检查系统环境
确保系统可以运行图形界面或可以远程运行图形界面,在此使用的远程桌面是X Manager 2.0
打开XBrowser,输入服务器的IP地址即可连上。
查看系统版本(要求5.10 64-bit)
? uname -a
SunOS javasvr 5.10 Generic_118844-26 i86pc i386 i86pc
? isainfo -kv
64-bit amd64 kernel modules
查看物理内存(要求512MB以上,按具体情况)
? /usr/sbin/prtconf | grep "Memory size"
Memory size: 2048 Megabytes
查看交换文件(要求1G以上)
? /usr/sbin/swap -l
swapfile dev swaplo blocks free
/dev/dsk/c0t0d0s1 55,65 8 4192952 4192952
临时文件空间(要求400M以上)
? df -h /tmp
Filesystem size used avail capacity Mounted on
swap 3.1G 8K 3.1G 1% /tmp
这里的物理内存为2G,理论上为2G*1.5=3G合适,这里再添加512MB
创建一个512MB的交换文件:
# mkfile 512M /export/home/swapone
添加刚创建的交换文件:
# swap -a /export/home/swapone
检查一下:
# swap -l
swapfile dev swaplo blocks free
/dev/dsk/c0d0s1 102,1 8 1056376 1056376
/export/home/swapone - 8 1048568 1048568
下面设置交换文件在重启后自动加载使用:
# vi /etc/vfstab
/export/home/swapone - - swap - no -
查看硬盘空间(要求3.7G以上)
df -h
Filesystem size used avail capacity Mounted on
/dev/dsk/c0t0d0s0 29G 3.1G 25G 12% /
......
swap 3.1G 636K 3.1G 1% /etc/svc/volatile
......
/dev/dsk/c0t0d0s7 27G 6.3G 20G 24% /export/home
查看以下软件包是否存在
? pkginfo -i SUNWarc SUNWbtool SUNWhea SUNWlibm SUNWlibms SUNWsprot SUNWtoo SUNWi1of SUNWi1cs SUNWi15cs SUNWxwfnt
system SUNWarc Lint Libraries (usr)
system SUNWbtool CCS tools bundled with SunOS
system SUNWhea SunOS Header Files
system SUNWi1of ISO-8859-1 (Latin-1) Optional Fonts
system SUNWlibm Math & Microtasking Library Headers & Lint Files (Usr)
system SUNWlibms Math & Microtasking Libraries (Usr)
system SUNWsprot Solaris Bundled tools
system SUNWtoo Programming Tools
system SUNWxwfnt X Window System platform required fonts
ERROR: information for "SUNWi1cs" was not found
ERROR: information for "SUNWi15cs" was not found
这里需要安装两个包:SUNWi1cs和SUNWi15cs
这里从下载的安装镜像文件安装
加载存放镜像文件分区
? mkdir /mnt/storage
? mount -F pcfs /dev/dsk/c0t0d0p4:1 /mnt/storage
以块设备加载镜像文件
? lofiadm -a /mnt/storage/solaris10/sol-10-u1-ga-x86-dvd.iso
/dev/lofi/1
? mount -F hsfs -o ro /dev/lofi/1 /mnt/isoimg
安装这两个包
? pkgadd -d /mnt/isoimg/Solaris_10/Product SUNWi1cs
? pkgadd -d /mnt/isoimg/Solaris_10/Product SUNWi15cs
卸载加载的文件
? umount /mnt/isoimg/
? lofiadm -d /dev/lofi/1
? umount /mnt/storage/
由于使用的Solaris 10 u1比较新,就不打补丁了。
创建用户和组
需要创建两个组oinstall和dba,两个用户oracle和nobody
先查看是否已存在
? grep oinstall /etc/group
? grep dba /etc/group
? id -a oracle
? id -a nobody
uid=60001(nobody) gid=60001(nobody) groups=60001(nobody)
创建组
? groupadd oinstall
? groupadd dba
创建用户
? useradd -g oinstall -G dba -d /export/home/oracle -s /usr/bin/bash -c 'Oracle software owner' -m oracle
? id -a oracle
uid=107(oracle) gid=104(oinstall) groups=105(dba)
设置密码
? passwd oracle
***
创建所需目录
需要创建两个目录oracle和oradata,一个用来存储程序文件,一个用来存储数据文件
查看磁盘空间
? df -kh
创建目录oracle(需要3G以上)
? mkdir -p /opt/oracle
? chown -R oracle:oinstall /opt/oracle
? chmod -R 775 /opt/oracle
创建目录oradata(需要1.2G以上)
? mkdir -p /export/home/oradata
? chown -R oracle:oinstall /export/home/oradata
? chmod -R 775 /export/home/oradata
调整内核参数
备份配置文件
? cp /etc/system /etc/system.orig
修改配置文件,添加如下几行
? vi /etc/system
* for install oracle 10g
set noexec_user_stack=1
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_shmmin=1
set shmsys:shminfo_shmmni=100
set shmsys:shminfo_shmseg=10
重启系统
? reboot
准备安装文件
解压安装文件:
? unzip 10201_database_solx86_64.zip
得到文件夹database
配置环境参数
用oracle登录
? su - oracle
设置环境参数
? vi .profile
umask 022
ORACLE_BASE=/opt/oracle
ORACLE_SID=cdtdb
export ORACLE_BASE ORACLE_SID
重新登录查看
-bash-3.00$ umask
0022
? env | more
-bash-3.00$ env | more
......
ORACLE_SID=cdtdb
ORACLE_BASE=/opt/oracle
......
开始安装过程
用Xmanager登录到服务器
用oracle用户
运行database目录下的runInstaller
Select Installation Method
Advanced Installation
Specify Inventory directory and credentials
/opt/oracle/oraInventory
oinstall
Select Installation Type
Enterprise Edition
Sepcify Home Details
Name: OraDb10g_home1
Path: /opt/oracle/oracle/product/10.2.0/db_1
Product-Specific Prerequisite Checks
全部通过即可!
Select Configuration Option
Create a database
Select Database Configuration
General Purpose
Specify Database Configuration Options
Global Database Name:cdtdb SID:cdtdb
Select Database Character set: Simplified Chinese ZHS16GBK
选中Create database with sample schemas
Select Database Management Option
选中Use Database Control for Database Management
Enable Email Notification
61.144.43.235
chenliqun@pyp.edu.cn
Specify Database Storage Option
选中File System
location:/export/home/oradata
Specify Backup and Recovery Options
选中Do not enable Automated backups
Specify Database Schema Passwords
统一使用一个密码:***
Summary
Execute Configuration Scripts
按照提示,用root用户运行脚本
安装完成!
安装日志:
/opt/oracle/oracle/product/10.2.0/db_1/cfgtoollogs/dbca/cdtdb
iSQL*Plus URL:
http://192.168.200.11:5560/isqlplus
iSQL*Plus DBA URL:
http://192.168.200.11:5560/isqlplus/dba
Enterprise Manager 10g Database Control URL:
http://192.168.200.11:1158/em
用sys用户以sysdba身份登录
完成服务配置
用oracle登录
? su - oracle
修改配置文件
? vi .profile
stty istrip
PS1='# '
umask 022
MAIL=/usr/mail/${LOGNAME:?}
PATH=/usr/bin:/usr/sbin:/usr/sadm/bin:/usr/sfw/bin:/usr/local/bin:/usr/ucb:/etc:.
ORACLE_SID=cdtdb
ORAENV_ASK=NO
ORACLE_BASE=/opt/oracle
export PS1 PATH ORACLE_BASE ORACLE_SID ORAENV_ASK
. oraenv
正确配置数据库实例入口
? vi /var/opt/oracle/oratab
cdtdb:/opt/oracle/oracle/product/10.2.0/db_1:Y
创建自动运行脚本
? vi /etc/init.d/oracle
#!/bin/sh
ORA_HOME=/opt/oracle/oracle/product/10.2.0/db_1
ORA_OWNER=oracle
if [ ! -f $ORA_HOME/bin/dbstart ]
then
echo "Oracle startup: cannot start"
exit
fi
case "$1" in
'start') # Start the Oracle databases and listeners
su - $ORA_OWNER -c "$ORA_HOME/bin/dbstart"
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"
su - $ORA_OWNER -c "$ORA_HOME/bin/emctl start dbconsole"
su - $ORA_OWNER -c "$ORA_HOME/bin/isqlplusctl start"
;;
'stop') # Stop the Oracle databases and listeners
su - $ORA_OWNER -c "$ORA_HOME/bin/isqlplusctl stop"
su - $ORA_OWNER -c "$ORA_HOME/bin/emctl stop dbconsole"
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop"
su - $ORA_OWNER -c "$ORA_HOME/bin/dbshut"
;;
esac
建立符号连接
? ln -s /etc/init.d/oracle /etc/rc2.d/S99oracle
? ln -s /etc/init.d/oracle /etc/rc0.d/K10oracle
其它配置和错误排除
解决em和isqlplus中文按钮乱码问题
# cd $ORACLE_HOME/jre/1.4.2/lib
# cp font.properties font.properties.orig
# cp font.properties.zh_CN_UTF8 font.properties
# cd $ORACLE_HOME/jdk/jre/lib/
# cp font.properties font.properties.orig
# cp font.properties.zh_CN_UTF8 font.properties
清除缓存的文件
# cd $ORACLE_HOME/oc4j/j2ee/oc4j_applications/applications/em/em/cabo/images/cache/zhs
# rm *.*
# cd $ORACLE_HOME/oc4j/j2ee/oc4j_applications/applications/isqlplus/isqlplus/cabo/images/cache/zhs
# rm *.*
排除tnslsnr启动错误:
错误信息:Failed to auto-start Oracle Net Listene using /ade/vikrkuma_new/oracle/bin/tnslsnr
这里的Listene应该是Listener吧!
# vi $ORACLE_HOME/bin/dbstart
将 ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle
改为 ORACLE_HOME_LISTNER=$ORACLE_HOME
可见,这是由于Oracel工程师手误引起!非常不应该!
启动Oracle时启动Apache出错
查看错误提示
# vi /var/adm/messages
Mar 30 08:31:50 javasvr svc.startd[7]: [ID 652011 daemon.warning] svc:/network/http:apache2: Method "/
lib/svc/method/http-apache2 start" failed with exit status 1.
? svcs -a | grep apache2
maintenance Mar_31 svc:/network/http:apache2
上面说明apache2没有正常运行
应该是Oracle安装时,想启动Apache2,但Apache2作为SMF服务,不允许外部程序单独启用。
如果不需要Apache2服务,关闭它
? svcadm disable http:apache2
如果需要,就启用它
? svcadm disable http:apache2
? svcadm enable http:apache2
注意,em和isqlplus使用的是oc4j服务器。
Subscribe to:
Posts (Atom)
