以下在fedora 11上安装和卸载
创建用于安装和维护 Oracle 数据库 10g 第 2 版软件的 Linux 组和用户帐户。用户帐户将称为
oracle,而组将称为 oinstall 和 dba。以 root 用户身份执行以下命令:
groupadd oinstall
groupadd dba
mkdir -p /u01/app/oracle
useradd -g oinstall -G dba -d /u01/app/oracle oracle
cp /etc/skel/.bash_logout /u01/app/oracle/
cp /etc/skel/.bash_profile /u01/app/oracle/
cp /etc/skel/.bashrc /u01/app/oracle/
为oracle用户设置密码 123456
passwd oracle
chown -R oracle:oinstall /u01/
chown -R 755 /u01/
检查 nobody 是否存在 ,
缺省存在的。如果不存在 # /usr/sbin/useradd -g nobody
检查安装oracle10g的依赖包是否存在,如没有则安装
# rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})n' binutils
compat-db compat-libstdc++-296 control-center gcc gcc-c++ glibc
glibc-common gnome-libs libstdc++ libstdc++-devel make pdksh
sysstat xscreensaver setarch
应该包含下列的包:
binutils-2.19.51.0.2-17.fc11 (i586)ncompat-db-4.5.20-5.fc9 (i386)ncompat-libstdc++-33-3.2.3-66 (i586)ncontrol-center-2.26.0-6.fc11 (i586)ngcc-4.4.0-4 (i586)ngcc-c++-4.4.0-4 (i586)nglibc-2.10.1-2 (i686)nglibc-common-2.10.1-2 (i586)ngnome-libs-1.4.2-13.fc11 (i586)nlibstdc++-4.4.0-4 (i586)nlibstdc++-devel-4.4.0-4 (i586)nmake-3.81-15.fc11 (i586)npdksh-5.2.14-30 (i386)nsysstat-8.0.4-7.fc11 (i586)nxscreensaver-4.05-1 (i386)npackage setarch is not installed
如果缺少相应的包可以去http://rpm.pbone.net/或http://rpmfind.net/linux/RPM/index.html搜索下载相应的包来安装,安装时如果有很多依赖包可以选择 rpm -ivh xxxxx.rpm -nodeps -force命令强制安装
修改fedora11的redhat-release
vim /etc/redhat-release
Red Hat Enterprise Linux AS release 4 (Nahant Update 4)
安装完后可以修改回fedora11的内容
配置 Linux 内核参数
以root身份登陆,用 vi 命令修改/etc/sysctl.conf 配置文件,加入或者修改如下参数
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
修改完后 保存退出 并执行命令
# /sbin/sysctl -p
注意这步一定要做否则修改的文件不会生效的
为 oracle 用户设置 Shell 限制
Oracle 建议对每个 Linux 帐户可以使用的进程数和打开的文件数设置限制。要进行这些更改,以 root
用户的身份执行下列命令:
cat >> /etc/security/limits.conf
<
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
EOF
cat >> /etc/pam.d/login
<
EOF
以上可以直接vim /etc/security/limits.conf和/etc/pam.d/login保存,一样的。
(注意:以下的步骤我没有执行也安装成功)
修改 bash 和 ksh
的默认配置文件以及 cshell 的默认登录脚本。
cat >> /etc/profile
<
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi
EOF
cat >> /etc/csh.login
<
limit maxproc 16384
limit descriptors 65536
umask 022
endif
EOF
注意 这个也可以用vi直接打开要编辑的文件(我就是用vi打开文件输入并保存的)
限制oracle环境变量
编辑 /u01/app/oracle/.bash_profile。
添加以下行:
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
ORACLE_SID=orclxiao
PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH
注意这个要视你的oracle情况而定啦我装的是oraccle10.2.0.1所以我的ORACLE_HOME就设置如上了。
配置完以上后可以重启一下服务器,然后以oracle用户登录进linux开始安装
如果重启后用户oracle用户登录如果发现
Could not chdir to home directory /u01/oracle: Permission denied
的错误则是selinux引起的
编辑 /etc/sysconfig/selinux ->
../selinux/config,找到这段:
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=enforcing
把 SELINUX=enforcing 注释掉:#SELINUX=enforcing ,然后新加一行为:
SELINUX=disabled
保存,关闭。重启
到此为止linux的系统设置完成了具体请参考
10201_database_linux32.zip压缩包内的welcome.html
,里面有详细的英文安装帮助也可以参考如下几个网址:
《在 Linux x86 上安装 Oracle 数据库 10g》
http://www.oracle.com/technology/global/cn/pub/articles/smiley_10gdb_install.html#config
《将 Oracle Enterprise Linux 5 和 Oracle 数据库 11g 第 1 版安装并配置为 Oracle VM
Server 上的超虚拟化机 (PVM)》
http://www.oracle.com/technology/global/cn/obe/ovm/ovmel5pvmdb11gr1/ovmel5pvmdb11gr1.htm#t3
《在 Oracle Enterprise Linux 5 (32 位和 64 位)上安装 Oracle 数据库 11g 第 1
版》
http://www.oracle.com/technology/global/cn/pub/articles/smiley-11gr1-install.html
把10201_database_linux32.zip文件解压后 得到database目录,
/u01/database/response下有有enterprise.rsp、standard.rsp和custom.rsp三个应答文件,分别对应企业版、标准版和定制的安装。
我们以以enterprise.rsp为例,我cp了一个到/u01目录:
UNIX_GROUP_NAME="oinstall"
ORACLE_HOME_NAME="OraDb10g_home1"
ORACLE_HOME="/u01/app/oracle/product/10.2.0/db_1"
SHOW_INSTALL_PROGRESS_PAGE= true
SHOW_END_OF_INSTALL_MSGS= true
COMPONENT_LANGUAGES={"zh_CN"}
s_nameForDBAGrp= "dba"
s_nameForOPERGrp="dba"
INSTALL_TYPE="EE"
n_configurationOption=3
RESTART_SYSTEM=false
RESTART_REMOTE_SYSTEM=false
s_dbSid= "orclxiao"
s_dbRetChar="Unicode standard UTF-8 AL32UTF8"
说明:这几项要视情况而定比如说 UNIX_GROUP_NAME="oinstall"
和s_nameForDBAGrp= "dba"
还有环境变量都要参照前面自己定义好的来填
换oracle用户登录:注意文件位置视自己刚刚修改的文件位置而定
./runInstaller -silent -responseFile /u01/enterprise.rsp
Installation in progress (Mon Sep 21 23:37:00 CST 2009)
............................................................... 18%
Done.
............................................................... 36%
Done.
............................................................... 54%
Done.
............................................................... 72%
Done.
................
Install successful
Linking in progress (Mon Sep 21 23:39:49 CST 2009)
Link successful
Setup in progress (Mon Sep 21 23:43:11 CST 2009)
..............
Setup successful
End of install phases.(Mon Sep 21 23:43:20 CST 2009)
WARNING:A new inventory has been created in this session. However,
it has not yet been registered as the central inventory of this
system.
To register the new inventory please run the script
'/u01/app/oracle/oraInventory/orainstRoot.sh' with root
privileges.
If you do not register the inventory, you may not be able to update
or patch the products you installed.
The following configuration scripts
/u01/app/oracle/product/10.2.0/db_1/root.sh
need to be executed as root for configuring the system. If you skip
the execution of the configuration tools, the configuration will
not be complete and the product wont function properly. In order to
get the product to function properly, you will be required to
execute the scripts and the configuration tools after exiting the
OUI.
The installation of Oracle Database 10g was
successful.(恭喜你成功了如果没这个提示就看看他说的日志继续修改下ok)
Please check
'/u01/app/oracle/oraInventory/logs/silentInstall2009-09-21_11-36-22PM.log'
for more details.
接下来按提示 操作, root身份登录
/u01/app/oracle/oraInventory/orainstRoot.sh
/u01/app/oracle/product/10.2.0/db_1/root.sh
修改/u01/dbca.rsp
根据数据库建立方式的不同编辑不同的数据库库选项。
比如在本次安装过程中设置了下列参数:(注意下面参数视情况而定啦不要照抄该选项原文件都有说明的)
RESPONSEFILE_VERSION = "10.0.0"
OPERATION_TYPE = "createDatabase"
GDBNAME = "orclxiao"
SID = "orclxiao"
TEMPLATENAME = "New_Database.dbt"
SYSPASSWORD = "xiao"
SYSTEMPASSWORD = "xiao"
DATAFILEDESTINATION ="/u01/app/oracle/oradata/"
RECOVERYAREADESTINATION="/u01/app/oracle/flash_recovery_area"
STORAGETYPE=FS
CHARACTERSET = "UTF8"
NATIONALCHARACTERSET= "UTF8"
MEMORYPERCENTAGE = "40"
SCRIPTDESTINATION ="/u01/app/oracle/admin/ora10g/scripts"
EMCONFIGURATION=”LOCAL”
SYSMANPASSWORD = "xiao"
DBSNMPPASSWORD = "xiao"
其中最后1项不是必须的,这个的目的是在建立数据库的同时生成脚本。
下面就可以开始SILENT模式的数据库创建了。
dbca -silent -responseFile /u01/dbca.rsp
最后提示创建成功后
到这里本地的oracle 可以奔起来了,如果要其他机器的oracle客户端连接这台机器需要运行:
把oracle监听器打开
oracle
oracle一般手动启动方法
(需要设置ORACLE_SID等环境变量)
sqlplus /nolog
conn / as sysdba
startup
oracle 启动了!
复制/u01/app/oracle/admin/orclxiao/pfile/init.ora.1025201075330
到
/u01/app/oracle/product/10.2.0/db_1/dbs/initorclxiao.ora
也许就可以启动了
卸载:
还是用安装时的enterprise.rsp
./runInstaller -silent -deinstall -invPtrLoc
/u01/oraInventory/oraInst.loc -responseFile
/u01/enterprise.rsp
rm -rf /u01/oradata/
rm -rf /u01/oracle/
rm -rf /u01/flash_recovery_area/
rm -rf /u01/oraInventory/
rm -rf /u01/admin/
rm -rf /etc/oratab
rm -f /etc/oraInst.loc /etc/oratab
rm -rf /etc/oracle
rm -f /etc/inittab.cssd
rm -f /usr/local/bin/coraenv /usr/local/bin/dbhome
/usr/local/bin/oraenv
删除oracle用户以及用户组
然后删除/tmp/OraInstall2010-11-23_06-00-49AM
类似的目录
删除oracle完毕
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/23351611/viewspace-1118678/ ,如需转载,请注明出处,否则将追究法律责任。