This requires root access to the machine. One team member should be in charge of root commands.
root
using ssh
:
ssh -l root machine_name
useradd
, create your account with primary group arsdigit
and secondary group dba
useradd -g arsdigit -G dba -m username(see
man useradd
for more details about this step.)
passwd username
svrmgrl
Note: you must be in the dba
group to use svrmgrl
(this should have been accomplished in step 2.)
$ svrmgrl
Oracle Server Manager Release 3.1.5.0.0 - Production
(c) Copyright 1997, Oracle Corporation. All Rights Reserved.
Oracle8i Enterprise Edition Release 8.1.5.0.0 - Production
With the Partitioning and Java options
PL/SQL Release 8.1.5.0.0 - Production
SVRMGR> connect internal
Connected.
SVRMGR> select file_name from dba_data_files;
Example results:
/ora8/m01/app/oracle/oradata/ora8/system01.dbf
/ora8/m01/app/oracle/oradata/ora8/oemrep01.dbf
/ora8/m01/app/oracle/oradata/ora8/rbs01.dbf
/ora8/m01/app/oracle/oradata/ora8/temp01.dbf
/ora8/m01/app/oracle/oradata/ora8/users01.dbf
/ora8/m01/app/oracle/oradata/ora8/indx01.dbf
/ora8/m01/app/oracle/oradata/ora8/drsys01.dbf
/ora8/m02/oradata/ora8/jsc01.dbf
m0n
subdirectories in the above listing) separate from the Oracle system data files. In this example, we'll use /ora8/m02/oradata/ora8/
.
autoextend
. This allows the tablespace's storage capacity to grow as the size of the data grows. We set the pctincrease to be a very low value so that our extents won't grow geometrically. We do not set it to 0 at the tablespace level because this would affect Oracle's ability to automatically coalesce free space in the tablespace.
SVRMGR> create tablespace service_name datafile '/ora8/m02/oradata/ora8/service_name01.dbf' size 50m autoextend on default storage ( pctincrease 1);
database_password
with the appropriate password.)
SVRMGR> create user service_name identified by database_password default tablespace service_name
temporary tablespace temp quota unlimited on service_name;
SVRMGR> grant connect, resource, ctxapp, javasyspriv, query rewrite to service_name;
SVRMGR> revoke unlimited tablespace from service_name;
SVRMGR> alter user service_name quota unlimited on service_name;
To export:
exp service_name/database_password file=foo.dmp consistent=y direct=y compress=nTo import:
imp service_name/database_password file=foo.dmp commit=y [fromuser=olduser touser=service_name]
drop user
command with the cascade
option. This command will drop the user and every database object the user owns.
drop user service_name cascade
If this does not work because svrmgrl "cannot drop a user that is currently connected", make sure to kill the AOLserver using this user. If it still does not work, do:
select username, sid, serial# from v$session where username='service_name';
and then
alter system kill session 'sid,serial#';
where sid and serial# are replaced with the corresponding values for the open session.
Use with caution!
If you feel the need to delete everything related to the service, you can also issue the following:
drop tablespace service_name including contents ;
crontab -l | grep export-oracle
You should see a line similar to the following:
0 23 * * * /usr/local/sbin/export-oracle
If you don't see it, you should add it:
EDITOR=emacs crontab -e
/usr/local/sbin/export-oracle
has the correct environmental variables.
Compare the settings in /usr/local/sbin/export-oracle
with:
# su -l oracle
Sun Microsystems Inc. SunOS 5.6 Generic August 1997
$ env
HOME=/home/oracle
HZ=
LD_LIBRARY_PATH=/ora8/m01/app/oracle/product/8.1.5/lib:/usr/lib:/lib:/usr/openwin/lib
LOGNAME=oracle
ORACLE_BASE=/ora8/m01/app/oracle
ORACLE_HOME=/ora8/m01/app/oracle/product/8.1.5
ORACLE_SID=ora8
ORACLE_TERM=vt100
ORAENV_ASK=NO
PATH=/ora8/m01/app/oracle/product/8.1.5/bin:/ora8/m01/app/oracle/product/8.1.5/bin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/ccs/bin:/usr/ucb:/usr/dt/bin:/usr/openwin/bin:/usr/local/bin:/usr/sbin
SHELL=/bin/sh
TERM=vt100
TZ=US/Eastern
/usr/local/sbin/export-oracle
accordingly. Your complete export_oracle
file should look something like this:
#!/bin/sh
HOME=/home/oracle
HZ=
LD_LIBRARY_PATH=/ora8/m01/app/oracle/product/8.1.5/lib:/usr/lib:/lib:/usr/openwin/lib
LOGNAME=oracle
ORACLE_BASE=/ora8/m01/app/oracle
ORACLE_HOME=/ora8/m01/app/oracle/product/8.1.5
ORACLE_SID=ora8
ORACLE_TERM=vt100
ORAENV_ASK=NO
PATH=/ora8/m01/app/oracle/product/8.1.5/bin:/ora8/m01/app/oracle/product/8.1.5/bin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/ccs/bin:/usr/ucb:/usr/dt/bin:/usr/openwin/bin:/usr/local/bin:/usr/sbin
SHELL=/bin/sh
TERM=vt100
TZ=US/Eastern
exportdir=/export_root/oracle-exports
file=$exportdir/oraexport-service_name.dmp
mv -f $file.gz $file.old.gz
exp service_name/database_password file=$file owner=service_name consistent=Y
gzip $file
localhost
(127.0.0.1
):
netstat -in | awk '{ print $4 }' | xargs -i% sh -c 'if [ `grep % /home/nsadmin/*.ini > /dev/null` $? -eq "1" ]; then echo %; fi'
/home/nsadmin/service-name.ini
file:
[ns/threads] ; use more than 1 processor (Solaris) SystemScope=on
Note: If you have a single processor machine, SystemScope=off
is more efficient.
[ns/server/service_name/modules] ... nscache=nscache.so [ns/server/service_name/module/nscache] ... CacheADP=on
MaxThreads
parameter to get more performance. Increasing this beyond 50
causes more thrashing or more pages waiting for database
handles. (AOL does some tuning on this parameter and generally
settles on numbers between 8 and 75).
On handle-hogging pages (ie, intermedia searching), you don't want to tie up all your Oracle handles and deny service to everyone else. On these pages, you want to:
if ![ad_return_if_another_copy_is_running 6] { ns_log Notice "foo out of handles" return }
Careful!: On a db-backed web site, you want to make sure the entire database is stored in RAM. Caching graphics can be counterproductive if it interferes with query performance.[ns/server/service_name/modules] ... nscache=nscache.so [ns/server/service_name/module/nscache] ... CacheStatic=on
Keepalive is a virtual server located on the same physical machine as your service. It watches your service, notifies you of problems, and restarts it should it go down. All the services on the same machine share the same keepalive
.
If keepalive does not exist on your machine, you will have to install another virtual server on your machine.
/home/nsadmin/bin/nsd
instead of /home/nsadmin/bin/nsd-oracle
Once the Keepalive service is running, you need to test it:
/web/service_name/SYSTEM/dbtest
mv /web/service_name/SYSTEM/dbtest /web/serice_name/SYSTEM/dbtest.moved
/web/service_name/SYSTEM/dbtest
by moving it back
mv /web/service_name/SYSTEM/dbtest.moved /web/serice_name/SYSTEM/dbtest
http://service_domain/SYSTEM/uptime.txt
. You'll want alerts to be sent to the following:
The Glassroom for the service will be on a separate machine and has a domain staff.service_name domain. The ticket tracker and glassroom modules should be run on this server. Glassroom is built on top of an ACS installation.
Watchdog is virtual server located on the same machine as your service. It watches your log files and will notify you of tcl errors.
If watchdog does not exist on your machine, you will have to install another virtual server on your machine:
/home/nsadmin/bin/nsd
instead of /home/nsadmin/bin/nsd-oracle
If Watchdog is installed on your machine, add your service:
/home/nsadmin/watchdog.ini
to locate the domain and port for Watchdog on this machine
test
under the Watchdog server.
/web/rollover/tcl/rollover-list-of-systems
as appropriate for your installation.
cassandracle
user.
cassandracle
user connect, resource
and dba
privileges.
grant connect, resource, dba to cassandracle
nsadmin
. Template ini files are listed in the above directions. Make the following substitutions as appropriate:
service_ip_address
service_domain
[ns/server/service_name/module/nsftp]
section and the line nsftp=nsftp.so
in the [ns/server/service_name/modules]
section.
servers/service_name
.
This directory and all the files must be owned by nsadmin.
You can do this via one of the folowing methods:
cp -pr /home/nsadmin/modules/nssetup/template1/ /home/nsadmin/servers/service_name
/web/service_name
/home/nsadmin/bin/nsd-oracle -c /home/nsadmin/servername.ini
to test out your server setup. View your error log to make sure the service is starting without any problems. Attempt to connect to the service from a web browser.
This requires root and deals with sensitive files that can break every service on the machine. One member from a team should be in charge of this step.
/etc/inittab
for editing.
nss:234:respawn:/home/nsadmin/bin/nsd-oracle -i -c /home/nsadmin/service_name.ini
/sbin/init q
to start the server.