1.安装前装备
1.1 硬件要求
要求 | 查看方式 | |
内存 | 至少1G内存 | grep MemTotal /proc/meminfo |
SWAP |
如果内存为大于512M则swap大小为内存2倍
如果内存在1到2G之间则swap大小为内存1.5倍
如果内存在2到8G之间则swap大小为内存1倍
如果内存大于8G则swap大小为内存0.75倍
| grep SwapTotal /proc/meminfo |
磁盘 |
/tmp目录至少400MB
oracle安装目录大约在1.5到3.5G之间
数据文件至少1.2G
| df -h |
1.2软件要求
CentOS5.6标准安装,使用YUM安装以下所需软件
CentOS5.6标准安装,使用YUM安装以下所需软件
yum install -y compat-db pdksh sysstat screen libXp compat-libstdc++*
Red Hat Enterprise Linux 4.0需安装以下所需软件包
binutils-2.15.92.0.2-10.EL4
compat-db-4.1.25-9
control-center-2.8.0-12
gcc-3.4.3-9.EL4
gcc-c++-3.4.3-9.EL4
glibc-2.3.4-2
glibc-common-2.3.4-2
gnome-libs-1.4.1.2.90-44.1
libstdc++-3.4.3-9.EL4
libstdc++-devel-3.4.3-9.EL4
make-3.80-5
pdksh-5.2.14-30
sysstat-5.0.5-1
xscreensaver-4.18-5.rhel4.2
binutils-2.15.92.0.2-10.EL4
compat-db-4.1.25-9
control-center-2.8.0-12
gcc-3.4.3-9.EL4
gcc-c++-3.4.3-9.EL4
glibc-2.3.4-2
glibc-common-2.3.4-2
gnome-libs-1.4.1.2.90-44.1
libstdc++-3.4.3-9.EL4
libstdc++-devel-3.4.3-9.EL4
make-3.80-5
pdksh-5.2.14-30
sysstat-5.0.5-1
xscreensaver-4.18-5.rhel4.2
1.3添加用户及用户组
添加必要的用户组:/usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
/usr/sbin/groupadd oper
建立oracle用户
/usr/sbin/useradd -g oinstall -G dba,oper oracle
配置oracle的密码:
passwd oracle
1.4配置内核参数、修改用户环境变量
编辑/etc/sysctl.conf文件,在此文件中加入:
运行命令: sysctl -p 使设置生效
编辑/etc/sysctl.conf文件,在此文件中加入:
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144
运行命令: sysctl -p 使设置生效
编辑/etc/security/limits.conf文件,加入以下内容:
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
编辑/etc/pam.d/login文件,加入以下内容:
session required pam_limits.so
session required pam_limits.so
同时在/etc/profile中加入一下代码;
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
在/etc/profile文件中加入以下内容:
ORACLE_BASE="/opt/app/oracle"
export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE"/product/10.2.0/db_1"
ORACLE_SID=xmydlinux
#此SID在后面安装时需要填入和这里配置一样的
export ORACLE_HOME ORACLE_SID
vi /etc/redhat-release,修改redhat-release文件内容如下:(10G默认不支持5.6版本,修改掉此信息可略过错误)
redhat-4
redhat-4
修改oracle用户的环境配置文件
执行:su oracle 切换到oracle用户环境,然后编辑 .bash_profile 文件,更改PATH的配置,同时在环境变量中增加NLS_LANG的配置。如下:
执行:su oracle 切换到oracle用户环境,然后编辑 .bash_profile 文件,更改PATH的配置,同时在环境变量中增加NLS_LANG的配置。如下:
PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export PATH
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
1.5 创建目录
创建ORACLE_BASE目录: mkdir -p /opt/app/oracle
权限设置: chown -R oracle:oinstall /opt/app/
2.安装
创建ORACLE_BASE目录: mkdir -p /opt/app/oracle
权限设置: chown -R oracle:oinstall /opt/app/
2.安装
2.1 切换至oracle用户,copy 10201_database_linux32.zip文件到/OPT目录。执行:unzip 10201_database_linux32.zip解压10g文件。
执行:export LANG=en_US (防止乱码)
2.2 执行:/opt/database/runInstaller
执行:export LANG=en_US (防止乱码)
2.2 执行:/opt/database/runInstaller
选择安装方法,建议选择高级模式,如下图所示:
点击“next”,进入下一步骤
使用默认配置,点击“next”进入下一步骤
选择数据库版本,选择“企业版”,点击“产品语言”,出现下图对话框
在对话框中添加“简体中文”,点击“OK”,进入下一步
使用默认的安装目录,点击“next”进入下一步骤
进行数据库安装前检查,如上图所示,检查通过,如果没有任何错误,点击“next”
此处选择“只安装数据库软件”,点击“next”,进入下一步骤
点击“install”,进行安装
正在安装,如上图所示安装完成后点击“OK”
用root用户,运行以下脚本:
/opt/app/oracle/oraInventory/orainstRoot.sh
/opt/app/oracle/product/10.2.0/db_1/root.sh
[root@xmydlinux]#
/opt/app/oracle/oraInventory/orainstRoot.sh
Changing permissions of /opt/app/oracle/oraInventory to 770.
Changing groupname of /opt/app/oracle/oraInventory to oinstall.
The execution of the script is complete
[root@xmydlinux]#
/opt/app/oracle/product/10.2.0/db_1/root.sh
Running Oracle10 root.sh script…
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /opt/app/oracle/product/10.2.0/db_1
Enter the full pathname of the local bin directory: [/usr/local/bin]:
(此处直接回车,选择默认的安装目录)
Copying dbhome to /usr/local/bin …
Copying oraenv to /usr/local/bin …
Copying coraenv to /usr/local/bin …
Creating /etc/oratab file…
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
此时数据库软件的安装完成。
3.创建数据库
数据库软件安装完成后还需要创建数据库实例,在原来运行runInstall的终端中运行
dbca命令,运行此命令后,将会在本地的xmanager-passive的显示如下界面:
点击“next”进行配置
选择“create a database”进行创建数据库,点击“Next”进入下一步
勾选“Create Database”,点击“Finish”进入下一步
选择“General Purpose”,点击“Next”,进入下一步,
输入SID,此处输入的SID应该与环境变量的中设置的SID一致,注意区分大小写。点击“Next”进入下一步,
点击“Next”进入下一步
输入密码,点击“Next”进入下一步
在存储选项中选择“File System”,点击“Next”进入下一步
使用默认配置,点击“Next”进入下一步
使用默认配置,点击“Next”进入下一步
点击“Next”进入下一步
在初始化参数设置中的选项卡中选择“Sizing”,在Processes中填写600
在字符集选项卡中,选择字符集为“ZHS16FBK”,点击“Next”进入下一步
使用默认值,点击“Next”进入下一步
点击“Finish”创建数据库
点击“OK”确认配置
建数据库创建中……
在sys和system账号中输入密码,点击“OK”至此数据库安装完成。
附:oracle 10g下载地址:
Oracle Database 10g Release 2 (10.2.0.1.0) Enterprise/Standard Edition for Microsoft Windows (32-bit)
http://download.oracle.com/otn/nt/oracle10g/10201/10201_database_win32.zip
http://download.oracle.com/otn/nt/oracle10g/10201/10201_client_win32.zip
http://download.oracle.com/otn/nt/oracle10g/10201/10201_clusterware_win32.zip
http://download.oracle.com/otn/nt/oracle10g/10201/10201_gateways_win32.zip
http://download.oracle.com/otn/nt/oracle10g/10201/10201_database_win32.zip
http://download.oracle.com/otn/nt/oracle10g/10201/10201_client_win32.zip
http://download.oracle.com/otn/nt/oracle10g/10201/10201_clusterware_win32.zip
http://download.oracle.com/otn/nt/oracle10g/10201/10201_gateways_win32.zip
OracleDatabase 10g Release 2 (10.2.0.1.0) Enterprise/Standard Edition for Microsoft Windows (x64)
http://download.oracle.com/otn/nt/oracle10g/10201/102010_win64_x64_database.zip
http://download.oracle.com/otn/nt/oracle10g/10201/102010_win64_x64_client.zip
http://download.oracle.com/otn/nt/oracle10g/10201/102010_win64_x64_clusterware.zip
http://download.oracle.com/otn/nt/oracle10g/10201/102010_win64_x64_client.zip
http://download.oracle.com/otn/nt/oracle10g/10201/102010_win64_x64_clusterware.zip
OracleDatabase 10g Release 2 (10.2.0.1.0) Enterprise/Standard Edition for Linux x86
http://download.oracle.com/otn/linux/oracle10g/10201/10201_database_linux32.zip
http://download.oracle.com/otn/linux/oracle10g/10201/10201_client_linux32.zip
http://download.oracle.com/otn/linux/oracle10g/10201/10201_gateways_linux32.zip
http://download.oracle.com/otn/linux/oracle10g/10201/10201_client_linux32.zip
http://download.oracle.com/otn/linux/oracle10g/10201/10201_gateways_linux32.zip
OracleDatabase 10g Release 2 (10.2.0.1.0) Enterprise/Standard Edition for Linux x86-64
http://download.oracle.com/otn/linux/oracle10g/10201/10201_database_linux_x86_64.cpio.gz
http://download.oracle.com/otn/linux/oracle10g/10201/10201_client_linux_x86_64.cpio.gz
http://download.oracle.com/otn/linux/oracle10g/10201/10201_clusterware_linux_x86_64.cpio.gz
http://download.oracle.com/otn/linux/oracle10g/10201/10201_gateways_linux_x86_64.cpio.gz
http://download.oracle.com/otn/linux/oracle10g/10201/10201_client_linux_x86_64.cpio.gz
http://download.oracle.com/otn/linux/oracle10g/10201/10201_clusterware_linux_x86_64.cpio.gz
http://download.oracle.com/otn/linux/oracle10g/10201/10201_gateways_linux_x86_64.cpio.gz
OracleDatabase 10g Release 2 (10.2.0.1.0) Enterprise/Standard Edition for AIX5L
http://download.oracle.com/otn/aix/oracle10g/10201/10gr2_aix5l64_database.cpio.gz
http://download.oracle.com/otn/aix/oracle10g/10201/10gr2_aix5l64_client.cpio.gz
http://download.oracle.com/otn/aix/oracle10g/10201/10gr2_aix5l64_cluster.cpio.gz
http://download.oracle.com/otn/aix/oracle10g/10201/10gr2_aix5l64_gateways.cpio.gz
http://download.oracle.com/otn/aix/oracle10g/10201/10gr2_aix5l64_client.cpio.gz
http://download.oracle.com/otn/aix/oracle10g/10201/10gr2_aix5l64_cluster.cpio.gz
http://download.oracle.com/otn/aix/oracle10g/10201/10gr2_aix5l64_gateways.cpio.gz
OracleDatabase 10g Release 2 (10.2.0.2) Enterprise/Standard Edition for Solaris Operating System (x86)
http://download.oracle.com/otn/solaris/oracle10g/10202/10202_database_solx86.zip
http://download.oracle.com/otn/solaris/oracle10g/10202/10202_client_solx86.zip
http://download.oracle.com/otn/solaris/oracle10g/10202/10202_clusterware_solx86.zip
http://download.oracle.com/otn/solaris/oracle10g/10202/10202_client_solx86.zip
http://download.oracle.com/otn/solaris/oracle10g/10202/10202_clusterware_solx86.zip
OracleDatabase 10g Release 2 (10.2.0.1.0) Enterprise/Standard Edition for Solaris Operating System (x86-64)
http://download.oracle.com/otn/solaris/oracle10g/10201/x8664/10201_database_solx86_64.zip
http://download.oracle.com/otn/solaris/oracle10g/10201/x8664/10201_client_solx86_64.zip
http://download.oracle.com/otn/solaris/oracle10g/10201/x8664/10201_clusterware_solx86_64.zip
http://download.oracle.com/otn/solaris/oracle10g/10201/x8664/10201_client_solx86_64.zip
http://download.oracle.com/otn/solaris/oracle10g/10201/x8664/10201_clusterware_solx86_64.zip