move_arch_files.ksh
#ARCH_SPACE=`df -k /UASARCH | tail -1 | awk ‘{print $5’} | sed ‘s/%//g’` ARCH_SPACE=`df -k $ARCHMOUNTPOINT | tail -1 | awk ‘{print $5’} | sed ‘s/%//g’`
#ARCH_SPACE=`df -k /UASARCH | tail -1 | awk ‘{print $5’} | sed ‘s/%//g’` ARCH_SPACE=`df -k $ARCHMOUNTPOINT | tail -1 | awk ‘{print $5’} | sed ‘s/%//g’`
COMFORT_SPACE=75 NO_FILES_MOVED=0 NOTIFY_LIST=’dbaoracle@1800flowers.com’ cp /dev/null $LOG_FILE
ORACLE_SID=UAS LOG_FILE=/oracle/scripts/log/MOVE_UAS01.log ARCHMOUNTPOINT=/UASARCH DESTFOLDER=/uocdb7/archlog/UAS
#!/bin/ksh a=`ps -ef|grep “move_arch_files.ksh”|grep -v grep|wc -l` if [ $a -gt 2 ] then echo “Exiting because of more than 1 Moving archive log script is running ” exit fi # ## Setting Environment information and variables # NODENAME=`hostname`
set pagesize 2000 select text from user_source where name = upper(‘&procedure_name’) order by line;
REM =============================================================================== REM = Script Name : db_status.sql = REM = Usage : This script is to be used to give an overview of the current status = REM = of a given database. Things like suspect default and temporary = REM = tablespaces, tablespaces that have less than 20% free, objects that = REM…
set pagesize 300 set linesize 205 set head on set echo off spool tblwopk accept usrid prompt ‘Enter User Name : ‘ REM Find all tables that does not have primary key on them. select /*+ rule */ a.table_name from dba_tables a where a.owner = upper(‘&usrid’) and a.table_name not in ( select b.table_name from dba_constraints…
set pagesize 300 set linesize 205 set head on set echo off spool tblwopk accept usrid prompt ‘Enter User Name : ‘ accept table_name prompt ‘Enter Table Name : ‘ column PrimaryKey format a80 heading ‘Follwoing Are Primary Keys’ select substr(a.column_name, 1, 20) || ‘ Position : ‘ || to_char(a.position) PrimaryKey from dba_cons_columns a, dba_constraints…
set pagesize 300 set linesize 205 set head on set echo off spool fkwoind accept usrid prompt ‘Enter User Name : ‘ col “Cons Name” format a30 heading “Cons Name” word_wrapped col status format a10 heading status col “Cons Type” format a12 heading “Cons Type” col “Column Name” format a30 heading “Column Name” col “Cons…
accept usrnm prompt “Enter The User Name -> ” accept tblnm prompt “Enter The Table Name -> ” select index_name, substr(column_name,1,15) “Colm Name”, column_position “Position” from dba_ind_columns where table_name = upper(‘&tblnm’) and table_owner = upper(‘&usrid’) order by index_name, column_position;