首页 > 代码库 > 《oracle安装2》

《oracle安装2》

12.使用hosts文件解析主机名:

# hostname

node1.test.com

# vi /etc/hosts

192.168.0.1          node1.test.com          node1

                                  虚拟机                            主机

# ping node1               ping:强制回显请求数据(用来检测网络通与不通或测试网络连接速度的)

# ping node1.test.com  

 

13.安装包所在目录共享给虚拟机后解压缩。命令如下:

#  mkdir /installation

#  mount -t vboxsf installation  /installation/

# cd /installation/

# ls

p10404530_112030_Linux-x86-64_1of7.zip  p10404530_112030_Linux-x86-64_2of7.zip

#unzip p10404530_112030_Linux-x86-64_1of7.zip

#unzip p10404530_112030_Linux-x86-64_2of7.zip

[root@node1 installation]# ls

database                                p10404530_112030_Linux-x86-64_2of7.zip

p10404530_112030_Linux-x86-64_1of7.zip

 

 

14.图形界面安装:

# xhost +

# su - oracle

$ cd /database/

$ ./runInstaller

 

以root身份执行两个脚本

 

 

15.创建监听和数据库:

图形界面下创建监听,oracle执行:

$ netca

$ lsnrctl status                          //查看状态

$ netstat -tlnp | grep 1521   // 监听窗口的信息

图形界面创建db,oracle执行:

$ dbca  

通用或事务处理:orcl/orcl

Sys:系统管理员

System:系统的操作员

 Dbsnmp:网络管理员

Sysman:系统维护员

 

选中Sample schemas

 

字符类型会用在创建

内存:1200mb

数据库字符集:UnicodeUTF8

 

16.测试:

sqlplus测试:

$ sqlplus sys/password@orcl as sysdba

$ sqlplus / as sysdba

SQL> show user

SQL> select count(*) from hr.employees;

SQL> exit

浏览器测试:

https://192.168.0.1:1158/em

sys/password  sysdba

 

安装rlwrap:

root身份安装

windows下,将rlwrap软件包复制到installation

检查挂载的目录

[root@node1 ~]# cd /installation/

[root@node1 installation]# ls

 

[root@node1 installation]# yum install rlwrap-0.42-1.el6.x86_64.rpm

# vi ~oracle/.bashrc

alias sqlplus=‘rlwrap sqlplus‘

alias rman=‘rlwrap rman‘

 

# su - oracle

$ sqlplus / as sysdba

SQL> select * from hr.employees;

SQL> exi       //退出

 

17.添加启动脚本:

# vi /etc/oratab  把N改为Y

orcl:/u01/app/oracle/product/11.2.0/db_1:Y

 

# vi /etc/rc.d/init.d/oracle

 

#!/bin/bash

#chkconfig:35 99 01

case "$1" in

  start)

        echo -n "Starting Oracle Database & Listener:"

        su - oracle -c ‘dbstart $ORACLE_HOME‘ >/dev/null

        echo "[ ok ]"

 

        echo -n "Starting Oracle EM dbconsole:"

        su - oracle -c "emctl start dbconsole" >/dev/null

        echo "[ ok ]"

 

        touch /var/lock/subsys/oracle

        ;;

  stop)

        echo -n "Shutting Down Oracle EM dbconsole:"

        su - oracle -c "emctl stop dbconsole" >/dev/null

        echo "[ ok ]"

 

        echo -n "Shutting Down Oracle Database & Listener:"

        su - oracle -c ‘dbshut $ORACLE_HOME‘ >/dev/null

        echo "[ ok ]"

 

        rm -f /var/lock/subsys/oracle

        ;;

  *)

        echo "Usage: oracle {start|stop}"

        exit 1

esac

 

 

# chmod 755 /etc/rc.d/init.d/oracle

# chkconfig --add oracle

# chkconfig --list oracle

 

18.删除口令有效期:

# su - oracle

$ sqlplus / as sysdba

SQL> alter profile default limit PASSWORD_LIFE_TIME unlimited;

《oracle安装2》