--从OCM 虚拟机中,克隆了安装oracle之前的状态
配置网络:
[root@localhost network-scripts]# ifup ifcfg-eth0
[root@localhost network-scripts]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:58:5F:3F
lo Link encap:Local Loopback
[root@localhost network-scripts]# ping 192.168.153.1
PING 192.168.153.1 (192.168.153.1) 56(84) bytes of data.
64 bytes from 192.168.153.1: icmp_seq=0 ttl=128 time=5.08 ms
--- 192.168.153.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 5.082/5.082/5.082/0.000 ms, pipe 2
[root@localhost network-scripts]#
--安装JCH2 库 作用:存放历史数据,用于历史分析
配置oracle用户环境变量
vi ~/.bash_profile
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/jdk/bin:$PATH
配置主机名:
vi /etc/hosts
[root@localhost sysconfig]# vi network
[root@localhost sysconfig]# pwd
/etc/sysconfig
[root@localhost sysconfig]#
重启网络服务:
service network restart
给文件夹更换用户及组:
chown -R oracle:oinstall /u01
安装软件
切换到root用户:执行
/u01/app/oraInventory/orainstRoot.sh
/u01/app/oracle/product/10.2.0/db_1/root.sh
(linux知识:可以把oracle 放到 sudoer里面)
然后执行:sudo /u01/app/oraInventory/orainstRoot.sh
oracle is not in the sudoers file. This incident will be reported.
编辑 /etc/sudoers
加入下面一行,让oracle用户可以执行所有命令。
然后oracle用户登录就可以直接使用 sudo *******命令,执行root用户可以执行的命令了
oracle ALL=(ALL) ALL
修改sql提示符
vi /u01/app/oracle/product/10.2.0/db_1/sqlplus/admin/glogin.sql
装数据库
输入dbca
[oracle@ocm2 ~]$ dbca
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified
尝试修改了DISPLAY变量,仍然提示错误
后来发现只要直接用oracle用户登录,执行dbca就可以弹出窗口了
不要通过root su到oracle
em与gc只能选择一个。,所以这一步要取消em
下面的按钮图片没有显示出来:Standard Database Components:把jvm和XML DB关掉
创建监听
检查:
[oracle@ocm2 JCH2]$ vi /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
修改tnsnames.ora
JCH1 =
(description =
(address=(protocol=tcp)(host=ocm1)(port=1521))
(connect_data=
(server = dedicated)
(service_name = JCH1)
)
)
JCH2 =
(description =
(address=(protocol=tcp)(host=ocm2)(port=1521))
(connect_data=
(server = dedicated)
(service_name = JCH2)
)
)
SYS@JCH2> create user jch2 identified by jch2;
User created.
SYS@JCH2> grant dba to jch2;
Grant succeeded.
SYS@JCH2>
修改listener.ora
修改后:
登录JCH2