Home arrow Site Administration arrow Oracle Database XE: Utilities and Troubleshooting

Oracle Database XE: Utilities and Troubleshooting

In this conclusion to a five-part series on Oracle Database XE administration, you'll learn how to start and stop the application, troubleshoot it, and use its utilities. This article is excerpted from chapter 28 of the book Beginning PHP and Oracle: From Novice to Professional, written by W. Jason Gilmore and Bob Bryla (Apress; ISBN: 1590597702).

TABLE OF CONTENTS:
  1. Oracle Database XE: Utilities and Troubleshooting
  2. Using Oracle-Supplied Utilities
  3. Troubleshooting in Oracle
By: Apress Publishing
Rating: starstarstarstarstar / 1
October 21, 2010

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

Starting and Stopping Oracle Database XE

When you install Oracle Database XE, one of your options is to startthe database automatically when the operating system starts. When youshut down your server, the shutdown process runs scripts toautomatically shut down the database as well. Whether you start thedatabase automatically using this method, or start it manually using themenu commands or SQL*Plus, there are situations where you need to stopthe database manually without shutting down your server. For example,you may want to move some of your tablespaces from one disk drive toanother, or you may want to change some system parameters that can onlybe changed after you shut down the database.


Note  Under Linux, Oracle starts up automatically when theparameterORACLE_DBENABLEDis set toTRUEin the file/etc/sysconfig/oracle-xe. Under Windows operating systems, the installer sets the autostartoption by setting the registry keyHKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_XE\
ORA_XE_AUTOSTARTtoTRUE
.  


Starting Oracle Database XE

The manual startup and shutdown procedures are identical on Linux andWindows. You can use SQL*Plus from the command line, the SQL CommandGUI equivalent from the Windows or Linux start menu, or the StartDatabase and Stop Database menu items in the Windows or Linux startmenu. The following shows how to start up SQL*Plus from the command lineif you did not configure Oracle to start up automatically on your Linuxserver:

[oracle@phpxe ~]$ sqlplus system as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on FriJul 14 00:17:53 2006

Copyright (c) 1982, 2005, Oracle. All rightsreserved.

Enter password:
Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area   146800640 bytes FixedSize                   1257668 bytes Variable Size               79695676 bytes Database Buffers            62914560 bytes RedoBuffers                 2932736 bytes Database mounted.
Database opened.
SQL>

Notice the keywordsAS SYSDBAin theSQLPLUScommand. Because the database is down, you cannot authenticate your useraccount using the database.AS SYSDBAauthenticates your user account with a password file stored in theOracle directory structure. The password you supply is the same passwordyou use to connect when the database is up. Oracle automatically keepsthe passwords stored in the database in sync with the passwords storedin the password file for user accounts that you grant theSYSDBAprivilege. We discuss user privileges, security, and roles in greaterdetail in Chapter 30.


Note  The password file is located in%ORACLE_HOME%\server\database\PWDXE.oraon Windows and$ORACLE_HOME/dbs/orapwXEon Linux.


If you are logged into the server using the user account you used toinstall the Oracle software, you can start up the database byauthenticating with the operating system. You need not specify a useraccount or a password. To use operating system authentication to startup the database, you use the/keyword as follows:

[oracle@phpxe ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on FriJul 14 00:18:20 2006

Copyright (c) 1982, 2005, Oracle. All rightsreserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area   146800640 bytes FixedSize                   1257668 bytes Variable Size             79695676bytes Database Buffers            62914560 bytes RedoBuffers                 2932736 bytes Database mounted.
Database opened.

SQL>

Notice that you specify neither a username nor a password, since theauthentication takes place when you log into the operating systemaccount that owns the Oracle software.

If you are using Windows XP as your host operating system, you donítneed to see the command line. Click Start ? All Programs ? OracleDatabase 10g Express Edition ? Start Database to, as you mightexpect, start the database. A DOS command window will appear to confirmthat you started the database successfully.

Stopping Oracle Database XE

Ideally, you want all users logged off before you shut down thedatabase. If you cannot contact the users that are still logged in anddo not have time to disconnect each session manually using the MonitorSessions function under the Administration icon on the Oracle DatabaseXE home page, you can still shut down the database quickly with the SHUTDOWN IMMEDIATEcommand. This command performs the following operations:

  1. Prevents any new connections
  2. Prevents any new transactions from starting 
     
  3. Rolls back any uncommitted transactions 
     
  4. Immediately disconnects all users and applications

To shut down the database, connect to the database using the commandSQLPLUS / AS SYSDBA, and use theSHUTDOWN IMMEDIATEcommand:

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
 

If theSHUTDOWNcommand does not respond after several minutes, you can force ashutdown. The database may not be responding for a number of reasons,including a background process that is no longer responding, a corrupteddatafile, or a network failure. Use theSHUTDOWN ABORTcommand to force a shutdown:

SQL> shutdown abort
ORACLE instance shut down.
SQL>

Since the database is in an inconsistent state, Oracle recommends thatyou start up the database to perform a recovery process, and then shutdown the database gracefully using theSHUTDOWN IMMEDIATEcommand:

SQL> startup
ORACLE instance started.

Total System Global Area   146800640 bytes FixedSize                   1257668 bytes Variable Size             79695676bytes Database Buffers            62914560 bytes RedoBuffers                 2932736 bytes Database mounted.
Database opened.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>

If you are using Windows XP as your host operating system, you donítneed to see the command line in this case either. Click Start ? AllPrograms ? Oracle Database 10g Express Edition ? Stop Database tostop the database. A DOS command window will appear to confirm that youstopped the database successfully.



 
 
>>> More Site Administration Articles          >>> More By Apress Publishing
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

SITE ADMINISTRATION ARTICLES

- Coding: Not Just for Developers
- To Support or Not Support IE?
- Administration: Networking OSX and Win 7
- DotNetNuke Gets Social
- Integrating MailChimp with Joomla: Creating ...
- Integrating MailChimp with Joomla: List Mana...
- Integrating MailChimp with Joomla: Building ...
- Integrating MailChimp with Joomla
- More Top WordPress Plugins for Social Media
- Optimizing Security: SSH Public Key Authenti...
- Patches and Rejects in Software Configuratio...
- Configuring a CVS Server
- Managing Code and Teams for Cross-Platform S...
- Software Configuration Management
- Back Up a Joomla Site with Akeeba Backup

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: