虚拟机版本:centos7.9
虚拟机ip:192.168.5.144
oracle版本:11g
oracle安装包:p13390677_112040_Linux-x86-64_1of7.zip,p13390677_112040_Linux-x86-64_2of7.zip,p13390677_112040_Linux-x86-64_3of7.zip
yum -y install binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel expat gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers libaio libaio-devel libgcc libstdc++ libstdc++-devel make pdksh sysstat unixODBC unixODBC-devel
groupadd oinstall
groupadd dba
groupadd asmadmin
groupadd asmdba
useradd -g oinstall -G dba,asmdba oracle -d /home/oracle
passwd oracle
vim /etc/sysctl.conf
fs.aio-max-nr=1048576
fs.file-max=6815744
kernel.shmall=2097152
kernel.shmmni=4096
kernel.shmmax = 1073741824
kernel.sem=250 32000 100 128
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=1048586
sysctl -p
vim /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
vim /etc/pam.d/login
session required /lib64/security/pam_limits.so
session required pam_limits.so
vim /etc/profile
if [ $USER = "oracle" ]; thenif [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536else
ulimit -u 16384 -n 65536fifi
mkdir -p /db/app/oracle/product/11.2.0
mkdir /db/app/oracle/oradata
mkdir /db/app/oracle/inventory
mkdir /db/app/oracle/fast_recovery_area
chown -R oracle:oinstall /db/app/oracle
chmod -R 775 /db/app/oracle
su oracle
vim .bash_profile
umask 022
export ORACLE_HOSTNAME=centos-oracle
export ORACLE_BASE=/db/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/
export ORACLE_SID=ORCL
export PATH=.:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$ORACLE_HOME/jdk/bin:$PATH
export LC_ALL="en_US"
export LANG="en_US"
export NLS_LANG="AMERICAN_AMERICA.ZHS16GBK"
export NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"
source .bash_profile
unzip p13390677_112040_Linux-x86-64_1of7.zip -d /db/
unzip p13390677_112040_Linux-x86-64_2of7.zip -d /db/
unzip p13390677_112040_Linux-x86-64_3of7.zip -d /db/
mkdir /db/etc/
cp /db/database/response/* /db/etc/
vim /db/etc/db_install.rsp
oracle.install.option=INSTALL_DB_SWONLY
DECLINE_SECURITY_UPDATES=true
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/db/app/oracle/inventory
SELECTED_LANGUAGES=en,zh_CN
ORACLE_HOSTNAME=centos-oracle
ORACLE_HOME=/db/app/oracle/product/11.2.0
ORACLE_BASE=/db/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=dba
su oracle
cd /db/database
./runInstaller -silent -ignorePrereq -responseFile /db/etc/db_install.rsp
sh /db/app/oracle/inventory/orainstRoot.sh
sh /db/app/oracle/product/11.2.0/root.sh
su oracle
netca /silent /responsefile /db/etc/netca.rsp
切换为root用户
su root
vim /db/etc/dbca.rsp
GDBNAME = "orcl"
SID = "orcl"
SYSPASSWORD = "oracle"
SYSTEMPASSWORD = "oracle"
SYSMANPASSWORD = "oracle"
DBSNMPPASSWORD = "oracle"
DATAFILEDESTINATION =/db/app/oracle/oradata
RECOVERYAREADESTINATION=/db/app/oracle/fast_recovery_area
CHARACTERSET = "AL32UTF8"
TOTALMEMORY = "1638"
su oracle
dbca -silent -responseFile /db/etc/dbca.rsp
cp /db/app/oracle/admin/orcl/pfile/init.ora.8420191849 /db/app/oracle/product/11.2.0/dbs/initORCL.ora
vim /etc/fstab
tmpfs /dev/shm tmpfs defaults,size=4G 0 0
mount -o remount,size=4G /dev/shm
sqlplus / as sysdba
SQL> startup
ORACLE instance started.
Total System Global Area 1720328192 bytes
Fixed Size 2253944 bytes
Variable Size 1056967560 bytes
Database Buffers 654311424 bytes
Redo Buffers 6795264 bytes
ORA-01102: cannot mount database in EXCLUSIVE mode
报错无法启动
cd $ORACLE_HOME/dbs
rm -rf lkORCL
再次启动
SQL> startup
ORACLE instance started.
Total System Global Area 1720328192 bytes
Fixed Size 2253944 bytes
Variable Size 1056967560 bytes
Database Buffers 654311424 bytes
Redo Buffers 6795264 bytes
ORA-00205: error in identifying control file, check alert log for more info
查看共享内存段
ipcs -map
根据ID号清除共享内存段
查看信号量
ipcs -s
根据semid清除信号量
再次启动
SQL> startup
ORACLE instance started.
Total System Global Area 1720328192 bytes
Fixed Size 2253944 bytes
Variable Size 1056967560 bytes
Database Buffers 654311424 bytes
Redo Buffers 6795264 bytes
Database mounted.
Database opened.
SQL> select status from v$instance;
STATUS
------------------------
OPEN