cc/td/doc/product/iaabu/csids/csids1
hometocprevnextglossaryfeedbacksearchhelp
PDF

Table of Contents

RDBMS Reference

RDBMS Reference

This appendix includes the following sections:


Note For information on running SQL queries to create reports from NetRanger security data, refer to "Managing Security Data."

Installing an Oracle RDBMS

This section describes how to set up an Oracle RDBMS for NetRanger data staging, and includes the following topics:


Note For Solaris installations, Oracle will not install if your Solaris support was installed without "Developer Support" or better.

Oracle Server is Local on the Director

This section describes setting up an Oracle server that is local to the Director, and includes the following sections:

Before You Run the orainst Utility

The first task in setting up Oracle with the orainst utility is to set up various parameters, as follows:

Step 1 Use the su command to become user root.

Step 2 Edit the /etc/system file, adding the following memory parameters:

set shmsys:shminfo_shmmax=16777216
set shmsys:shminfo_shmmin=1
set shmsys:shminfo_shmmni=200
set shmsys:shminfo_shmseg=10

Step 3 Reboot the system.

Step 4 Create the oracle user by typing:

useradd oracle
 

Step 5 Edit the /etc/passwd file and change the oracle user's home directory to your ORACLE_BASE, which is usually /local/oracle, but may be different on your system.

Step 6 Use the passwd command to create a password for the oracle user.

Step 7 Create the required oracle user directories by typing the following commands:

mkdir -p oracle_home
chown oracle oracle_home
mkdir -p /var/opt/oracle
chown oracle /var/opt/oracle
 

where oracle_home is the ORACLE_BASE, which is usually /local/oracle, but may be different on your system.

Step 8 Use the su command to become user oracle.

Step 9 Edit the .profile file for user oracle with the following parameters:

export ORACLE_HOME=oracle_home/product
export ORACLE_SID=your_SID_name
export ORACLE_BASE=oracle_home
export PATH=/usr/bin:/usr/sbin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
 

where oracle_home is the ORACLE_BASE (usually /local/oracle) and your_SID_name is an alphanumeric identifier you create, such as NRDB or DBAdmin.

Run the orainst Utility

The orainst utility guides you through an Oracle installation. To run the orainst utility, follow these steps:

Step 1 Use the su command to become user root.

Step 2 Insert the Oracle CD into the CD-ROM drive.

Step 3 Mount the CD-ROM drive.

Step 4 Use the su command to become user oracle.

Step 5 Type the following command:

cd /cdrom/cdrom0/orainst
 

Step 6 Set your terminal emulation by typing the following command:

export TERM=emulation_type
 

where emulation_type is either sun5, vt100, or ansi, depending on your system.

Step 7 Start the orainst utility by typing the following command:

./orainst
 

If you are installing on Windows, type:

./orainst /m
 

Use the Tab key to navigate and the space bar to select items. Pressing Enter defaults to OK.

Step 8 On the Install Type screen, choose Default Install.

Step 9 Press Enter after reading the preamble.txt file.

Step 10 Press Enter after reading the /cdrom/oracle804/orainst/README.FIRST file.

Step 11 On the Installation Activity Choice screen, choose Install, Upgrade, or De-Install Software.

Step 12 On the Installation Options screen, choose Install New Product - Create DB Objects.

Step 13 On the Environment Variables screen, set the following variables:

where oracle_home is your ORACLE_BASE (usually /local/oracle) and your_SID_name is the same SID set in Step 9 of the "Before You Run the orainst Utility" section earlier in this chapter.

Step 14 Press Enter after reading the /local/oracle/product/orainst/defaults file.

Step 15 On the Software Asset Manager screen, use the space bar to select each of the following:

Step 16 On the Default Database Startup Using Prebuilt Datafiles screen, press Enter.

Step 17 On the Database Mount Points screen, define the following mount points:

where oracle_home is your ORACLE_BASE (usually /local/oracle).

Step 18 On the LSM Question screen, choose No.

Step 19 For the rest of the install options, choose the default option.

The orainst utility installs the Oracle software.

After You Run the orainst Utility

After running the orainst utility, follow these steps:

Step 1 If prompted by the orainst utility, run the root.sh script.

Step 2 Use the su command to become user root.

Step 3 Create the /etc/rc2.d/S99oracle file and add the following line to it:

su - oracle -c /local/oracle/product/bin/dbstart
 

Step 4 Use the su command to become user oracle.

Step 5 Type the following command to verify that the variables in the .profile file are set correctly:

ls -l $ORACLE_HOME/bin
 

Step 6 In the /var/opt/oracle/oratab file, change the SID status from N to Y.

Step 7 Type the following command:

$ORACLE_HOME/bin/dbstart
 

Step 8 Log on to sqlplus with the following command:

sqlplus sys/change_on_install
 

Step 9 From the SQL prompt, immediately change the passwords for sys and system:

alter user sys identified by sys_new_password;
alter user system identified by system_new_password;
 

where sys_new_password is the new password for user sys and system_new_password is the new password for user system.

Caution All Oracle passwords must be alphabetic characters only.

Step 10 Log on to SQLPlus as user sys by typing the following command:

sqlplus sys/sys_new_password
 

where sys_new_password is the newly configured password for user sys.

Step 11 Create the Oracle netranger user with the following commands:

create user netranger identified by netranger_password default tablespace USERS;
grant dba to netranger;
 

where netranger_password is the password you define for Oracle user netranger.

Caution All Oracle passwords must be alphabetic characters only.

Step 12 Use the su command to become the UNIX user netrangr.

Step 13 Edit the .profile.custom file for user netrangr with the following parameters:

export ORACLE_HOME=oracle_home/product
export ORACLE_SID=your_SID_name
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
 

where oracle_home is your ORACLE_HOME (usually /local/oracle) and your_SID_name is the same SID set in Step 9 of the "Before You Run the orainst Utility" section earlier in this chapter.

Step 14 Type the following command:

. ./.profile
 

Step 15 Log on to SQLPlus as Oracle user netranger with the following command:

sqlplus netranger/netranger_password
 

where netranger_password is the password you defined in Step 11.

Step 16 Type the following query:

select substr(tablespace_name,1,8),substr(file_name,1,59),bytes from dba_data_files order by 1;
 

The result of this query should be a path and filename similar to the following:

oracle_home/oracle_mount/oradata/your_SID_name/filename.dbf

where oracle_home is your ORACLE_BASE (usually /local/oracle), oracle_mount is one of the mount points defined in the Oracle Mount Points screen of the orainst utility, your_SID_name is the established SID, and filename is a filename containing alphabetical characters with a numerical suffix (for example, users02).

Step 17 Extend your datafiles with the following command:

alter tablespace USERS add datafile `file_spec' size numberM;
 

where file_spec is the path and filename from the previous step, but with an incremented numerical suffix (for example, if the highest numbered dbf file is users02.dbf, use users03.dbf) and number is the amount of megabytes set aside for your tablespace.

For example:

alter tablespace USERS add datafile '/local/oracle/1/oradata/ripper/users03.dbf' size 2000M;
 

adds 2 gigabytes of disk space to the existing USERS tablespace, and specifies the /local/oracle/1/oradata/ripper/users03.dbf file.

Step 18 Type quit to exit SQL*Plus.

Step 19 Type the following commands:

cd /usr/nr/bin/sap/sql/skel
./nrdb_master_create
 

Step 20 When prompted, type your database username and password. When prompted for Remote DB Service, enter a blank space.


Note It is normal to see error messages at this point.

Use nrConfigure to Set Tokens

After installing Oracle, you will need to set the database user and password tokens in nrConfigure. To do so, follow these steps:

Step 1 On the Director interface, click the remote machine you want to configure.

Step 2 Click Configure on the Security menu.

The Configuration Librarian opens.

Step 3 In the currently applied version, double-click Data Management.

The Data Management dialog box opens.

Step 4 Click the Database tab (see Figure C-1).


Figure C-1: Database Tab

Step 5 Edit the User and Password fields for User 1.

Step 6 Click OK to close the Data Management dialog box.


Note Clicking Cancel discards any configuration changes. To apply any new changes, select the newly created transient version on the File Management screen and click Apply.

Oracle Server is Remote from the Director

This section describes setting up an Oracle server that is remote from the Director, and includes the following sections:

Preconfigure the Oracle Server

To preconfigure the Oracle server, follow these steps:

Step 1 Use the su command to become user root.

Step 2 Edit the /etc/system file, adding the following memory parameters:

set shmsys:shminfo_shmmax=16777216
set shmsys:shminfo_shmmin=1
set shmsys:shminfo_shmmni=200
set shmsys:shminfo_shmseg=10

Step 3 Create the oracle user by typing:

useradd oracle
 

Step 4 Edit the /etc/passwd file and change the oracle user's home directory to your ORACLE_BASE, which should be /local/oracle.

Step 5 Use the passwd command to create a password for the oracle user.

Step 6 Create the required oracle user directories by typing the following commands:

mkdir -p /local/oracle
chown oracle /local/oracle
mkdir -p /var/opt/oracle
chown oracle /var/opt/oracle
 

Step 7 Use the su command to become user oracle.

Step 8 Edit the .profile file for user oracle with the following parameters:

export ORACLE_HOME=/local/oracle/product
export ORACLE_SID=your_SID_name
export PATH=/usr/bin:/usr/sbin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
 

where your_SID_name is an alphanumeric identifier you create, such as NRDB or DBAdmin.

Run the orainst Utility on the Server

To run the orainst utility, follow these steps:

Step 1 Use the su command to become user root.

Step 2 Insert the Oracle CD into the CD-ROM drive.

Step 3 Mount the CD-ROM drive.

Step 4 Use the su command to become user oracle.

Step 5 Type the following command:

cd /cdrom/cdrom0/orainst
 

Step 6 Set your terminal emulation by typing the following command:

export TERM=emulation_type
 

where emulation_type is either sun5, vt100, or ansi, depending on your system.

Step 7 Start the orainst utility by typing the following command:

./orainst
 

Use the Tab key to navigate and the space bar to select items. Pressing Enter defaults to OK.

Step 8 On the Install Type screen, choose Default Install.

Step 9 Press Enter after reading the preamble.txt file.

Step 10 Press Enter after reading the /cdrom/oracle804/orainst/README.FIRST file.

Step 11 On the Installation Activity Choice screen, choose Install, Upgrade, or De-Install Software.

Step 12 On the Installation Options screen, choose Install New Product - Create DB Objects.

Step 13 On the Environment Variables screen, set the following variables:

where your_SID_name is the same SID set in Step 9 of the "Before You Run the orainst Utility" section earlier in this chapter.

Step 14 Press Enter after reading the /local/oracle/product/orainst/defaults file.

Step 15 On the Software Asset Manager screen, use the space bar to select each of the following:

Step 16 On the Default Database Startup Using Prebuilt Datafiles screen, press Enter.

Step 17 On the Database Mount Points screen, define the following mount points:

Step 18 On the LSM Question screen, choose No.

Step 19 For the rest of the install options, choose the default option.

The orainst utility installs the Oracle software.

Set Up Networking and Communications on the Server

To set up networking and communications on the server, follow these steps:

Step 1 If prompted by the orainst utility, run the root.sh script.

Step 2 Use the su command to become user root.

Step 3 Add the following lines to the /etc/rc2.d/S99oracle file:

su - oracle -c /local/oracle/product/bin/dbstart
su - oracle -c /local/oracle/product/bin/lsnrctl start
 

Step 4 Use the su command to become user oracle.

Step 5 Type the following command to verify that the variables in the .profile file are set correctly:

ls -l $ORACLE_HOME/bin
 

Step 6 In the /var/opt/oracle/oratab file, change the SID status from N to Y.

Step 7 Type the following command:

$ORACLE_HOME/bin/dbstart
 

Step 8 Edit the listener.ora file:

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME= hostname)
      (ORACLE_HOME= /local/oracle/product)
      (SID_NAME = your_SID_name)
    )
    (SID_DESC =
      (SID_NAME = extproc)
      (ORACLE_HOME = /local/oracle/product)
      (PROGRAM = extproc)
    )
 

where hostname is the name of the host on which the Oracle server is running, and your_SID_name is the established SID.

Step 9 Type the following command:

$ORACLE_HOME/bin/lsnrctl start
 

Step 10 Log on to sqlplus with the following command:

sqlplus sys/change_on_install
 

Step 11 From the SQL prompt, immediately change the passwords for sys and system:

alter user sys identified by sys_new_password;
alter user system identified by system_new_password;
 

where sys_new_password is the new password for user sys and system_new_password is the new password for user system.

Caution All Oracle passwords must be alphabetic characters only.

Step 12 Log on to SQLPlus as user sys by typing the following command:

sqlplus sys/sys_new_password
 

where sys_new_password is the newly configured password for user sys.

Step 13 Create the Oracle netranger user with the following commands:

create user netranger identified by netranger_password default tablespace USERS;
grant dba to netranger;
 

where netranger_password is the password you define for Oracle user netranger.

Caution All Oracle passwords must be alphabetic characters only.

Step 14 Use the su command to become the UNIX user netrangr.

Step 15 Edit the .profile file for user netrangr with the following parameters:

export ORACLE_HOME=/local/oracle/product
export ORACLE_SID=your_SID_name
export PATH=/usr/bin:/usr/sbin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
 

where your_SID_name is the same SID set in Step 9 of the "Before You Run the orainst Utility" section earlier in this chapter.

Step 16 Type the following command:

. ./.profile
 

Step 17 Log on to SQLPlus as Oracle user netranger with the following command:

sqlplus netranger/netranger_password
 

where netranger_password is the password you defined in Step 11.

Increase the Tablespace Size on the Server

To increase the tablespace size on the server, follow these steps:

Step 1 From SQLPlus, type the following query:

select substr(tablespace_name,1,8),substr(file_name,1,59),bytes from dba_data_files order by 1;
 

The result of this query should be a path and filename similar to the following:

/local/oracle/oracle_mount/oradata/your_SID_name/filename.dbf

where oracle_mount is one of the mount points defined in the Oracle Mount Points screen of the orainst utility, your_SID_name is the established SID, and filename is a file name containing alphabetical characters with a numerical suffix (for example, users02).

Step 2 Extend your datafiles with the following command:

alter tablespace USERS add datafile `file_spec' size numberM;
 

where file_spec is the path and filename from the previous step, but with an incremented numerical suffix (for example, if the highest numbered dbf file is users02.dbf, use users03.dbf) and number is the amount of megabytes set aside for your tablespace.

For example:

alter tablespace USERS add datafile `/local/oracle/1/oradata/ripper/users03.dbf' size 2000M;
 

adds 2 gigabytes of disk space to the existing USERS tablespace, and specifies the /local/oracle/1/oradata/ripper/users03.dbf file.

Preconfigure the Oracle Client

To preconfigure the Oracle client on the NetRanger Director, follow these steps:

Step 1 Use the su command to become user root.

Step 2 Create the oracle user by typing:

useradd oracle
 

Step 3 Edit the /etc/passwd file and change the oracle user's home directory to your ORACLE_BASE, which should be /local/oracle.

Step 4 Use the passwd command to create a password for the oracle user.

Step 5 Create the required oracle user directories by typing the following commands:

mkdir -p /local/oracle
chown oracle /local/oracle
mkdir -p /var/opt/oracle
chown oracle /var/opt/oracle
 

Step 6 Use the su command to become user oracle.

Step 7 Edit the .profile file for user oracle with the following parameters:

export ORACLE_HOME=/local/oracle/product
export PATH=/usr/bin:/usr/sbin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib

Run the orainst Utility on the Client

To run the orainst utility, follow these steps:

Step 1 Use the su command to become user root.

Step 2 Insert the Oracle CD into the CD-ROM drive.

Step 3 Mount the CD-ROM drive.

Step 4 Use the su command to become user oracle.

Step 5 Type the following command:

cd /cdrom/cdrom0/orainst
 

Step 6 Set your terminal emulation by typing the following command:

export TERM=emulation_type
 

where emulation_type is either sun5, vt100, or ansi, depending on your system.

Step 7 Start the orainst utility by typing the following command:

./orainst
 

Use the Tab key to navigate and the space bar to select items. Pressing Enter defaults to OK.

Step 8 On the Install Type screen, choose Default Install.

Step 9 Press Enter after reading the preamble.txt file.

Step 10 Press Enter after reading the /cdrom/oracle804/orainst/README.FIRST file.

Step 11 On the Installation Activity Choice screen, choose Install, Upgrade, or De-Install Software.

Step 12 On the Installation Options screen, choose Install New Product - Do Not Create DB Objects.

Step 13 On the Environment Variables screen, set the following variables:

Step 14 Press Enter after reading the /local/oracle/product/orainst/defaults file.

Step 15 On the Software Asset Manager screen, use the space bar to select each of the following:

Step 16 For the rest of the install options, choose the default option.

The orainst utility installs the Oracle software.

Set Up Networking and Communications on the Client

To set up networking and communications on the client, follow these steps:

Step 1 If prompted by the orainst utility, run the root.sh script.

Step 2 Use the su command to become user oracle.

Step 3 Type the following command to verify that the variables in the .profile file are set correctly:

ls -l $ORACLE_HOME/bin
 

Step 4 In the /var/opt/oracle/oratab file, change the SID status from N to Y.

Step 5 Add an entry to the tnsnames.ora file:

remoteDB =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(Host = hostname)(Port = 1521)
      (CONNECT_DATA= (SID = your_SID_name))
    )
 

where hostname is the name of the host on which the Oracle server is running, and your_SID_name is the established SID on the Oracle server.

Step 6 Type the following command:

tnsping hostname
 

where hostname is the host name of the Oracle server.

Step 7 Use the su command to become the UNIX user netrangr.

Step 8 Edit the .profile file for the UNIX user netrangr with the following parameters:

export ORACLE_HOME=/local/oracle/product
export PATH=/usr/bin:/usr/sbin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
 

Step 9 Type the following command:

. ./profile
 

Step 10 Type the following command:

tnsping tnsname
 

where tnsname is the alias of the Oracle server established in the tnsnames.ora file.

Step 11 Type the following commands:

cd /usr/nr/bin/sap/sql/skel
./nrdb_master_create
 

Step 12 When prompted, type your database username and password, and the following for Remote DB Service:

@hostname
 

where hostname is the hostname running the Oracle server.

Use nrConfigure to Set Tokens

After installing Oracle, you will need to set the database user and password tokens in nrConfigure. To do so, follow these steps:

Step 1 On the Director interface, click the remote machine you want to configure.

Step 2 Click Configure on the Security menu.

The Configuration Librarian opens.

Step 3 In the currently applied version, double-click Data Management.

The Data Management dialog box opens.

Step 4 Click the Database tab (see Figure C-2).


Figure C-2: Database Tab

Step 5 Edit the User and Password fields for User 1.

Step 6 Click OK to close the Data Management dialog box.


Note Clicking Cancel discards any configuration changes. To apply any new changes, select the newly created transient version on the File Management screen and click Apply.

Useful Queries and SQLPlus Commands

This section discusses the following topics:

Useful SQLPlus Queries

Table C-1 lists various useful SQLPlus queries.


Table C-1: Useful SQLPlus Queries
Purpose Query

Show active user sessions

select osuser,substr(machine,1,20),status,username from v$session

Show configured users

select substr(username,1,15),

substr(account_status,1,15),

substr(default_tablespace,1,15),

substr(temporary_tablespace,1,15) from dba_users;

Show all data files

select substr(tablespace_name,1,8),substr(file_name,1,59),bytes from dba_data_files order by 1;

Show summary of allocated tablespaces

select tablespace_name,sum(bytes) from dba_data_files group by tablespace_name;

Show free space

select tablespace_name,sum(bytes) from dba_free_space group by tablespace_name;

List all tables

select table_name,tablespace_name from all_tables;

Useful SQLPlus Commands

Table C-2 lists various useful SQLPlus commands.


Table C-2: Useful SQLPlus Commands
Command Purpose

set pagesize

Defines the frequency of column headings. Override the low default of 14 with 5000 or more.

set linesize

Defines the maximum width of a line. Increase above 80 if your query returns data wrapped over a single line.

spool

Output mechanism. The spool filename command appends all sqlplus output to the file designated in filename. The spool command without arguments shows the current state. The spool off command closes the file.

help

Syntax reference for SQL commands. For example, help alter tablespace provides information on the Oracle alter tablespace command.

Installing a non-Oracle RDBMS

This section provides generic instructions for installing a non-Oracle RDBMS with NetRanger, and includes the following topics:

Set Up the Database Schema

Follow these steps to set up non-Oracle schemas:

Step 1 Log on as user netrangr.

Step 2 Type the following command:

cd /usr/nr/bin/sap/sql/skel
 

Step 3 Edit the nrdb_master_create script and associated create_table scripts to conform to your database's syntax.

Step 4 Type the following command:

nrdb_master_create
 

Step 5 At the prompts, type your database username and password followed by one of the following for the Remote DB Service prompt:

Set Up the Database Loader

Follow these steps to set up a non-Oracle database loader:

Step 1 Log on as user netrangr.

Step 2 Type the following commands:

cd /usr/nr/bin/sap
cp load_run.sh load_run.sh.bak
cp skel/load_run_sh.oraldr load_run.sh
 

Step 3 Adjust the syntax of the following line in the new load_run.sh file:

sqlldr DATA=${TEMP_FILE} CONTROL=${CONTROL_FILE} USERID=${DB_CONNECT}
 

This line as it stands works with the Oracle bulk loader. Edit this line to meet the needs of your RDBMS system's bulk loader call (which may or may not require DATA, CONTROL, and USERID arguments).

Step 4 You also need to edit the *.ctl files in /usr/nr/bin/sap/skel to support your database system's bulk loading syntax. These files define the table schemas and input handling for the bulk loader.

Step 5 To ensure that load_run.sh is functioning properly, create and run the following testBulkLoad script:

#!/bin/ksh
export PATH_TMP=/usr/nr/var/tmp
export SAP_DB_USER=database_user_name
export SAP_DB_PASS=database_password
export SAP_BIN=/usr/nr/bin/sap
 
$SAP_BIN/load_run.sh netranger_logfile
 

where database_user_name is your database username, database_password is your database password, and netranger_logfile is a valid NetRanger log file in /usr/nr/var/tmp.

Set Up and Customize Database Reports

You may need to make minor syntax changes to the queries in the /usr/nr/bin/sap/sql directory to accommodate non-Oracle SQL interpreters. However, you will not need to change the overall structure of the queries.

For more information on using and customizing SQL queries, refer to the "Generating and Customizing Reports with SQL Queries" section in "Managing Security Data."

Set Up the Database Scheduler

The database scheduler uses the load_run.sh file to stage the data from /usr/nr/var/new into the appropriate database tool. Make sure that you are using the load_run.sh file for this purpose, and the scheduler will run appropriately.

Setting Up a Remedy ARS Trouble Ticketing System

To set up a Remedy ARS Trouble Ticketing System, follow these steps:

Step 1 On the Director, log on as user netrangr.

Step 2 Type:

cd /usr/nr/bin/sap
cp load_run.sh load_run.sh.bak
cp skel/load_run_sh.remedy load_run.sh
 

Step 3 On the Director interface, click the Director icon.

Step 4 Click Configure on the Security menu.

The Configuration Librarian opens.

Step 5 In the currently applied version, double-click Data Management.

Step 6 The Data Management dialog box opens (see Figure C-3).

Step 7 Click the Database tab.


Figure C-3: Setting Up a Remedy Account with nrConfigure

Step 8 You can set up a Remedy account by editing the following fields:

Step 9 Click OK to close the Data Management dialog box.

Step 10 To apply your changes, click the newly-created transient folder and click Apply.


Note For information on creating trouble tickets with Remedy ARS, refer to the
"Security>Create>Trouble Ticket" section in "Operating the Director."

hometocprevnextglossaryfeedbacksearchhelp
Posted: Wed Jul 19 15:23:31 PDT 2000
Copyright 1989-2000©Cisco Systems Inc.