数据库
首页 > 数据库> > Centos7 静默安装oracle11g

Centos7 静默安装oracle11g

作者:互联网

Centos7静默安装Oracle11g

5.查看监听端口

netstat -tnpl | grep 1521

image-20210804153622221

​ ps: 如果监听出现问题请查看以下这个教程:

监听显示异常点击

​ 5.数据库安装成功,开始登录数据库

su - oracle
sqlplus / as sysdba

​ 2.更具提示信息进行修改

// 将形如/usr/local/oracle/ora/admin/orcl/pfile/init.ora.742021164145的文件 拷贝到 /usr/local/oracle/ora/product/11.2.0/db_1/dbs/路径下 并改名 
cp /usr/local/oracle/ora/admin/orcl/pfile/init.ora.742021164145  /usr/local/oracle/ora/product/11.2.0/db_1/dbs/initORCL.ora

image-20210804174712511

3.ORA-01102: cannot mount database in EXCLUSIVE mode错误

image-20210804180848982

ORA-01102:异常点击

4.重新启动后:查看数据库版本信息

select * from v$version;

image-20210804181357437

3.新建文件/etc/rc.d/init.d/oracle

vi /etc/rc.d/init.d/oracle

// 文件中添加以下内容    

# processname: oracle
. /etc/rc.d/init.d/functions
LOCKFILE=/var/lock/subsys/oracle
ORACLE_HOME=/usr/local/oracle/ora/product/11.2.0/db_1
ORACLE_USER=oracle
case "$1" in
'start')
   if [ -f $LOCKFILE ]; then
      echo $0 already running.
      exit 1
   fi
   echo -n $"Starting Oracle Database:"
   su - $ORACLE_USER -c "$ORACLE_HOME/bin/lsnrctl start"
   su - $ORACLE_USER -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
   su - $ORACLE_USER -c "$ORACLE_HOME/bin/emctl start dbconsole"
   touch $LOCKFILE
   ;;
'stop')
   if [ ! -f $LOCKFILE ]; then
      echo $0 already stopping.
      exit 1
   fi
   echo -n $"Stopping Oracle Database:"
   su - $ORACLE_USER -c "$ORACLE_HOME/bin/lsnrctl stop"
   su - $ORACLE_USER -c "$ORACLE_HOME/bin/dbshut"
   su - $ORACLE_USER -c "$ORACLE_HOME/bin/emctl stop dbconsole"
   rm -f $LOCKFILE
   ;;
'restart')
   $0 stop
   $0 start
   ;;
'status')
   if [ -f $LOCKFILE ]; then
      echo $0 started.
      else
      echo $0 stopped.
   fi
   ;;
*)
   echo "Usage: $0 [start|stop|status]"
   exit 1
esac
exit 0

4.给/etc/init.d/oracle添加执行权限

chmod +x /etc/init.d/oracle

5.开机启动oracle

systemctl enable oracle
或
chkconfig oracle on

6.给启动文件加权限

cd /usr/local/oracle/ora/product/11.2.0/db_1/bin/
    
chmod 6751 oracle
    
cd /var/tmp
chown -R oracle:oinstall .oracle

7.防火墙配置放开oracle的端口 (默认oracle是 1521端口)

firewall-cmd --zone=public --add-port=1521/tcp --permanent
firewall-cmd --reload

标签:etc,Centos7,静默,export,oracle,ORACLE,HOME,oracle11g,usr
来源: https://www.cnblogs.com/yppaopao/p/15101793.html