Shutting down the Oracle Databases using Python

advertisement
Starting Up Oracle Databases using Python Scripts
The Startup Scripts, Their Locations, and Their Requirements
Production versions of the shutdown scripts and the library they require exist in the
following directory:
~oracle/scripts/python/prod
Two scripts can be used to startup Oracle databases.
startup_database.py,
shuts down a single database from the machine which hosts it
startup_all_databases.py
shuts down all known oracle instances from promethium
Both of these scripts require the following library module, which is located in the same
directory.
ora_library.py
If the scripts are in a development state, they will be in the following directory:
~oracle/scripts/python/dev
External Processes Associated with Starting Up a Database
Currently, it is possible for the startup scripts to start 4 additional external processes after
the databases are started.
ctxsrv (ctx)
Maintains intermedia indices
dbsnmp (agent)
The ‘Intelligent Agent’ process. It allows use of Oracle
Eneterprise Manager (OEM) functions.
tnslsnr (listener)
Allows users to connect to the databases for which it is
configured. Generally, there is one listener per host, not per
database.
vppdc (gatherer)
Allows use of OEM data-gathering functions.
Not all processes are started up with every database.
How to Use Each of the Startup Scripts
startup_database.py NEW VERSION NOT FULLY TESTED
When run as oracle from the specified database’s host server, startup_database.py will
startup the specified database and the specified processes.
shutdown_database.py can take two kinds of arguments, the ORACLE_SID, that is, the
name, of the database you want to start, and an optional PROCESS_LIST consisting of
the external process you want to start after the database starts. The ORACLE_SID is
specified using the –o flag. The processes are specified using the –p flag.
For help, you can either use the –h flag or specify no arguments.
If you don’t include valid arguments, a usage message will be returned.
To successfully run this script for a database, you must be logged in as oracle on the
server which hosts the database.
prompt > startup_database.py –o ORACLE_SID [–p PROCESS_LIST]
startup_all_databases.py NEW VERSION NOT FULLY TESTED
When run as oracle from promethium, this script will as simultaneously as possible start
the processes to shut down all of the databases on a machine, at a location, or in general.
startup_all_databases.py can take several arguments to specify which set of databases to
shut down. They are: –a [all databases] –b [all databases in building] –s [all databases
running on host].
To get help for this process, either use the –h flag or don’t specify any arguments.
If you don’t include valid arguments, a usage message will be returned.
To successfully run this script for all database, you must be logged into promethium as
oracle.
prompt > startup_all_databases.py –s kornberg
Processes to Start with Each Database
When using the startup_all_databases.py script, the processes to start with each database
are determined by the DBDictionaries.db_processes_dict, which is populated by the
DBDictionaries.create_db_process_dictionary() function. The user is not responsible for
determining which processes need to be started.
Logfiles Created
The startup_database.py script creates a logfile which is stored in the directory specified
in the script by PYTHON_LOGS_DIR. The script output will identify the logfile.
Revisions
Last updated: March 7, 2003
Download