select name, floor(space_limit/1024/1024) "Size_MB", ceil(space_used/1024/1024) "Used_MB", floor(space_limit/1024/1024) - ceil(space_used/1024/1024) "Available_MB", round(ceil(space_used/1024/1024) / floor(space_limit/1024/1024) * 100) || '%' "Percent Used" from v$recovery_file_dest order by name;
Monday, 12 December 2011
Available db_recovery_file_dest
Tuesday, 8 November 2011
chmod
chmod u+rwx
chmod g+rwx
chmod o+rwx
chmod u-rwx
chmod g-rwx
chmod o-rwx
Monday, 24 October 2011
Export to Pipe
make fifo pipe
mkdir fifo db.fifo
write the file output to gzip and send to background
cat db.fifo | gzip > db.dmp.gz &
run the export to the fifo pipe
exp username/password file=db.fifo log=db.log etc
Thursday, 13 October 2011
Tuesday, 27 September 2011
OEM - UDM Collection Interval
If you wish to change this interval, you can do so by editing a xml file on the server which is the target of the UDM.
On target server, navigate to $ORACLE_AGENT_HOME/sysman/emd/collection and edit file oracle_database_{SID}.{SERVER}.xml.
Search for the name of the UDM and edit the IntervalSchedule tag e.g.
<CollectionItem NAME="{UDM_NAME}">
<Schedule>
<IntervalSchedule INTERVAL="{n}"/>
</Schedule>
Saturday, 13 August 2011
Saturday, 6 August 2011
Ardmona Cricket Cards
Ardmona 1979 Set
Ardmona 1980 Set
Friday, 5 August 2011
Change Apex 4.0 Admin Password
Rem Copyright (c) Oracle Corporation 1999 - 2006. All Rights Reserved.
Rem
Rem NAME
Rem apxxepwd.sql
Rem
Rem DESCRIPTION
Rem Changes the password for the INTERNAL ADMIN user
Rem
Rem NOTES
Rem Assumes the SYS user is connected.
Rem
Rem REQUIRENTS
Rem - Oracle 10g
Rem
Rem
Rem MODIFIED (MM/DD/YYYY)
Rem jstraub 08/01/2006 - Created
Rem jkallman 09/29/2006 - Adjusted current_schema to FLOWS_030000
Rem jkallman 08/02/2007 - Change FLOWS_030000 references to FLOWS_030100
Rem jkallman 07/08/2008 - Change FLOWS_030100 references to FLOWS_040000
Rem jkallman 10/02/2008 - Change FLOWS_040000 references to APEX_040000
Rem
set define '&'
set verify off
alter session set current_schema = APEX_040000;
prompt ...changing password for ADMIN
begin
wwv_flow_security.g_security_group_id := 10;
wwv_flow_security.g_user := 'ADMIN';
wwv_flow_security.g_import_in_progress := true;
for c1 in (select user_id
from wwv_flow_fnd_user
where security_group_id = wwv_flow_security.g_security_group_id
and user_name = wwv_flow_security.g_user) loop
wwv_flow_fnd_user_api.edit_fnd_user(
p_user_id => c1.user_id,
p_user_name => wwv_flow_security.g_user,
p_web_password => '&1',
p_new_password => '&1');
end loop;
wwv_flow_security.g_import_in_progress := false;
end;
/
Thursday, 7 July 2011
Monday, 4 July 2011
Been A Good Book Week
Saturday, 25 June 2011
Tuesday, 14 June 2011
Sunday, 17 April 2011
Monday, 4 April 2011
Wednesday, 30 March 2011
Tuesday, 29 March 2011
DOS Script to Email Results of a Database Export
@ECHO OFF
REM Enable local environments to be changed without affecting anything else.
SETLOCAL
REM check the export.log file for the filedate and pass it into a variable. Done by doing a directory listing on the file, returning just the filename and then looping through and capturing the file's timestamp into a variable
for /f "tokens=* delims=" %%a in ('dir/b export.log') do (
for /f "tokens=1 delims=" %%i in ("%%a") do (
set _fdt=%%~Ti
)
)
REM Write the logfile contents to a secondary file. This is only done to allow us to append the results of a TSM tape backup of the export.dmp to a logfile and email it in the email body.
type export.log > bkup.log
REM set a variable _status with a default of ERRORS. If the process has a status of SUCCESS, the following commands will overwrite this variable. If not, it will report it as ERRORS in the email
SET _status=ERRORS
REM Loop through the earlier generated secondary logfile and find the string "Export terminated successfully without warnings" which is a standard Oracle output found in export logs
for /f "tokens=*" %%s in ('type bkup.log ^| find /i "Export terminated successfully without warnings"') do (SET _status=SUCCESS)
REM Processes to follow a SUCCESS which includes sending the export.dmp to TSM tape storage. Append the TSM results to the secondary logfile generated earlier.
if %_status%==SUCCESS (
cd \TSM\baclient\
dsmc archive -des="TSM Archive Name %_fdt%" -archmc=ARCH14D export.dmp >> bkup.log
Use a third party application, postie to email the results
c:\postie\postie -host:mailhost -to:sender@email.com -s:"SUCCESS:ExportDaily (%USERDOMAIN%) for %_fdt%" -nomsg -from:sender@email.com -file:bkup.log
)
REM Email as ERRORS if the above step fails
if %_status%==ERRORS c:\postie\postie -host:mailhost -to:recipient@email.com -s:"ERRORS:ExportDaily (%USERDOMAIN%) for %_fdt%" -nomsg -from:sender@email.com -file:D:\backup\obj_live\bkup.log
Friday, 18 March 2011
Alter Database Open Resetlogs Upgrade
- Copied datafiles to target
- Created a New Controlfile
- Recovered using syntax: RECOVER DATABASE UNTIL TIME 'YYYY-MM-DD:HH:MI' USING BACKUP CONTROLFILE;
- Ran ALTER DATABASE OPEN RESETLOGS;
The reason for this is that the target database was upgraded sometime after the point in time recovery date.
In the past, when faced with this situation, I was able to point the database and the /etc/oratab entries to the old Oracle Home and recover that way, but in this instance the old home had been removed and well a more elegant solution needed to be found.
Resolution:
- Copied datafiles to target
- Created a New Controlfile
- Recovered using syntax: RECOVER DATABASE UNTIL TIME 'YYYY-MM-DD:HH:MI' USING BACKUP CONTROLFILE;
- Ran ALTER DATABASE OPEN RESETLOGS UPGRADE;
Friday, 11 March 2011
Meeting Jeff Thomson
- Hilditch is likely to be offered another 2 year extension of contract as Selector, which is bad news for Australian cricket.
- Ponting has his favourites and as a result talented players like Brad Hodge have not had a decent run in the team.
- Michael Clarke is not liked by the players and the selectors would rather have as captain someone such as Tim Paine.
- Thomson doesn't rate Phil Hughes as a test calibre batsman and would rather see someone like David Warner given a chance to play test cricket.
- From the current crop of players, he rates Brett Lee the highest. Does not appear to have any time for the likes of Tait, Siddle or Mitchell.
- In his opinion, most bowlers don't spend enough time honing their craft on the cricket pitch. As an example, Steve Finn when not picked for England, was sent off for strength and conditioning instead of playing cricket for his county side. Thomson feels that the only way to get the best out of bowlers is to have them bowl a lot.
- His role model was "his dad" and guys such as Fred Trueman.
MySQL Spool File
You can increase the verboseness (is that a word?) of a batch output logfile in MySQL, by repeating the "-v" switch.
This is amazingly useful if for example you are running some DML and wish to capture in your output logfile the number of rows being inserted/deleted/updated.
mysql -u user -ppassword database_name -v -v < test.sql > test.log
Thursday, 10 March 2011
Lightening Strikes Thrice!! (Warning: Disturbing Images)
My primary air-filter stopped working and the secondary didn't have enough juice to keep the fish alive, as the population in my tank, through breeding was starting to get out of control. My own fault of course, for not thinning them out and there is only so much equipment that can be added to a tank!
Anyhow, just lost an array of fantastic fish including Frontosas, Duboisies, Mainganos, Electric Yellows. The only survivors, my clown loaches, bristlenose catfish and one or two hybrid cichlids, which may not live through the day :(
Not sure what to do now, may just give the survivors to a friend and call it a day!
Thursday, 24 February 2011
Obtaining a Cricket Postmark
I think the end result is quite pleasing to the eye.
The Great Forgery!!
Whilst awaiting my prize, I asked my daughter to illustrate the shirt for my work newsletter. Looking at her handiwork alongside the now received shirt, I feel quite satisfied that should she fall upon hard times in the future, she may well have a decent career in forgery!
Monday, 21 February 2011
Friday, 18 February 2011
Thursday, 3 February 2011
MySQL Global Options File - Storing Password
A reasonable solution found is to simply store the password in the /etc/my.cnf (options) file.
Added the following text to achieve this. Also decided to store the default database name as well to make life simpler.
[client]For this setting to take affect, just had to restart the database. So now the cron script can simply connect to the correct database by typing in "mysql".
password={password}
database={dbname}
Need to assess security implications of this decision as I proceed to learn the nuances of MySQL.
Wednesday, 2 February 2011
Check O/S Version
Also .....
LINUX:
cat /etc/issue
AIX:
oslevel
oslevel -r (shows technology level)
oslevel -s (shows service pack)