Backup Report from Enterprise Manager

How do we report on databases that haven’t been backed up? We create a report from Enterprise manager and see what has failed and what backups are potentially missing Run this in Enterprise Manager /* mark young 23-August 2011 */ SELECT a.HOST_NAME, a.DISPLAY_NAME, CASE WHEN b.end_time < SYSDATE – 2 THEN ‘3. BACKUP OLDER THAN … Read more

Change passwords in Oracle with Python

Write the contents out to a CSV file import sys import cx_Oracle import os def printf (format,*args): sys.stdout.write (format % args) def printException (exception): error, = exception.args printf (“Error code = %s\n”,error.code); printf (“Error message = %s\n”,error.message); username = sys.argv[1] password = sys.argv[2] databaseName = sys.argv[3] new_user = sys.argv[4] new_password = sys.argv[5] print(‘Connecting to ‘ … Read more

How to convert an instance to a cluster database

I have tried to perform this using Enterprise Manager, however I have never been successful. Here are the manual steps. Migrating a database from one RAC system to another can be performed by cloning the database, once it’s cloned it can be converted to a cluster database. The following steps are what is required. Step … Read more

How to change a MYSQL User Password

Solution Step 1. Login to the relevant server as any user and login to mysql as described below cd /usr/local/mysql/bin ./mysql -uroot Change the user password update mysql.user set password=’indreport’ where user=’indreport’; Query OK, 0 rows affected (0.11 sec) Rows matched: 1 Changed: 0 Warnings: 0 mysql> commit; Query OK, 0 rows affected (0.00 sec)

Truncate sys.aud$ table

How to reclaim space from system Solution Step 1. Check to see what is the lagest table in the system tablespace SELECT * FROM ( SELECT OWNER, SEGMENT_NAME, BYTES / 1024 / 1024 MB FROM DBA_SEGMENTS WHERE SEGMENT_TYPE = ‘TABLE’ ORDER BY BYTES / 1024 / 1024 DESC) WHERE ROWNUM

Database Capacity Planning

Capacity and Growth Forecast How to estimate the growth and forecast of a database on a host. Step-by-step guide The procedure is at the bottom of this article. Login to enterprise manager from sqlplus (from omsdbaup03) oracle@omsdbaup03:/users/oracle [emrep12c] $ sqlplus sysman/xxxxxx 2. Follow the following to calculate growth for each database on a host SQL> … Read more

Everything RAC – Cheat Sheet

The is to guide you through the Oracle RAC clustered system CRSCTL Command Note: -Any command which just needs to query information can be run using oracle user. But anything which alters Oracle Clusterware requires root privileges. First set oracle environment to CRS Start Oracle Clusterware UNIX>crsctl start crs Stop Oracle Clusterware UNIX>crsctl stop crs … Read more

Purge Oracle Maintenance Logs

Purging Oracle Logs The basis of this script is to purge logs from the Oracle Base directory daily The script will be executed from cron on a daily basis, however this could run at different times on each system due to business and or system load requirements. Technical Steps #!/bin/ksh #——————————————————————————– #– #– File name: … Read more