用户资源限制
建立Oracle用户和组
建议指定GID和UID方式(尤其集群环境)
[root@dba ~]# groupadd -g 1000 oinstall
[root@dba ~]# groupadd -g 1001 dba
[root@dba ~]# useradd -u 1000 -g oinstall -G dba oracle
[root@dba ~]# passwd oracle
建立oracle软件安装文件目录
[root@dba ~]# mkdir -p /u01/oracle
[root@dba ~]# chown -R oracle:oinstall /u01/
[root@dba ~]#
设置oracle环境变量
vi ~oracle/.bash_profile
export ORACLE_BASE=/u01/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0
export ORACLE_SID=ora10g
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
加载配置
oracle用户注销重新登录 或 source .bash_profile
ORACLE_BASE oracle产品基目录
ORACLE_HOME 数据库产品目录
通常情况下HOME目录是BASE的子目录 ORACLE_HOME=$ORACLE_BASE/product/10.2.0
ORACLE_SID 操作系统和oracle实例关联的纽带
PATH 将安装后的oracle命令追加到执行搜索路径
LD_LIBRARY_PATH 动态库的位置
shell限制
[root@dba ~]# grep -v '^#' /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
[root@dba ~]#
[root@dba ~]# grep 'limit' /etc/pam.d/system-auth
session required pam_limits.so
[root@dba ~]#
运行安装命令
若想支持中文界面 以后的EM或DBCA界面显示中文
安装 rpm -ivh ttfonts-zh_CN-2.14-6.noarch.rpm
export LANG=zh_CN.utf-8
安装界面使用英文则 export LANG=C
注销root使用oracle用户登录X-window执行安装命令 runInstaller
如果安装包再光盘介质上 挂载后要离开光盘挂在位置绝对路径执行
因为安装程序会创建临时文件 光盘是只读的 不能创建临时文件
若当前桌面是root 用su - oracle切换用户 需要在切换前root执行 # xhost + 否则oracle用户不能连接root的桌面
[root@dba ~]# /u01/oracle/oraInventory/orainstRoot.sh
更改权限/u01/oracle/oraInventory 到 770.
更改组名/u01/oracle/oraInventory 到 oinstall.
脚本的执行已完成
[root@dba ~]# /u01/oracle/product/10.2.0/root.sh
Running Oracle10 root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/oracle/product/10.2.0
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.
[root@dba ~]#
安装结束后,数据库处于启动状态:
[root@dba ~]# ps -ef | grep ora_
oracle 1213 1 2 04:44 ? 00:00:00 ora_j000_ora10g
root 1228 3315 0 04:45 pts/3 00:00:00 grep ora_
oracle 6635 1 0 04:00 ? 00:00:00 ora_pmon_ora10g
oracle 6637 1 0 04:00 ? 00:00:00 ora_psp0_ora10g
oracle 6639 1 0 04:00 ? 00:00:00 ora_mman_ora10g
oracle 6641 1 0 04:00 ? 00:00:00 ora_dbw0_ora10g
oracle 6643 1 0 04:00 ? 00:00:01 ora_lgwr_ora10g
oracle 6645 1 0 04:00 ? 00:00:02 ora_ckpt_ora10g
oracle 6647 1 0 04:00 ? 00:00:01 ora_smon_ora10g
oracle 6649 1 0 04:00 ? 00:00:00 ora_reco_ora10g
oracle 6651 1 0 04:00 ? 00:00:00 ora_cjq0_ora10g
oracle 6653 1 0 04:00 ? 00:00:01 ora_mmon_ora10g
oracle 6655 1 0 04:00 ? 00:00:00 ora_mmnl_ora10g
oracle 6657 1 0 04:00 ? 00:00:00 ora_d000_ora10g
oracle 6659 1 0 04:00 ? 00:00:00 ora_s000_ora10g
oracle 6666 1 0 04:01 ? 00:00:00 ora_qmnc_ora10g
oracle 6726 1 0 04:01 ? 00:00:00 ora_q000_ora10g
oracle 6730 1 0 04:01 ? 00:00:00 ora_q002_ora10g
[root@dba ~]#
