安装环境
1、centos 7
2、内存 64G
3、磁盘1T
安装步骤
1、上传安装包
2、格式磁盘
3、安装依赖
4、修改配置
格式磁盘
fdisk -l
pvcreate /dev/sdb
fdisk /dev/sdb
n p 1 8e :w
pvcreate /dev/sdb1
vgcreate oracle_data /dev/sdb1
lvcreate -l 100%Free -n data1 oracle_data
mkfs.xfs /dev/oracle_data/data1
mount /dev/oracle_data/data1 /data
blkid -s UUID
vim /etc/fstab
修改配置
vim /etc/sysctl.conf
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152 //此行默认已有,确认不低于此数即可
kernel.shmmax = 536870912 //此行默认已有,确认不低于此数即可 内存*0.8 * 1024 * 1024
kernel.shmmni = 4096
kernel.sem = 250 32000 100128
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 = 1048576
vim db_install.rsp
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=localhost
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/home/data/u01/app/oraInventory
SELECTED_LANGUAGES=en
ORACLE_HOME=/home/data/u01/app/oracle/product/11.2.0/db_1
ORACLE_BASE=/home/data/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.EEOptionsSelection=false
oracle.install.db.optionalComponents=oracle.rdbms.partitioning:11.2.0.4.0,oracle.oraolap:11.2.0.4.0,oracle.rdbms.dm:11.2.0.4.0,oracle.rdbms.dv:11.2.0.4.0,oracle.rdbms.lbac:11.2.0.4.0,oracle.rdbms.rat:11.2.0.4.0
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=dba
oracle.install.db.CLUSTER_NODES=
oracle.install.db.isRACOneInstall=
oracle.install.db.racOneServiceName=
oracle.install.db.config.starterdb.type=
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.memoryOption=true
oracle.install.db.config.starterdb.memoryLimit=15943
oracle.install.db.config.starterdb.installExampleSchemas=false
oracle.install.db.config.starterdb.enableSecuritySettings=true
oracle.install.db.config.starterdb.password.ALL=xiaozhangboo
oracle.install.db.config.starterdb.password.SYS=
oracle.install.db.config.starterdb.password.SYSTEM=
oracle.install.db.config.starterdb.password.SYSMAN=
oracle.install.db.config.starterdb.password.DBSNMP=
oracle.install.db.config.starterdb.control=DB_CONTROL
oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=
oracle.install.db.config.starterdb.automatedBackup.enable=false
oracle.install.db.config.starterdb.automatedBackup.osuid=
oracle.install.db.config.starterdb.automatedBackup.ospwd=
oracle.install.db.config.starterdb.storageType=
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=/home/data/oracle/oradata
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=/home/data/oracle/fast_recovery_area
oracle.install.db.config.asm.diskGroup=
oracle.install.db.config.asm.ASMSNMPPassword=
MYORACLESUPPORT_USERNAME=
MYORACLESUPPORT_PASSWORD=
SECURITY_UPDATES_VIA_MYORACLESUPPORT=
DECLINE_SECURITY_UPDATES=true
PROXY_HOST=
PROXY_PORT=
PROXY_USER=
PROXY_PWD=
PROXY_REALM=
COLLECTOR_SUPPORTHUB_URL=
oracle.installer.autoupdates.option=
oracle.installer.autoupdates.downloadUpdatesLoc=
AUTOUPDATES_MYORACLESUPPORT_USERNAME=
AUTOUPDATES_MYORACLESUPPORT_PASSWORD=
./runInstaller -silent -responseFile /home/oracle/database/response/db_install.rsp -ignoreSysPrereqs
vim /home/oracle/database/response/dbca.rsp
RESPONSEFILE_VERSION ="11.2.0"//不能更改
OPERATION_TYPE ="createDatabase" GDBNAME ="dg1"//全局数据库的名字=SID+主机域名
SID ="dg1"//对应的实例名字
TEMPLATENAME ="General_Purpose.dbc"//建库用的模板文件
SYSPASSWORD ="sys"//SYS管理员密码
SYSTEMPASSWORD ="sys"//SYSTEM管理员密码
DATAFILEDESTINATION = /u01/app/oracle/oradata //数据文件存放目录
RECOVERYAREADESTINATION=/u01/app/oracle/oradata_back //恢复数据存放目录
CHARACTERSET =" AL32UTF8"//字符集,重要!!! 建库后一般不能更改,所以建库前要确定清楚。
TOTALMEMORY ="15360"//oracle内存4069MB
dbca -silent -responseFile /home/oracle/database/response/dbca.rsp
Oracle优化
$sqlpuls / as sysdba;
ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED; -- 取消oracle默认180天密码
ALTER SYSTEM SET SEC_CASE_SENSITIVE_LOGON = FALSE; -- 登录大小写
SELECT * FROM dba_profiles s WHERE s.profile='DEFAULT' AND resource_name='PASSWORD_LIFE_TIME';
alter system set processes =5000 scope = spfile; -- 修改最大连接数:
最大连接数
select count(*) from v$process --当前的数据库连接数
select value from v$parameter where name ='processes';--数据库允许的最大连接数
alter system set processes =5000 scope = spfile;--修改最大连接数:
su - oracle
sqlpuls / as sysdba;
1.shutdown immediate;
2.startup;