您的位置:首页 > 博客中心 > 数据库 >

Install Oracle12cR1 on Oracle Linux 6.5 in VirtualBox

时间:2022-03-14 01:26

My Oralce Linux 6.5 is running on VirtualBox. Basic settings is 4G memory, 50G hard-disk, auto partition when install OL6.5.

 

** Following series of operations need root privilege.

1. Edit /etc/host

Add your hostname. For example, you host name ol65.localdomain then



gxlsystem.com,布布扣

gxlsystem.com,布布扣

gxlsystem.com,布布扣

gxlsystem.com,布布扣

gxlsystem.com,布布扣

gxlsystem.com,布布扣

gxlsystem.com,布布扣

gxlsystem.com,布布扣

gxlsystem.com,布布扣

gxlsystem.com,布布扣


** Stop here! Open console, login as root, run these two scripts


1) /u01/app/oraInventory/orainstRoot.sh

[root@ol65 oraInventory]# ./orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /u01/app/oraInventory to oracle.
The execution of the script is complete.

2) /u01/app/oracle/product/12.1.0/dbhome_1/root.sh

[root@ol65 dbhome_1]# ./root.sh
Performing root user operation.

The following environment variables are set as:
   ORACLE_OWNER= oracle
   ORACLE_HOME=  /u01/app/oracle/product/12.1.0/dbhome_1

Enter the full pathname of the local bin directory: [/usr/local/bin]:
  Copying dbhome to /usr/local/bin ...
  Copying oraenv to /usr/local/bin ...
  Copying coraenv to /usr/local/bin ...


Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.


gxlsystem.com,布布扣

gxlsystem.com,布布扣

gxlsystem.com,布布扣
Completed!

14. Access EM Database Express URL to test

gxlsystem.com,布布扣

15. Login as oracle and edit ~/.bash_profile

Add below part inside
# Oracle12c Settings
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_HOSTNAME=oracle12c.localdomain
export ORACLE_UNQNAME=oracle12c
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/dbhome_1
export ORACLE_SID=orcl
export PATH=/usr/sbin:$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

16. Set auto startup

Login as root

1) Edit /etc/oratab, change N to Y as below

orcl:/u01/app/oracle/product/12.1.0/dbhome_1:Y

2) Create file /etc/init.d/dbora and add following content

#!/bin/sh
# chkconfig: 345 99 10
# description: Service to start and stop Oracle Database and Listener
#
# processname: oracle
# config: /etc/oratab
# pidfile: /var/run/oracle.pid

# Source function library.
. /etc/init.d/functions

RETVAL=0
ORA_OWNER="oracle"
ORA_HOME="/u01/app/oracle/product/12.1.0/dbhome_1"

# See how we were called.

prog="oracle"

start() {
echo -n $"Starting $prog: "
su - $ORA_OWNER -c "$ORA_HOME/bin/dbstart $ORA_HOME"
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/dbora

return $RETVAL
}

stop() {
echo -n $"Stopping $prog: "
su - $ORA_OWNER -c "$ORA_HOME/bin/dbshut $ORA_HOME"
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -r /var/lock/subsys/dbora

return $RETVAL
}

restart() {
stop
start
}

case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
esac

exit $?
ORA-OWNER and ORA_HOME should math your own condition.

Next you need to run the following commands to change permissions and make the service active.

chgrp oracle /etc/init.d/dbora 
chmod 755 /etc/init.d/dbora 
chkconfig --level 345 dbora on

3) Reboot server
reboot

Congratulation!

热门排行

今日推荐

热门手游