欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

CentOS 7.2静默安装Oracle11g

程序员文章站 2023-12-17 18:13:40
Preface Today I'm gonna export some test data to another server.The source server is Windows Server 2012 R2 and the tartget server is CentOS 7.2.Event ......
 
preface
 
    today i'm gonna export some test data to another server.the source server is windows server 2012 r2 and the tartget server is centos 7.2.eventually,i found out that when using the oui of oracle 11g,the mouse cannot click anything in the interface even to click "exit".i'm afraid it's not properly supported on centos 7 series.therefore i decided to install oracle with silent mode first.
 
precedure
 
1. add user and groups.
1 groupadd oinstall
2 groupadd dba
3 useradd -g oinstall -g dba -m oracle
4 passwd oracle
5 id oracle

 

2. create directories and grant privileges on them.

1 mkdir -p /u01/app/oracle/product/11.2.0/dbhome_1
2 mkdir -p /u01/app/oracle/{oradata,inventory,fast_recovery_area}
3 chown -r oracle:oinstall /u01
4 chmod -r 775 /u01

 

3. modify the os release(it's a little trick).

1 cat /proc/version
2 cat /etc/redhat-release
3 centos linux release 7.1.1503 (core)
4 vim /etc/redhat-release
5 cat /etc/redhat-release
6 redhat-7

 

4. install the required package.

1 yum install gcc* gcc-* gcc-c++-* glibc-devel-* glibc-headers-* compat-libstdc* libstdc* elfutils-libelf-devel* libaio-devel* sysstat* unixodbc-* pdksh-*

 

5. disable the firewall.

1 systemctl status firewalld.service
2 systemctl stop firewalld.service
3 systemctl disable firewalld.service

 

6. disable the selinux.

1 vi /etc/selinux/config 
2 cat /etc/selinux/config
3 selinux=disabled
4 or
5 sestatus -v
6 selinux status:                 disabled

 

7. modify the core parameters.

 1 vim /etc/sysctl.conf
 2 net.ipv4.icmp_echo_ignore_broadcasts = 1
 3 net.ipv4.conf.all.rp_filter = 1
 4 fs.file-max = 6815744 //max opened files.
 5 fs.aio-max-nr = 1048576
 6 kernel.shmall = 2097152 //all pages of shared memory 8g:2097152*4k/1024/1024
 7 kernel.shmmax = 2147483648
 8 kernel.shmmni = 4096
 9 kernel.sem = 250 32000 100 128
10 net.ipv4.ip_local_port_range = 9000 65500 //range of ports of ipv4.
11 net.core.rmem_default = 262144
12 net.core.rmem_max= 4194304
13 net.core.wmem_default= 262144
14 net.core.wmem_max= 1048576
15 //make it take effect.
16 sysctl -p

 

8. modify the limits to oracle user.

1 vim /etc/security/limits.conf
2 cat /etc/security/limits.conf
3 oracle soft nproc 2047
4 oracle hard nproc 16384
5 oracle soft nofile 1024
6 oracle hard nofile 65536

 

9. modify the pam limit.

1 vim /etc/pam.d/login
2 cat /etc/pam.d/login
3 session required /lib64/security/pam_limits.so
4 session required pam_limits.so 

 

10. modify variables of evironment.

1 export oracle_base=/u01/app/oracle
2 export oracle_home=$oracle_base/product/11.2.0/dbhome_1
3 export oracle_sid=orcl 
4 export oracle_term=xterm
5 export path=$oracle_home/bin:/usr/sbin:$path
6 export ld_library_path=$oracle_home/lib:/lib:/usr/lib
7 export lang=en_us
8 export nls_lang=american_america.al32utf8

 

11. install oracle software by silent mode.

 1 egrep -v "(^#|^$)" /u01/database/response/db_install.rsp
 2 vim /u01/database/response/db_install.rsp
 3 cat /u01/database/response/db_install.rsp
 4 oracle.install.option=install_db_swonly
 5 oracle_hostname=w808-cgsqlsit-2
 6 unix_group_name=oinstall
 7 inventory_location=/u01/app/oracle/inventory
 8 selected_languages=en,zh_cn
 9 oracle_home=/u01/app/oracle/product/11.2.0/dbhome_1
10 oracle_base=/u01/app/oracle
11 oracle.install.db.installedition=ee
12 oracle.install.db.eeoptionsselection=true
13 oracle.install.db.dba_group=dba
14 oracle.install.db.oper_group=dba
15 oracle.install.db.config.starterdb.password.all=passw0rd
16 decline_security_updates=true 
17 //execute the installation command.
18 ./runinstaller -silent -responsefile /u01/database/response/db_install.rsp -ignoreprereq

 

12. install oracle network by silent mode.

 1 egrep -v "(^#|^$)" /u01/database/response/netca.rsp
 2 [general]
 3 responsefile_version="11.2"
 4 create_type="custom"
 5 [oracle.net.ca]
 6 installed_components={"server","net8","javavm"}
 7 install_type=""typical""
 8 listener_number=1
 9 listener_names={"listener"}
10 listener_protocols={"tcp;1521"}
11 listener_start=""listener""
12 naming_methods={"tnsnames","onames","hostname"}
13 nsn_number=1
14 nsn_names={"extproc_connection_data"}
15 nsn_service={"plsextproc"}
16 //execute the configuration command.
17 netca -silent -responsefile "/u01/database/response/netca.rsp"

 

13. install oracle database by silent mode.

 1 egrep -v "(^#|^$)" /u01/database/response/dbca.rsp
 2 vim /u01/database/response/dbca.rsp
 3 cat /u01/database/response/dbca.rsp
 4 gdbname = "orcl"
 5 sid = "orcl"
 6 db_unique_name = 'orcl'
 7 syspassword = "passw0rd"
 8 systempassword = "passw0rd"
 9 datafiledestination =/u01/app/oracle/oradata
10 recoveryareadestination=/u01/app/oracle/fast_recovery_area
11 characterset = "al32utf8"
12 totalmemory = "512"
13 //execute the creation command.
14 dbca -silent -responsefile /u01/database/response/dbca.rsp 
15 or
16 dbca -silent -createdatabase -templatename $oracle_home/assistants/dbca/templates/general_purpose.dbc -gdbname orcl -sid orcl -db_unique_name orcl -responsefile no_value -syspassword passw0rd -systempassword passw0rd -datafiledestination /u01/app/oracle/oradata recoveryareadestination /u01/app/oracle/oradata/fast_recovery_area -characterset al32utf8 -sampleschema false -totalmemory 512

 

 

上一篇:

下一篇: