search
HomeDatabaseMysql TutorialSolaris上Oracle数据库开机自动启动方法

Solaris上Oracle数据库开机自动启动方法总结: 一、Solaris上开机自动启动 Solaris在开机时,会自动运行/etc/rc.d目录下的所有脚

Solaris上Oracle数据库开机自动启动方法总结:

一、Solaris上开机自动启动

Solaris在开机时,会自动运行/etc/rc.d目录下的所有脚本,其中N越大,执行的级别越高。其中,S开头的脚本在开机时自动运行,K开头的脚本在关机时自动运行。

二、Oracle上的启动脚本

启动脚本可以自己编写,也可以使用Oracle自带的启动和关闭数据库的脚本。

Oracle自带脚本:$ORACLE_HOME/bin/dbstart、$ORA_HOME/bin/dbshut

特别需要注意的是:dbstart中的参数PFILE可能存在问题,需要手动修改。

1、如在oracle用户下运行dbstart命令没有反应,,则需要在文件/var/opt/oracle/oratab中将“ora:/export/home/oracle/product/9.2:N”修改为“ora:/export/home/oracle/product/9.2:Y”。

三、设置Oracle自动启动步骤(使用Oracle自带脚本)

1、修改dbstart、dbshut脚本,保证直接运行时可启动和关闭数据库;

2、新建调用dbstart、dbshut的脚本dbora放置在/etc/init.d目录下,dbora的内容如下:

#!/bin/sh
ORA_HOME=/export/home/oracle/app/oracle/products/9.2.0
ORA_OWNER=oracle
if [ ! -f $ORA_HOME/bin/dbstart ]
  then
  echo "Oracle startup:cannot start"
  exit
fi
case "$1" in
'start' )
su - $ORA_OWNER -c $ORA_HOME/bin/dbstart &
/etc/init.d/dblsnrctl.sh
;;
'stop' )
su - $ORA_OWNER -c $ORA_HOME/bin/dbshut &
;;
esac

3、新建启动lsnrctl的脚本dblsnrctl.sh(dbora脚本将调用此脚本)防止在/etc/init.d目录下,dblsnrctl.sh的内容如下:

#!/bin/sh

su - oracle

lsnrctl start

exit

4、修改dbora脚本和dblsnrctl.sh脚本的权限,以保证可运行:

#chmod 755 /etc/init.d/dbora

#chmod 755 /etc/init.d/dblsnrctl.sh

5、在/etc/rc2.d中设置启动链接:

#cd /etc/rc2.d

6、在/etc/rc0.d中设置关闭链接:

#cd /etc/rc0.d

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
What Are the Limitations of Using Views in MySQL?What Are the Limitations of Using Views in MySQL?May 14, 2025 am 12:10 AM

MySQLviewshavelimitations:1)Theydon'tsupportallSQLoperations,restrictingdatamanipulationthroughviewswithjoinsorsubqueries.2)Theycanimpactperformance,especiallywithcomplexqueriesorlargedatasets.3)Viewsdon'tstoredata,potentiallyleadingtooutdatedinforma

Securing Your MySQL Database: Adding Users and Granting PrivilegesSecuring Your MySQL Database: Adding Users and Granting PrivilegesMay 14, 2025 am 12:09 AM

ProperusermanagementinMySQLiscrucialforenhancingsecurityandensuringefficientdatabaseoperation.1)UseCREATEUSERtoaddusers,specifyingconnectionsourcewith@'localhost'or@'%'.2)GrantspecificprivilegeswithGRANT,usingleastprivilegeprincipletominimizerisks.3)

What Factors Influence the Number of Triggers I Can Use in MySQL?What Factors Influence the Number of Triggers I Can Use in MySQL?May 14, 2025 am 12:08 AM

MySQLdoesn'timposeahardlimitontriggers,butpracticalfactorsdeterminetheireffectiveuse:1)Serverconfigurationimpactstriggermanagement;2)Complextriggersincreasesystemload;3)Largertablesslowtriggerperformance;4)Highconcurrencycancausetriggercontention;5)M

MySQL: Is it safe to store BLOB?MySQL: Is it safe to store BLOB?May 14, 2025 am 12:07 AM

Yes,it'ssafetostoreBLOBdatainMySQL,butconsiderthesefactors:1)StorageSpace:BLOBscanconsumesignificantspace,potentiallyincreasingcostsandslowingperformance.2)Performance:LargerrowsizesduetoBLOBsmayslowdownqueries.3)BackupandRecovery:Theseprocessescanbe

MySQL: Adding a user through a PHP web interfaceMySQL: Adding a user through a PHP web interfaceMay 14, 2025 am 12:04 AM

Adding MySQL users through the PHP web interface can use MySQLi extensions. The steps are as follows: 1. Connect to the MySQL database and use the MySQLi extension. 2. Create a user, use the CREATEUSER statement, and use the PASSWORD() function to encrypt the password. 3. Prevent SQL injection and use the mysqli_real_escape_string() function to process user input. 4. Assign permissions to new users and use the GRANT statement.

MySQL: BLOB and other no-sql storage, what are the differences?MySQL: BLOB and other no-sql storage, what are the differences?May 13, 2025 am 12:14 AM

MySQL'sBLOBissuitableforstoringbinarydatawithinarelationaldatabase,whileNoSQLoptionslikeMongoDB,Redis,andCassandraofferflexible,scalablesolutionsforunstructureddata.BLOBissimplerbutcanslowdownperformancewithlargedata;NoSQLprovidesbetterscalabilityand

MySQL Add User: Syntax, Options, and Security Best PracticesMySQL Add User: Syntax, Options, and Security Best PracticesMay 13, 2025 am 12:12 AM

ToaddauserinMySQL,use:CREATEUSER'username'@'host'IDENTIFIEDBY'password';Here'showtodoitsecurely:1)Choosethehostcarefullytocontrolaccess.2)SetresourcelimitswithoptionslikeMAX_QUERIES_PER_HOUR.3)Usestrong,uniquepasswords.4)EnforceSSL/TLSconnectionswith

MySQL: How to avoid String Data Types common mistakes?MySQL: How to avoid String Data Types common mistakes?May 13, 2025 am 12:09 AM

ToavoidcommonmistakeswithstringdatatypesinMySQL,understandstringtypenuances,choosetherighttype,andmanageencodingandcollationsettingseffectively.1)UseCHARforfixed-lengthstrings,VARCHARforvariable-length,andTEXT/BLOBforlargerdata.2)Setcorrectcharacters

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment