Linux课堂笔记--第九天

替代

 cd /media/OL6.4\ x86_64\ Disc\ 1\ 20130225/Packages/

 Yuminstall  oracle-rdbms-server-11gR2-preinstall-1.0-7.el6.x86_64.rpm

使用hosts文件解析主机名:

# hostname

node1.test.com

# vi /etc/hosts

在物理主机中解压缩2个安装包,然后共享给虚拟机,命令如下:

 

# mkdir /installation

# mount -t vboxsf installation /installation

# cd /installation

# unzip p10404530_112030_Linux-x86-64_1of7.zip

# unzip p10404530_112030_Linux-x86-64_2of7.zip

 

图形界面安装:

# xhost +

# su - oracle

$ cd /database/

$ ./runInstaller

 

以root身份执行两个脚本

 

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

$ netca

$ lsnrctl status

$ netstat -tlnp | grep 1521

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

$ dbca

通用或事务处理 

Orcl  orcl

选中样板资源   内存1200

数据库字符级    

 

 

测试:

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:

 

在 windows下,将rlwrap安装包移到installation

Root身份安装

# 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;

 

 

添加启动脚本:

# 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

 

 

k# chkconfig --add oracle

# chkconfig --list oracle

 

删除口令有效期:

# su - oracle

$ sqlplus / as sysdba

SQL> alter profile default limit PASSWORD_LIFE_TIME unlimited;

 

正常关闭 退出后冲进从新$ sqlplus / as sysdba检查

 

数据库用户:

SYS管理员

SYSTEM 操作员

DBSNMP简单网络管理协议      信息   

SYSMAN   自动化任务   维护账户

 

Unicode 统一编码   UTF8   存储方式

 

posted on 2017-07-26 18:25  看透ら不说透  阅读(125)  评论(0编辑  收藏  举报