Nov 24, 2011
Missing DBMS_SCHEDULER Jobs via OEM
If you notice a job is running, even an os command, then query the dba_scheduler_jobs view. This will list all dbms_scheduler jobs, then use notmal dbms_scheduler options to work with this job, prefrebably drop the job.
Nov 17, 2011
Invisible Indexes
To make an index invisable then run:
sql> alter index <index name> INVISIBLE;
To make an index visible:
sql> alter index <index name> VISIBLE;
You can also make the optimizer use all invisible indexes by for the current session by:
sql> alter session set optimizer_use_invisible_indexes = true ;
Nov 12, 2011
TAR and Excluding Files
The syntax to do this is:
tar cvfX <
Nov 11, 2011
Packaging Oracle Incidents
"AUTOIMATIC DIAGNOSTIC REPOSITORY"
This tool, among other tasks does the following:
- Automatically purges trace files, alert log files etc
- Manages "incidents"
- Packages incidents.
This blog will talk about how to manage the logs and manage incidents. Although many features discussed in this blog can be completed via OEM, I will be discussing how to do this from the command interface.
To Log On, run:
unix> adrci
To show your current environment, run:
adrci> show homes
To set a HOME environment, run:
adrci> set home
To show current incidents, run:
adrci> show incidents
ADR Home = /opt/oracle/admin/diag/rdbms/xxx/XXX:
*************************************************************************
INCIDENT_ID PROBLEM_KEY CREATE_TIME
-------------------- ----------------------------------------------------------- ------------------
12426 ORA 3137 [12333] 2011-11-02 16:47:50.277000 +13:00
1 rows fetched
To purge a particular incident, run:
adrci> purge -i n nn nnn
To purge a type of data, run:
adrci> purge -age nn -type xxx
where age is defined in minutes and type can be "alert, incident, trace, dump etc"
Nov 8, 2011
11.2 Update Window Details
BEGIN
DBMS_SCHEDULER.DISABLE(
name=>'"SYS"."SATURDAY_WINDOW"',
force=>TRUE);
END;
BEGIN
DBMS_SCHEDULER.SET_ATTRIBUTE(
name=>'"SYS"."SATURDAY_WINDOW"',
attribute=>'DURATION',
value=>numtodsinterval(1080, 'minute'));
END;
BEGIN
DBMS_SCHEDULER.SET_ATTRIBUTE(
name=>'"SYS"."SATURDAY_WINDOW"',
attribute=>'REPEAT_INTERVAL',
value=>'FREQ=WEEKLY;BYDAY=SAT;BYHOUR=3;BYMINUTE=0;BYSECOND=0');
END;
BEGIN
DBMS_SCHEDULER.ENABLE(
name=>'"SYS"."SATURDAY_WINDOW"');
END;
Aug 11, 2011
tar / compress in one command
Aug 10, 2011
rman delete
Aug 3, 2011
vi search and replace
May 16, 2011
ksh Setting Variables only if the variable is not set
DATESTRING=${DATESTRING:-$(date)}
May 4, 2011
Xauth x11 forwarding on unix
1. Update putty X11 settings. Click the "ENABLE X11 FORWARDING", for each putty connection.
2. Login to unix server.
3. Run > xauth list
Output will be something like
Where nn is a number like 10, 11, 12, ...
4. Start exceed / similar server.
5. Run > export DISPLAY=localhost:nn
If sudoing to another unix account then run the following:
1. Sudo to unix account
2. Run > xauth add unix:nn ... Output from xauth list command ran in step 3 above.
3. Run > export DISPLAY=localhost:nn
Now run your x11 application.
Feb 22, 2011
Remove unwanted files from FLASH_RECOVERY_AREA
Note : Flashback logs cannot be backed up outside the recovery area and so are not backed up by BACKUP RECOVERY AREA.
NOTE: Removing these files with an operating system utility will physically remove these files, but the database will still think the files exist and the problem of archival error may still occur. Use the following commands to synchronize the files with the database and use rman to remove these files.
RMAN>CROSSCHECK ARCHIVELOG ALL;
RMAN>Delete expired backup;
RMAN>Delete expired archivelog all;
RMAN>Delete force obsolete;
4. Make sure that your guaranteed restore points are necessary. If not, delete them
5. If flashback logs are enabled then make sure you have enough space for all the flashback logs. If its not required then you can turn off flashback.
6. Review your backup retention policy and if required change the RMAN RETENTION POLICY
Exceptions :
- If RMAN is not part of backup strategy and archivelogs are going to FRA then manual intervention required for deletion of archivelogs. Periodically purse old archivelogs
for example
- By default RMAN backup goes to FRA. While taking RMAN backup if backup location explictly specified to flash recovery area location then those backup pieces are not considered as part of FRA for auto managment.
- For Archivelogs backup to FRA use USE_DB_RECOVERY_FILE_DEST rather than giving explict path of FRA
- Bug 4911954
Details:
V$RECOVERY_FILE_DEST SPACE_USED and NUMBER_OF_FILES values may be wrong.
eg: Number of files in V$FLASH_RECOVERY_AREA_USAGE and V$RECOVERY_FILE_DEST are different.
This problem can lead to recovery area files being deleted even though there is no space pressure.
Fixed in : 10.2.0.3 , 11.1.0.6
- Bug 5106952
Details:
Flashback logs are not reclaimed by flash recovery area when using guaranteed
restore point (after dropping guaranteed restore point) or when changing
db_flashback_retention_target to a lower value.
Feb 14, 2011
11.2 recovery - free up spaceon DB_RECOVERY_FILE_DEST*
Make more disk space available and increase DB_RECOVERY_FILE_DEST_SIZE
2. Move backups from the flash recovery area to tertiary storage such as tape.
Note : Flashback logs cannot be backed up outside the recovery area and so are not backed up by BACKUP RECOVERY AREA.
3. Run DELETE for any files that have been removed with an operating system utility. If you use host operating system commands to delete files, then the database will not be aware of the resulting free space.
RMAN>CROSSCHECK ARCHIVELOG ALL;
RMAN>Delete expired backup;
RMAN>Delete expired archivelog all;
RMAN>Delete force obsolete;
4. Make sure that your guaranteed restore points are necessary. If not, delete them
5. If flashback logs are enable then make sure you have enough space for all the flashback logs. If its not required then you can turn off flashback.
6. Review your backup retention policy and if required change the RMAN RETENTION POLICY
Exceptions :
- If RMAN is not part of backup strategy and archivelogs are going to FRA then manual intervention required for deletion of archivelogs. Periodically purse old archivelogs
for example
- By default RMAN backup goes to FRA. While taking RMAN backup if backup location explictly specified to flash recovery area location then those backup pieces are not considered as part of FRA for auto managment.
- For Archivelogs backup to FRA use USE_DB_RECOVERY_FILE_DEST rather than giving explict path of FRA
- Bug 4911954
Details:
V$RECOVERY_FILE_DEST SPACE_USED and NUMBER_OF_FILES values may be wrong.
eg: Number of files in V$FLASH_RECOVERY_AREA_USAGE and V$RECOVERY_FILE_DEST are different.
This problem can lead to recovery area files being deleted even though there is no space pressure.
Fixed in : 10.2.0.3 , 11.1.0.6
- Bug 5106952
Details:
Flashback logs are not reclaimed by flash recovery area when using guaranteed
restore point (after dropping guaranteed restore point) or when changing
db_flashback_retention_target to a lower value.