MAC DMG to Disk

September 29th, 2010 Comments off

Long time no see, huh?

I have been quite busy lately figuring out the meaning of life and didn’t have enough time to share my IT tribulations with the public. With great amazement I even discovered that the database host of the wordpress has changed and my site hasn’t been working for some time. However I am back! Back for good..
This post is meant to suite purely self regulatory purpose of not forgetting the command to write dmg images to devices.
It is quite useful when upgrading Mac OSX Leopard to Leopard Snow for example.

Here is the code

asr -source /Volumes/WhereDMGisMounted -target /Volumes/Disk -erase

Read more…

Categories: MAC Tags:

Gather Schema and Index Statistics in Oracle

January 28th, 2010 2 comments

In this post I would like to draw your attention to the Optimizer in Oracle 10g.
The best place to start is the DBMS_STATS package reference page.

The DBMS_STATS package contains all the procedures required to maintain the optimizer statistics of any schema.
Once you get familiar with the documentation of the package, you will actually know which approach is best for your database and schemas. In my case I have to gather schema statistics once per week with a specific estimate_percent value and I have to gather schema index statistics every night. For this purpose I have created the following simple PL/SQL. I recommend if you create jobs and schedule them as appropriate.

-- Gathering Schema Statistics
execute dbms_stats.gather_schema_stats('SCHEMA1', estimate_percent=>39, cascade=>TRUE);
execute dbms_stats.gather_schema_stats('SCHEMA2', estimate_percent=>45, cascade=>TRUE);
-- Gathering Index Statistics
set serveroutput on
begin
for ind in
(select object_name
from user_objects
where object_type='INDEX'
and object_name like 'YOUR_INDEX_PATTERN_HERE'
)
loop
dbms_output.put_line('Gathering Index Statistics for '||ind.object_name||'.....');
dbms_stats.gather_index_stats('SHEMA1', ind.object_name , estimate_percent=>100);
dbms_output.put_line('Gathering Index Statistics for '||ind.object_name||' is Complete!');
end loop;
end;
/

Read more…

Compile Invalid SYNONYM Oracle

January 11th, 2010 4 comments

Happy New Year!
Wish you all the great stuff you have been dreaming about to come true in 2010!

I haven’t posted for a long time but my excuse is the busy season at work. At the end of the day I am finding a minute to share a simple but useful hint on generating the COMPILE SQL for invalid PUBLIC SYNONYM objects.

Every time you drop and recreate an object such as a SEQUENCE, the PUBLIC SYNONYM for that objects invalidates (if such exists). In order to generate the COMPILE commands you could use SQL similar to the following two examples:

Read more…

Categories: Database, Oracle Tags: , , , ,

list MAC addresses of guest VMs

September 9th, 2009 Comments off

I noticed an IP conflict today on a windows box hosted on the ESXi. In the events viewer under system I checked the MAC address of the system trying to hijack my IP address. I wanted to find a quick way and check if this mac address is in my existing ESXi Virtual Machines or it’s outside somewhere..
I wanted to find a quick and dirty way to check this since there is number of machines on the ESXi host.
Here is what I did…

I opened VMWare VI-TOOLKIT. After I connected I decided to try some commands that I regularly use such as get-vm and get-vmguest. After I found nothing interesting I checked out the CI Toolkit Cmdlets Reference Document.

And there it was… the perfect command for what I wanted..

Read more…

Categories: ESX, ESXi, VI, VMware Tags: , , , ,

Fixing incorrect crs_stat

September 8th, 2009 Comments off

I was interested to find out how I can change the configuration of the oracle cluster nodeapps.
I had a problem with the listener running on both nodes.
The problem was an incorrect ACTION_SCRIPT=/u01/app/oracle/oracle/product/10.2.0/asm/bin/racgwrap
The path was incorrect due to previous installation that I did with the wrong path. This leads to unknown status in the application state as follows:

oracle@rac03:/u01/crs1020/crs/public> crs_stat -t
Name Type Target State Host
————————————————————
ora….SM1.asm application ONLINE ONLINE rac03
ora….03.lsnr application ONLINE UNKNOWN rac03
ora.rac03.gsd application ONLINE ONLINE rac03
ora.rac03.ons application ONLINE ONLINE rac03
ora.rac03.vip application ONLINE ONLINE rac03
ora….SM2.asm application ONLINE ONLINE rac04
ora….04.lsnr application ONLINE UNKNOWN rac04
ora.rac04.gsd application ONLINE ONLINE rac04
ora.rac04.ons application ONLINE ONLINE rac04
ora.rac04.vip application ONLINE ONLINE rac04

In order go fix this I exported the listener configuration by using the following for both nodes separately:

Read more…

Use vm-support to stop stalled Virtual Machines

July 30th, 2009 Comments off

In some rare cases you can notice resource allocated to virtual machines that don’t appear to be running.

esxtop can help you find this out.

Using vm-support you can identify the world id of the virtual machine and then using the same command you can generate some support logs and abort the virtual machine.

Read more…

Categories: ESX, ESXi, VI, VMware Tags: , , ,

Invalid Objects after wrong utlrp.sql

June 24th, 2009 Comments off

Be extra careful with the location of your utlrp.sql script when you decide to recompile the invalid objects for the entire database as sys.
The utlrp.sql script resides in the ORACLE_HOME/rdbms/admin and in CLIENT_HOME/rdbms/admin folders.
It is utterly wrong to use and recompile with the script in the client home folder.
After such a mistake of me the SYSMAN schema got completely corrupt.
I restored the SYSMAN using the steps described in my previous post OracleDBControl .

The remaining invalid objects are as follows:

select owner, object_name from all_objects where status='INVALID';

Read more...

Categories: Oracle Tags:

OracleDBControl

June 24th, 2009 Comments off

If you have ever exported and imported complete databases and moved them around from one server to another, you have probably noticed the issues that might occur with the EM repository. During the last delivery project that I worked on I had to import two databases in two Oracle servers (10.2.0.4) installed on Microsoft Windows 2003 x64. Everything was going smooth with the DBCA during the creation of the new database. I have selected the database to be manager using Enterprise Manager so the EM repository was being installed. Unfortunately it errored out. The logs are stored in the following location:

D:\oracle\product\10.2.0\db_1\cfgtoollogs\emca\instance_name (ORACLE_HOME\cfgtoollogs\emca\instance_name)

I found out that everything with the creation of the EM repository has been successful except the actual start of the windows service. In the log files I found the following trace:

24.06.2009 10:11:50 oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
24.06.2009 10:14:32 oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
24.06.2009 10:14:42 oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
24.06.2009 10:15:08 oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.
24.06.2009 10:19:48 oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
24.06.2009 10:21:13 oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
24.06.2009 10:25:08 oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
24.06.2009 10:24:08 oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...

Read more…

Categories: Oracle Tags:

SSH Tunnel + SOCKS Proxy Browsing

May 23rd, 2009 4 comments

This article I create for my personal reference since I tend to forget things such as names, addresses, SSH Tunnel configurations, severe acts of nature and so on…

Concerning Tunnels:

A tunnel is usually an underground passage from one place to another. Why is there a reason to go through a tunnel instead above ground I can’t really answer in general, but I sure know why I have to use tunnels in my daily IT routines.
The tunneling allows me to deliver payload securely and also allows me to access resources that are otherwise restricted from my location.
The example below demonstrates the setup of an SSH Tunnel that is used for simple internet browsing.

Read more…

Categories: SSH Tags: ,

Drop multiple tables in Oracle

April 23rd, 2009 13 comments

I just noticed that the Oracle instance that I am working with has the SMP_% tables added from the Oracle Enterprise Manager. Since I don’t need them I decided to drop them. Here is my sql that generates the delete statements:

select ‘drop table ‘||table_name||’;’ from user_tables where table_name like ‘SMP_%’;

or..

Read more…

Categories: Oracle Tags: ,