RMAN Backup with Python

I want to start using Python to perform my backups. Here is a simple script to perform it. Insde both the Incremental_backup.cmd and Full_backup.cmd, you can put any rman commands you like. Archive log backup archivelog all delete all input; backup current controlfile; delete noprompt expired archivelog all; delete noprompt obsolete; Incremental level 0 backup … Read more

Automatic Shrink

The company I work for would rebuild their tables and indexes every quarter, this did cause some concern for me and they were adamant that this needed to be done. I compromised and came up with this script.

How to calculate DB time for a week

DB Time is a period demonstrate measurement that is the entirety of Oracle process CPU utilization and non-inert hold up time. While advancing Oracle frameworks we regularly center around decreasing “time”, however ordinarily database work is additionally part of the condition. SELECT sum(Round(NVL((e.value – s.value),-1)/60/1000000,2))/1440 ||’ days’ “DB Time” FROM DBA_HIST_SYS_TIME_MODEL s, DBA_HIST_SYS_TIME_MODEL e WHERE … Read more

How many log switches per hour

Calculate the log switches per hour over the last week. SET PAGESIZE 90 SET LINESIZE 150 set heading on column “00:00” format 9999 column “01:00” format 9999 column “02:00” format 9999 column “03:00” format 9999 column “04:00” format 9999 column “05:00” format 9999 column “06:00” format 9999 column “07:00” format 9999 column “08:00” format 9999 … Read more

Primary Keys without auto increment (MYSQL)

How do you check that all primary keys have an auto increment function? Well here is how to do it. SELECT distinct u.table_name, u.column_name, u.constraint_name, c.extra FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE u, INFORMATION_SCHEMA.COLUMNS c WHERE u.TABLE_NAME=c.TABLE_NAME and u.COLUMN_NAME=c.COLUMN_NAME AND u.TABLE_SCHEMA=c.TABLE_SCHEMA AND u.CONSTRAINT_NAME = ‘PRIMARY’ AND u.TABLE_SCHEMA = ‘mytoll’ AND c.extra ‘auto_increment’;