Mostrar mensagens com a etiqueta dba. Mostrar todas as mensagens
Mostrar mensagens com a etiqueta dba. Mostrar todas as mensagens

terça-feira, 5 de junho de 2012

Grid Control - Alerts By type

Well and now, getting the information for all the [same] alerts across all targeted databases, you can use the following query (knowing the view, it is easy to get the rest of the different types of information). For this specific query I wanted the invalid objects order by number. Example:
"237 object(s) are invalid in the PUBLIC schema."


If you check the MGMT$ views on the sysman schema, you get all the necessary information. After this post:
http://pinelasgarden.blogspot.co.uk/2012/06/grid-control-target-databases-size.html
I leave you with the following query (the message_params field has the varying  info).



select target_name, message_params,message
from MGMT$ALERT_CURRENT 
where target_type='oracle_database'
and metric_name='invalid_objects'
order by to_number(substr(message_params,1,instr(message_params,'&')-1)) desc;

Grid Control - Target Databases Size Report

After going through all the MGMT$ views in the sysman schema, I finally found out how to get the size of all monitored targets (oracle databases) in a single table (I was only given access to GC and not any DB).
And after that, how to create a report based on that query in Grid Control (10g).
So here are the steps to create a report and the query for the report. 


Basically you go to reports, click create, add a "table from sql" element then you edit the element and paste the sql statement and with that and one or two more slight touches (names and so forth), you are good to go.
And the query is:
select host_name,target_name, 
ROUND(sum(tablespace_size)/1024/1024/1024,1) totalGB,
round(sum(tablespace_used_size)/1024/1024/1024,1) usedGB,
round((sum(tablespace_used_size))/(sum(tablespace_size))*100,1) usedPerc
From MGMT$DB_TABLESPACES
group by host_name,target_name order by 5 desc


This gives you the host and target name, the total GB allocated, the used GB, and the used percentage.

terça-feira, 20 de setembro de 2011

[DBA] - asktom , CWs

well, latelly I've been really busy on tunning some heavy queries on a great number of rows (using all of them).
So, I came across one of the pages from the Oracle SQL GURU, Tom Kyte
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:7413988573867

which came crashing down on some of my beliefs (or "CWs - Conventional Wisdom" as he calls them). He says:

"Other CW's (that are all 100% wrong)

o indexes mean fast=true, if the optimizer doesn't use them, the optimizer has
  a bug

o indexes need to be rebuilt frequently or on a scheduled basis

o rebuilt indexes are faster, smaller and better

o segments should have few extents -- double digit extents are really bad for
  performance

o all cursors in code should be explicit cursors, implicit cursors are slow and
  bad

o select count(1) is better then select count(*)

o procedural code is faster then doing it in SQL

o adding more CPU will make our systems faster

o index space is not reused

o nologging stops all redo log from being generated on that segment

o the most selective fiedls must be first in an index

o you should commit frequently to save resources and time

o a cold backup is better then a hot backup"

sábado, 17 de setembro de 2011

[DBA] - mysql update with self values

interesting how a simple:

update tab1 set field1=(select field1 from tab1 where field1=field2)

cannot be simply done in mysql. you need some workarounds like another duplicate table or as demonstrated at
http://www.xaprb.com/blog/2006/06/23/how-to-select-from-an-update-target-in-mysql/
since mysql "materializes subqueries in the FROM clause (“derived tables”) as temporary tables, wrapping the subquery into another inner subquery in the FROM clause causes it to be executed and stored into a temporary table, then referenced implicitly in the outer subquery.  "

The error message is:
" ERROR 1093 (HY000): You can't specify target table '<whatever>' for update in FROM clause."

Strange.

terça-feira, 16 de agosto de 2011

[EN] - Forex GBP/USD 2011-Aug-16 22:53 GMT+0

 
Technical Analysis:
Well, the channel remains valid since April with a fake move around the end of the month. The GBP may take another strike at the resistance.

 
Fundamental Analysis:
The USA has been showing signs of a "not-so-strong" economy forecast for the next few months. This may be the catalyst that the GBP needs to break through the resistance.

Strategy:
Agressive tactics may enter long positions. But the channel is ready to be tested. So, conservative investers may decide to "keep of the grass" for now.

 
[Disclaimer]
This article doesn't constitute any advice on investment and the author takes no responsibility for the outcome of orders opened based on the information written here. The reader must take into account his own investment profile and financial capability. Investing in the forex markets can incure in severe losses.

domingo, 14 de agosto de 2011

[DBA] - OBIEE 11g - BI admin Tool - Connection Failed

In order to connect the BI Administration Tool to a DB by OCI 10g/11g a few steps are required to avoid the connection Failed error..

1 - you need to put a tnsnames.ora on the <BI MDW Home>\network\admin folder..
2 - you need to place the <BI MDW Home>\bin directory on the PATH environmental variable.
3 - if you connect with sys (just sys) he will return the "the connection has failed" error without the useful information regarding the "as sysdba" argument.

In the shown example, my <BI MDW Home> is E:\mdw_home\Oracle_BI.

After these changes, AND restarting the BI tool, everything should be fine.

Hope that helps.




quarta-feira, 10 de agosto de 2011

[DBA] - OBIEE 11g (1.1.1.3) (post) installation errors

OBIEE is a very interesting tool. If all goes well during the install process, you don't have to worry about anything. Just input the data, and next, next, next.
If, however problems due happen, it can be pretty boring to find out why.
So here are some helpfull pointers:

1 - RTFM - http://www.oracle.com/technetwork/middleware/bi-enterprise-edition/documentation/index.html

2 - pay atention to your hosts file. Don't have any entries with the hostname and IPS other than 127.0.0.1 (unless you definitely know you need it).

3 - the diagnostics directory under <MDW_HOME>\instances\instance can be very useful when diagnosing the separate components.

4 - most (stupid = not your fault :P) problems during install process may happen simply due to memory shortage. The page at http://download.oracle.com/docs/html/E18558_01/fusion_requirements.htm indicates no less than 2GB of physical memory and 4GB of total memory (physical + swap). Well, my VMs never had more than 2GB, and the swap was around 2.5GB and the virtual memory was always in the dog house. So bear this in mind.
I had problems that just went away after a reboot and a restart of the install process like (creating ASinstance, Creating BI components, etc)

5 - problems during "start process coreapplication_obips1" can be tested by the "sawping" comand. this because the Presentation Services webpage (by default <hostname>:9704/analytics) contact with the sawserver and if there are problems with the port, or the services aren't up. That and the DSN created by OBIEE can have the IP instead of the hostname in it's configuration. Check it out.
Also, this is a very demanding memory process (atleast so it seemed by taskmanager's behaviour).
Memory problems could occur.

6 - problems during "start process coreapplication_obijh1" can be that you're machine is having problems with the 1024M parameter in <MDW_HOME>\instances\instance\config\opmn\opmn\opmn.xml. you can switch it to 768M (http://forums.oracle.com/forums/thread.jspa?threadID=1124066)

7 - when you reboot, you have to give it some time to start all the services. Even after the browser window opens with the Analytics page and the shell is closed. use <MDW_HOME>\instances\instance1\bin\opmnctl status to check the components. Components with alive are ok, with init are still starting (give them a chance) and with down will not start on their own. You can use the Admin Pages (EM or Console) or the command:
opmnctl startproc ias-component=<component name on status list>.

hope it was helpful.
BR.

terça-feira, 12 de julho de 2011

[EN] - OEL 5.6 + 11gR2 + OEM = Streams? simple and easy?

well this saturday I updated my test environment and created a VM with OEL 5.6 and Oracle Database 11gR2 (I tried OEL 6 but that was a little frustrating - more on that later). I had previous experience with 11gR2 but never had a permanent VM.
I then migrate my data from the 10gR2 DB to this one via Data Pump. Worked great.

After that I went browsing Enterprise Manager (OEM) and found this interesting option:

Very interesting! One of these days I'll duplicate my VM, change the DB name (for simplicity) and try this option. Let's see how it goes.

More information in the near future :D

terça-feira, 28 de junho de 2011

EN] - HAA in Oracle vs MySQL - part 2

filling in the gaps..
http://pinelasgarden.blogspot.com/2011/06/en-haa-in-oracle-vs-mysql.html

I said that "(...) mysql replication which had asynchronous data transmission and this does not garantee me data persistence (yet). " and I've found that for the Mysql Cluster, you don't need the normal server or replication. It does thant synchronously by itself.
Very nice.

[EN] - RMAN set newname slowwwwwwwwwww

Well this was an interesting solution....

Problem:
A restore on a vm with windows for a 10.2.0.3 db, was taking something lik 50/60 seconds between the setnewname commands. I had 120 so, do the math. This was seriously cramping my style (and annoying me).

Solution:
I googled, then I metalinked (:D) and then I found the note
SET NEWNAME takes 2 minutes per file [ID 554923.1]
which told me to
"1) Move SET UNTIL TIME command just before RESTORE DATABASE command.
2) Move all SQL commands that are used to rename log file names, before SET UNTIL TIME command. "


Actually the note was dead on. I had the set until command before the newname commands.
The google part of the research, had already discovered other dbas with a similar problemas (although with duplicates) and their research found that the slow querys were on the v$log_history view.
http://ronr.blogspot.com/2009/07/rman-duplicate-database-slow.html
This indicated something related to archive logs.
Honestly I didn't think that the command's position mattered.
Live and learn. :D

terça-feira, 14 de junho de 2011

[EN] - HAA in Oracle vs MySQL

well, the other day an interesting question came up, which led me to think "what if I wanted an EBS-like architecture with high availabity, but with MySQL?".

I have all the knowledge I need regarding what I need and how to configure and install all the components for such an architecture with oracle technology: RAC, shared storage, network, Web servers all this and more.
But how do I do this with MySQL? This is an interesting question for knowledge sake as well as for simple discussion on the benefits of the alternative.
After googling, I came across two new concepts (rather obviously named): MySQL Cluster and MySQL Replication.
mysql cluster (loosing the case text) looked like Oracle Real Application Cluster.
http://www.mysql.com/products/cluster/architecture.html

What I'm still questioning are the "data nodes". I need some more research to find a relation to the database nodes on RAC. This because I found mysql replication which had asynchronous data transmission and this does not garantee me data persistence (yet). But, I love to learn.
If these Data nodes use mysql replication, I need to read some more :D
more on this in the future.

segunda-feira, 16 de maio de 2011

[EN] - OEL 5.2 + rawdevices

well, rawdevices aren't directly supported on OEL 5.x. So there must be some tricks executed to allow a database to run on these. This was a requirement from the client prior to the upgrade to 11g and r12.
Note Linux 2.6 Kernel Deprecation of Raw Devices [ID 357492.1] instructs how to setup the environment ("Script to Migrate Raw to Block Devices")

In a nutshell:
- you create the  /etc/sysconfig/rawdevices since there isn't one in OEL 5.x;
- you create symbolink links (in the note using a perl script which reads theto the devices with /dev/raw/raw<number>  names;
- and voilá.

2 Problems:
1 - if you're installing a RAC (like I am), the OUI doesn't support this method. So you have to get another solutions (we used OCFS2 :http://www.oracle-base.com/articles/linux/OCFS2OnLinux.php);

2 - every time your node reboots, you must create the symbolic links again. They are not persistent. This is quite annoying.

[EN] - OEL 5.2 + EBS 11.5.10

Well....... this is a troublesome task...... installing old on new. Problems will arise.

Problem:
According to Metalink Note 316806.1 the 2.15 version of the binutils rpm is required to link some EBS modules. However, 5.x come with 2.17. So what to do? You could install over...... but this requires the previous version of the gnu c compiler (gcc). And in order to remove this, you will find that about 90% of the packages would need to go :\

not cool!!
So what to do?

Solution:
available at http://oss.oracle.com/projects/compat-oracle/files/Enterprise_Linux/ there is the following rpm:
compat-binutils215-2.15.92.0.2-24.i386.rpm
this allows the scripts required to finish EBS cloning to finish (with errors) but without errors.
quite interesting.

domingo, 8 de maio de 2011

[EN] - OEL 5.6 + eth + bond

well, I'm now involved in an upgrade from:
- OEL 4.6, 10g RAC (rawdevs) + EBS 11.5.10.2
to:
- OEL 5.6, 11g RAC (ASM) + EBS 12.1.03

and this project has been going like a porsche driving in the sahara dunes.......... slow and painful.
It started with the problem that the servers didn't have a DVD-ROM drive and the ISO from edelivery as only available in DVD format, and next we found out the machines didn't support 64 bit software.
GREAT!!!!

Problem:
The greatest was the problem with the 5.6 release that made the ethernet devices switch positions in the OS. Well, with the bond mechanism, this caused us to lose network connection to the machine on each reboot.

Solution:
- installed 5.2 release (3 days work out the window) and the problem disappeared.

Also, rawdevices are deprecated in 5.x, so a workaround was required to bypass the problema: creating symbolic links, etc etc, (I'll post the link soon, remind if I forget :D)

This has to be finished by Tuesday morning..... let's see...

sábado, 30 de abril de 2011

[EN] - ILO + HP Proliant 580 G2 + Virtual Media


Problem:
Well this was enough to waste 24 hours of a pair of highly skilled professionals :D While trying to setup an ISO image in order to install Oracle Enterprise Linux 5.6 (got it from edelivery.oracle.com) because the server is older than me and doesn't have a DVD reader, I unzip the file, loaded it and connected the virtual drive.

Sounds simple write?? No!!! The image had been tested on my VM Ware server and it booted fine. On the ILO, not so much.
After some intense rebooting trying to boot the damn thing, an idea came into the office: "you have a DVD right? Try loading it from your DVD-ROM drive in your client PC".
this made absolutely NO SENSE!!! but just for the sake of it I tried it.
Solution:
And stupidly enough it worked. And the page was accepting CD images but not DVD ones. Ridiculous. But whatever, problem surpassed.....