systemctl stop firewalld
永久关闭:systemctl disable firewalld
setenforce 0
永久关闭:vim /etc/selinux/config
设置SELINUX= enforcing 为SELINUX=disabled
rpm -qp gcc make binutils gcc-c++ compat-libstdc++-33 elfutils-libelf-devel elfutils-libelf-devel-static ksh libaio libaio-devel numactl-devel sysstat unixODBC unixODBC-devel pcre-devel libXtst-devel
yum -y install gcc make binutils gcc-c++ compat-libstdc++-33 elfutils-libelf-devel elfutils-libelf-devel-static ksh libaio libaio-devel numactl-devel sysstat unixODBC unixODBC-devel pcre-devel libXtst-devel libXtst-devel unzip
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
passwd oracle
vim /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
mkdir -p /u01/app/oracle/product/11.2.0
mkdir /u01/app/oracle/oradata
mkdir /u01/app/oracle/inventory
mkdir /u01/app/oracle/fast_recovery_area
chown -R oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/app/oracle
su - oracle
vim /home/oracle/.bash_profile
添加:
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/11.2.0
ORACLE_SID=orcl
PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
export NLS_DATE_FORMAT='yyyy-mm-dd hh24:mi:ss'
立即生效:source /home/oracle/.bash_profile
unzip linux.x64_11gR2_database_1of2.zip
unzip linux.x64_11gR2_database_2of2.zip
vim /tmp/database/response/db_install.rsp
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=localhost
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oracle/inventory
SELECTED_LANGUAGES=en,zh_CN
ORACLE_HOME=/u01/app/oracle/product/11.2.0
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=dba
DECLINE_SECURITY_UPDATES=true
cd /tmp/database
./runInstaller -silent -force -ignorePrereq -responseFile /tmp/database/response/db_install.rsp
出现Successfully Setup Software代表安装完成
sh /u01/app/oracle/inventory/orainstRoot.sh
sh /u01/app/oracle/product/11.2.0/root.sh
netca -silent -responseFile /tmp/database/response/netca.rsp
显示这个代表成功继续下一步:
****DISPLAY environment variable not set!
Oracle Net Configuration Assistant is a GUI tool
which requires that DISPLAY specify a location
where GUI tools can display.
Set and export DISPLAY, then re-run.
则需要执行命令: export DISPLAY=localhost:0.0 配置DISPLAY变量 然后重新执行netca命令
netstat -anp|grep 1521
vim /tmp/database/response/dbca.rsp
GDBNAME = "orcl"
SID = "orcl"
SYSPASSWORD = "oracle"
SYSTEMPASSWORD = "oracle"
SYSMANPASSWORD = "oracle"
DBSNMPPASSWORD = "oracle"
DATAFILEDESTINATION =/u01/app/oracle/oradata
RECOVERYAREADESTINATION=/u01/app/oracle/fast_recovery_area
CHARACTERSET = "ZHS16GBK"
TOTALMEMORY = "800"
dbca -silent -responseFile /tmp/database/response/dbca.rsp
ps -ef | grep ora_ | grep -v grep
lsnrctl start
lsnrctl status
lsnrctl reload
sqlplus / as sysdba
startup
select name from v$database
sqlplus system/oracle@192.168.52.130:1521/orcl
vim /u01/app/oracle/start_ora.sh
#!/bin/sh
lsnrctl start
echo "Oracle just have been started!"
echo "Begin to start the oracle!"
sqlplus /nolog <<EOF
connect / as sysdba
startup
exit
EOF
exit
vim /etc/rc.d/rc.local
su - oracle -c "/u01/app/oracle/start_ora.sh"
chmod 755 /etc/rc.d/rc.local
chmod 755 /u01/app/oracle/start_ora.sh
shutdown abort --不建议使用
评论