Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Silent installation of Oracle

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

The server uses Aliyun, as shown below

[root@aliyun_test var] # cat / etc/system-release

CentOS release 6.5 (Final)

[root@aliyun_test var] # uname-r

2.6.32-431.23.3.el6.x86_64

[root@aliyun_test var] # uname-n

Aliyun_test

Memory:

Since Aliyun does not have swap by default, you need to create this by yourself. I will talk about how to create it later.

Some necessary actions before silent installation

# install java

Rpm-ivh jdk-7u75-linux-x64.rpm

Echo "export JAVA_HOME=/usr/java/jdk1.7.0_75" > > / etc/profile.d/java.sh

Echo "export PATH=$JAVA_HOME/bin:$PATH" > > / etc/profile.d/java.sh

Echo "export CLASSPATH=.:$JAVA_HOME/jre/lib:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar" > > / etc/profile.d/java.sh

. / etc/profile.d/java.sh

# verify java

Java-version

Some necessary bags

Yum-y install binutils compat-libstdc++-33 compat-libstdc++-33.i686 ksh elfutils-libelf\

Elfutils-libelf-devel glibc glibc-common glibc-devel gcc gcc-c++ libaio\

Libaio.i686 libaio-devel libaio-devel.i686 libgcc libstdc++ libstdc++.i686\

Libstdc++-devel libstdc++-devel.i686 make sysstat unixODBC unixODBC-devel unzip

Then there are some kernel parameter adjustments.

# modify / etc/sysctl.conf

Echo "fs.aio-max-nr = 1048576" > > / etc/sysctl.conf

Echo "fs.file-max = 6815744" > > / etc/sysctl.conf

Echo "kernel.shmmni = 4096" > > / etc/sysctl.conf

Echo "kernel.sem = 32000 100128" > > / etc/sysctl.conf

Echo "net.ipv4.ip_local_port_range = 9000 65500" > > / etc/sysctl.conf

Echo "net.core.rmem_default = 262144" > > / etc/sysctl.conf

Echo "net.core.rmem_max = 4194304" > > / etc/sysctl.conf

Echo "net.core.wmem_default = 262144" > > / etc/sysctl.conf

Echo "net.core.wmem_max = 1048576" > > / etc/sysctl.conf

/ sbin/sysctl-p

Then there is the opening number of soft and hard files.

# modify / etc/security/limits.conf

Echo "oracle soft nproc 2047" > > / etc/security/limits.conf

Echo "oracle hard nproc 16384" > > / etc/security/limits.conf

Echo "oracle soft nofile 1024" > > / etc/security/limits.conf

Echo "oracle hard nofile 65536" > > / etc/security/limits.conf

Create an oracle user

# create user oracle

/ usr/sbin/groupadd oinstall

/ usr/sbin/groupadd dba

/ usr/sbin/useradd-g oinstall-G dba oracle

Passwd oracle

Mkdir / u01/app-p

Chown-R oracle:oinstall / U01

Chmod 755 / u01/app

Create an oracle manifest file

# create oraInventory

Echo "inventory_loc=/u01/app/oraInventory" > > / etc/oraInst.loc

Echo "inst_group=oinstall" > > / etc/oraInst.loc

Chown-R oracle:oinstall / etc/oraInst.loc

Chmod 755 / etc/oraInst.loc

Add login authentication

# modify / etc/pam.d/login

# add

Session required pam_limits.so

Modify / etc/profile to restrict the use of other users

# modify / etc/profile

# add follows to the end

If [$USER = "oracle"]; then

If [$SHELL = "/ bin/ksh"]; then

Ulimit-p 16384

Ulimit-n 65536

Else

Ulimit-u 16384-n 65536

Fi

Fi

Then switch oracle users to operate.

# for oracle user

Su-oracle

Cd / home/oracle

File1:wget http://download.oracle.com/otn/linux/oracle11g/R2/linux.x64_11gR2_database_1of2.zip

File2:wget http://download.oracle.com/otn/linux/oracle11g/R2/linux.x64_11gR2_database_2of2.zip

Vim .bash _ profile

Export ORACLE_BASE=/u01/app

Export ORACLE_SID=test

Unzip linux.x64_11gR2_database_1of2.zip-d / u01/app

Unzip linux.x64_11gR2_database_2of2.zip-d / u01/app

Since oracle is installed using a silent file, a modified response file must be created (please refer to the official website for specific parameters)

Cp / u01/app/database/response/db_install.rsp / home/oracle

Chmod 700 / home/oracle/*.rsp

# add to rsp

Modify the following values

Oracle.install.option=INSTALL_DB_SWONLY

ORACLE_HOSTNAME=oracle11g

UNIX_GROUP_NAME=oinstall

INVENTORY_LOCATION=/u01/app/oraInventory

SELECTED_LANGUAGES=en,zh_CN,zh_TW

ORACLE_HOME=/u01/app/product/11.2.0/dbhome_1

ORACLE_BASE=/u01/app

Oracle.install.db.InstallEdition=EE

Oracle.install.db.isCustomInstall=false

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=test

Oracle.install.db.config.starterdb.SID=test

Oracle.install.db.config.starterdb.memoryLimit=512

Oracle.install.db.config.starterdb.password.ALL=redhat

SECURITY_UPDATES_VIA_MYORACLESUPPORT=false

DECLINE_SECURITY_UPDATES=true

When the preparations are ready, the installation is carried out.

# silent install oracle

Cd / u01/app

. / database/runInstaller-silent-responseFile / home/oracle/db_install.rsp

Please take appropriate measures according to the output information on the screen (because it is an Ali CVM, the swap requirement is not met)

Swap memory does the following:

If the swap space is not enough: for Ali CVMs or hosts with swap 0

Dd if=/dev/zero of=/test bs=1G count=4---- "if this method does not work, please select the following

Mkswap-f / test

Swapon / test

Free-m

Set 2G swap space

[root@aliyun_test var] # dd if=/dev/zero of=/var/test bs=1G count=2

Dd: memory exhausted

[root@aliyun_test var] # dd if=/dev/zero of=/var/test bs=1024 count=2097152

2097152 0 records in

2097152 0 records out

2147483648 bytes (2.1 GB) copied, 38.0205 s, 56.5 MB/s

[root@aliyun_test var] # du-sh / var/test

2.1G / var/test

[root@aliyun_test var] # mkswap-f / var/test

Setting up swapspace version 1, size = 2097148 KiB

No label, UUID=d3ba4921-7d5e-47ae-810b-44f2369a24c2

[root@aliyun_test var] # swapon / var/test

[root@aliyun_test var] # free-m

Total used free shared buffers cached

Mem: 994 930 63 0 31 809

-/ + buffers/cache: 89 905

Swap: 2047 0 2047

When the installation appears as follows, you are asked to use the root user to execute the following script

/ u01/app/product/11.2.0/dbhome_1/root.sh

So use another session terminal to execute

[root@aliyun_test ~] # / u01/app/product/11.2.0/dbhome_1/root.sh

Check / u01/app/product/11.2.0/dbhome_1/install/root_aliyun_test_2016-09-20 10-20-22.log for the output of root script

Then go back to the oracle user and type the enter key at the terminal to complete the installation.

Then continue to modify the environment files in the oracle home directory as follows

Vim / home/oracle/.bash_profile

Export ORACLE_HOME=/u01/app/product/11.2.0/dbhome_1

PATH=$ {ORACLE_HOME} / bin:$PATH:$HOME/bin

The next step is to configure the listening service, as follows

Initiate monitoring

# modify netca.rsp

Cp database/response/netca.rsp / home/oracle/

Vim / home/oracle/netca.rsp

GENERAL]

RESPONSEFILE_VERSION= "11.2"

CREATE_TYPE= "CUSTOM"

Type of INSTALL_TYPE= "" custom "installation (" typical- typical "," minimal- Min "or" custom- Custom ")

Number of LISTENER_NUMBER=1 listeners

List of names for LISTENER_NAMES= {"test"} listeners

List of communication protocols used by LISTENER_PROTOCOLS= {"TCP;1521"} listeners

Name started by the LISTENER_START= "" test "listener

Then run:

Netca / silent / responsefile / home/oracle/netca.rsp

[oracle@aliyun_test app] $netca / silent / home/oracle/netca.rsp

Parsing command line arguments:

Parameter "silent" = true

Parameter "responsefile" = / opt/oracle/netca.rsp

Done parsing command line arguments.

Oracle Net Services Configuration:

Configuring Listener:test

Listener configuration complete.

Oracle Net Listener Startup:

Running Listener Control:

/ u01/app/product/11.2.0/dbhome_1/bin/lsnrctl start test

Listener Control complete.

Listener started successfully.

Profile configuration complete.

Oracle Net Services configuration successful. The exit code is 0

When the monitoring configuration is finished, the port will open. Check it out.

[root@aliyun_test ~] # netstat-tunlp | grep 1521

Tcp 0 0 0.0.0.0 1521 0.0.0.015 * LISTEN 17760/tnslsnr

/ u01/app/product/11.2.0/dbhome_1/bin/tnslsnr test (started by this command)

Finally, create a single instance database

Silently build a new library

Cp database/response/dbca.rsp / home/oracle/

Vim / home/oracle/dbca.rsp

Then modify the following:

[GENERAL]

RESPONSEFILE_VERSION = "11.2.0" / / cannot be changed

OPERATION_TYPE = "createDatabase"

GDBNAME = "test" / / name of the global database = SID+ host domain name

SID= "test" / / corresponding instance name

TEMPLATENAME = "General_Purpose.dbc" / / template file for building the library

SYSPASSWORD = "redhat" / / SYS administrator password

SYSTEMPASSWORD = "redhat" / / SYSTEM administrator password

DATAFILEDESTINATION = / u01/app/oradata / / data file storage directory

RECOVERYAREADESTINATION=/u01/app/flash_recovery_area / / restore the data storage directory

CHARACTERSET = "AL32UTF8" / / character set, important! Generally speaking, it cannot be changed after the library is built, so make sure it is clear before building the library. (CHARACTERSET = "AL32UTF8"

NATIONALCHARACTERSET= "UTF8")

TOTALMEMORY = "380s" / / oracle memory

Then silently build the library.

Dbca-silent-responseFile / home/oracle/dbca.rsp

After this, after the database is created, use the sqlplus command to log in

The system password used by the logged-in user is redhat, and all the above actions are recorded.

At this point, the silent installation of oracle is complete.

Start monitoring:

[oracle@oracle admin] $lsnrctl start test

Check to see if port 1521 is open

Start the database:

[oracle@oracle admin] $sqlplus / nolog

SQL*Plus: Release 11.2.0.1.0 Production on Wed Jul 26 14:37:17 2017

Copyright (c) 1982, 2009, Oracle. All rights reserved.

SQL > conn / as sysdba

Connected to an idle instance.

SQL > startup

ORACLE instance started.

Total System Global Area 584568832 bytes

Fixed Size 2215544 bytes

Variable Size 490733960 bytes

Database Buffers 88080384 bytes

Redo Buffers 3538944 bytes

Database mounted.

Database opened.

Connect to the database:

[oracle@oracle admin] $echo $ORACLE_SID

Test

[oracle@oracle admin] $sqlplus system/redhat@test

SQL*Plus: Release 11.2.0.1.0 Production on Wed Jul 26 14:42:34 2017

Copyright (c) 1982, 2009, Oracle. All rights reserved.

ERROR:

ORA-28002: the password will expire within 7 days

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL >

[oracle@oracle admin] $echo $SERVICE_NAME

Oracle.test

[oracle@oracle admin] $sqlplus system/redhat@192.168.223.138:1521/oracle.test

SQL*Plus: Release 11.2.0.1.0 Production on Wed Jul 26 14:44:02 2017

Copyright (c) 1982, 2009, Oracle. All rights reserved.

ERROR:

ORA-28002: the password will expire within 7 days

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL >

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report