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

Linux silent installation Oracle 11g tutorial

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

Preparatory work

Download linux.x64_11gR2_database_1of2.zip and linux.x64_11gR2_database_2of2.zip from your computer

Http://download.oracle.com/otn/linux/oracle11g/R2/linux.x64_11gR2_database_1of2.zip

Http://download.oracle.com/otn/linux/oracle11g/R2/linux.x64_11gR2_database_2of2.zip

Copy links are downloaded directly with Xunlei.

Root user logs in to Linux

Create / data/oracle/oraclesetup/ directory

[root@lynn-02] # mkdir-p / data/oracle/oraclesetup/

Enter the / data/oracle/oraclesetup/ directory

[root@lynn-02 ~] # cd / data/oracle/oraclesetup/

Ctrl plus Alt plus F Open xftp and upload the downloaded linux.x64_11gR2_database_1of2.zip and linux.x64_11gR2_database_2of2.zip to the Linux / data/oracle/oraclesetup/ directory

View linux.x64_11gR2_database_1of2.zip and linux.x64_11gR2_database_2of2.zip in the / data/oracle/oraclesetup/ directory

[root@lynn-02 oraclesetup] # lslinux.x64_11gR2_database_1of2.zip linux.x64_11gR2_database_2of2.zip

Decompress the Oracle package

[root@lynn-02 oraclesetup] # unzip linux.x64_11gR2_database_1of2.zip & & unzip linux.x64_11gR2_database_2of2.zip

Unzipping the Oracle package will generate a database directory with the Oracle installer in the current directory

[root@lynn-02 oraclesetup] # lsdatabase linux.x64_11gR2_database_1of2.zip linux.x64_11gR2_database_ 2 of 2.zip [root @ lynn-02 oraclesetup] # cd database [root @ lynn-02 database] # lsdoc install response rpm runInstaller sshsetup stage welcome.html

Add a hostname to / etc/hosts

[root@lynn-02 database] # vim / etc/hosts127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4::1 localhost localhost.localdomain localhost6 localhost6.localdomain6192.168.130.168 CentOS

Close SELinux

[root@lynn-02 database] # vim / etc/selinux/config# This file controls the state of SELinux on the system.# SELINUX= can take one of these three values:# enforcing-SELinux security policy is enforced.# permissive-SELinux prints warnings instead of enforcing.# disabled-No SELinux policy is loaded.SELINUX=disabled# SELINUXTYPE= can take one of three two values:# targeted-Targeted processes are protected,# minimum-Modification of targeted policy. Only selected processes are protected. # mls-Multi Level Security protection.SELINUXTYPE= target [root @ lynn-02 database] # setenforce 0

Turn off the firewall

[root@lynn-02 database] # service iptables stopRedirecting to / bin/systemctl stop iptables.service [root @ lynn-02 database] # systemctl stop firewall [root @ lynn-02 database] # systemctl disable firewalld

Install the Oracle 11g dependency package

[root@lynn-02 database] # yum install-y gcc make binutils gcc-c++ compat-libstdc++-33elfutils-libelf-devel elfutils-libelf-devel-static ksh libaio libaio-develnumactl-devel sysstat unixODBC unixODBC-devel pcre-devel

Add installation users and user groups

[root@lynn-02 database] # groupadd install [root @ lynn-02 database] # groupadd dba [root @ lynn-02 database] # useradd-g oinstall-G dba Oracle [root @ lynn-02 database] # passwd oracle changes the password of user oracle. New password: invalid password: password less than 8 characters re-enter the new password: passwd: all authentication tokens have been successfully updated. [root@lynn-02 database] # id oracleuid=1000 (oracle) gid=1000 (oinstall) group = 1000 (oinstall), 1001 (dba)

Modify kernel parameter configuration file / etc/sysctl.conf

Add the following

Fs.aio-max-nr = 1048576

Fs.file-max = 6815744

Kernel.shmall = 2097152

Kernel.shmmax = 1073741824

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

Where kernel.shmmax = 1073741824 is half of the native physical memory (2G) in byte.

[root@lynn-02 database] # vim / etc/sysctl.conf# sysctl settings are defined through files in# / usr/lib/sysctl.d/, / run/sysctl.d/, and / etc/sysctl.d/.## Vendors settings live in / usr/lib/sysctl.d/.# To override a whole file, create a new file with the same in# / etc/sysctl.d/ and put new settings there. To override# only specific settings, add a file with a lexically later# name in / etc/sysctl.d/ and put new settings there.## For more information, see sysctl.conf (5) and sysctl.d (5). Fs.aio-max-nr = 1048576fs.file-max = 6815744kernel.shmall = 2097152kernel.shmmax = 1073741824kernel.shmmni = 4096kernel.sem = 25032000100 128net.ipv4.ip_local_port_range = 900065500net.core.rmem_default = 262144net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048576

Modify the user's restriction file / etc/security/limits.conf

Add the following

Oracle soft nproc 2047

Oracle hard nproc 16384

Oracle soft nofile 1024

Oracle hard nofile 65536

Oracle soft stack 10240

[root@lynn-02 database] # vim / etc/security/limits.conf# / etc/security/limits.conf##This file sets the resource limits for the users logged in via PAM.#It does not affect resource limits of the system services.##Also note that configuration files in / etc/security/limits.d directory,#which are read in alphabetical order, override the settings in this#file in case the domain is the same or more specific.#That means for example that setting a limit for wildcard domain here#can be overriden with a wildcard setting in a config file in the#subdirectory But a user specific setting here can be overriden only#with a user specific setting in the subdirectory.##Each line describes a limit for a user in the form:## Where:# can be:#-a user name#-a group name, with @ group syntax#-the wildcard *, for default entry#-the wildcard%, can be also used with% group syntax # for maxlogin limit#-fsize-maximum filesize (KB) #-memlock-max locked-in-memory address space (KB) #-nofile-max number of open file descriptors#-rss-max resident set size (KB) #-stack-max stack size (KB) #-cpu-max CPU time (MIN) #-nproc-max number of processes#-as -address space limit (KB) #-maxlogins-max number of logins for this user#-maxsyslogins-max number of logins on the system#-priority-the priority to run user process with#-locks-max number of file locks the user can hold#-sigpending-max number of pending signals#-msgqueue-max memory used by POSIX message queues (bytes) #-nice-max nice priority allowed to raise to values: [- 20 19] #-rtprio-max realtime priority## * soft core zero * hard rss 10000#@student hard nproc 20#@faculty soft nproc 20#@faculty hard nproc 50#ftp hard nproc 0#@student-maxlogins End of fileoracle soft nproc 2047oracle hard nproc 16384oracle soft nofile 1024oracle hard nofile 65536oracle soft stack 10240

Modify the / etc/pam.d/login file:

Add the following:

Session required / lib64/security/pam_limits.so

Session required pam_limits.so

[root@lynn-02 database] # vim / etc/pam.d/login#%PAM-1.0auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.soauth substack system-authauth include postloginaccount required pam_nologin.soaccount include system-authpassword include system-auth# pam_selinux.so close should be the first session rulesession required pam_selinux.so closesession required pam_loginuid.sosession optional pam_console.sosession required / lib64/security/pam_limits.sosession required pam_limits.so# pam_selinux.so open should only be followed by sessions to be executed in the user contextsession required pam_selinux.so opensession required pam_namespace.sosession optional pam_keyinit.so force revokesession include system-authsession include postlogin-session optional pam_ck_connector.so

Modify the / etc/profile file:

Add the following:

If [$USER = "oracle"]; then

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

Ulimit-p 16384

Ulimit-n 65536

Else

Ulimit-u 16384-n 65536

Fi

Fi

[root@lynn-02 database] # vim / etc/profile# / etc/profile# System wide environment and startup programs, for login setup# Functions and aliases go in / etc/bashrc# It's NOT a good idea to change this file unless you know what you# are doing. It's much better to create a custom.sh shell script in# / etc/profile.d/ to make custom changes to your environment, as this# will prevent the need for merging in future updates.pathmunge () {case ": ${PATH}:" in *: "$1": *); *) if ["$2" = "after"] Then PATH=$PATH:$1 else PATH=$1:$PATH fi esac} if [- x / usr/bin/id]; then if [- z "$EUID"] Then # ksh workaround EUID= `/ usr/bin/id-u` UID=` / usr/bin/id-ru` fi USER= "`/ usr/bin/id-un`" LOGNAME=$USER MAIL= "/ var/spool/mail/$USER" fi# Path manipulationif ["$EUID" = "0"]; then pathmunge / usr/sbin pathmunge / usr/local/sbin# By default, we want umask to get set. This sets it for login shell# Current threshold for system reserved uid/gids is 20 You could check uidgid reservation validity in# / usr/share/doc/setup-*/uidgid fileif [$UID-gt] & & ["`/ usr/bin/id-gn`" = "` / usr/bin/id-un`"]; then umask 002else umask 022fifor I in/ etc/profile.d/*.sh; do if [- r "$I"] Then if ["${- # * I}"! = "$-"]; then. "$I" else. "$I" > / dev/null fi fidoneunset iunset-f pathmungeif [$USER = "oracle"]; then if [$SHELL = "/ bin/ksh"]; then ulimit-p 16384 ulimit-n 65536 else ulimit-u 16384-n 65536 fifi

Create installation directory and set file permissions

[root@lynn-02 database] # vim / etc/security/ profiles. Confession [root @ lynn-02 database] # vim / etc/pam.d/ log [root @ lynn-02 database] # vim / etc/ profile [root @ lynn-02 database] # mkdir-p / data/oracle/product/11.2.0 [root@lynn-02 database] # mkdir / data/oracle/ oradata [root @ lynn-02 database] # mkdir / data/oracle/ account [root @ lynn-02 database] # mkdir / data/oracle / fast_recovery_ area [root @ lynn-02 database] # chown-R oracle:oinstall / data/ Oracle [root @ lynn-02 database] # chmod-R 775 / data/oracle

Set oracle user environment variables

Log in to oracle users

[root@lynn-02 ~] # su-oracle Last login: June 7, April 7, 09:27:52 on CST 2018pts/0

Edit .bash _ profile to add the following:

ORACLE_BASE=/data/oracle

ORACLE_HOME=$ORACLE_BASE/product/11.2.0

ORACLE_SID=ora11

PATH=$PATH:$ORACLE_HOME/bin

Export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH

Note that the bold must be the same as the name of the database instance created, otherwise the database cannot be accessed after startup.

[oracle@lynn-02] $vim .bash _ profile# .bash _ profile# Get the aliases and functionsif [- f ~ / .bashrc]; then. ~ / .bashrcfi # User specific environment and startup programsPATH=$PATH:$HOME/.local/bin:$HOME/binexport PATHORACLE_BASE=/data/oracleORACLE_HOME=$ORACLE_BASE/product/11.2.0ORACLE_SID=ora11PATH=$PATH:$ORACLE_HOME/binexport ORACLE_BASE ORACLE_HOME ORACLE_SIDPATH

Edit / data/oracle/oraclesetup/database/response/db_install.rsp silent installation response file

[oracle@lynn-02 ~] $vim / data/oracle/oraclesetup/database/response/db_install.rsp

The options to be set are as follows:

Oracle.install.option=INSTALL_DB_SWONLY

ORACLE_HOSTNAME=CentOS

UNIX_GROUP_NAME=oinstall

INVENTORY_LOCATION=/data/oracle/inventory

SELECTED_LANGUAGES=en,zh_CN

ORACLE_HOME=/data/oracle/product/11.2.0

ORACLE_BASE=/data/oracle

Oracle.install.db.InstallEdition=EE

Oracle.install.db.DBA_GROUP=dba

Oracle.install.db.OPER_GROUP=dba

DECLINE_SECURITY_UPDATES=true

Silently install Oracle 11g [oracle @ lynn-02 response] $cd / data/oracle/oraclesetup/database/ [oracle @ lynn-02 database] $. / runInstaller-silent-responseFile / data/oracle/oraclesetup/database/response/db_install.rsp-ignorePrereqStarting Oracle Universal Installer...Checking Temp space: must be greater than 120 MB. Actual 9490 MB PassedChecking swap space: must be greater than 150 MB. Actual 4095 MB PassedPreparing to launch Oracle Universal Installer from / tmp/OraInstall2018-04-07 / 11-12-32AM. Please wait... [oracle@lynn-02 database] $[WARNING] [INS-32055] The Central Inventory is located in the Oracle base. CAUSE: The Central Inventory is located in the Oracle base. ACTION: Oracle recommends placing this Central Inventory in a location outside the Oracle base directory. [WARNING] [INS-32055] The Central Inventory is located in the Oracle base. CAUSE: The Central Inventory is located in the Oracle base. ACTION: Oracle recommends placing this Central Inventory in a location outside the Oracle base directory.You can find the log of this install session at: / data/oracle/inventory/logs/installActions2018-04-07. 11-12-32AM.logThe following configuration scripts need to be executed as the "root" user. #! / bin/sh # Root scripts to run/data/oracle/inventory/orainstRoot.sh/data/oracle/product/11.2.0/root.shTo 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

Start silent installation of Oracle in the background. During installation, if you prompt [WARNING] to ignore it, the installer is still in the background, and if [FATAL] appears, the installer has stopped.

Installation is successful when Successfully Setup Software appears.

Open the terminal, log in as root, and execute the script:

[root@lynn-02 ~] # sh / data/oracle/inventory/orainstRoot.shChanging permissions of / data/oracle/inventory.Adding read,write permissions for group.Removing read,write Execute permissions for world.Changing groupname of / data/oracle/inventory to oinstall.The execution of the script is complete.[ root @ lynn-02 ~] # sh / data/oracle/product/11.2.0/root.shCheck / data/oracle/product/11.2.0/install/root_lynn-02_2018-04-07 / 11-26-59.log for the output of root script

Configure snooping silently:

Re-use oracle user login to execute netca / silent / responseFile / data/oracle/oraclesetup/database/response/netca.rsp

[root@lynn-02 ~] # su-oracle Last login: [oracle@lynn-02 ~] $netca / silent / responseFile / data/oracle/oraclesetup/database/response/netca.rsp is parsing command line parameters on CST 2018pts/1 at 10:16:21 on Saturday, April 7: parameter "silent" = true parameter "responsefile" = / data/oracle/oraclesetup/database/response/netca.rsp completes parsing of command line parameters. Oracle Net Services configuration: complete the profile configuration. Oracle Net listener startup: running listener control: / data/oracle/product/11.2.0/bin/lsnrctl start LISTENER listener control completed. The listener started successfully. The listener configuration is complete. Oracle Net Services configuration completed successfully. The exit code is 0

After running successfully, generate listener.ora and sqlnet.ora in / data/oracle/product/11.2.0/network/admin/

[oracle@lynn-02 ~] $ls / data/oracle/product/11.2.0/network/admin/listener.ora samples shrept.lst sqlnet.ora

You can see that port 1521 is listening through the netstat command.

[root@lynn-02 ~] # netstat-tnulp | grep 1521tcp6 0 0: 1521: * LISTEN 13419/tnslsnr

Create a new library silently, as well as a corresponding instance.

Edit / data/oracle/oraclesetup/database/response/dbca.rsp

Set the following parameters:

GDBNAME= "ora11"

SID = "ora11"

SYSPASSWORD= "20180606"

SYSTEMPASSWORD= "20180606"

SYSMANPASSWORD= "20180606"

DBSNMPPASSWORD= "20180606"

DATAFILEDESTINATION=/data/oracle/oradata

RECOVERYAREADESTINATION=/data/oracle/fast_recovery_area

CHARACTERSET= "ZHS16GBK"

TOTALMEMORY= "1638"

Where TOTALMEMORY = "1638" is 1638MB and physical memory is 2Gbps.

[oracle@lynn-02 ~] $vim / data/oracle/oraclesetup/database/response/dbca.rsp

Silent configuration

[oracle@lynn-02 ~] $dbca-silent-responseFile / data/oracle/oraclesetup/database/response/dbca.rsp replication database file 1% completed 3% completed 18% completed 26% completed 37% created and started Oracle instance 40% completed 45% completed 50% completed 55% completed 56% completed 60% completed 62% Completed database creation in progress 66% completed 70% completed 73% completed 85% completed 96% completed 100% completed details See the log file "/ data/oracle/cfgtoollogs/dbca/ora11/ora11.log".

Check the instance process after building the database:

[oracle@lynn-02 ~] $ps-ef | grepora _ | grep-v greporacle 13850 10 14:32? 00:00:00 ora_pmon_ora11oracle 13852 10 14:32? 00:00:00 ora_vktm_ora11oracle 13856 10 14:32? 00:00:00 ora_gen0_ora11oracle 13858 10 14:32? 00:00:00 ora_diag_ora11oracle 13860 1 0 14:32? 00:00:00 ora_dbrm_ora11oracle 13862 1 0 14:32? 00:00:00 ora_psp0_ora11oracle 13864 1 0 14:32? 00:00:00 ora_dia0_ora11oracle 13866 1 0 14:32? 00:00:00 ora_mman_ora11oracle 13868 1 0 14:32? 00:00:00 ora_dbw0_ora11oracle 13870 1 0 14:32? 00:00:00 ora_lgwr_ora11oracle 13872 1 0 14:32? 00:00:00 ora_ckpt_ora11oracle 13874 1 0 14:32? 00:00:00 ora_smon_ora11oracle 13876 1 0 14:32? 00:00:00 ora_reco_ora11oracle 13878 1 0 14:32? 00:00:00 ora_mmon_ora11oracle 13880 1 0 14:32? 00:00:00 ora_mmnl_ora11oracle 13882 1 0 14:32? 00:00:00 ora_d000_ora11oracle 13884 1 0 14:32? 00:00:00 ora_s000_ora11oracle 13898 1 0 14:32? 00:00:00 ora_qmnc_ora11oracle 13913 1 0 14:32? 00:00:00 ora_cjq0_ora11oracle 13915 1 0 14:32? 00:00:00 ora_q000_ora11oracle 13917 1 0 14:32? 00:00:00 ora_q001_ora11

View the monitoring status:

[oracle@lynn-02] $lsnrctl statusLSNRCTL for Linux: Version 11.2.0.1.0-Production on 07-APR-2018 14:34:17Copyright (c) 1991, 2009, Oracle. All rights reserved.Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=IPC) (KEY=EXTPROC1521)) STATUS of the LISTENER----Alias LISTENERVersion TNSLSNR for Linux: Version 11.2.0.1.0-ProductionStart Date 07-APR-2018 14:11:08Uptime 0 days 0 hr. 23 min. 13 secTrace Level offSecurity ON: Local OS AuthenticationSNMP OFFListener Parameter File / data/oracle/product/11.2.0/network/admin/listener.oraListener Log File / data/oracle/diag/tnslsnr/lynn-02/listener/alert/log.xmlListening Endpoints Summary... (DESCRIPTION= (ADDRESS= (PROTOCOL=ipc) (KEY=EXTPROC1521) (DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=lynn-02) (PORT=1521)) Services Summary...Service "ora11" has 1 instance (s) Instance "ora11", status READY, has 1 handler (s) for this service...Service "ora11XDB" has 1 instance (s). Instance "ora11", status READY, has 1 handler (s) for this service...The command completed successfully

Log in to view the status of the instance:

[oracle@lynn-02] $sqlplus / as sysdbaSQL*Plus: Release 11.2.0.1.0 Production on Sat Apr 7 17:28:34 2018Copyright (c) 1982, 2009, Oracle. All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL > select status from

Modify / data/oracle/product/11.2.0/bin/dbstart

[oracle@lynn-02 ~] $vim / data/oracle/product/11.2.0/bin/dbstart

Change ORACLE_HOME_LISTNER=$1 to ORACLE_HOME_LISTNER=$ORACLE_HOME

Modify / data/oracle/product/11.2.0/bin/dbshut

[oracle@lynn-02 ~] $vim / data/oracle/product/11.2.0/bin/dbshut

Change ORACLE_HOME_LISTNER=$1 to ORACLE_HOME_LISTNER=$ORACLE_HOME

Modify / etc/oratab file

Change the last N in orcl:/data/oracle/product/11.2.0:N to Y to become orcl:/data/oracle/product/11.2.0:Y

[oracle@lynn-02] $vim / etc/oratab## This file is used by ORACLE utilities. It is created by root.sh# and updated by the Database Configuration Assistant when creating# a database.# A colon,':', is used as the field terminator. A new line terminates# the entry. Lines beginning with a pound sign,'#', are comments.## Entries are of the form:# $ORACLE_SID:$ORACLE_HOME::## The first and second fields are the system identifier and home# directory of the database respectively. The third filed indicates# to the dbstart utility that the database should, "Y", or should not,# "N", be brought up at system boot time.## Multiple entries with the same $ORACLE_SID are not allowed.##ora11:/data/oracle/product/11.2.0:Y

Enter the commands dbshut and dbstart to test

[oracle@lynn-02 ~] $dbshutProcessing Database instance "ora11": log file / data/oracle/product/11.2.0/ shutdown.log [oracle @ lynn-02] $lsnrctl statusLSNRCTL for Linux: Version 11.2.0.1.0-Production on 07-APR-2018 14:52:41Copyright (c) 1991, 2009, Oracle. All rights reserved.Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=IPC) (KEY=EXTPROC1521)) TNS-12541: TNS:no listener TNS-12560: TNS:protocol adapter error TNS-00511: No listener Linux Error: 2: No such file or directoryConnecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=CentOS) (PORT=1521) TNS-12541: TNS:no listener TNS-12560: TNS:protocol adapter error TNS-00511: No listener Linux Error: 111: Connection refractive [lynn-02 ~] $ps-ef | grep ora_ | grep-v grep [oracle @ lynn-02 ~] $

Oracle snooping stops and the process disappears.

[oracle@lynn-02 ~] $dbstartProcessing Database instance "ora11": log file / data/oracle/product/11.2.0/ startup.log [oracle @ lynn-02 ~] $lsnrctl statusLSNRCTL for Linux: Version 11.2.0.1.0-Production on 07-APR-2018 14:54:27Copyright (c) 1991, 2009, Oracle. All rights reserved.Connecting to (DESCRIPTION= (ADDRESS= (PROTOCOL=IPC) (KEY=EXTPROC1521)) STATUS of the LISTENER----Alias LISTENERVersion TNSLSNR for Linux: Version 11.2.0.1.0-ProductionStart Date 07-APR-2018 14:54:13Uptime 0 days 0 hr. 0 min. 19 secTrace Level offSecurity ON: Local OS AuthenticationSNMP OFFListener Parameter File / data/oracle/product/11.2.0/network/admin/listener.oraListener Log File / data/oracle/diag/tnslsnr/lynn-02/listener/alert/log.xmlListening Endpoints Summary... (DESCRIPTION= (ADDRESS= (PROTOCOL=ipc) (KEY=EXTPROC1521) (DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=lynn-02) (PORT=1521)) Services Summary...Service "ora11" has 1 instance (s) Instance "ora11", status READY, has 1 handler (s) for this service...Service "ora11XDB" has 1 instance (s). Instance "ora11", status READY Has 1 handler (s) for this service...The command completed fulfilling [oracle @ lynn-02 ~] $ps-ef | grepora _ | grep-v greporacle 14236 1 0 14:54? 00:00:00 ora_pmon_ora11oracle 14238 10 14:54? 00:00:00 ora_vktm_ora11oracle 14242 10 14:54? 00:00:00 ora_gen0_ora11oracle 14245 10 14:54? 00:00:00 ora_diag_ora11oracle 14247 1 0 14:54? 00:00:00 ora_dbrm_ora11oracle 14249 1 0 14:54? 00:00:00 ora_psp0_ora11oracle 14251 1 0 14:54? 00:00:00 ora_dia0_ora11oracle 14253 1 0 14:54? 00:00:00 ora_mman_ora11oracle 14255 1 0 14:54? 00:00:00 ora_dbw0_ora11oracle 14257 1 0 14:54? 00:00:00 ora_lgwr_ora11oracle 14259 1 0 14:54? 00:00:00 ora_ckpt_ora11oracle 14261 1 0 14:54? 00:00:00 ora_smon_ora11oracle 14264 1 0 14:54? 00:00:00 ora_reco_ora11oracle 14266 11 14:54? 00:00:00 ora_mmon_ora11oracle 14268 1 0 14:54? 00:00:00 ora_mmnl_ora11oracle 14270 1 0 14:54? 00:00:00 ora_d000_ora11oracle 14272 1 0 14:54? 00:00:00 ora_s000_ora11oracle 14280 1 0 14:54? 00:00:00 ora_qmnc_ora11oracle 14358 1 0 14:54? 00:00:00 ora_cjq0_ora11oracle 14360 1 0 14:54? 00:00:00 ora_j000_ora11oracle 14362 1 0 14:54? 00:00:00 ora_j001_ora11oracle 14371 1 0 14:54? 00:00:00 ora_q000_ora11oracle 14373 1 0 14:54? 00:00:00 ora_q001_ora11

Oracle snooping starts and the process starts.

Switch to root account to set up a self-startup script

[oracle@lynn-02 ~] $su-password: last login: Saturday, April 7, 11:21:33 on CST 2018pts/0 [root@lynn-02 ~] # vim / etc/rc.d/init.d/oracle

Add the following (some values such as ORACLE_HOME and ORACLE_USER can be modified according to the actual situation):

#! / bin/bash#oracle: Start/Stop Oracle Database 11g R2#chkconfig: 345 90 10#description: The Oracle Database is an Object-Relational Database ManagementSystem.#. / etc/rc.d/init.d/functionsLOCKFILE=/var/lock/subsys/oracleORACLE_HOME=/data/oracle/product/11.2.0ORACLE_USER=oraclecase "$1" in'start') if [- f $LOCKFILE]; then echo $0 already running. Else echo-n $"StartingOracle Database:" su-$ORACLE_USER-c "$ORACLE_HOME/bin/lsnrctl start" su-$ORACLE_USER-c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME" su-$ORACLE_USER-c "$ORACLE_HOME/bin/emctl start dbconsole" touch $LOCKFILE fi 'stop') if [!-f $LOCKFILE]; then echo $0 already stopping. Else echo-n $"StoppingOracle Database:" su-$ORACLE_USER-c "$ORACLE_HOME/bin/lsnrctl stop" su-$ORACLE_USER-c "$ORACLE_HOME/bin/dbshut" su-$ORACLE_USER-c "$ORACLE_HOME/bin/emctl stop dbconsole" rm-f $LOCKFILE fi 'restart') $0 stop sleep 5 $0 start;;' status') if [- f $LOCKFILE]; then echo $0 started. Else echo $0 stopped. Fi;; *) echo "Usage: $0 [start | stop | status]" exit 1esacexit 0

Modify / etc/init.d/oracle service file permissions

[root@lynn-02 ~] # chmod 755 / etc/init.d/oracle

Set to boot

[root@lynn-02 ~] # chkconfig oracle on [root @ lynn-02 ~] # chkconfig-- list oracle Note: this output shows only SysV services, not native systemd services. SysV configuration data may be overwritten by native systemd configurations. To list systemd services, execute 'systemctl list-unit-files'. To view the services enabled in a specific target, please execute 'systemctl list-dependencies [target]'. Oracle 0: off 1: off 2: on 3: on 4: on 5: on 6: off

Conduct a service oracle start/stop/restart test

[root@lynn-02 ~] # service oracle status/etc/init.d/oracle stopped.[ root @ lynn-02 ~] # service oracle startStarting oracle (via systemctl): [OK] [root@lynn-02 ~] # service oracle stopStopping oracle (via systemctl): [OK] [root@lynn-02 ~] # service oracle restartRestarting oracle (via systemctl): [OK]

Reboot restart View Oracle snooping and instance processes can be started automatically.

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