generated from ministryofjustice/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9196 from ministryofjustice/TM-606-migrate-tst-data
TM-606 migrate data
- Loading branch information
Showing
8 changed files
with
195 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
|
||
chown -R oracle:dba /home/oracle/scripts | ||
ORACLE_SID=EDW;export ORACLE_SID | ||
ORACLE_HOME=/oracle/software/product/10.2.0 | ||
ORACLE_BASE=/oracle/software/product/; export ORACLE_BASE | ||
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib; export LD_LIBRARY_PATH | ||
PATH=$ORACLE_HOME/bin:$PATH;export PATH | ||
TO_DATE="20`date +%y%m%d`"; export TO_DATE | ||
|
||
echo ======= | ||
echo Extract Alert log location | ||
echo ======= | ||
export VAL_DUMP=$(${ORACLE_HOME}/bin/sqlplus -S /nolog <<EOF | ||
conn /as sysdba | ||
set pages 0 feedback off; | ||
prompt | ||
SELECT value from v\$parameter where NAME='background_dump_dest'; | ||
exit; | ||
EOF | ||
) | ||
export LOCATION=`echo ${VAL_DUMP} | perl -lpe'$_ = reverse' |awk '{print $1}'|perl -lpe'$_ = reverse'` | ||
export ALERTDB=${LOCATION}/alert_$ORACLE_SID.log | ||
export ELOG=$( echo ${ALERTDB} | sed s/cdump/trace/) | ||
|
||
echo ======= | ||
echo Compress current | ||
echo ======= | ||
|
||
if [ -e "$ELOG" ] ; then | ||
mv ${ELOG} ${ELOG}_${TO_DATE}; | ||
gzip ${ELOG}_${TO_DATE}; | ||
> ${ELOG} | ||
else | ||
echo not found | ||
fi | ||
|
||
exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
prompt Find Tablespace used space > 95 percent used with 'autoextend on'. | ||
set pages 90 | ||
set lines 132 | ||
select TABLESPACE_NAME,round(TABLESPACE_SIZE*8192/1024/1024/1024,2) "TS_SIZE(GB)", | ||
round(USED_SPACE*8192/1024/1024/1024,2) "USED_SPACE(GB)", | ||
round((TABLESPACE_SIZE*8192/1024/1024/1024)-(USED_SPACE*8192/1024/1024/1024),2) "FREE_SPACE(GB)", | ||
round(USED_PERCENT,2) "USED%",'ALERT' as status | ||
from dba_tablespace_usage_metrics | ||
where round(USED_PERCENT,2) > 94.75 | ||
and TABLESPACE_NAME not like 'UNDO%' | ||
order by 5 desc | ||
/ |
Oops, something went wrong.