在Linux上进行Oracle存储管理涉及多个步骤,包括环境准备、安装Oracle数据库、配置存储参数、监控和管理存储等。以下是详细的步骤和建议:
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# systemctl stop NetworkManager
[root@localhost ~]# systemctl disable NetworkManager
[root@localhost ~]# setenforce 0
sed -i "/^SELINUX=/s#enforcing#disabled#" /etc/selinux/config
[root@localhost ~]# cat >> /etc/hosts <<EOF
192.168.8.220 host_db
EOF
[root@localhost ~]# hostnamectl set-hostname host_db
[root@host-db ~]# groupadd dba
[root@host-db ~]# groupadd oper
[root@host-db ~]# groupadd oinstall
[root@host-db ~]# useradd -g oinstall -G dba,oper oracle
[root@host-db ~]# echo "oracle" | passwd --stdin
[root@host-db ~]# mkdir -p /opt/oracle/app/oraInventory
[root@host-db ~]# mkdir -p /opt/oracle/app/oracle/product/19.3.0/dbhome_1
[root@host-db ~]# chown -R oracle:oinstall /opt/oracle
[root@host-db ~]# chmod -R 775 /opt/oracle
[oracle@host-db ~]$su - oracle
[oracle@host-db ~]$ vi .bash_profile
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_HOSTNAME=host_db
export ORACLE_UNQNAME=orclexport
export ORACLE_BASE=/opt/oracle/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/19.3.0/dbhome_1
export ORACLE_SID=orclexport
export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
/etc/hosts
文件包含服务器的完全限定名。[root@host-db ~]# dnf install -y oracle-database-preinstall-19c
/etc/sysctl.conf
或/etc/sysctl.d/98-oracle.conf
文件,添加以下行:fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
kernel.panic_on_oops = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2
[root@host-db ~]# cd /opt/oracle/database/19.3.0/dbhome_1
[root@host-db dbhome_1]# ./runInstaller
du -k * | sort -nr | cut -f2 | xargs -d '\n' du -sh | more
find /oracle -name "*trc" -print | xargs rm -rf
find /oracle -name "*.log" -mtime +3 -print | xargs rm -rf
netstat -anpT | grep oracleSID | awk '{print $5}' | grep -o -E '1.*:' | awk -F ':' '{print $1}' | sort
netstat -anpT | grep 1521 | awk '{print $5}' | grep -o -E '1.*:' | awk -F ':' '{print $1}' | sort
kill -9 `ps -ef | grep oracleSID | grep LOCAL=NO | grep -v grep | awk '{print $2}'`
iostat -d -x -m 1 3
sar -s 08:00:00 -e 10:00:00
通过以上步骤,你可以在Linux上进行有效的Oracle存储管理。这些命令和配置有助于确保系统的安全性和性能。
辰迅云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
推荐阅读: linux中如何把文件放入目录