SQL> shutdown immediate
SQL> startup mount
SQL> alter SYSTEM ENABLE RESTRICTED SESSION;
SQL> alter SYSTEM SET JOB_QUEUE_PROCESSES=0;
SQL> alter SYSTEM SET AQ_TM_PROCESSES=0;
SQL> alter DATABASE OPEN;
SQL> alter session set events ’10046 trace name context forever,level 12’;
SQL> alter database character set INTERNAL_USE ZHS16GBK;
SQL> shutdown immediate
SQL> startup
察看系统字符集
SQL> select * FROM NLS_DATABASE_PARAMETERS;
#!/bin/sh
#Please change the ARCHIVE_FS to your actual filesystem that your archive log storaged
ARCHIVE_FS=/usr5
#Please change the ARCHIVE_DIR to your actual directory that your archive log storaged
ARCHIVE_DIR=/usr5/oracle/bjdb/arch_2
#Defined the location of log file
LOG=/usr5/oracle/bjdb/${0}.`date +%m%d`.log
#Obtain the usage of filesystem at that time
DFK=`df -k|grep $ARCHIVE_FS|awk ’{USAGE=substr($5,1,length($5) - 1)
print USAGE}’`
START_RMAN="
setenv ORACLE_SID rman
sqlplus /nolog << EOF
connect /as sysdba
startup
exit
EOF"
STOP_RMAN="
setenv ORACLE_SID rman
sqlplus /nolog << EOF
connect /as sysdba
shutdown immediate
exit
EOF
"
#Defined the command of archivelog crosscheck
CMD_STR="
setenv ORACLE_SID bjdb
rman target sys/sys catalog rman/rman@rman<<EOF
crosscheck archivelog all;
exit
EOF
"
#Check the usage of ARCHIVE_FS
if [ $DFK -gt 80 ]
then
TIME=`date`
echo "At the time: "$TIME", Usage of " $ARCHIVE_FS "filesystem is beyond 80%. The used rate is :"$DFK"% now">>$LOG
cd $ARCHIVE_DIR
#Obtain file list that need to be remove
FILE_LIST=`ls -lt|tail -600|awk ’{print $9}’`
for FILE in $FILE_LIST
do
rm $FILE 2>>$LOG
done
#Start rman database
su - oracle -c "$START_RMAN">>$LOG
#Run the crosscheck operation
su - oracle -c "$CMD_STR">>$LOG
#Stop rman database
su - oracle -c "$STOP_RMAN">>$LOG
echo "……">>$LOG
else
exit 0
fi
12 判断oracle版本位数的方法
有2种方法,详情如下:
1) file $ORACLE_HOME/bin/oracle
/oracle92/app/oracle/product/9.2.0.1/bin/oracle: ELF 64-bit MSB executable SPARCV9 Version 1, dynamically linked, not stripped
2)SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
PL/SQL Release 9.2.0.6.0 - Production
CORE 9.2.0.6.0 Production
TNS for Solaris: Version 9.2.0.6.0 - Production
NLSRTL Version 9.2.0.6.0 – Production