Get-EventLog – Use Powershell to filter Event Logs

Use Powershell to locate the Errors from Event Logs on Servers

Powershell is indeed a powerful tool. But using it productively for the real world challenges is the key. With Powershell we can achieve a pro-active approach to IT Management within an organisation. Lets take a scenario; say we need to audit the servers regularly to check for System and Application Errors in the EventLogs

Open Powershell as an Administrator and type below command

Get-EventLog -Logname System -EntryType Error -Newest 5 -Computername Server1,Server2,Server3,Server4  | export-csv c:\plogs\errors.csv

Get-EventLog -Logname Application -EntryType Error -Newest 5 -Computername Server1,Server2,Server3,Server4  | export-csv c:\plogs\errors.csv

The above commands extract the latest 5 System and Application errors from the EventLogs of all the specified Servers. You can run this script through a Simple Task Scheduler for daily information

Advertisements

Backing up the Recovery Catalog – Oracle 10g / 11g

Your backup strategy is not complete until you ensure that your Recovery Catalog Database is also backed up. Use a simple batch file to automate this backup

set ORACLE_SID=<catalog_db_name>
rman target / NOCATALOG log C:\CatalogBackup.log APPEND cmdfile=c:\CatalogBackup.cmd

The backup metadata of the recovery catalog has to go to the Control File of the recovery catalog database; therefore you have to login to RMAN using NOCATALOG. Since RMAN Scripts work only when connected to the Recovery Catalog, you have to use an alternate operating system command file to automate the backup.

As illustrated above we have used the cmdfile  argument of RMAN to specify a custom cmd file. You can specify the RMAN Backup command within this file.

 

 

 

Master Sync has been disabled – Samsung Galaxy S6

If you have come across a scenario, where-in your email synchronization settings are active but yet you get the message Master Sync has been disabled

The below illustration will guide you through. You may also watch the video for the solution

From any screen, drag down the top portion of the Screen

S4 Screenshot

Click the Top Right Icon with 3 squares and a double arrow and you get the below screen as illustrated

Click the Icon titled Sync to enable it and you are done

S4 Screenshot

Create a Batch Script for Oracle RMAN Backup with Logging

You may want to run Oracle Backups using the regular Windows Task Scheduler. A simple batch file can be created for this purpose using below command. If you have multiple databases it would be wise to specify the ORACLE_SID

set ORACLE_SID=<targetdb>
rman target / catalog rmanuser/password@catalogdatabase script=<rman_script_name>

Example:  Target Database: orcl | Recovery Catalog Username /Password: rman/pwdrman | Recovery Catalog DB: rmandb

set ORACLE_SID=orcl
rman target / catalog rman/password@rmandb script=LEVEL1_BACKUP

Enabling Logging

To enable logging for your entire backup session, you can explicitly define it in the batch file itself, as illustrated below. The APPEND keyword ensures the file in rewritten in the next backup schedule.

rman target / catalog rman/password@rmandb log c:\TEMP\Oracle_backup.log APPEND script=LEVEL1_BACKUP

 

ORA-01950: no privileges on tablespace

Error from recovery catalog database: ORA-01950: no privileges on tablespace ‘SYSTEM’

ORACLE error from recovery catalog database: ORA-01950: no privileges on tablespace ‘SYSTEM’ | RMAN-06433: error installing recovery catalog

Please ensure you have assigned below minimum privileges to the User for your Recovery Catalog. Grant these by logging into your SYS user

  • GRANT resource to <recovery catalog username>
  • GRANT RECOVERY_CATALOG_OWNER to <recovery catalog username>