Databases Reference
In-Depth Information
Solution
Connect to the database with a sys* privileged user ( sysdba , sysoper , or sysbackup ), and issue the startup and
shutdown statements. If you're not sure which account you should use, refer to Recipe 2-1 for details on connecting
to your database. The following example uses OS authentication to connect to the database:
$ sqlplus / as sysdba
After you are connected as a privileged account, you can start up your database as follows:
SQL> startup;
You should then see messages from Oracle indicating that the system global area (SGA) has been allocated and
the database is mounted and then opened. For example:
ORACLE instance started.
Total System Global Area 300630016 bytes
Fixed Size 2259768 bytes
Variable Size 222299336 bytes
Database Buffers 71303168 bytes
Redo Buffers 4767744 bytes
Database mounted.
Database opened.
Use the shutdown immediate statement to stop a database. The immediate parameter instructs Oracle to halt
database activity and roll back any open transactions:
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
In most cases, shutdown immediate is an acceptable method of shutting down your database.
Stopping and restarting your database in quick succession is known colloquially in DBA land as bouncing
the database.
Note
How It Works
Starting and stopping your database is a fairly simple process. If the environment is set up correctly, you should be
able to connect to your database as a privileged user and issue the appropriate startup and shutdown statements.
When shutting down your database, usually shutdown immediate is sufficient. If shutdown immediate appears
to be hanging, then don't be afraid to try shutdown abort ; it's not as bad as it sounds. The shutdown abort command
immediately terminates the database instance and transactions are killed and are not rolled back. Oracle will ensure
uncommitted transactions are rolled back when you subsequently restart the database (after shutdown abort ).
 
 
Search WWH ::




Custom Search