grep SwapTotal /proc/meminfo
vim /etc/redhat-release
2.1.删除CentOS Linux release 7.9.2009 (Core)(快捷键dd),改成redhat-7
redhat-7
vim /etc/sysctl.conf
添加以下内容:
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
kernel.shmall = 2097152
kernel.shmmax = 2147483648
net.ipv4.ip_local_port_range = 9000 65500
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.conf.all.rp_filter = 1
net.core.rmem_default = 262144
net.core.rmem_max= 4194304
net.core.wmem_default= 262144
net.core.wmem_max= 1048576
sysctl -p
yum -y install binutils* compat-libcap1* compat-libstdc++* gcc* gcc-c++* glibc* glibc-devel* ksh* libaio* libaio-devel* libgcc* libstdc++* libstdc++-devel* libXi* libXtst* make* sysstat* elfutils* unixODBC* unzip lrzsz
groupadd oinstall
groupadd dba
useradd -g dba -m oracle
usermod -a -G oinstall oracle
passwd oracle
id oracle
mkdir -p /data/oracle
mkdir -p /data/inventory
mkdir -p /data/src
chown -R oracle:oinstall /data/oracle
chown -R oracle:oinstall /data/inventory
chown -R oracle:oinstall /data/src
ll /data
vim /etc/security/limits.conf
添加内容如下:
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
vim /home/oracle/.bashrc
添加内容如下:
export PATH
export ORACLE_BASE=/data/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_SID=orcl
export ORACLE_UNQNAME=orcl
export PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export LANG=C
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
source /home/oracle/.bashrc
unzip linux.x64_11gR2_database_1of2.zip -d /data/src/
unzip linux.x64_11gR2_database_2of2.zip -d /data/src/
chown -R oracle:oinstall /data/src/
ll /data/src/
vim /etc/selinux/config
22.1.修改SELINUX=disabled
disabled
reboot
su oracle
vim /data/src/database/response/db_install.rsp
25.1.按esc,输入/+参数名(例如oracle.install.option),根据以下值修改(要细心,一个也不能错!!!)
注意:按esc,输入/+参数名搜索不到可能是空格问题!参数输入时也要注意空格!!!
oracle.install.option=INSTALL_DB_SWONLY # 安装类型
ORACLE_HOSTNAME=oracle.server # 主机名称
UNIX_GROUP_NAME=oinstall # 安装组
INVENTORY_LOCATION=/data/inventory # INVENTORY目录
SELECTED_LANGUAGES=en,zh_CN # 选择语言
ORACLE_HOME=/data/oracle/product/11.2.0/db_1 # oracle_home
ORACLE_BASE=/data/oracle # oracle_base
oracle.install.db.InstallEdition=EE # oracle版本
oracle.install.db.DBA_GROUP=dba # dba用户组
oracle.install.db.OPER_GROUP=oinstall # oper用户组
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE # 数据库类型
oracle.install.db.config.starterdb.globalDBName=orcl # globalDBName
oracle.install.db.config.starterdb.SID=orcl # SID
oracle.install.db.config.starterdb.characterSet=AL32UTF8 # 默认数据库编码
oracle.install.db.config.starterdb.memoryLimit=800 # 自动管理内存的最小内存(M)
oracle.install.db.config.starterdb.password.ALL=oracle # 设定所有数据库用户使用同一个密码
DECLINE_SECURITY_UPDATES=true # 设置安全更新
oracle.install.option=
INSTALL_DB_SWONLY
ORACLE_HOSTNAME=
oracle.server
UNIX_GROUP_NAME=
oinstall
INVENTORY_LOCATION=
/data/inventory
SELECTED_LANGUAGES=
en,zh_CN
ORACLE_HOME=
/data/oracle/product/11.2.0/db_1
ORACLE_BASE=
/data/oracle
oracle.install.db.InstallEdition=
EE
oracle.install.db.DBA_GROUP=
dba
oracle.install.db.OPER_GROUP=
oinstall
oracle.install.db.config.starterdb.type=
GENERAL_PURPOSE
oracle.install.db.config.starterdb.globalDBName=
orcl
oracle.install.db.config.starterdb.SID=
orcl
oracle.install.db.config.starterdb.characterSet=
AL32UTF8
oracle.install.db.config.starterdb.memoryLimit=
800
oracle.install.db.config.starterdb.password.ALL=
oracle
DECLINE_SECURITY_UPDATES=
true
/data/src/database/runInstaller -silent -responseFile /data/src/database/response/db_install.rsp -ignorePrereq
漫长的等待......
在另一个窗口输入命令如下:
/data/oracle/product/11.2.0/db_1/root.sh
vim /data/src/database/response/netca.rsp
28.1.按esc,输入/+参数名(例如INSTALL_TYPE),根据以下值修改(要细心,一个也不能错!!!)
INSTALL_TYPE=""custom"" # 安装的类型
LISTENER_NUMBER=1 # 监听器数量
LISTENER_NAMES={"LISTENER"} # 监听器的名称列表
LISTENER_PROTOCOLS={"TCP;1521"} # 监听器使用的通讯协议列表
LISTENER_START=""LISTENER"" # 监听器启动的名称
INSTALL_TYPE=
""custom""
LISTENER_NUMBER=
1
LISTENER_NAMES=
{"LISTENER"}
LISTENER_PROTOCOLS=
{"TCP;1521"}
LISTENER_START=
""LISTENER""
/data/oracle/product/11.2.0/db_1/bin/netca /silent /responseFile /data/src/database/response/netca.rsp
vim /data/src/database/response/dbca.rsp
30.1.按esc,输入/+参数名(例如RESPONSEFILE_VERSION),根据以下值修改(要细心,一个也不能错!!!)
RESPONSEFILE_VERSION ="11.2.0" // 不要变哦
OPERATION_TYPE ="createDatabase" // 操作为创建实例
GDBNAME ="orcl" // 数据库实例名
SID ="orcl" // 实例名字
TEMPLATENAME = "General_Purpose.dbc" // 建库用的模板文件
SYSPASSWORD = "oracle" // SYS管理员密码
SYSTEMPASSWORD = "oracle" // SYSTEM管理员密码
SYSMANPASSWORD= "oracle"
DBSNMPPASSWORD= "oracle"
DATAFILEDESTINATION =/data/oracle/oradata // 数据文件存放目录
RECOVERYAREADESTINATION=/data/oracle/flash_recovery_area // 恢复数据存放目录
CHARACTERSET ="AL32UTF8" // 字符集
NATIONALCHARACTERSET= "AL16UTF16" // 字符集
TOTALMEMORY ="1638" // 1638MB,物理内存2G*80%
RESPONSEFILE_VERSION =
"11.2.0"
OPERATION_TYPE =
"createDatabase"
GDBNAME =
"orcl"
SID =
"orcl"
TEMPLATENAME =
"General_Purpose.dbc"
SYSPASSWORD =
"oracle"
SYSTEMPASSWORD =
"oracle"
SYSMANPASSWORD=
"oracle"
DBSNMPPASSWORD=
"oracle"
DATAFILEDESTINATION =
/data/oracle/oradata
RECOVERYAREADESTINATION=
/data/oracle/flash_recovery_area
CHARACTERSET =
"AL32UTF8"
NATIONALCHARACTERSET=
"AL16UTF16"
TOTALMEMORY =
"1638"
/data/oracle/product/11.2.0/db_1/bin/dbca -silent -responseFile /data/src/database/response/dbca.rsp
ps -ef | grep ora_ | grep -v grep
vim /data/oracle/product/11.2.0/db_1/bin/dbstart
33.1.将ORACLE_HOME_LISTNER=$1修改为ORACLE_HOME_LISTNER=/data/oracle/product/11.2.0/db_1
ORACLE_HOME_LISTNER
/data/oracle/product/11.2.0/db_1
vim /data/oracle/product/11.2.0/db_1/bin/dbshut
33.2.同上,将ORACLE_HOME_LISTNER=$1修改为ORACLE_HOME_LISTNER=/data/oracle/product/11.2.0/db_1
ORACLE_HOME_LISTNER
/data/oracle/product/11.2.0/db_1
vim /etc/oratab
34.1.将orcl:/data/oracle/product/11.2.0:N修改为orcl:/data/oracle/product/11.2.0:Y
/data/oracle/product/11.2.0/db_1/bin/dbstart
chmod +x /etc/rc.d/rc.local
vim /etc/rc.d/rc.local
在文件最后追加以下内容:
su oracle -lc "/data/oracle/product/11.2.0/db_1/bin/lsnrctl start"
su oracle -lc "/data/oracle/product/11.2.0/db_1/bin/dbstart"
sqlplus / as sysdba