rhel 7.7 oracle 19.7 静默安装-凯发app官方网站

凯发app官方网站-凯发k8官网下载客户端中心 | | 凯发app官方网站-凯发k8官网下载客户端中心
  • 博客访问: 3503110
  • 博文数量: 718
  • 博客积分: 1860
  • 博客等级: 上尉
  • 技术积分: 7790
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-07 08:51
个人简介

偶尔有空上来看看

文章分类

全部博文(718)

文章存档

2024年(4)

2023年(74)

2022年(134)

2021年(238)

2020年(115)

2019年(11)

2018年(9)

2017年(9)

2016年(17)

2015年(7)

2014年(4)

2013年(1)

2012年(11)

2011年(27)

2010年(35)

2009年(11)

2008年(11)

最近访客
相关博文
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·

分类: oracle

2020-07-17 16:51:59


来自真实世界的生产环境。

准备介质:

oracle software

linux.x64_193000_db_home.zip

oracle ru

p30783543_190000_linux-x86-64.zip

(combo of ojvm ru component 19.7.0.0.200414 db ru 19.7.0.0.200414)

oracle opatch

p6880880_190000_linux-x86-64.zip

compat-libstdc 软件

compat-libstdc -33-3.2.3-72.el7.x86_64.rpm

os watcher服务包

oswatcher-8.3.0-1.el7.noarch.rpm

rhel7.4光盘

rhel-server-7.7-x86_64-dvd.iso


挂载os光盘
mount -r /dev/sr0 /mnt

cat > /etc/yum.repos.d/yum.repo<

[rhel77]

name=rhel77

baseurl=file:///mnt

gpgcheck=0

eof


yum makecache

yum install -y  elfutils* gcc* glibc* libaio* libgcc* libgomp* libstdc* libstdc -devel* sysstat unixodbc* *libcap* libxp* dstat* compat-* bc unzip smartmontools* mlocate* psmisc* -y


cd /u01/media

rpm -e compat-libstdc

rpm -ivh compat-libstdc -33-3.2.3-72.el7.x86_64.rpm

设置主机名
hostnamectl set-hostname o19c

cat >> /etc/hosts <


xx.xx.1.20         o19c

eof

设置os参数

cat >> /etc/sysctl.conf <

kernel.shmmax = 137438953472

kernel.shmall = 33554432

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

kernel.panic_on_oops = 1

kernel.randomize_va_space = 0

fs.file-max = 6815744

fs.aio-max-nr = 4194304

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

net.ipv4.ipfrag_high_thresh = 16777216

net.ipv4.ipfrag_low_thresh = 15728640

net.ipv4.ipfrag_time = 60

vm.min_free_kbytes = 524288

vm.swappiness = 0

# vm.nr_hugepages = 43008

eof


sysctl -p

echo "nozeroconf=yes" >> /etc/sysconfig/network

setenforce 0

sed -i 's/selinux=enforcing/selinux=disabled/' /etc/sysconfig/selinux

打开用户限制

cat >> /etc/security/limits.conf <


#oracle setting

* soft memlock unlimited  

* hard memlock unlimited 

 oracle soft nproc   16384

oracle hard nproc   16384

oracle soft nofile  65536

oracle hard nofile  65536

oracle soft stack   10240

eof

禁用服务

systemctl stop postfix

systemctl stop smartd

systemctl disable firewalld

systemctl disable postfix

systemctl disable smartd
systemctl stop firewalld

systemctl disable firewalld

cat >> /etc/pam.d/login <


#oracle setting

session required pam_limits.so

eof

关闭透明大页

sed -i '/grub_cmdline_linux=/ s/"$/ transparent_hugepage=never"/' /etc/default/grub

grub2-mkconfig > /boot/grub2/grub.cfg

groupadd -g 1001 oinstall

groupadd -g 1002 dba

useradd -u 1100 -g oinstall -g dba,oinstall oracle

echo "oracle"|passwd --stdin oracle


mkdir -p /u01/app/oracle

mkdir -p /u01/app/oracle/product/19.3/db_1

chown -r oracle:oinstall /u01

chmod -r 775 /u01

设置用户概要文件

vi ~/.bash_profile


# oracle 19c oracle environment                                                                                           

export oracle_base=/u01/app/oracle

export oracle_home=/u01/app/oracle/product/19.3/db_1

export oracle_sid=orcl

export tmp=/tmp

export nls_lang=american_america.al32utf8

export libpath=$oracle_home/lib:$oracle_home/lib32

export ld_library_path=$ld_libary_path:$oracle_home/jdk/jre/lib:$oracle_home/network/lib:$oracle_home/rdbms/lib

export ld_library_path=$ld_libary_path:$oracle_home/lib:$oracle_home/lib32

export class_path=$oracle_home/jre:$oracle_home/jlib:$oracle_home/rdbms/jlib:$oracle_home/network/jlib

export path=$oracle_home/bin:$oracle_home/opatch:$home/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/usr/ucb:/usr/bin/x11:/sbin:.


umask 022

if [ $user = "oracle" ]; then

if [ $shell = "/bin/ksh" ]; then

ulimit -p 16384

ulimit -n 65536

else

ulimit -u 16384 -n 65536

fi

fi


alias sql='sqlplus / as sysdba'

stty erase ^h

以下用oracle执行

cd /u01/media/

unzip linux.x64_193000_db_home.zip -d $oracle_home/

用root执行
cd /u01/app/oracle/product/19.3/db_1/cv/rpm

rpm -ivh cvuqdisk-1.0.10-1.rpm


静默配置
以oracle执行

vi db.rsp


oracle.install.responsefileversion=/oracle/install/rspfmt_dbinstall_response_schema_v19.0.0

oracle.install.option=install_db_swonly

unix_group_name=oinstall

inventory_location=/u01/app/orainventory

oracle_base=/u01/app/oracle



oracle.install.db.installedition=ee

oracle.install.db.osdba_group=dba

oracle.install.db.osoper_group=oinstall

oracle.install.db.osbackupdba_group=dba

oracle.install.db.osdgdba_group=dba

oracle.install.db.oskmdba_group=dba

oracle.install.db.osracdba_group=dba

oracle.install.db.rootconfig.executerootscript=false

oracle.install.db.rootconfig.configmethod=

oracle.install.db.rootconfig.sudopath=

oracle.install.db.rootconfig.sudousername=

oracle.install.db.cluster_nodes=

oracle.install.db.config.starterdb.type=general_purpose

oracle.install.db.config.starterdb.globaldbname=

oracle.install.db.config.starterdb.sid=

oracle.install.db.configureascontainerdb=false

oracle.install.db.config.pdbname=

oracle.install.db.config.starterdb.characterset=

oracle.install.db.config.starterdb.memoryoption=false

oracle.install.db.config.starterdb.memorylimit=

oracle.install.db.config.starterdb.installexampleschemas=false

oracle.install.db.config.starterdb.password.all=

oracle.install.db.config.starterdb.password.sys=

oracle.install.db.config.starterdb.password.system=

oracle.install.db.config.starterdb.password.dbsnmp=

oracle.install.db.config.starterdb.password.pdbadmin=

oracle.install.db.config.starterdb.managementoption=default

oracle.install.db.config.starterdb.omshost=

oracle.install.db.config.starterdb.omsport=0

oracle.install.db.config.starterdb.emadminuser=

oracle.install.db.config.starterdb.emadminpassword=

oracle.install.db.config.starterdb.enablerecovery=false

oracle.install.db.config.starterdb.storagetype=

oracle.install.db.config.starterdb.filesystemstorage.datalocation=

oracle.install.db.config.starterdb.filesystemstorage.recoverylocation=

oracle.install.db.config.asm.diskgroup=

oracle.install.db.config.asm.asmsnmppassword=

开始安装
cd $oracle_home/

./runinstaller -ignoreprereq -silent -force -responsefile /home/oracle/db.rsp 

大概10分钟...

用root执行:
/u01/app/orainventory/orainstroot.sh
/u01/app/oracle/product/19.3/db_1/root.sh

升级psu补丁
mv $oracle_home/opatch $oracle_home/opatch_bak

cd /u01/media

unzip p6880880_*.zip -d $oracle_home/

$oracle_home/opatch/opatch version

db的ru:

cd /u01/media/30783543/30869156

$oracle_home/opatch/opatch apply

ojvm的ru:
cd /u01/media/30783543/30805684
$oracle_home/opatch/opatch apply

检查:
$oracle_home/opatch/opatch lspatches

30805684;ojvm release update: 19.7.0.0.200414 (30805684)

30869156;database release update : 19.7.0.0.200414 (30869156)

29585399;ocw release update 19.3.0.0.0 (29585399)


建库
vi dbca.rsp


responsefileversion=/oracle/assistants/rspfmt_dbca_response_schema_v12.2.0
gdbname=orcl
sid=orcl
databaseconfigtype=si
raconenodeservicename=
policymanaged=false
createserverpool=false
serverpoolname=
cardinality=
force=false
pqpoolname=
pqcardinality=
createascontainerdatabase=false
numberofpdbs=0
pdbname=
uselocalundoforpdbs=true
pdbadminpassword=
nodelist=
templatename=/u01/app/oracle/product/19.3/db_1/assistants/dbca/templates/general_purpose.dbc
syspassword=
systempassword= 
serviceuserpassword=
emconfiguration=
emexpressport=5500
runcvuchecks=false
dbsnmppassword=
omshost=
omsport=0
emuser=
empassword=
dvconfiguration=false
dvusername=
dvuserpassword=
dvaccountmanagername=
dvaccountmanagerpassword=
olsconfiguration=false
datafilejarlocation={oracle_home}/assistants/dbca/templates/
datafiledestination=/oradata/{db_unique_name}/
recoveryareadestination=
storagetype=fs
diskgroupname=
asmsnmppassword=
recoverygroupname=
characterset=zhs16gbk
nationalcharacterset=al16utf16
registerwithdirservice=false
dirserviceusername=
dirservicepassword=
walletpassword=
listeners=
variablesfile=
variables=oracle_base_home=/u01/app/oracle/product/19.3/db_1,db_unique_name=orcl,oracle_base=/u01/app/oracle,pdb_name=,db_name=orcl,oracle_home=/u01/app/oracle/product/19.3/db_1,sid=orcl
initparams=undo_tablespace=undotbs1,sga_target=2340mb,db_block_size=8192bytes,nls_language=american,dispatchers=(protocol=tcp) (service=orclxdb),diagnostic_dest={oracle_base},control_files=("/oradata/{db_unique_name}/control01.ctl", "/oradata/{db_unique_name}/control02.ctl"),remote_login_passwordfile=exclusive,audit_file_dest={oracle_base}/admin/{db_unique_name}/adump,processes=3000,pga_aggregate_target=781mb,nls_territory=america,open_cursors=300,compatible=19.0.0,db_name=orcl,audit_trail=db
sampleschema=false
memorypercentage=40
databasetype=multipurpose
automaticmemorymanagement=false
totalmemory=0

dbca -ignoreprereqs -ignoreprereqfailure -silent -createdatabase -responsefile /home/oracle/dbca.rsp


配置侦听
cd $oracle_home/network/admin
vi listener.ora 


sid_list_listener =
  (sid_list =
    (sid_desc =
      (global_dbname = orcl)
      (oracle_home = /u01/app/oracle/product/19.3/db_1)
      (sid_name = orcl)
    )
  )


listener =
  (description =
    (address = (protocol = tcp)(host = xx.xx.1.20)(port = 1521))
  )


adr_base_listener = /u01/app/oracle


lsnrctl  start

优化数据库参数

alter system set processes=1000 scope=spfile; 

alter system set control_file_record_keep_time=60 scope=spfile sid='*';

alter system set deferred_segment_creation=false scope=spfile sid='*';

alter system set event='43822 trace name context forever,level 1','28401 trace name context forever,level 1','10949 trace name context forever,level 1' scope=spfile sid='*'; 

alter system set max_dump_file_size='1024m' scope=spfile sid='*';

alter system set open_cursors=500 scope=spfile sid='*';

alter system set parallel_max_servers=32 scope=spfile sid='*'; 

alter system set recovery_parallelism=10  scope=spfile sid='*';

alter system set result_cache_max_size=0 scope=spfile sid='*';

alter system set session_cached_cursors=100 scope=spfile sid='*';

alter system set large_pool_size=256m  scope=spfile;

alter system set db_files=1000 scope=spfile;

alter system set "_cleanup_rollback_entries"=10000 scope=spfile sid='*';

alter system set "_datafile_write_errors_crash_instance"=false scope=spfile sid='*';

alter system set "_gc_defer_time"=3 scope=spfile sid='*';

alter system set "_optimizer_use_feedback"=false sid ='*' scope=spfile;

alter system set "_partition_large_extents"=false scope=spfile sid='*';

alter system set "_px_use_large_pool"=true sid ='*' scope=spfile;

alter system set "_sys_logon_delay"=0 sid ='*' scope=spfile;

alter system set "_optimizer_adaptive_cursor_sharing"=false sid='*' scope=spfile;

alter system set "_optimizer_extended_cursor_sharing"=none sid='*' scope=spfile;

alter system set "_optimizer_extended_cursor_sharing_rel"=none sid='*' scope=spfile;

alter profile default limit password_life_time unlimited;

alter profile default limit password_lock_time unlimited;

alter profile default limit password_grace_time unlimited;

alter profile default limit failed_login_attempts unlimited;

exec dbms_workload_repository.modify_snapshot_settings(interval=>30, retention=>45*24*60);

exec dbms_auto_task_admin.disable(client_name => 'sql tuning advisor',operation => null,window_name => null);

exec dbms_auto_task_admin.disable(client_name => 'auto space advisor',operation => null,window_name => null);

alter database add logfile group 11 '/oradata/orcl/redo11.log' size 1g reuse;
alter database add logfile group 12 '/oradata/orcl/redo12.log' size 1g reuse;
alter database add logfile group 13 '/oradata/orcl/redo13.log' size 1g reuse;
alter system swtich logfile;
alter system swtich logfile;
alter system swtich logfile;
alter system checkpoint;
alter database drop logfile group 1;
alter database drop logfile group 2;
alter database drop logfile group 3;

alter database datafile 1,2,3 resize 4g;

--切换归档模式
alter system set log_archive_dest_1='location=/arch';
shutdown immediate

startup mount

alter database archivelog;

alter database open;


以root配置osw
rpm -ivh oswatcher-8.3.0-1.el7.noarch.rpm

vi /etc/sysconfig/oswatcher

 # the directory where oswatcher logs should be kept

datadir=/u01/oswatcher

# the interval (in seconds) between runs runs of statistics collections

interval=10

# the maximum age (in hours) of the various log files

maxage=72

# extra options, for example, "-z gzip" to compress files

options=-z gzip

激活服务

systemctl start oswatcher

systemctl enable oswatcher
阅读(2436) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~
")); function link(t){ var href= $(t).attr('href'); href ="?url=" encodeuricomponent(location.href); $(t).attr('href',href); //setcookie("returnouturl", location.href, 60, "/"); }
网站地图