Let your Oracle start with the system

xiaoxiao2021-03-06  47

Under Windows, it is easy to implement Oracle automatic start, as long as it is set in [Administrative Tools] / [Service], this article mainly introduces the implementation method under Linux: 1. Oracle itself provides two scripts to implement Oracle. Start and close, but the default is not used, we can modify in the / etc / oratab file: Oracle: /oacle92/Product/9.2: n Change the last N to Y, indicating that the instance Oracle is automatically started. Now login with an Oracle user, try to perform DBSTART and DBSHUT, see if Oracle can check / stop. 2. Create a script to implement Oralce and the startup stop for the listener, which is convenient for operating system calls. #! / bin / bash #start and stop the oracle instance # #CHKCONFIG: 345 91 19 #description: Starts the oracle listener and instance ora_home = "/ Oracle / Product / 9.2" Ora_owner = "Oracle" IF [! -f $ ORA_HOME / BIN / DBSTART -O! -D $ ORA_HOME] THEN Echo "Oracle Startup: Cannot Start" EXIT 1 FI Case "$ 1" in start) #startup the Oracle Listener and Instance Echo -n "Oracle Startup:" Su - $ Ora_owner -c "$ ora_home / bin / lsnrctl start" su - $ ora_owner -c $ ora_home / bin / dbstart touch / var / lock / subsys / oracle echo "finished" ;; stop) #SHUTDOWN The Oracle Listener and Instance Echo - N "Oracle Shutdown:" Su - $ ORA_OWNER-C "$ ORA_HOME / BIN / LSNRCTL Stop" Su - $ ORA_OWNER -C $ ORA_HOME / BIN / DBSHUT RM -F / VAR / LOCK / SUBSYS / ORACLE Echo "Finished" ;; RELOAD | Restart $ 0 $ 0 Start ;; *) Echo "Usage: /etc/rc.d/init.d/oracle {start | stop | restart | reload}" EXIT 1 ESAC EXIT 0 Save the above script is called Oracle File, copy to /etc/rc.d/init.d, and modify file properties ChMOD U X Oracle Next, then this script is easy to use: ./oracle start ./oracle stop ./oracle recreation? Continue ... Let Linux start to call Oracle: Chkconfig -Add Oracle Let's take a look at whether to add successful chkconfig -l to see Oracle's startup options? Is it started at 3, 4, 5? OK! [Note] If your Oracle uses the spfile to make an initialization file, you should also create a file called InITORACLE.ORA in the initialization file directory, the content is: spfile = / oracle / Product / 9.2 / DBS / SPFileoracle.ora

转载请注明原文地址:https://www.9cbs.com/read-80438.html

New Post(0)