Starting / Shutdown Oracle Database in Unix

| Posted by watashii | Filed under Database, Unix

This simple guide to shows how to start /stop your Oracle database from Unix.  You must have logon access to do this.

Step 1

Unix login as oracle (usually the user that installed the database)

Step 2

Make sure your environment variables are set, eg:

ORACLE_SID=MYDBSID
ORACLE_BASE=/opt/oracle
ORACLE_HOME=/opt/oracle/product/11.2.0/dbhome_1
LD_LIBRARY_PATH=/opt/oracle/product/11.2.0/dbhome_1/lib
PATH=/usr/bin:/usr/sbin:/usr/ucb:/usr/local:/usr/local/bin:/usr/local/sbin:/opt/oracle/product/11.2.0/dbhome_1/bin

Step 3 – Start DB Instance

On the Unix command line, run sqlplus with sysdba, and simply type startup in the prompt to start it up.

oracle@db-srv-01 % sqlplus '/ as sysdba'

SQL*Plus: Release 11.2.0.1.0 Production on Tue Nov 30 12:06:47 2010

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 3207790592 bytes
Fixed Size                  2152368 bytes
Variable Size            2449475664 bytes
Database Buffers          738197504 bytes
Redo Buffers               17965056 bytes
Database mounted.
Database opened.

Step 4 – Start Listener

To start the oracle listener (assuming listener.ora is setup), run lsnrctl start

oracle@db-srv-01 % lsnrctl start

LSNRCTL for Solaris: Version 11.2.0.1.0 - Production on 30-NOV-2010 12:00:34

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Starting /opt/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...

TNSLSNR for Solaris: Version 11.2.0.1.0 - Production
System parameter file is /opt/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /opt/oracle/diag/tnslsnr/db-srv-01/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=db-srv-01)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=db-srv-01)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Solaris: Version 11.2.0.1.0 - Production
Start Date                30-NOV-2010 12:00:35
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /opt/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /opt/oracle/diag/tnslsnr/db-srv-01/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=db-srv-01)(PORT=1521)))
The listener supports no services
The command completed successfully

Step 4 – Shutdown

Similarly, to shutdown the instance, type shudown normal within sqlplus.

Stop the listener, by running lsnrctl stop

Tags: , , , ,

Abort Windows Shutdown Using Shortcut

| Posted by watashii | Filed under Programming

forceshutdown_abort

This follows on from the previous post on how to force shutdown your Windows machine using a shortcut.  This post shows how to cancel / stop Windows from shutting down after launching the shutdown command (eg by accident).

To create this shortcut, open Notepad, and add the following line of text, then save it with a .bat extension.  You need to hit the shortcut quickly if you want to abort in time.

shutdown.exe -a

Where:
-a abort shutdown

[abort_shutdown.bat] 32 bytes

Tags: , , ,

Force Shutdown Windows XP Using Shortcut

| Posted by watashii | Filed under Programming

forceshutdown

Here is a handy way to force shutdown your Windows XP machine using a shortcut.  To create this shortcut, open Notepad, and add the following line of text, then save it with a .bat extension.

shutdown.exe -f -s -t 5 -c "bye"

Where:
-s  shutdown (use -r for restart)
-f  force shutdown
-t  time delay (5 secs)
-c  prompted comment, "bye"

[shutdown.bat]  32 bytes

Tags: , ,

Windows Vista – Change Sleep Button to Shutdown Button

| Posted by watashii | Filed under Software

sleep_to_shutdown_button

Recently got my new computer system loaded with Windows Vista (Home Basic).  The first annoyance I encountered was that the default power down on the Start Menu is the orange sleep mode button.

Having sleep mode allows quick resume of Windows without needing to reload Windows from scratch, as well as saving power – the benefits obvious.

But for the not-so occasional PC user, a shutdown button is more convenient.  Here is how to swap it with red shutdown button.

- Goto [Start > Control Panel > Power Options]

- Click on the power plan in use, and select Advanced Power Settings

- Expand the + signs under Power Buttons and Lid, then Start Menu and Power Buttons

- Then in the dropdown box set it to the Shutdown setting

Tags: , , ,