In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Database instance listens to boot self-startup settings under linux
2016-5-16 zhanky
Script introduction
Before we begin, let's introduce a few scripts that will be used.
Oratab
The oratab file is created when the database instance is created and is obtained after the root.sh script is executed by the root user at installation time. (if you forget, you can also create it manually. )
$ORACLE_HOME/bin/dbstart and $ORACLE_HOME/bin/dbshut in the $ORACLE_HOME/bin directory need to call the / etc/oratab file. If they do not exist, dbstart and dbshut will fail with an error message of / etc/oratab "is notaccessible.
The format of oratab is: ORACLE_SID:ORACLE_HOME:AUTO
If you need to start the database automatically, set AUTO to Y, which will not take effect until the dbstart command is called. Dbstart starts the corresponding database according to the configuration in / etc/oratab, but the option is whether you can use $ORACLE_HOME/bin/dbstart and $ORACLE_HOME/bin/dbshut to turn on and off the database.
If you start the database with your own script instead of a dbstart script, you don't need an oratab file at all.
Dbstart
Dbstart is the script that comes with the database installation to start the database instance, which is stored under $oracle_home/bin by default. Here we set the system to boot automatically execute the dbstart script file to achieve, boot automatically start the data instance.
Lsnrctl
Lsnrctl is a script that comes with database installation to start database listening. it is stored under $oracle_home/bin by default. Here we realize this by setting the system to boot and automatically execute lsnrctl script files, and boot up to start data monitoring automatically.
Rc.local
The rc.local system comes with a boot boot program script, which is stored under / etc/rc.d by default. We can start the database instance and listen automatically by adding scripts to the rc.local script to start the database and start listening.
Test introduction
System version: linuxredhat 5.4x64
Database version: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit Production
Instance name: test
ORACLE_HOME:/u01/app/oracle/product/11.2.0/dbhome_1
Test procedure
1. Modify / oratab
Create it manually because there is no oratab in my environment.
[oracle@zky /] $vi / etc/oratab
[oracle@zky /] $cat / etc/oratab
Test:/u01/app/oracle/product/11.2.0/dbhome_1:Y
2. Edit rc.local
The red mark is the newly added content.
The first is: log in with the oracle user and run the lsnrctl start script to enable snooping.
The second rule is: log in with oracle user, run dbstart to start the database
[root@zky /] $vi / etc/rc.d/rc.local
[root@zky /] $cat / etc/rc.d/rc.local
#! / bin/sh
#
# This script will be executed * after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
Touch / var/lock/subsys/local
Su-oracle-c "/ u01/app/oracle/product/11.2.0/dbhome_1/bin/lsnrctl start"
Su-oracle-c "/ u01/app/oracle/product/11.2.0/dbhome_1/bin/dbstart startup"
[root@zky /] $
3. Test and verify, restart the database.
Then complete the database instance and monitor the boot self-boot.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.