16
AUTOMATION OF DATABASE STARTUP DURING LINUX BOOTUP Prepared By : SIRISHA DIRISAM Version : Oracle 10g Platform : LINUX (32 Bit)

Automation of Database on Linux - Pavan DBA's Blog Web viewOpen PuTTY application in which we have to give the host name or IP address of server and click on Open

Embed Size (px)

Citation preview

Page 1: Automation of Database on Linux - Pavan DBA's Blog  Web viewOpen PuTTY application in which we have to give the host name or IP address of server and click on Open

AUTOMATION OF DATABASE STARTUP DURING LINUX BOOTUP

Prepared By : SIRISHA DIRISAM

Version : Oracle 10g

Platform : LINUX (32 Bit)

Page 2: Automation of Database on Linux - Pavan DBA's Blog  Web viewOpen PuTTY application in which we have to give the host name or IP address of server and click on Open

We can configure our system to automatically start oracle databases when the system

starts and to shut down the databases when our system shuts down.

The dbstart and dbshut scripts are used to automate database startup and shutdown which

are located in the $ORACLE_HOME/bin directory. These scripts reference the same entries in

the oratab file, so the scripts must apply to the same set of databases. We have to perform the

following tasks to set up the dbstart and dbshut scripts so that they are called at system startup.

Step 1: Open PuTTY application in which we have to give the host name or IP address of server and click on Open.

Page 3: Automation of Database on Linux - Pavan DBA's Blog  Web viewOpen PuTTY application in which we have to give the host name or IP address of server and click on Open

Step 2: Login as root user and give the user name and password for authentication.

Step 3: Check user id (uid), group id (gid) and the current user’s effective groups by using id command.

Page 4: Automation of Database on Linux - Pavan DBA's Blog  Web viewOpen PuTTY application in which we have to give the host name or IP address of server and click on Open

Step 4: To know how many databases got created with their location and SID names we can verify in etc folder, open the oratab file.

Page 5: Automation of Database on Linux - Pavan DBA's Blog  Web viewOpen PuTTY application in which we have to give the host name or IP address of server and click on Open

Step 5: Edit the oratab file accordingly. Database entries in the oratab file appear in the following format: ORACLE_SID:ORACLE_HOME:{Y/N}, where Y or N specifies whether we want the dbstart and dbshut scripts to start up and shut down the database. Find the entries for all the databases that we want to start up. They are identified by the SID in the first field. Change the last field for each to Y and save the file.

Step 6: Create a file named dbora in the /etc/init.d directory (if it does not already exist)

Page 6: Automation of Database on Linux - Pavan DBA's Blog  Web viewOpen PuTTY application in which we have to give the host name or IP address of server and click on Open

Step 7: Copy the script (which is attached) and save the changes accordingly. For example, ORACLE_HOME, OWNER.

Page 7: Automation of Database on Linux - Pavan DBA's Blog  Web viewOpen PuTTY application in which we have to give the host name or IP address of server and click on Open

If the databases are in different locations then we have to mention those locations. We

can get the location from vi/<mount point>/usr/oraInventory/contentsXML/inventory.XML To

know the location of oraInventory vi/etc/oraInst.loc Save the script and exit.

Step 8: Change the permissions for the dbora file as chmod 750 /etc/init.d/dbora

Step 9: Associate the dbora service with the appropriate run levels and set it to auto start using

the command chkconfig –add <filename> and run the script

Page 8: Automation of Database on Linux - Pavan DBA's Blog  Web viewOpen PuTTY application in which we have to give the host name or IP address of server and click on Open

Step 10: Shut down the OS and restart using init 6 command.

Step 11: Switch to user and verify whether all databases are up and running using the command

ps –ef | grep smon

Here we can see the 3 databases which we have changed the status to Y in oratab file are up and

running.

Page 9: Automation of Database on Linux - Pavan DBA's Blog  Web viewOpen PuTTY application in which we have to give the host name or IP address of server and click on Open

Step 12: Connect to SQL as sysdba and verify the status of databases. Following are the

screenshots in which we can verify.

Page 10: Automation of Database on Linux - Pavan DBA's Blog  Web viewOpen PuTTY application in which we have to give the host name or IP address of server and click on Open
Page 11: Automation of Database on Linux - Pavan DBA's Blog  Web viewOpen PuTTY application in which we have to give the host name or IP address of server and click on Open
Page 12: Automation of Database on Linux - Pavan DBA's Blog  Web viewOpen PuTTY application in which we have to give the host name or IP address of server and click on Open
Page 13: Automation of Database on Linux - Pavan DBA's Blog  Web viewOpen PuTTY application in which we have to give the host name or IP address of server and click on Open

As observed all the databases are automatically got started when Linux bootup.