First, start monitoring and database
1. Start monitoring:
[HTML]View PlainCopy
- [Email protected] oracle]# su-oracle
- bash-4.1$ Lsnrctl Start
Description
The-,-l,--login is appended to the SU, which means that the environment variable (HOME,SHELL,USER,LOGNAME,PATH, etc.) is the same as the user who wants to switch the user,
The results are as follows, starting successfully:
[HTML]View PlainCopy
- Lsnrctl for linux:version 11.2.0.1.0-production on 04-apr-2014 16:15:25
- Copyright (c) 1991, Oracle. All rights reserved.
- Starting/home/oracle/product/11.2/db_1/bin/tnslsnr:please wait ...
- Tnslsnr for Linux:version 11.2.0.1.0-production
- System parameter File Is/home/oracle/product/11.2/db_1/network/admin/listener.ora
- Log messages Written To/home/oracle/diag/tnslsnr/jtwf/listener/alert/log.xml
- Listening on: (description= (address= (protocol=tcp) (host= jtwf) (port= 1521))
- Connecting to (description= (address= (protocol=TCP) (host=jtwf) (port=1521))
- STATUS of the LISTENER
- ------------------------
- Alias LISTENER
- Version Tnslsnr for Linux:version 11.2.0.1.0-production
- Start Date 04-apr-2014 16:15:25
- Uptime 0 days 0 hr. 0 min. 0 sec
- Trace level off
- Security on:local OS Authentication
- SNMP OFF
- Listener Parameter File/home/oracle/product/11.2/db_1/network/admin/listener.ora
- Listener Log File/home/oracle/diag/tnslsnr/jtwf/listener/alert/log.xml
- Listening Endpoints Summary ...
- (description= (address= (protocol=tcp) (host=jtwf) (port=1521 ))
- The listener supports no services
- The command completed successfully
2. Start the database:
Connect to Sqlplus
[HTML]View PlainCopy
- Su Oracle
- bash-4.1$ Sqlplus/nolog
The results are as follows:
[HTML]View PlainCopy
- Sql*plus:release 11.2.0.1.0 Production on Fri APR 4 16:15:52 2014
- Copyright (c) 1982, Oracle. All rights reserved.
- SQL>
Log in as SYSDBA and execute command startup
[HTML]View PlainCopy
- SQL> Conn/as sysdba
- Connected to an idle instance.
- SQL> Startup
The results are as follows:
[HTML]View PlainCopy
- ORACLE instance started.
- Total System Global area 839282688 bytes
- Fixed Size 2217992 bytes
- Variable Size 578815992 bytes
- Database buffers 251658240 bytes
- Redo buffers 6590464 bytes
- Database mounted.
- Database opened.
- SQL>
Second, close the database, monitor
1. Close the database
[HTML]View PlainCopy
- Su-oracle
- [[email protected] oracle]# su Oracle
- bash-4.1$ Sqlplus/nolog
Landing Sqlplus, the results are as follows:
[HTML]View PlainCopy
- Sql*plus:release 11.2.0.1.0 Production on Fri APR 4 15:10:59 2014
- Copyright (c) 1982, Oracle. All rights reserved.
- SQL>
SYSDBA Login:
[HTML]View PlainCopy
- SQL>conn/as sysdba
- Connected.
To close the database:
[HTML]View PlainCopy
- SQL> Shutdown Immediate
- Database closed.
- Database dismounted.
- ORACLE instance shut down.
After you close the database, if you execute a query command, the following error is reported:
[HTML]View PlainCopy
- SQL> select * from Vio_business_request;
- SELECT * FROM Vio_business_request
- *
- ERROR at line 1:
- Ora-01034:oracle Not available
- Process id:14138
- Session id:75 Serial number:503
- SQL>
Exit Sqlplus:
[HTML]View PlainCopy
- SQL> Exit
- Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit Production
- With the partitioning, OLAP, Data Mining and Real application testing options
2. Turn off monitoring:
[HTML]View PlainCopy
- bash-4.1$ lsnrctl Stop//Oracle User execution
- Lsnrctl for linux:version 11.2.0.1.0-production on 04-apr-2014 15:17:00
- Copyright (c) 1991, Oracle. All rights reserved.
- Connecting to (description= (address= (protocol=TCP) (host= jtwf) (port= 1521))
- The command completed successfullybash-4.1$ Lsnrctl stop
- Lsnrctl for linux:version 11.2.0.1.0-production on 04-apr-2014 15:17:00
- Copyright (c) 1991, Oracle. All rights reserved.
- Connecting to (description= (address= (protocol=TCP) (host= jtwf) (port= 1521))
- The command completed successfully
Startup and shutdown monitoring, database for oracle11g R2 under Linux