oracle ±¸·Ý,±í¿Õ¼ä¼ì²éshell½Å±¾´úÂë
#!/bin/ksh
#****************************************************************************
#
# (C) Copyright CPIC. 2008
#
# File name: check_db_alert.sh
# Project: Database Alerts Check
#
# Parameter : app_name -- name of db application(=oracle_sid)
# ipaddress -- ip of the db server
#
# Creation Date: Aug 19, 2008
# Origin Author: Shangkun Peng
#
#
# Prerequisites:
# before using this shell script, directory $DAILY_CHECK must be created
# and this shell script should be put into it.
# for each application, environment file $DBENVFILE must be put into it.
# also, variables for auto ftp must be set
#
# Limitations:
# this shell script can be run at most once an hour
# additional job can be added but variable JOB_LIST must be modified
# and relative function must be coded too
#
#****************************************************************************
# record start date and time
echo "------------------------------------------------------------"
echo "database information collect started at:"; date
# check necessary parameter(s)
if [ $# -ne 2 ]
then
echo "ERROR: parameter(s) not supplied correctly"
echo "USAGE: check_db_alert.sh app_name ipaddress"
echo "WHERE:"
echo "app_name -- name of db application"
echo "ipaddress -- ip of the db server"
exit 1
fi
# -----------------------------------------------------------------------------------------------------------
# DEFINE VALUES FOR VARIABLES IN THIS SHELL
# general variables, can not be modified
APP_NAME=$1 # name of db application
IPADDRESS=$2 # ip of db server
DAILY_CHECK=/tmp/db_dailycheck # directory for information collection of db application
DBENVFILE=$APP_NAME".dbenv"&
Ïà¹ØÎĵµ£º
Ò»¡£²é¿´oracleÊý¾Ý¿âÊÇ·ñΪ¹éµµÄ£Ê½£º[1]
¡¡¡¡1.select name,log_mode from v$database;
¡¡¡¡NAME LOG_MODE
¡¡¡¡------------------ ------------------------
¡¡¡¡QUERY NOARCHIVELOG
¡¡¡¡2.ʹ ......
sysÊÇOracleÊý¾Ý¿âÖÐȨÏÞ×î¸ßµÄÕʺţ¬¾ßÓÐcreate databaseµÄȨÏÞ£¬¶øsystemûÓÐÕâ¸öȨÏÞ£¬sysµÄ½ÇÉ«ÊÇsysdba£¬systemµÄ½ÇÉ«ÊÇsysoper¡£
¡¡¡¡ÆäÓà¾ÍÊÇËûÃÇÁ½¸öÓû§¹²ÓеÄȨÏÞÁË£º
¡¡¡¡startup/shutdown/dbaÁ½¸öÓû§¶¼ÊÇ¿ÉÒÔ¹ÜÀíµÄ¡£
¡¡¡¡Æ½Ê±ÓÃsystemÀ´¹ÜÀíÊý¾Ý¿â¾Í¿ÉÒÔÁË¡£Õâ¸öÓû§µÄȨÏÞ¶Ô ......
¡¡ ¹ØÓÚOracleµÄÐÔÄܵ÷Õû£¬Ò»°ã°üÀ¨Á½¸ö·½Ã棬һÊÇÖ¸OracleÊý¾Ý¿â±¾ÉíµÄµ÷Õû£¬±ÈÈçSGA¡¢PGAµÄÓÅ»¯ÉèÖ㬶þÊÇÁ¬½ÓOracleµÄÓ¦ÓóÌÐòÒÔ¼°SQLÓï¾äµÄÓÅ»¯¡£×öºÃÕâÁ½¸ö·½ÃæµÄÓÅ»¯£¬¾Í¿ÉÒÔʹһÌ×ÍêÕûµÄOracleÓ¦ÓÃϵͳ´¦ÓÚÁ¼ºÃµÄÔËÐÐ״̬¡£
¡¡¡¡ ±¾ÎÄÖ÷ÒªÊǰÑһЩOracle TuningµÄÎÄÕÂ×÷ÁËÒ»¸ö¼òµ¥µÄ×ܽᣬ ......
1¡¢µÇ¼·½·¨:£ºsys or systemµÇ¼
Õ˺ţºsystem
ÃÜÂ룺system as sysdba---------¡·ÃÜÂë+as sysdba
conn system/password as sysdba
ʹÓÃÃüÁ
sql>alter user scott account unlock;
sql> commit;
Í ......