實驗在Debian 上安裝 Oracle 11gR2
大家好!
今天總監要我幫忙安裝oracle資料庫,當我登入上去發現和平時的不太一樣,原來是debian系統,這個還真沒安裝過oracle,趕快去官方文件查詢安裝手冊,居然沒有,只能按照linux的安裝啦!
1.安裝vncserver
root@db100:/etc/apt#apt-get install vnc4server
如果報:E: Unable to locate package vnc4server 錯誤,
則執行 root@db100:/etc/apt#apt-get update後,
重新執行root@db100:/etc/apt#apt-get install vnc4server
輸入vnc密碼:終端輸入 vncpasswd ,提示輸入密碼即可
配置vncserver自動啟動:
vi /etc/init.d/vncserver
#! /bin/sh
export USER="root"
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/bin/X11"
NAME=vncstart
start()
{
su - $USER -c"vncserver :5"
}
stop()
{
su - $USER -c"vncserver -clean -kill :1"
}
case "$1" in
start)
echo -n "Starting Xvnc: "
start
;;
stop)
echo -n "Stopping Xvnc "
stop
;;
restart)
echo -n "Restarting Xvnc "
stop
start
;;
****)
echo "Usage: /etc/init.d/$NAME {start|stop|restart}"
exit 1
;;
esac
exit 0
export USER="root"
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/bin/X11"
NAME=vncstart
start()
{
su - $USER -c"vncserver :5"
}
stop()
{
su - $USER -c"vncserver -clean -kill :1"
}
case "$1" in
start)
echo -n "Starting Xvnc: "
start
;;
stop)
echo -n "Stopping Xvnc "
stop
;;
restart)
echo -n "Restarting Xvnc "
stop
start
;;
****)
echo "Usage: /etc/init.d/$NAME {start|stop|restart}"
exit 1
;;
esac
exit 0
儲存,設定為可執行,並加入到服務列表
chmod +x /etc/init.d/vncserver
update-rc.d vncserver defaults 98
update-rc.d vncserver defaults 98
2.安裝rpm,unzip等oracle需要的包
root@db100:/etc/apt# apt-get install unzip rpm gawk
3.建立oracle使用者和組
addgroup oinstall
addgroup dba
addgroup nobody
useradd -g oinstall -G dba -p oracle -s /bin/bash -d /home/oracle -m oracle
usermod -g nobody nobody
addgroup dba
addgroup nobody
useradd -g oinstall -G dba -p oracle -s /bin/bash -d /home/oracle -m oracle
usermod -g nobody nobody
4.建立安裝目錄
mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01/app/oracle
chmod -R 755 /u01/app/oracle
chown -R oracle:oinstall /u01/app/oracle
chmod -R 755 /u01/app/oracle
5.對部分檔案建軟連線
ln -s /usr/bin/awk /bin/awk
ln -s /usr/bin/rpm /bin/rpm
ln -s /usr/bin/basename /bin/basename
ln -s /usr/bin/awk /bin/awk
ln -s /usr/bin/rpm /bin/rpm
ln -s /usr/bin/basename /bin/basename
6.欺騙oracle 模擬 CentOS 的環境
echo "CentOS release 6.3 (Final)" > /etc/redhat-release
mkdir /etc/rc.d
ln -s /etc/rc0.d /etc/rc.d/rc0.d
ln -s /etc/rc2.d /etc/rc.d/rc2.d
ln -s /etc/rc3.d /etc/rc.d/rc3.d
ln -s /etc/rc4.d /etc/rc.d/rc4.d
ln -s /etc/rc5.d /etc/rc.d/rc5.d
ln -s /etc/rc6.d /etc/rc.d/rc6.d
ln -s /etc/init.d /etc/rc.d/init.d
echo "CentOS release 6.3 (Final)" > /etc/redhat-release
mkdir /etc/rc.d
ln -s /etc/rc0.d /etc/rc.d/rc0.d
ln -s /etc/rc2.d /etc/rc.d/rc2.d
ln -s /etc/rc3.d /etc/rc.d/rc3.d
ln -s /etc/rc4.d /etc/rc.d/rc4.d
ln -s /etc/rc5.d /etc/rc.d/rc5.d
ln -s /etc/rc6.d /etc/rc.d/rc6.d
ln -s /etc/init.d /etc/rc.d/init.d
7.修改核心引數
# vi /etc/sysctl.conf
kernel.shmall = 4194304
kernel.shmmax = 524288000 --記憶體大小根據安裝環境調整
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500
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
# sysctl -p --使修改生效
# vi /etc/sysctl.conf
kernel.shmall = 4194304
kernel.shmmax = 524288000 --記憶體大小根據安裝環境調整
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500
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
# sysctl -p --使修改生效
8.修改資源限制
# vi /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft memlock 33554432
oracle hard memlock 33554432
# vi /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft memlock 33554432
oracle hard memlock 33554432
9.修改安全限制
vi /etc/pam.d/login
session required /lib64/security/pam_limits.so
session required pam_limits.so
vi /etc/pam.d/login
session required /lib64/security/pam_limits.so
session required pam_limits.so
10.登入oracle使用者,設定oracle使用者環境變數
設定環境變數
su - oracle
# vi /home/oracle/.bashrc
umask 022
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/11.2.0.3/db_1
ORACLE_SID=Aning
export ORACLE_BASE ORACLE_HOME ORACLE_SID
export PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin:/usr/bin:/sbin
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
su - oracle
# vi /home/oracle/.bashrc
umask 022
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/11.2.0.3/db_1
ORACLE_SID=Aning
export ORACLE_BASE ORACLE_HOME ORACLE_SID
export PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin:/usr/bin:/sbin
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
source /home/oracle/.bashrc
11.使用vnc安裝
# xhost +
# su - oracle
$ cd /u01/soft/database (切換到 Oracle 安裝檔案所在的目錄)
$ ./runInstaller --只安裝軟體
# su - oracle
$ cd /u01/soft/database (切換到 Oracle 安裝檔案所在的目錄)
$ ./runInstaller --只安裝軟體
根據oracle提示安裝需要的包:
安裝所需元件
root@db100:/etc/apt#apt-get install gcc g++ make binutils libc6 libc6-dev libstdc++6 libstdc++5 rpm gawk alien lesstif2 libmotif4 libaio1 elfutils libaio-dev sysstat unixodbc-bin unixodbc-dev pdksh
root@db100:/etc/apt#apt-get install gcc g++ make binutils libc6 libc6-dev libstdc++6 libstdc++5 rpm gawk alien lesstif2 libmotif4 libaio1 elfutils libaio-dev sysstat unixodbc-bin unixodbc-dev pdksh
安裝java
apt-get install sun-java6-jdk
12.dbca建立資料庫
# xhost +
# su - oracle
#dbca
# su - oracle
#dbca
13.配置oracle自動啟動
# vi /etc/init.d/oracle
#!/bin/bash
#!/bin/bash
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/11.2.0.3/db_1
ORACLE_OWNER=oracle
ORACLE_SID=Aning
ORACLE_UNQNAME=Aning
ORACLE_HOME_LISTNER=$ORACLE_HOME
PATH=$PATH:$ORACLE_HOME/bin
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export ORACLE_BASE ORACLE_HOME ORACLE_OWNER
export ORACLE_SID ORACLE_UNQNAME ORACLE_HOME_LISTNER
export PATH LD_LIBRARY_PATH CLASSPATH
ORACLE_HOME=/u01/app/oracle/product/11.2.0.3/db_1
ORACLE_OWNER=oracle
ORACLE_SID=Aning
ORACLE_UNQNAME=Aning
ORACLE_HOME_LISTNER=$ORACLE_HOME
PATH=$PATH:$ORACLE_HOME/bin
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export ORACLE_BASE ORACLE_HOME ORACLE_OWNER
export ORACLE_SID ORACLE_UNQNAME ORACLE_HOME_LISTNER
export PATH LD_LIBRARY_PATH CLASSPATH
# if the executables do not exist -- display error
if [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]
then
echo "Oracle startup: cannot start"
exit 1
fi
then
echo "Oracle startup: cannot start"
exit 1
fi
# depending on parameter -- startup, shutdown, restart
# of the instance and listener or usage display
# of the instance and listener or usage display
case "$1" in
start)
# Oracle listener and instance startup
echo -n "Starting Oracle: "
su $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl start"
su $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
touch /var/lock/oracle
su $ORACLE_OWNER -c "$ORACLE_HOME/bin/emctl start dbconsole"
echo "OK"
;;
stop)
# Oracle listener and instance shutdown
echo -n "Shutdown Oracle: "
su $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl stop"
su $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME"
rm -f /var/lock/oracle
su $ORACLE_OWNER -c "$ORACLE_HOME/bin/emctl stop dbconsole"
echo "OK"
;;
reload|restart)
$0 stop
$0 start
;;
*)
echo "Usage: `basename $0` start|stop|restart|reload"
exit 1
esac
exit 0
# chmod a+x /etc/init.d/oracledb
# update-rc.d oracle defaults 99
# vi /etc/oratab
Aning:/u01/app/oracle/product/11.2.0.3/db_1:Y
start)
# Oracle listener and instance startup
echo -n "Starting Oracle: "
su $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl start"
su $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
touch /var/lock/oracle
su $ORACLE_OWNER -c "$ORACLE_HOME/bin/emctl start dbconsole"
echo "OK"
;;
stop)
# Oracle listener and instance shutdown
echo -n "Shutdown Oracle: "
su $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl stop"
su $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME"
rm -f /var/lock/oracle
su $ORACLE_OWNER -c "$ORACLE_HOME/bin/emctl stop dbconsole"
echo "OK"
;;
reload|restart)
$0 stop
$0 start
;;
*)
echo "Usage: `basename $0` start|stop|restart|reload"
exit 1
esac
exit 0
# chmod a+x /etc/init.d/oracledb
# update-rc.d oracle defaults 99
# vi /etc/oratab
Aning:/u01/app/oracle/product/11.2.0.3/db_1:Y
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/12457158/viewspace-753442/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle 11gR2 在Linux平臺上安裝體驗OracleLinux
- 在Debian上安裝freeswitch
- 在 Debian 和 Ubuntu 上安裝 Cutefish 可愛魚Ubuntu
- debian 7上安裝svn
- Oracle 11gR2 for Linux 初次安裝體驗OracleLinux
- Oracle 11GR2 在CentOS 7 上的單例項靜默安裝OracleCentOS單例
- 在 Debian 上安裝 IntelliJ IDEA 筆記(含 JDK 的安裝)IntelliJIdea筆記JDK
- Debian 32位Oracle安裝Oracle
- Oracle 11gR2 for Linux RAC 初次安裝體驗OracleLinux
- 在 Debian 64 位上安裝 wkhtmltopdf 時遇到的問題HTML
- Oracle在Linux上的安裝OracleLinux
- oracle 11gr2 rac 安裝Oracle
- 在基於RedHat或Debian的系統上安裝 Wine 1.7Redhat
- 轉享:在ubuntu 和 debian上安裝 NOSQL cassandra資料庫UbuntuSQL資料庫
- 在Debian上安裝輕量級入侵監測系統(轉)
- 【oracle】靜默安裝 oracle 11gr2Oracle
- 在Debian 9 (Stretch)安裝Dotclear
- Debian下安裝Oracle10gOracle
- 【配置上線】靜默安裝資料庫Oracle 11gR2資料庫Oracle
- 在Oracle Linux 7.1上安裝DockerOracleLinuxDocker
- 在Solaris 11上安裝Oracle 11.2.0.3Oracle
- 【RAC安裝】 AIX下安裝Oracle 11gR2 RACAIOracle
- Debian安裝
- 安裝oracle 11GR2 手記Oracle
- 在Linux(Debian)下安裝mono(轉)LinuxMono
- 在debian中安裝Java環境(轉)Java
- 圖解SLES 11 SP3+Oracle 11gR2 RAC在VirtualBOX上的安裝與部署圖解Oracle
- 在FC5上安裝oracle 9204Oracle
- 在Redhat 9上安裝 Oracle 817心(轉)RedhatOracle
- 在Oracle Linux 6.6上安裝Oracle 12cOracleLinux
- Solaris 10.5 安裝Oracle 11gR2Oracle
- Debian Docker 安裝Docker
- Debian安裝ChromeChrome
- Debian安裝MySQLMySql
- 在Debian Woody (Stable) 下安裝 2.6 核心(轉)
- 在linux下實施goldengate11.2for oracle 11gR2安裝配置文件LinuxGoOracle
- Oracle 10G在fedora core4上的安裝Oracle 10G在fedora core4上的安裝Oracle 10g
- debian安裝和解除安裝vmware