Monday 10 November 2014

Oracle 11g Rebuild indexes on partitions using ALTER

To rebuild indexes on partitions for a user in Oracle 11g run -

Select 'ALTER INDEX '|| index_name ||' rebuild partition ' || PARTITION_NAME ||';' from USER_IND_PARTITIONS;

Then run the output from that command

This is a fix for SQL Error: ORA-08102: index key not found, obj#


Thursday 9 October 2014

Converting Unix time to localtime in UNIX with PERL

Convert Unix time since the Jan 1st 1970 00:00 epoch to local time using PERL with this command :

$ perl -e 'print scalar (localtime(1246130142657481/1000000)),"\n"'
Sat Jun 27 20:15:42 2009


Use gmtime instead of localtime for GMT time.

Friday 28 February 2014

Creating CSR with openssl

Use openssl to create a Certificate Request - csr

openssl genrsa -out blogspot.co.uk.key 2048
openssl req - new blogspot.co.uk.csr -key blogsport.co.uk.key - config.openssl.cnf

Then print the values to check the csr
openssl req -text -noout -in blogspot.co.uk.csr