• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

Install Oracle12cR1 on Oracle Linux 6.5 in VirtualBox

mysql 搞代码 4年前 (2022-01-09) 18次浏览 已收录 0个评论

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/hosts Add your hostname. For example, you host

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/hosts

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

<span><span>127.0.0.1   localhost localhost.localdomain ol65 ol65.localdomain</span></span><span><span>::1              localhost localhost.localdomain ol65 ol65.localdomain</span></span>

When you install oracle linux6.5 there is one step ask domain name. You should add it into /etc/hosts before you start installing. If there is no this domain name there will be an error, installation can’t continue.

PRVF-00002: Could not retrieve local nodename

Cause: Unable to determine local host name using Java network functions.

Action: Ensure that hostname is defined correctly using the ‘hostname’ command.


2. Add or amend the following lines to the /etc/sysctl.conf

fs.file-max = 6815744kernel.sem = 250 32000 100 128kernel.shmmni = 4096kernel.shmall = 1073741824kernel.shmmax = 4398046511104net.core.rmem_default = 262144net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048576fs.aio-max-nr = 1048576net.ipv4.ip_local_port_range = 9000 65500

3. Run the following command to change the current kernel parameters

/sbin/sysctl -p

4. Add the following lines to the /etc/security/limits.conf

oracle   soft   nofile   1024oracle   hard   nofile   65536oracle   soft   nproc    2047oracle   hard   nproc    16384oracle   soft   stack    10240oracle   hard   stack    32768

5. Check and install following packages

yum install binutils -yyum install compat-libcap1 -yyum install compat-libstdc++-33 -yyum install compat-libstdc++-33.i686 -yyum install gcc -yyum install gcc-c++ -yyum install glibc -yyum install glibc.i686 -yyum install glibc-devel -yyum install glibc-devel.i686 -yyum install ksh -yyum install libgcc -yyum install libgcc.i686 -yyum install libstdc++ -yyum install libstdc++.i686 -yyum install libstdc++-devel -yyum install libstdc++-devel.i686 -yyum install libaio -yyum install libaio.i686 -yyum install libaio-devel -yyum install libaio-devel.i686 -yyum install libXext -yyum install libXext.i686 -yyum install libXtst -yyum install libXtst.i686 -yyum install libX11 -yyum install libX11.i686 -yyum install libXau -yyum install libXau.i686 -yyum install libxcb -yyum install libxcb.i686 -yyum install libXi -yyum install libXi.i686 -yyum install make -yyum install sysstat -yyum install unixODBC -yyum install unixODBC-devel -y

6. Create new group and user

**I install Oracle for learning so I simplified this, only created one new user who will be in charge of all oracle related operations. This’s not suitable to product environment.

groupadd -g 54321 oracleuseradd -u 54321 -g oracle oraclepasswd oracle

7. Amend the /etc/security/limits.d/90-nproc.conf

<span># Change this*          soft    nproc    1024# To this* - nproc 16384</span>

8. Change the setting of SELinux to permissive by editing the /etc/selinux/config

SELINUX=permissive

9. Set firewall to enable Oracle DB ports

Open 1521 and 5500, up to you.

10. Create a new file and change its owner

<span>touch /etc/oratabchown -R oracle:oracle /etc/oratab</span>

11. Create install directory

mkdir -p /u01chown -R oracle:oracle /u01

** Login as oracle

12. Unzip installer and run installer

Unzip linuxamd64_12102_database_1of2.zip and linuxamd64_12102_database_2of2.z本文来源gaodai$ma#com搞$$代**码网ip

Go into database folder

Run ./runInstaller



13. Install























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


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

[root@ol65 oraInventory]# ./orainstRoot.shChanging 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.shPerforming root user operation.The following environment variables are set as:   ORACLE_OWNER= oracle   ORACLE_HOME=  /u01/app/oracle/product/12.1.0/dbhome_1Enter 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 byDatabase Configuration Assistant when a database is createdFinished running generic part of root script.Now product-specific root actions will be performed.






Completed!

14. Access EM Database Express URL to test


15. Login as oracle and edit ~/.bash_profile

Add below part inside

# Oracle12c Settingsexport TMP=/tmpexport TMPDIR=$TMPexport ORACLE_HOSTNAME=oracle12c.localdomainexport ORACLE_UNQNAME=oracle12cexport ORACLE_BASE=/u01/app/oracleexport ORACLE_HOME=$ORACLE_BASE/product/12.1.0/dbhome_1export ORACLE_SID=orclexport PATH=/usr/sbin:$PATH:$ORACLE_HOME/binexport LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/libexport 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/functionsRETVAL=0ORA_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/dborareturn $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/dborareturn $RETVAL}restart() {stopstart}case "$1" instart)start;;stop)stop;;restart)restart;;*)echo $"Usage: $0 {start|stop|restart}"exit 1esacexit $?

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!


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:Install Oracle12cR1 on Oracle Linux 6.5 in VirtualBox

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址