CentOS6.5x64 install 64-bit Oracle 11g in silent mode

Source: Internet
Author: User

CentOS6.5x64 install 64-bit Oracle 11g in silent mode

1. Download the 64-bit Oracle11g source file and upload it to the Linux server.

2. Package installation check and installation:

Install the tool using yum:

Yum-y install binutils compat-libstdc ++-33 elfutils-libelf-devel glibc-common glibc-devel gcc-c ++ libaio-devel libaliblibgcc gcc stdc + + libstdc ++-devel make sysstat unixODBC-devel pdksh numactl-devel glibc-headers

Check the packages that fail to be successfully installed after installation. If the installation fails, you can download them online based on the package name:
# Rpm-q binutils compat-libstdc ++-33 elfutils-libelf-devel expat gcc-c ++ glibc-common glibc-devel glibc-headers libaio- devel libgcc libstdc ++-devel make pdksh sysstat unixODBC-devel | grep "not installed"

3. Add database groups and users
# Id oracle (check whether the oracle user exists)
#/Usr/sbin/groupadd oinstall (create a product list Management Group)
#/Usr/sbin/groupadd dba (Create a database installation Group)
#/Usr/sbin/groupadd asmadmin (create an ASM Management Group)
#/Usr/sbin/groupadd asmdba (create a Grid Management Group)
#/Usr/sbin/useradd-g oinstall-G dba, asmdba oracle-d/home/oracle (oinstall is the main group to ensure that/home/oracle does not exist)
# Id oracle (remember the uid and gid of the oracle user)
Uid = 501 (oracle) gid = 501 (oinstall) groups = 501 (oinstall), 502 (dba), 504 (asmdba)
# Passwd oracle

4. Adjust OS Kernel Parameters
Setting principles:
The kernel. shmmax value is 4GB-1byte or half of the physical memory. which value is lower;
Fs. file-max is 512 * PROCESSES.
# Vi/etc/sysctl. conf (add or modify the following parameters. The reference value is the minimum requirement. You do not need to set kernel. shmmax by default)
Fs. aio-max-nr = 1048576
Fs. file-max = 6815744
Kernel. shmall = 2097152
# Kernel. shmmax = 536870912
Kernel. shmmni = 4096
Kernel. sem = 250 32000 100 128
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 = 1048586
#/Sbin/sysctl-p (the Setting Parameter takes effect immediately)

5. Added shell restrictions.
Add shell restrictions for oracle users to improve performance.
# Vi/etc/security/limits. conf (add or modify the following parameters at the end of the file)
Oracle soft nproc 2047
Hard nproc 16384
Oracle soft nofile 1024
Oracle hard nofile 65536

# Vi/etc/pam. d/login (add or modify the following parameters at the end of the file)
Session required pam_limits.so

# Vi/etc/profile (add or modify the following script at the end of the file)
If [$ USER = "oracle"]; then
If [$ SHELL = "/bin/sh"]; then
Ulimit-p 16384
Ulimit-n 65536
Ulimit-u 16384-n 65536

6. Create a required directory
# More/etc/oratab (check whether the Oracle main directory exists)
# More/etc/oraInst. loc (check whether the Oracle product list directory exists)
# Mkdir-p/u01/app/oracle/
# Chown-R oracle: oinstall/home/oracle
# Chown-R oracle: oinstall/u01
# Chmod-R 775/home/oracle
# Chmod-R 775/u01

7. Set oracle user environment variables
If the server has multiple NICs, set ORACLE_HOSTNAME to the host name corresponding to the IP address of the NIC. For details, refer to the/etc/hosts file.
# Su-oracle
$ Vi ~ /. Bash_profile
Umask 022
Export ORACLE_HOSTNAME = rhel5
Export ORACLE_BASE =/u01/app/oracle
Export ORACLE_HOME = $ ORACLE_BASE/product/11.2.0/dbhome_1
Export PATH =.: $ ORACLE_HOME/bin: $ ORACLE_HOME/OPatch: $ ORACLE_HOME/jdk/bin: $ PATH
Export LC_ALL = "en_US"
Export LANG = "en_US"

# Source ~ /. Bash_profile (make the environment variable take effect)

8. Switch to the oracle account, decompress the oracle11g compressed board 1 and 2 to the same directory, and generate a response file template.
$ Unzip linux. x64_11gR2_database _ *. zip/u01/database/

$ Vi/u01/database/db_swonly.rsp

Create a file and paste the following content:



Oracle. install. responseFileVersion =/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
Oracle. install. option = INSTALL_DB_SWONLY
UNIX_GROUP_NAME = oinstall
INVENTORY_LOCATION =/u01/app/oracle/oraInventory
Selected_ages = en, zh_CN
ORACLE_HOME =/u01/app/oracle/product/11.2.0/dbhome_1
ORACLE_BASE =/u01/app/oracle
Oracle. install. db. InstallEdition = EE
Oracle. install. db. isCustomInstall = true
Oracle. install. db. customComponents = oracle. install. db. customComponents = oracle. server:, oracle. sysman. cr:, oracle. xdk:, oracle. rdbms. oci:, oracle. network:, oracle. network. listener:, oracle. rdbms:, oracle. options:, oracle. rdbms. partitioning:, oracle. oraolap:, oracle. rdbms. dm:, oracle. rdbms. dv:, orcle. rdbms. lbac:, oracle. rdbms. rat:
Oracle. install. db. DBA_GROUP = dba
Oracle. install. db. OPER_GROUP = oinstall



The parameter meanings are as follows:
-Silent indicates silent Installation Without any prompt
-Force allows installation to a non-empty directory
-Noconfig indicates that the configuration assistant netca is not run.
-ResponseFile indicates which response file to use and must use an absolute path.
Oracle. install. responseFileVersion: the version of the response file template. Do not change this parameter.
Oracle. install. option Installation option. In this example, only the oracle software is installed. Do not change this parameter.
Whether online security update is required for DECLINE_SECURITY_UPDATES. Set this parameter to false. Do not change this parameter.
UNIX_GROUP_NAME name of the group used by the oracle user to install software
INVENTORY_LOCATION oracle product list directory
SELECTED_LANGUAGES oracle operating language environment, generally including citation and simplified and Traditional Chinese
ORACLE_HOME Oracle Installation Directory
ORACLE_BASE basic oracle directory
Oracle. install. db. InstallEdition
Whether oracle. install. db. isCustomInstall is customized or not. The default options include Partitioning, OLAP, and RAT.
Oracle. install. db. customComponents custom installation component list: In addition to the above default, you can add Label Security and Database Vault
Oracle. install. db. DBA_GROUP name of the group used by oracle users to grant OSDBA Permissions
Oracle. install. db. OPER_GROUP the group name that oracle users use to grant OSOPER Permissions

9. start installing oracle software
Silent Installation through the response file:

The installation is complete until the following prompt is displayed:

/U01/app/oracle/oraInventory/orainstRoot. sh
/U01/app/oracle/product/11.2.0/dbhome_1/root. sh
To execute the configuration scripts:
1. Open a terminal window
2. Log in as "root"
3. Run the scripts
4. Return to this window and hit "Enter" key to continue
Successfully Setup Software.

10. Run orainstRoot. sh and root. sh.
If oracle software is installed for the first time on the local machine, execute orainstRoot. sh to create the oraInst. loc file and modify the permission:
$ Su-
#/U01/app/oracle/oraInventory/orainstRoot. sh
# More/etc/oraInst. loc
Run root. sh under $ ORACLE_HOME to create the oratab, dbhome, oraenv, and coraenv files. If prompted, press Enter:
#/U01/app/oracle/product/11.2.0/dbhome_1/root. sh
# More/etc/oratab

11. startup settings -- (you can skip this step)
1) vi/u01/app/oracle/product/11.2.0/dbhome_1/bin/dbstart
2) vi/u01/app/oracle/product/11.2.0/dbhome_1/bin/dbshut

12. Compile the boot Startup File-(you can leave it empty)
# Vi/etc/init. d/oracle
Add the following content:



View Code

After writing, execute the following commands in sequence:

# Chmod 750/etc/init. d/oracle
# Ln-s/etc/init. d/oracle/etc/rc1.d/K61oracle
# Ln-s/etc/init. d/oracle/etc/rc3.d/S61oracle
# Chkconfig -- level 345 oracle on
# Chkconfig -- add oracle
[Root @ localhost ~] # Service oracle start
Oracle Start Succesful! OK.
[Root @ localhost ~] # Service oracle stop
Oracle Stop Succesful! OK.

Install readline

# Yum-y install readline *

Download, install rlwrap current Max version: rlwrap-0.42.tar.gz

This is an enhanced tool and can be installed without downloading.

# Tar-zxvf rlwrap-0.42.tar.gz
# Cd rlwrap-0.42
# Make
# Make install

# Vi/etc/bashrc
# Add the following information:

Alias sqlplus = '/usr/local/bin/rlwrap sqlplus'
Alias rman = '/usr/local/bin/rlwrap rman'


13. Edit the silent database creation response File

Switch to oracle user

# Su-oracle

$ Cd/u01/database/response
$ Cp dbca. rsp dbca_dbcsk.rsp // rename dbca _ database name. rsp

14. Silent configuration listening

$ Netca/silent/responsefile/u01/database/response/netca. rsp

Parsing command line arguments:
Parameter "silent" = true
Parameter "responsefile" =/u01/database/response/netca. rsp
Done parsing command line arguments.
Oracle Net Services Configuration:
Profile configuration complete.
Oracle Net Listener Startup:
Running Listener Control:
/U01/app/oracle/product/11.2.0/dbhome_1/bin/lsnrctl start LISTENER
Listener Control complete.
Listener started successfully.
Listener configuration complete.

Oracle Net Services configuration successful. The exit code is 0

After the file is successfully run, the sqlnet. ora and listener. ora files are generated under the/u01/app/oracle/product/11.2.0/dbhome_1/network/admin directory.

Start the listener:

$/U01/app/oracle/product/11.2.0/dbhome_1/bin/lsnrctl start LISTENER
Run the netstat-tlnp command.
Tcp 0 0: 1521: * LISTEN 5477/tnslsnr
It indicates that the listener has started to work on port 1521.
15. Silently create a new database (and also create a corresponding instance)

Modify/u01/database/response/dbca_dbcsk.rsp as follows:

RESPONSEFILE_VERSION = "11.2.0" // cannot be changed
OPERATION_TYPE = "createDatabase"
GDBNAME = "oracle11g.dbcsk.cn" // Database Name
SID = "ORAC" // corresponding instance name
TEMPLATENAME = "General_Purpose.dbc" // template file for database creation
SYSPASSWORD = "oracle1234" // SYS administrator password
SYSTEMPASSWORD = "oracle1234" // SYSTEM Administrator Password
DATAFILEDESTINATION =/home/oracle/oradata // data file storage directory
RECOVERYAREADESTINATION =/home/oracle/oradata_back // restore the data storage directory
CHARACTERSET = "AL32UTF8" // Character Set, important !!! Generally, it cannot be changed after the database is created. Therefore, you must confirm before creating the database.
TOTALMEMORY = "10240" // oracle memory 10 Gb, which can be smaller than 5120 MB

The command for silent database creation is as follows:

$ Dbca-silent-responseFile/u01/database/response/dbca_dbcsk.rsp
Copying database files
1% complete
3% complete
11% complete
18% complete
26% complete
37% complete
Creating and starting Oracle instance
40% complete
45% complete
50% complete
55% complete
56% complete
60% complete
62% complete
Completing Database Creation
66% complete
70% complete
73% complete
85% complete
96% complete
100% complete
Look at the log file "/u01/app/oracle/export toollogs/dbca/orcl11g/orcl11g. log" for further details.

So far, the database creation is complete, and the listening status is viewed.

$ Lsnrctl status

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.