Database Startup |
What do they do? |
NOMOUNT |
background processes are started based
on reading the spfile |
MOUNT |
control files are opened and read |
OPEN |
data files are opened |
|
Startup <options> |
STARTUP [FORCE][RESTRICT][NOMOUNT][MIGRATE][QUIET]
[PFILE=<file_name>]
[MOUNT [EXCLUSIVE] <database_name>x |
OPEN <READ {ONLY | WRITE [RECOVER]} | RECOVER>
<database_name>] |
SQL> STARTUP |
Startup Force |
SQL> STARTUP FORCE |
Startup Nomount |
SQL> STARTUP NOMOUNT |
Startup Mount |
SQL> STARTUP MOUNT |
Startup Mount Exclusive |
Deprecated .. now use STARTUP MOUNT |
Startup Open |
SQL> STARTUP OPEN |
Startup Migrate |
SQL> STARTUP MIGRATE |
Startup Restricted |
SQL> STARTUP RESTRICT |
Startup <upgrade> |
STARTUP [PFILE=<file_name>]{UPGRADE | DOWNGRADE} [QUIET] |
SQL> STARTUP UPGRADE |
|
Alter Database |
Alter Database Mount |
SQL> ALTER DATABASE MOUNT |
Alter Database Open |
SQL> ALTER DATABASE OPEN |
|
Database Shutdown |
Shutdown |
SHUTDOWN <ABORT | IMMEDIATE | TRANSACTIONAL[LOCAL]> |
SQL> SHUTDOWN |
Shutdown Normal |
SQL> SHUTDOWN NORMAL |
Shutdown Transactional |
SQL> SHUTDOWN TRANSACTIONAL |
Shutdown Immediate |
SQL> SHUTDOWN IMMEDIATE |
Shutdown Abort |
SQL> SHUTDOWN ABORT |
|
Oracle Supplied Startup & Shutdown Scripts |
Startup |
dbstart |
Shutdown |
dbshut |
|
System Hangs On Shutdown |
Solution #1 |
SQL> alter system checkpoint;
SQL> shutdown abort
SQL> startup restrict
SQL> shutdown immediate |
|
Oracle Services On Windows |
Startup |
net start OracleService<SID> |
c:\winnt\system32 net start oracleserviceorabase |
Shutdown |
net stop OracleService<SID> |
c:\winnt\system32 net stop oracleserviceorabase |
Help |
net<error_msg_number> |
c:\winnt\system32 net help helpmsg
c:\winnt\system32\net1063 |
|
Oracle Services On Windows With Oradim |
Start Oracle Service |
oradim -STARTUP
[-SID <side_name> | -ASMSID <sid> [-SYSPWD <password>]
[STARTTYPE <service_name | instance_name | service_name,instance_name]
[-PFILE <file_name> | -SPFILE] |
$ORACLE_HOME\bin\oradim -STARTUP
-SID orabase -STARTTYPE tstc -SPFILE |
Stop Oracle Service |
oradim -SHUTDOWN
[-SID <side_name> | -ASMSID <sid> [-SYSPWD <password>]
[-SHUTTYPE <service_name | instance_name | service_name,instance_name]
[-SHUTMODE <normal | immediate | abort> |
$ORACLE_HOME\bin\oradim -SHUTDOWN
-SID orabase -SHUTMODE abort |
|
Stopping Processes |
When stop doesn't stop |
alter database close may fail for many reasons. Among them job queue processes, dbms_job, and advanced queueing.
SQL> ALTER DATABASE CLOSE;
alter database close
*
ERROR at line 1:
ORA-01093: ALTER DATABASE CLOSE only permitted with no sessions connected
col username format a20
col schemaname format a20
col osuser format a20
SELECT username, schemaname, osuser, status
FROM gv$session;
ALTER SYSTEM SET job_queue_processes = 0 SCOPE=MEMORY;
ALTER SYSTEM SET aq_tm_processes=0 SCOPE=MEMORY;
ALTER DATABASE CLOSE; |
Force log files to be archived in preparation for media recovery |
startup mount;
alter database orabase archivelog;
alter system archive log start;
alter database open; |
When testing startup scripts be
sure you are mimicking the environment under which the script will
actually run |
For example:
sh -x /etc/init.d/oracle start |