Page 317
Page 318
The purpose of this chapter is to familiarize you with the basic and advanced functions of Server Manager. It also should help you put that knowledge to use in your current and future environments. Although this chapter's coverage is not exhaustive, it certainly should give you all the requirements you need to forge ahead in understanding the more advanced concepts of database management with Server Manager.
NOTE |
Server Manager is Oracle's replacement for previous versions of SQL*DBA. Both SQL*DBA and Server Manager were provided by Oracle until Oracle 7.3, in which SQL*DBA became obsolete. Server Manager, until version 8, was provided in both a line mode and a GUI mode. In Oracle8, Server Manager is provided only in line mode, and the previous GUI version has been incorporated into Oracle Enterprise Manager. |
To assist in the setup, administration, and day-to-day operations of your Oracle databases, Oracle Corporation provides a tool called Server Manager. Although it has many functions, its most obvious use is to start up and shut down local and remote databases. This versatility gives the database administrator great flexibility in database management.
Secondary functions of Server Manager include altering database and system statistics, modifying the characteristics of a database, administering users and security, restoring databases, and manipulating data files belonging to a database. With the added capability to monitor various aspects of the database as it is running, Server Manager is an important and multifaceted tool.
Server Manager's line mode is a non-graphical interface that enables the user to interactively enter commands. The output is scrolled across the user 's screen. This mode is very useful for managing portions of the database that do not require the ease of a GUI interface.
Server Manager's command mode is identical to line mode with the exception of how it is used. Although line mode is interactive by nature, command mode is intended to run batch commands. Generally, command mode is used to run a script, or collection of commands, created by the user.
Server Manager accepts all standard SQL, PL/SQL, and Server Manager commands, with a few exceptions. Exceptions to this rule include SQL*Plus formatting commands such as set heading or set linesize. You can find a complete list of Server Manager_specific commands in the command reference at the end of this chapter.
Page 319
You must meet several requirements before you can run Server Manager. First, if it is running on a multiuser platform, the user must own the executable or be a member of the group associated with it. You can find the Server Manager executable in the bin directory of your ORACLE_HOME environment variable; the name varies between platforms, but the most common name is svrmgrl (DOS-based systems might include an EXE or COM extension). If you are running Oracle on an NT/95 machine, the executable is located in the directory pointed to by your XBIN environment variable and contains a version. In the BETA-2 version of Oracle8, the NT/95 executable name is svrmgr30.exe.
After you can execute svrmgrl, you also must have privileges to execute the specific commands you want to use. If you want to add a data file to a tablespace, for example, you must have the ALTER TABLESPACE privilege.
Next, it is important to know how to connect to a database. Nearly all the commands supported by Server Manager require a connection to a database ( especially startup and shutdown options).
With a username/password specification, you can connect to your default database. SQL*Net supports special connect strings to connect to remote databases on your network. You can use this option to eliminate the need for logging on to every system where a database is running.
Connect internal is the most typical connection using Server Manager. internal, a special username visible only through Server Manager, is actually an alias for logging on to the SYS account. Intended strictly for use with special operations, such as startup and shutdown, the internal username is limited to users with the correct access to Server Manager (ownership and group access to the executable).
Server Manager, similar to SQL*Plus, enables you to execute multiline commands. By default, you must terminate all commands with a semicolon (;) or forward slash (/), regardless of which mode you are using. These characters tell Server Manager to execute the command. Some commands might not require the terminator. If you press Return while entering a command for which Server Manager expects further input, Server Manager provides a continuation line where you can enter the next part of the command line. Entering the termination character ends the command and begins execution.
Of the two modes of operation, the only distinguishing difference is the way in which the Server Manager executable is called. To run in line mode, no command line parameters are needed. To run in command mode, you can specify a script file for Server Manager to execute.
Page 320
Line mode places the user in a line-driven, interactive interface. This mode does not provide menus and only supports input through the keyboard. You usually use line mode for quick access to Server Manager commands or for automating different aspects of its functionality.
To start Server Manager in line mode, enter one of the following commands:
svrmgrl (UNIX platforms)
or
svrmgr30.exe (NT/95 platforms)
After starting Server Manager, you should see a prompt that resembles this:
SVRMGR>
NOTE |
From this point on, the command svrmgrl is used to signify the starting or stopping of Server Manager. You should think of svrmgrl as a synonym of svrmgr30. |
At this point, you can connect to the database by using
connect internal
or
connect username/password
After you finish with your SQL*DBA session, you can issue the exit command to leave.
NOTE |
Server Manager is not case sensitive unless you are dealing with the selection of data from the database. Uppercase or lowercase letters are perfectly legitimate . |
As stated earlier, the primary use for Server Manager is the startup and shutdown of your database. You can do this from line or command mode, but the most common way is from line mode.