1. 程式人生 > >《oracle安裝2》

《oracle安裝2》

start bst limit tca 復制 事務 zip sta 界面

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

[[email protected] 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 [email protected] 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

檢查掛載的目錄

[[email protected] ~]# cd /installation/

[[email protected] installation]# ls

[[email protected] 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》