准备软件
em12.1.0.4_linux64_V45344-01.zip
em12.1.0.4_linux64_V45345-01.zip
em12.1.0.4_linux64_V45346-01.zip
安装操作系统(OEL6.5)
给 OS 空间 50G 以上装完OS和CC后需要占用 30G 空间建议6G 内存最少4G
[[email protected] newcc bin]$ cat /etc/hosts
127.0.0.1 localhostlocalhost.localdomain localhost4 localhost4.localdomain4
::1localhostlocalhost.localdomainlocalhost6 localhost6.localdomain6
10.1.32.229 OEL65
安装ccdb数据库
按照gcdb 11g的环境即可
[[email protected] newcc ~]$ uname -r
3.8.13-16.2.1.el6uek.x86_64
[[email protected] ~]# rpm -q --qf‘%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n‘ \binutils compat-libstdc++-33elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc-commonglibc-devel glibc-headers ksh libaio libaio-devel libgomp- libgcc libstdc++libstdc++-devel
make numactl-devel- sysstat unixODBC unixODBC-devel compat-libcap1
binutils-2.20.51.0.2-5.36.el6 (x86_64)
compat-libstdc++-33-3.2.3-69.el6 (x86_64)
compat-libstdc++-33-3.2.3-69.el6 (i686)
elfutils-libelf-0.152-1.el6 (x86_64)
elfutils-libelf-0.152-1.el6 (i686)
elfutils-libelf-devel-0.152-1.el6 (x86_64)
elfutils-libelf-devel-0.152-1.el6 (i686)
gcc-4.4.7-4.el6 (x86_64)
gcc-c++-4.4.7-4.el6 (x86_64)
glibc-2.12-1.132.el6 (x86_64)
glibc-2.12-1.132.el6 (i686)
glibc-common-2.12-1.132.el6 (x86_64)
glibc-devel-2.12-1.132.el6 (x86_64)
glibc-devel-2.12-1.132.el6 (i686)
glibc-headers-2.12-1.132.el6 (x86_64)
ksh-20120801-10.el6 (x86_64)
libaio-0.3.107-10.el6 (x86_64)
libaio-0.3.107-10.el6 (i686)
libaio-devel-0.3.107-10.el6 (x86_64)
libaio-devel-0.3.107-10.el6 (i686)
libgomp-4.4.7-4.el6 (x86_64)
libgcc-4.4.7-4.el6 (x86_64)
libgcc-4.4.7-4.el6 (i686)
libstdc++-4.4.7-4.el6 (x86_64)
libstdc++-4.4.7-4.el6 (i686)
libstdc++-devel-4.4.7-4.el6 (x86_64)
libstdc++-devel-4.4.7-4.el6 (i686)
make-3.81-20.el6 (x86_64)
numactl-devel-2.0.7-8.el6 (x86_64)
sysstat-9.0.4-22.el6 (x86_64)
unixODBC-2.2.14-12.el6_3 (x86_64)
unixODBC-2.2.14-12.el6_3 (i686)
unixODBC-devel-2.2.14-12.el6_3 (i686)
unixODBC-devel-2.2.14-12.el6_3 (x86_64)
compat-libcap1-1.10-1 (x86_64)
[[email protected] ~]#
#默认值
/etc/sysctl.conf
[[email protected] soft]#sysctl -p
kernel.msgmnb = 65536
kernel.msgmax = 65536
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500
#默认值
vi /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
session required pam_limits.so
#关闭SELINUX
vi /etc/selinux/config
SELINUX=disabled
#关闭防火墙
[[email protected]~]# service iptables stop
iptables:将链设置为政策 ACCEPT:filter [确定]
iptables:清除防火墙规则: [确定]
iptables:正在卸载模块: [确定]
[[email protected]~]# chkconfig iptables off
#创建组和用户
groupadd oinstall默认已经有
groupadd dba默认已经有
groupadd oper
groupadd asmadmin
userdel oracle
cd /home rm -rf oracle
useradd -g oinstall -G dba,oper,asmadmin oracle
passwd oracle
#创建目录
mkdir -p /u01/app/ora11g
mkdir -p /u01/app/ora11g/product
mkdir -p /u01/app/ora11g/oradata
mkdir -p /u01/app/ora11g/product/11.2.0/db_1
chown -R oracle:oinstall /u01
chmod -R 775 /u01
#创建环境变量
su – oracle
vi .bash_profile
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_TERM=xterm
export ORACLE_BASE=/u01/app/ora11g
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_GRID=$ORACLE_BASE/product/11.2.0/grid
export ORACLE_SID=ccdb
export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$ORACLE_GRID/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib64:/usr/lib64:/usr/local/lib64:/usr/X11R6/lib64
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export NLS_LANG="SIMPLIFIEDCHINESE_CHINA.ZHS16GBK"
exportALERT=$ORACLE_BASE/diag/rdbms/$ORACLE_SID/$ORACLE_SID/trace
stty erase ^H
umask 022
if [ $USER = "oracle" ]; then
if [$SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
#格式化分区
fdisk -l
[[email protected] ~]#
fdisk /dev/sdb
n p 1 w
#创建ASM disk
--检查asm包安装
[[email protected] ~]# rpm -qa oracleasm*
oracleasm-support-2.1.8-1.el6.x86_64
rpm –vih asmlib
[[email protected] ~]# /etc/init.d/oracleasmconfigure
Configuring the Oracle ASM library driver.
This will configure the on-boot propertiesof the Oracle ASM library
driver. The following questions will determine whether the driver is
loaded on boot and what permissions it willhave. The current values
will be shown in brackets (‘[]‘). Hitting <ENTER> without typing an
answer will keep that current value. Ctrl-C will abort.
Default user to own the driver interface[]: oracle
Default group to own the driver interface[]: asmadmin
Start Oracle ASM library driver on boot(y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n)[y]: y
Writing Oracle ASM library driverconfiguration: done
Initializing the Oracle ASMLib driver: [ OK ]
Scanning the system for Oracle ASMLibdisks: [ OK ]
[[email protected] ~]# /etc/init.d/oracleasmcreatedisk v1 /dev/sdb1
Marking disk "v1" as an ASMdisk: [ OK ]
[[email protected] ~]# /etc/init.d/oracleasmcreatedisk v2 /dev/sdc1
Marking disk "v2" as an ASMdisk: [ OK ]
[[email protected] ~]# /etc/init.d/oracleasmlistdisks
V1
V2
#配置host文件
[[email protected]~]# vi /etc/hosts
#cc
10.1.5.122 newcc.localdomain newcc
#Public
10.1.32.91 ntrac1.localdomain ntrac1
10.1.32.93 ntrac2.localdomain ntrac2
10.1.32.95 ntrac3.localdomain ntrac3
#Virtual
10.1.32.92 ntrac1-vip.localdomain ntrac1-vip
10.1.32.94 ntrac2-vip.localdomain ntrac2-vip
10.1.32.96 ntrac3-vip.localdomain ntrac3-vip
#SCAN
10.1.32.99 rac-scan.localdomain rac-scan
#Database和Grid安装
#创建ccdb数据库
配置ccdb
redo log 修改大小100M 然后创建 4组 redo log
** 根据提示修改就OK
ALTER SYSTEM SETprocesses=500 SCOPE=SPFILE;
系统已更改。
ALTER SYSTEM SETsession_cached_cursors=500 SCOPE=SPFILE;
系统已更改
ALTER SYSTEM SETsga_target=2G SCOPE=SPFILE; 默认要比这个大就不动
ALTER SYSTEM SETpga_aggregate_target=2G SCOPE=SPFILE;
ALTER SYSTEM SETjob_queue_processes=20SCOPE=SPFILE; 默认1000 要缩小
ALTER SYSTEM SETopen_cursors=300 SCOPE=SPFILE;
**
--Restart the instance.
SHUTDOWNIMMEDIATE
STARTUP
安装Cloud Control
官方文档参考:
http://docs.oracle.com/cd/E24628_01/install.121/e22624/install_em_exist_db.htm#BGBHDBCH
创建CC安装目录
oracleuser
$ mkdir-p /u01/app/oracle/oms12cr4
$mkdir -p /u01/app/oracle/agent12cr4
添加环境变量
export LANG=zh_CN
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_TERM=xterm
exportORACLE_BASE=/u01/app/ora11g
exportORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
exportORACLE_GRID=$ORACLE_BASE/product/11.2.0/grid
export OMS_HOME=/u01/app/oracle/oms12cr4/oms
export AGENT_HOME=/u01/app/oracle/agent12cr4/core/12.1.0.4.0
export ORACLE_SID=ccdb
export PATH=/usr/sbin:$PATH
exportPATH=$ORACLE_HOME/bin:$ORACLE_GRID/bin:$PATH
exportLD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib64:/usr/lib64:/usr/local/lib64:/usr/X11R6/lib64
exportCLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export NLS_LANG="SIMPLIFIEDCHINESE_CHINA.ZHS16GBK"
export ALERT=$ORACLE_BASE/diag/rdbms/$ORACLE_SID/$ORACLE_SID/trace
stty erase ^H
umask 022
if [ $USER = "oracle"]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
启动安装CC
--临时注释掉下面几个环境变量
unset ORACLE_HOME ORACLE_BASE ORACLE_SID
[[email protected]]$ ls
install jdk libskgxn oms plugins Release_Notes.pdf response runInstaller stage wls WT.zip
[[email protected]]$ ./runInstaller
因为主机名没有加domain
如果选着高级是这样
可以选择小中大型部署
删除em之前的dbconsole是stop的
[[email protected] 112db]# su - oracle
[[email protected] ~]$ export LANG=zh_EN
[[email protected] ~]$ emca -deconfig dbcontrol db-repos drop
EMCA 开始于 2013-12-9 21:06:52
EM Configuration Assistant, 11.2.0.3.0 正式版
版权所有 (c) 2003, 2011, Oracle。保留所有权利。
输入以下信息:
数据库 SID: ngcdb
监听程序端口号: 1521
SYS 用户的口令:
SYSMAN 用户的口令:
----------------------------------------------------------------------
警告: 当删除资料档案库时, 数据库将进入静默模式。
----------------------------------------------------------------------
是否继续? [是(Y)/否(N)]: y
2013-12-9 21:07:54oracle.sysman.emcp.EMConfig perform
信息: 正在将此操作记录到/u01/app/ora11g/cfgtoollogs/emca/ngcdb/emca_2013_12_09_21_06_51.log。
2013-12-9 21:07:55oracle.sysman.emcp.util.DBControlUtilstopOMS
信息: 正在停止 Database Control (此操作可能需要一段时间)...
2013-12-9 21:07:57oracle.sysman.emcp.EMReposConfig invoke
信息: 正在删除 EM 资料档案库 (此操作可能需要一段时间)...
2013-12-9 21:09:22oracle.sysman.emcp.EMReposConfig invoke
信息: 已成功删除资料档案库
已成功完成 Enterprise Manager 的配置
EMCA 结束于 2013-12-9 21:09:25
[[email protected] ~]$
Alert delete em
Mon Dec 09 21:08:01 2013
XDB installed.
XDB initialized.
Mon Dec 09 21:08:02 2013
Stopping background process CJQ0
Mon Dec 09 21:08:02 2013
ALTER SYSTEM SET job_queue_processes=0SCOPE=BOTH SID=‘*‘;
Warning: drop_queue_table: No evaluationfor the queue table: SYSMAN.MGMT_TASK_QTABLE
Warning: drop_queue_table: No evaluationfor the queue table: SYSMAN.MGMT_NOTIFY_INPUT_QTABLE
Warning: drop_queue_table: No evaluationfor the queue table: SYSMAN.MGMT_PAF_MSG_QTABLE_1
Warning: drop_queue_table: No evaluationfor the queue table: SYSMAN.MGMT_PAF_MSG_QTABLE_2
Mon Dec 09 21:08:28 2013
Thread 1 advanced to log sequence 9 (LGWRswitch)
Current log# 3 seq# 9 mem# 0:+DATA/ngcdb/onlinelog/group_3.263.833729183
Current log# 3 seq# 9 mem# 1: +FRA/ngcdb/onlinelog/group_3.259.833729183
Mon Dec 09 21:08:29 2013
Archived Log entry 4 added for thread 1sequence 8 ID 0x9c38e516 dest 1:
Mon Dec 09 21:08:48 2013
Thread 1 advanced to log sequence 10 (LGWRswitch)
ALTER SYSTEM SET job_queue_processes=20 SCOPE=BOTHSID=‘*‘;
手动写+DATA
简单安装方法界面如下:
[[email protected] ~]# export LANG=zh_CN
[[email protected] ~]#/u01/app/oracle/oms12cr3/oms/allroot.sh
Starting to execute allroot.sh .........
Starting to execute /u01/app/oracle/oms12cr3/oms/root.sh......
Running Oracle 11g root.sh script...
The following environment variables are setas:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/oms12cr3/oms
Enter the full pathname of the local bindirectory: [/usr/local/bin]:
The file "dbhome" already existsin /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying dbhome to /usr/local/bin ...
The file "oraenv" already existsin /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying oraenv to /usr/local/bin ...
The file "coraenv" already existsin /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying coraenv to /usr/local/bin ...
Entries will be added to the /etc/oratabfile as needed by
Database Configuration Assistant when adatabase is created
Finished running generic part of root.shscript.
Now product-specific root actions will beperformed.
/etc exist
Creating /etc/oragchomelist file...
/u01/app/oracle/oms12cr3/oms
Finished execution of /u01/app/oracle/oms12cr3/oms/root.sh ......
Starting to execute /u01/app/oracle/agent12cr3/core/12.1.0.3.0/root.sh......
Finished product-specific root actions.
/etc exist
Finished execution of /u01/app/oracle/agent12cr3/core/12.1.0.3.0/root.sh ......
[[email protected] ~]#
Sysman
安装后续操作
CC相关命令
#!/bin/bash
exportORACLE_HOME=/u01/app/oracle/product/11.2.0.3/db_1
exportOMS_HOME=/u01/app/oracle/oms12cr3/oms
exportAGENT_HOME=/u01/app/oracle/agent12cr3/core/12.1.0.3.0
# Start everything
$ORACLE_HOME/bin/dbstart$ORACLE_HOME
$OMS_HOME/bin/emctlstart oms
$AGENT_HOME/bin/emctlstart agent
#!/bin/bash
exportORACLE_HOME=/u01/app/oracle/product/11.2.0.3/db_1
exportOMS_HOME=/u01/app/oracle/oms12cr3/oms
exportAGENT_HOME=/u01/app/oracle/agent12cr3/core/12.1.0.3.0
# Stop everything
$OMS_HOME/bin/emctlstop oms -all
$AGENT_HOME/bin/emctlstop agent
$ORACLE_HOME/bin/dbshut$ORACLE_HOME