Useful commands to show RAID level of internal hard disks.
On HP blade servers:
/usr/sbin/hpacucli controller all show status /usr/sbin/hpacucli controller slot=0 logicaldrive all show
On other servers:
cat /proc/mdstat
Useful commands to show RAID level of internal hard disks.
On HP blade servers:
/usr/sbin/hpacucli controller all show status /usr/sbin/hpacucli controller slot=0 logicaldrive all show
On other servers:
cat /proc/mdstat
Problem: Client suffers intermittent ORA-12545 “Connect failed because target host or object does not exist” trying to connect to oracle RAC database.
Solution: Edit server side (not client side) listener.ora and tnsnames.ora files to have fully qualified hostnames.
Thanks to David Yahalom for flagging this – it doesn’t appear to be covered in metalink/my oracle support.
RAC servers were configured to resolve each others host names with – so ‘racserver1′ resolved to the same IP address as did the fully qualified name ‘racserver1.admin.mycompany.com’.
Client machine (web servers in my case) were not configured in that way. So they could resolve ‘racserver1.admin.mycompany.com’ ok, but could not resolve ‘racserver1′.
You might think that simply specifying the fully qualified hostnames in the client connect string (only) would be enough to resolve this. But no. Server side load balancing will every so often redirect the client to a new hostname. The client has to be able to resolve that new hostname, or it will report an ORA-12545. And that new hostname is supplied by the server, based on what is in the server listener and tnsnames settings. This behaviour is the default (at least in Oracle 11gR1).
This is especially likely with web servers, where security considerations might mean they don’t see exactly the same DNS as other servers do, so is often seen with jdbc, java, php oci8. But really it is a general oracle client issue – sql*plus would do the same from a client which could not resolve all of the server specified host names.
Bottom line – use fully qualified hostnames in RAC installation/DBCA, even when you think you don’t have to.
Database Resident Connection Pooling is new with 11g, and should be used for PHP applications. It will allow them to use the same type of connection pooling that java applications have had for a long time – largely equalising performance differences with those two programming languages.
It just needs two things done to use it:
1) In target database:
SQL> exec dbms_connection_pool.start_pool
2) In client easy connect, add “:pooled” at the end of the easy connect string, so it will look like:
scott/tiger@myserver/mydb:pooled
Or if you use client tnsnames.ora , then add “(server=pooled)” in the “connect_data” part of the “description”, so it will look like:
MYDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = myserver.my.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = POOLED)
(SERVICE_NAME = mydb.my.com)
)
)
3) For PHP to use this, you must be using oci8 v1.3 or above. That comes bundled with PHP v5.3 and above, or can be downloaded separately from http://pecl.php.net/package/oci8. Use phpinfo(); to see what version you are currently using.
This SQL will let you see if the connection pool is working correctly:
col cclass_name form a30 select cclass_name, num_hits, num_misses from gv$cpool_cc_stats ;
Other useful SQL for this:
select * from gv$cpool_stats ; select * from gv$cpool_cc_stats ; select program from gv$process where program like 'oracle%(N%)' ; select * from dba_cpool_info ;
Oracle Documentation on this is excellent, better than the blog or forum posts I saw:
Reference
Net Services Administrator’s Guide
Programmer’s Guide
Database Administrator’s Guide
The Underground PHP and Oracle Manual – Chapter 14. But note that this incorrectly states that PHP 5.3 has not yet been released.
For RAC, load balancing and transparent application failover should also be used. Load balancing is on by default according to the documentation (although I haven’t tested that), but transparent application failover need to be explicitly specified in tnsnames.ora to be used.
Load balancing would have “load_balance = on” in description part of client tnsnames.ora – supposedly that is on by default.
But Transparent Application Failover is not on by default. To use it, again in client tnsnames.ora, add
“(failover=on)” to the description, and “(failover_mode=(type=select)(method=basic))” to the connect_data. Alternatively use “(type=session)” for the more minimal type TAF, which will save some overhead on select operations.
The tnsnames.ora entry will end up looking like:
MYDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = myserver1.my.com)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = myserver2.my.com)(PORT = 1521))
(LOAD_BALANCE = on)
(FAILOVER = on)
(CONNECT_DATA =
(SERVER = POOLED)
(SERVICE_NAME = mydb.my.com)
(FAILOVER_MODE =
(TYPE = SELECT)
(METHOD = BASIC)
(RETRIES = 5)
(DELAY = 1)
)
)
)
Transparent Application Failover is documented in this part of the Net Services Administrator’s Guide.
For older versions of unix/linux, crons running at 01.* (anything from 01:00 to 01:59) do not run during the Spring Sunday time change. Those sames crons will run twice during the Autumn time change.
So it is important to not use 01.* times in your cron entries, for anything which runs on a Sunday.
Newer versions of unix try to deal intelligently with the time change. They attempt to run the Spring 01.* crons at a suitable time after 2am, and make sure not to run Autumn 01.* crons twice.
You can see what the behaviour of your version of unix is by looking at ‘man cron’ and ‘man crontab’. If they contain information like the below, then they attempt to deal intelligently with time changes, if not, not. The below is from ‘man cron’ in current HP-UX:
Spring and Autumn Time Transitions
On the days of daylight savings (summer) time transition (in time zones and countries where daylight savings time applies), cron schedules commands differently from normal.
In the following description, an ambiguous time refers to an hour and minute that occurs twice in the same day because of a daylight savings time transition (usually on a day during the Autumn season). A nonexistent time refers to an hour and minute that does not occur because of a daylight savings time transition (usually on a day during the Spring season). DST-shift refers to the offset that is applied to standard time to result in daylight savings time. This is normally one hour, but can be any combination of hours and minutes up to 23 hours and 59 minutes (see tztab(4)).
When a command is specified to run at an ambiguous time, the command is executed only once at the first occurrence of the ambiguous time.
When a command is specified to run at a nonexistent time, the command is executed after the specified time by an amount of time equal to the DST-shift. When such an adjustment would conflict with another time specified to run the command, the command is run only once rather than running the command twice at the same time.
Commands that are scheduled to run during all hours (there is a * is in the hour field of the crontab entry) are scheduled without any adjustment.
Britain, and the rest of Europe, always switch 1-2am, but other countries, including parts of the US, can switch at different times, so you may need to watch a different time range there.
Go to your wordpress dashboard, click on ‘Appearance’ > ‘Editor’. This will open up a Stylesheet (style.css) editor.
Here you can change the colours for ‘link’, ‘visited’, and ‘hover’, like this:
a:link {
color: #hexcodelinkcolor;
}
a:visited {
color: #hexcodeyouwantvisitedlinktobe;
}
a:hover {
color: #FF0000
}
A lot of hex colour codes are listed at http://www.computerhope.com/htmcolor.htm, although you may be copying the same colour code as already used elsewhere in your site.
These might appear more than once: first in the default global settings, but maybe also in a ‘Menu’ or ‘Header’ or ‘Content’ specific section lower down.
Click ‘update file’ to save changes.
It is a good idea to to cut and paste all the Stylesheet text into your PC somewhere before changing anything, so you have a good baseline version to revert to if needed.
More at
• http://wordpress.org/support/topic/changing-hover-color-in-css
• http://wordpress.org/support/topic/help-changing-color-of-hover-in-menu
• http://wordpress.org/support/topic/changing-color-of-visited-link
Howto create a popup dialog box in Oracle Forms – called ‘alerts’ although can be used for all kinds of purposes, not just alerting.
First create a new alert. Alerts are listed in the forms developer object navigator, immediately underneath Triggers. You can specify text and button names in the property palette of this new alert:
Then this new alert operates like a function, so you can call it in e.g. when-button-pressed triggers like this:
BEGIN
-- Prompt user with a message dialog box, and only proceed with the delete if they click 'ok'
IF show_alert('alert_confirm_delete') = alert_button1
THEN
DELETE FROM phototable WHERE id = :myblock.myid ;
END IF ;
END ;
A strange one – but it is a documented feature in oracle.
If you import specifying option ‘rows=n’, then statistics for all imported tables will be locked after the import operation is finished.
That is only for import – an export with ‘rows=n’ is fine, doesn’t lock anything.
That’s probably not what you want to happen – it means that ‘dbms_stats gather’ operations and ‘analyze’ operations will not update optimizer statistics on those tables.
Avoid this by either:
This is true for all versions from 10gR2 onwards, and it is documented:
It’s not just old style import – data pump import behaves similarly.
You can see what optimizer statistics are locked in your database with:
select owner, table_name, stattype_locked from dba_tab_statistics where stattype_locked is not NULL order by 1,2 ;
Use DBMS_STATS.UNLOCK_[SCHEMA|TABLE]_STATS and DBMS_STATS.LOCK_[SCHEMA|TABLE]_STATS to switch on and off outside import.
Shell script to demonstrate this: Continue reading
Windows Server 2008 and Windows 7 both hide printers that use the same port as another printer. But the printers aren’t really gone, they just take a little more effort to see – details at http://blogs.technet.com/b/askperf/archive/2010/03/02/windows-7-where-are-my-printers.aspx
Files /etc/hosts.allow and /etc/hosts.deny control tcp wrapper permissions for incoming requests to linux servers.
Ftp access is normally controlled by the ‘vsftpd’ line, e.g.:
vsftpd: 138.134.116. 138.134.117.
That would allow ftp connections from IP addresses like 138.134.116.x and 138.134.117.x.
If your IP address is not in the allow list, ftp attempts will fail with an error like this:
421 service not available. Connection closed by remote host.
Domain names can also be specified in these files as well as IP addresses.
Changes take effect immediately, there is no need to restart any services.