:: 环境 Linux5.4 oracle11G
:: 不管什么,先装包,以下的包是linux5.4下的,其他版本待自测......
---------------------------------------------------------------------------------------------------------------------------------
以下是手工(挂载光盘cd /media/Enterprise\ Linux\ dvd\ 20090908/Server/ )安装,测试配yum也OK
----------------------------------------------------------------------------------------------------------------------
安装包时提示 |
warning: gcc-4.1.2-46.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159 |
error: Failed dependencies: |
glibc-devel >= 2.2.90-12 is needed by gcc-4.1.2-46.el5.i386 |
libgomp >= 4.1.2-46.el5 is needed by gcc-4.1.2-46.el5.i386 |
|
解决 |
由于yum安装了旧版本的GPG keys造成,删除即可 |
切换到root,执行:rpm --import /etc/pki/rpm-gpg/RPM* |
然后再执行下面语句,后面加上 --force --nodeps 强制安装 |
---------------下面包安装为linux5.4环境下安装11G的缺少包-------------------------------------------- |
******************以下为32位版本*********************************************
rpm -ivh gcc-4.1.2-46.el5.i386.rpm --force --nodeps *
rpm -ivh gcc-c++-4.1.2-46.el5.i386.rpm --force --nodeps *
rpm -ivh glibc-devel-2.5-42.i386.rpm --force --nodeps *
rpm -ivh glibc-headers-2.5-42.i386.rpm --force --nodeps
rpm -ivh kernel-headers-2.6.18-164.el5.i386.rpm --force --nodeps
rpm -ivh libaio-devel-0.3.106-3.2.i386.rpm --force --nodeps
rpm -ivh libgomp-4.4.0-6.el5.i386.rpm --force --nodeps
rpm -ivh libstdc++-devel-4.1.2-46.el5.i386.rpm --force --nodeps
rpm -ivh sysstat-7.0.2-3.el5.i386.rpm --force --nodeps
rpm -ivh unixODBC-2.2.11-7.1.i386.rpm --force --nodeps
rpm -ivh unixODBC-devel-2.2.11-7.1.i386.rpm --force --nodeps
rpm -ivh elfutils-libelf-devel-0.137-3.el5.i386.rpm --force --nodeps
rpm -ivh elfutils-libelf-devel-static-0.137-3.el5.i386.rpm --force --nodeps
----------------------------------------------------------------------------------------------------------------------
1) 重启后生效
开启: chkconfig iptables on
关闭: chkconfig iptables off
2) 即时生效,重启后失效
开启: service iptables start
关闭: service iptables stop
执行 vi /etc/sysctl.conf 加入以下
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4294967295
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
保存并退出,执行语句生效:/sbin/sysctl -p
----------------------------------------------------------------------------------------------------------------------
修改:vi /etc/security/limits.conf 加入以下
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
----------------------------------------------------------------------------------------------------------------------
修改:vi /etc/pam.d/login
session required /lib/security/pam_limits.so
session required pam_limits.so
----------------------------------------------------------------------------------------------------------------------
关闭防火墙:vi /etc/selinux/config
SELINUX=disabled
----------------------------------------------------------------------------------------------------------------------
vi /etc/fstab
tmpfs /dev/shm tmpfs defaults,size=4G 0 0
通过重新挂载来修改
[root@user ~]# mount -o remount,size=4G /dev/shm
mount -o remount /dev/shm
修改:vi /etc/hosts
vi /etc/sysconfig/network
/ 本机 IP 地址 //长主机名 //短主机
192.168.2.30 user.com user
----------------------------------------------------------------------------------------------------------------------
修改vi /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
使设置生效 :source /etc/profile
--------------------------------------------------------------------------------------------------------------------------
创建 vi /etc/oraInst.loc文件,加入以下
nventory_loc=/u01/app/oracle/oraInventory
inst_group=oinstall
创建dba、oinstall用户组
[root@user ~]# groupadd dba //添加 dba 用户组(ORACLE 管理组)
[root@user ~]# groupadd oinstall //添加 oinstall 用户组(ORACLE 安装组)
[root@user ~]# useradd -g oinstall -G dba oracle //创建 oracle 用户并加入组
[root@user ~]# passwd oracle //修改 oracle 用户的密码
----------------------------------------------------------------------------------------------------------------------
创建安装目录
[root@user ~]# cd / //切换到根目录
[root@user /]# mkdir -p /u01/app/oracle //创建安装目录
[root@user /]# chown oracle:oinstall /u01/app/oracle/ //修改安装目录的权限
----------------------------------------------------------------------------------------------------------------------
修改环境变量(此次重启linux,以上面创建的oracle用户登录,环境变量不要乱改,否则会造成所有的命令不能用!!!!!)
[oracle@user ~]$ vi .bash_profile
export ORACLE_SID=orcl
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export PATH=$PATH:$ORACLE_HOME/bin
保存使其生效: source .bash_profile
----------------------------------------------------------------------------------------------------------------------
更改文件的权限
chmod -R 775 database
chown oracle:oinstall /etc/oraInst.loc
chmod 664 /etc/oraInst.loc
-------------------------------------------------------------------------------------------------------------------------
传输oracle安装文件。之后解压(略...)
-------------------------------------------------------------------------------------------------------------------------
修改安装Oracle软件的响应文件/u01/app/oracle/database/response/db_install.rsp
oracle.install.option=INSTALL_DB_SWONLY ---------------------- //29 行 安装类型
ORACLE_HOSTNAME=user.com -------------------------------------- //37 行 主机名称
UNIX_GROUP_NAME=oinstall --------------------------------------- //42 行 安装组
INVENTORY_LOCATION=/u01/app/oracle/oraInventory ---------------- //47 行 INVENTORY目录
SELECTED_LANGUAGES=en,zh_CN,zh_TW ------------------------------ //78 行 选择语言
ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1 ---------------- //83 行 oracle_home
ORACLE_BASE=/u01/app/oracle ------------------------------------ //88 行 oracle_base
oracle.install.db.InstallEdition=EE ---------------------------- //99 行 oracle版本
oracle.install.db.isCustomInstall=true ------------------------- //108行 自定义安装
oracle.install.db.DBA_GROUP=dba -------------------------------- //142行 dba用户组
oracle.install.db.OPER_GROUP=oinstall -------------------------- //147行 oper用户组
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE -------- //160行 数据库类型
oracle.install.db.config.starterdb.globalDBName=orcl ----------- //165行 globalDBName
oracle.install.db.config.starterdb.SID=orcl -------------------- //170行 SID
oracle.install.db.config.starterdb.memoryLimit=1024 ------------- //200行 自动管理内存的最小内存(M)
oracle.install.db.config.starterdb.password.ALL=oracle -------- //233行 设定所有数据库用户使用同一个密码
DECLINE_SECURITY_UPDATES=true ---------------------------------- //385行 设置安全更新
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
进行静默安装Oracle软件
cd database
./runInstaller -silent -force -responseFile /u01/app/oracle/database/response/db_install.rsp
查看安装日志信息了解安装进度
cd /u01/app/oracle/oraInventory/logs
tail -100f installActions*.log
安装中,如果提示[WARNING]不必理会,此时安装程序仍在进行,如果出现[FATAL],则安装程序已经停止了。
[oracle@user database]$ ./runInstaller -silent -force -responseFile /u01/app/oracle/database/response/db_install.rsp
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 80 MB. Actual 9813 MB Passed
Checking swap space: must be greater than 150 MB. Actual 2047 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2015-05-24_05-48-17AM. Please wait ...[oracle@user database]$ [WARNING] [INS-32055] The Central Inventory is located in the Oracle base.
CAUSE: The Central Inventory is located in the Oracle base.
ACTION: Oracle recommends placing this Central Inventory in a location outside the Oracle base directory.
[WARNING] [INS-13014] Target environment do not meet some optional requirements.
CAUSE: Some of the optional prerequisites are not met. See logs for details. /tmp/OraInstall2015-05-24_05-48-17AM/installActions2015-05-24_05-48-17AM.log
ACTION: Identify the list of failed prerequisite checks from the log: /tmp/OraInstall2015-05-24_05-48-17AM/installActions2015-05-24_05-48-17AM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
[WARNING] [INS-32055] The Central Inventory is located in the Oracle base.
CAUSE: The Central Inventory is located in the Oracle base.
ACTION: Oracle recommends placing this Central Inventory in a location outside the Oracle base directory.
[WARNING] [INS-13014] Target environment do not meet some optional requirements.
CAUSE: Some of the optional prerequisites are not met. See logs for details. /tmp/OraInstall2015-05-24_05-48-17AM/installActions2015-05-24_05-48-17AM.log
ACTION: Identify the list of failed prerequisite checks from the log: /tmp/OraInstall2015-05-24_05-48-17AM/installActions2015-05-24_05-48-17AM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
You can find the log of this install session at:
/u01/app/oracle/oraInventory/logs/installActions2015-05-24_05-48-17AM.log
The following configuration scripts need to be executed as the "root" user.
#!/bin/sh
#Root scripts to run
/u01/app/oracle/product/11.2.0/db_1/root.sh --------------这里提示要在ROOT用户下执行脚本就在root用户下执行:/u01/app/oracle/product/11.2.0/db_1/root.sh
To execute the configuration scripts:
1. Open a terminal window
2. Log in as "root"
3. Run the scripts
4. Return to this window and hit "Enter" key to continue
Successfully Setup Software.
[oracle@user database]$
提示要在ROOT用户下执行脚本就在root用户下执行:/u01/app/oracle/product/11.2.0/db_1/root.sh
大概时间是5分钟
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
增加oracle环境变量,加入以下
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export TNS_ADMIN=$ORACLE_HOME/network/admin
export PATH=.:${PATH}:$HOME/bin:$ORACLE_HOME/bin
export PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/lib
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/JRE
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/JRE/lib
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
export LIBPATH=${CLASSPATH}:$ORACLE_HOME/lib:$ORACLE_HOME/ctx/lib
export ORACLE_OWNER=oracle
export SPFILE_PATH=$ORACLE_HOME/dbs
export ORA_NLS10=$ORACLE_HOME/nls/data
source生效
-------------------------------------------------------------------------------------------------------------------
静默配置网络
$ORACLE_HOME/bin/netca /silent /responseFile /u01/app/oracle/database/response/netca.rsp
=============================至此,静默安装完成==========================
-------------------------------------------------------------------------------------------------------------------
====================================================================================================================
==============================以下为手工建库==============================
-------------------------------------------------------------------------------------------------------------------
-------在oracle用户下进行--------
mkdir /u01/app/oracle/admin
mkdir /u01/app/oracle/admin/orcl/
mkdir /u01/app/oracle/admin/orcl/{a,b}dump
mkdir /u01/app/oracle/oradata
mkdir /u01/app/oracle/oradata/orcl
mkdir /u01/app/oracle/flash_recovery_area
创建密码文件在$ORACLE_HOME/dbs下
orapwd file=orapworcl password=oracle
------------------------------------------------------------------------------------
SQL> startup
设置oracle用户环境变量实例名为orcl
export ORACLE_SID=orcl
::在dbs下面
创建参数文件
cat $ORACLE_HOME/dbs/init.ora | grep -v ^$ | grep -v ^# > initorcl.ora
修改参数文件:vi initorcl.ora
db_name='ORCL'
memory_target=1024M
processes = 150
audit_file_dest='/u01/app/oracle/admin/orcl/adump'
audit_trail ='db'
db_block_size=8192
db_domain=''
db_recovery_file_dest='/u01/app/oracle/flash_recovery_area'
db_recovery_file_dest_size=2048M
diagnostic_dest='/u01/app/oracle'
dispatchers='(PROTOCOL=TCP) (SERVICE=ORCLXDB)'
open_cursors=300
remote_login_passwordfile='EXCLUSIVE'
undo_tablespace='UNDOTBS1'
control_files = ('/u01/app/oracle/oradata/orcl/control01.ctl','/u01/app/oracle/oradata/orcl/control02.ctl','/u01/app/oracle/oradata/orcl/control03.ctl')
compatible ='11.2.0'
启动实例(NOMOUNTT状态)
startup nomount
运行建库脚本
CREATE DATABASE orcl
LOGFILE GROUP 1 ('/u01/app/oracle/oradata/orcl/redo01.log') SIZE 100M,
GROUP 2 ('/u01/app/oracle/oradata/orcl/redo02.log') SIZE 100M,
GROUP 3 ('/u01/app/oracle/oradata/orcl/redo03.log') SIZE 100M
MAXLOGFILES 50
MAXLOGMEMBERS 5
MAXLOGHISTORY 10
MAXDATAFILES 100
MAXINSTANCES 1
CHARACTER SET US7ASCII
NATIONAL CHARACTER SET AL16UTF16
DATAFILE '/u01/app/oracle/oradata/orcl/system01.dbf' SIZE 325M REUSE
EXTENT MANAGEMENT LOCAL
SYSAUX DATAFILE '/u01/app/oracle/oradata/orcl/sysaux01.dbf' SIZE 325M REUSE
DEFAULT TABLESPACE users
DATAFILE '/u01/app/oracle/oradata/orcl/users01.dbf' SIZE 100M REUSE
DEFAULT TEMPORARY TABLESPACE tempts
TEMPFILE '/u01/app/oracle/oradata/orcl/temp01.dbf'
SIZE 20M REUSE
UNDO TABLESPACE undotbs1
DATAFILE '/u01/app/oracle/oradata/orcl/undotbs01.dbf'
SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;
::过程等待几分钟完成
运行创建数据字典脚本
创建数据字典视图
SQL> @?/rdbms/admin/catalog.sql
创建PL/SQL的软件包和过程
SQL> @?/rdbms/admin/catproc.sql
conn system/manager
@$ORACLE_HOME/sqlplus/admin/pupbld.sql
-----------------------------------------------------------------------------------------------------------------------------------------------------
================================END=====================================
|