There are three items to consider under the topic of database:
o The database instance
o The database itself
o The database listener
The database instance consists of memory structures and processes. It exists in your server’s RAM and on its CPUs, and its existence is transitory. An instance can be started, meaning that the memory structures are built and the processes launched and then stopped.
A database (which is a set of files) is opened by an instance. As a general rule, it is impossible for any user or process to get to the database directly; all access is through the instance.There are exceptions to this rule, known as direct database I/O, but these are only for a very few operations where high performance is essential.
The database listener is an independent process that lets users connect to the instance, and (through the instance) to the database. The listener monitors ports on the server machine’s network interface addresses for incoming connection requests and establishes connections against the instance.
II.Starting an Instance and Opening a Database
To start an instance, the memory structures must be built and the processes launched. These are configured by an instance parameter file.
The parameter file specifies limits, such as the maximum number of concurrent sessions that the instance will accept. The default name and location of the parameter file is
$ORACLE_HOME/dbs/spfile.ora on UNIX.
During startup, the parameter file is read and its contents used to build the instance in memory. The next step is to mount the database; the mount is when the instance locates the control file of the database and reads it.
After reading the controlfile, the instance can open the database by locating and opening all these files.
Shutdown Command
There are variations in the shutdown command.
- transactional
- immediate
- abort
The transactional shutdown will disconnect all sessions that aren’t doing anything but let other sessions finish their currently running statement or transaction before disconnecting them. This is the “polite” way to shut down a database.
An immediate will disconnect all users immediately and roll back any currently active transactions. Either of these shutdown methods is clean. After the shutdown there are no incomplete transactions and all work is saved to the database.
An abort will terminate the instance right away; no work is written to disk, no incomplete work is rolled back.
Best Practice
connect sys/oracle as sysdba
shutdown abort
startup restrict
shutdown immediate
III. Enterprise Manager Database Control
Enterprise Manager is Oracle’s web tool for administering all server-side processes. It comes in two forms: Database Control and Grid Control.
Database Control is designed to manage a single database;
Grid Control can manage any number of databases and also application servers. Grid Control requires an additional license and is not installed as part of Oracle Collaboration Suite.
To contact the Database Control process, use the URL
http://host.domain:5500/em
substituting the host and domain of your server machine. The port will typically be 5500, but to confirm this, look at the portlist.ini file in the ORACLE_HOME/install directory.
IV. Controlling the Database Listener
The database listener is a process that accepts connection requests from user processes and establishes connections for these processes against a database instance.
There may be several database listeners running off the executables installed in one Oracle home, but usually they will all be controlled by one file which is
$ORACLE_HOME/network/admin/listener.ora on UNIX,
A standard Oracle Collaboration Suite installation will use only one listener per database server machine, which will run on the default port of 1521, and listen on one address.
If the listener is using some other port, the instance parameter LOCAL_LISTENER (stored in the instance parameter file) should be set to specify the address of the listener.
From the SQL*Plus prompt use the following commands:
SQL> alter system set local_listener '<' ENTER '>'
'(address=(protocol=tcp)(host=hostname.com)(port=1522))';
SQL> alter system register;
http://host.domain:5500/em
substituting the host and domain of your server machine. The port will typically be 5500, but to confirm this, look at the portlist.ini file in the ORACLE_HOME/install directory.
IV. Controlling the Database Listener
The database listener is a process that accepts connection requests from user processes and establishes connections for these processes against a database instance.
There may be several database listeners running off the executables installed in one Oracle home, but usually they will all be controlled by one file which is
$ORACLE_HOME/network/admin/listener.ora on UNIX,
A standard Oracle Collaboration Suite installation will use only one listener per database server machine, which will run on the default port of 1521, and listen on one address.
If the listener is using some other port, the instance parameter LOCAL_LISTENER (stored in the instance parameter file) should be set to specify the address of the listener.
From the SQL*Plus prompt use the following commands:
SQL> alter system set local_listener '<' ENTER '>'
'(address=(protocol=tcp)(host=hostname.com)(port=1522))';
SQL> alter system register;
V. lsnrctl Utility
The command-line utility to control a database listener is lsnrctl. On UNIX, it is
$ORACLE_HOME/bin/lsnrctl
VI. Application Server Startup and Shutdown
The heart of any Oracle Application Server instance, whether middle tier or infrastructure, is the Oracle Process Management and Notification service (OPMN).
OPMN is configured with an XML file:
$ORACLE_HOME/opmn/conf/opmn.xml
VII. Infrastructure tier components Startup and Shutdown
Oracle Internet Directory
Oracle Internet Directory is a perfect example of the fly-by-wire approach taken for many Oracle Application Server components. You do not start and stop it yourself; you ask a control process, the monitor, to start and stop it for you. This can be done with opmnctl:
opmnctl startproc process-type=OID
opmnctl stopproc process-type=OID
To start the Oracle Internet Directory, the database and database listener must already be running. Then you must start the monitor process. This is an executable residing in the infrastructure Oracle home An example of starting the monitor is the following:
oidmon connect=ocsdb host=hostname.com sleep=10 start
Once the monitor is running, you can use the oidctl utility to place commands in the database that the monitor will action. The oidctl utility is an executable in the infrastructure Oracle home.
No comments:
Post a Comment