Brief Tutorial Oracle 10g Administration in Solaris 10
Everytime I shutdown my Solaris 10, sometimes I forget how to start and stop database Oracle 10g. So, I write down this article to remind me again if I forget to start/stop my database. You have to refer to this article Install Oracle 10g in Solaris 10 x86 as a reference for some configurations. |
START AND STOP DATABASE ORACLE 10g
1. Login as database owner user. In this case, the user is oracle.
bash-3.00# su - oracle
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
2. Set ORACLE_HOME and ORACLE_SID.
bash-3.00$ export ORACLE_HOME=/export/home/oracle/product/10.2.0/db_1
bash-3.00$ export ORACLE_SID=ORASOL
bash-3.00$ export ORACLE_SID=ORASOL
3. Goto the Oracle instance folder.
bash-3.00$ cd /export/home/oracle/product/10.2.0/db_1/bin/
4. Execute SQL*Plus.
bash-3.00$ ./sqlplus /nolog
SQL*Plus: Release 10.2.0.2.0 - Production on Tue May 5 12:41:03 2009
Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
SQL>
SQL*Plus: Release 10.2.0.2.0 - Production on Tue May 5 12:41:03 2009
Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
SQL>
5. Connect database as sysdba account.
SQL> connect / as sysdba
Connected to an idle instance.
Connected to an idle instance.
6. Start database.
SQL> startup
ORACLE instance started.
Total System Global Area 289406976 bytes
Fixed Size 1279820 bytes
Variable Size 92276916 bytes
Database Buffers 192937984 bytes
Redo Buffers 2912256 bytes
Database mounted.
Database opened.
ORACLE instance started.
Total System Global Area 289406976 bytes
Fixed Size 1279820 bytes
Variable Size 92276916 bytes
Database Buffers 192937984 bytes
Redo Buffers 2912256 bytes
Database mounted.
Database opened.
7. Verify database by executing simple SQL script.
SQL> SELECT * FROM tab;
8. Stop database.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
Database closed.
Database dismounted.
ORACLE instance shut down.
9. Exit SQL*Plus.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
bash-3.00$
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
bash-3.00$
START AND STOP LISTENER ORACLE 10g
We will use lsnrctl command to start/stop listener. Basically lsnrctl (Listener Control) is an SQL*Net utility used for controlling database listeners. A listener is required for allowing remote (not local) clients to connect to the Oracle database via the network. This utility cannot create or configure listeners, but provides commands to control listener functions such as starting and stopping listeners, reporting the status of listeners, changing parameter listener settings, etc.
1. Under root login, make sure that you have configure your host. Please check it using this command.
bash-3.00# cat /etc/hosts
#
# Internet host table
#
::1 localhost
127.0.0.1 localhost
192.168.56.132 solaris10.server.com solaris10 unknown # Added by DHCP
#
# Internet host table
#
::1 localhost
127.0.0.1 localhost
192.168.56.132 solaris10.server.com solaris10 unknown # Added by DHCP
2. Login as database owner user. In this case, the user is oracle.
bash-3.00# su - oracle
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
3. Goto the Oracle instance folder.
bash-3.00$ cd /export/home/oracle/product/10.2.0/db_1/bin/
4. Start listener.
bash-3.00$ ./lsnrctl start
5. Stop listener.
bash-3.00$ ./lsnrctl stop