Posting Code Blocks with your free WordPress Blog

February 27, 2015

Please visit https://en.support.wordpress.com/code/posting-source-code/ for detailed information about how to post source code blocks with your free wordpress.com blog.
A tip from me: Have a look at the source code of wordpress support page opened ;) you “MAY” get more ideas. Okay I didn’t say that!
Let us look at some samples:

1

Will produce the below, syntax highlighted code block for you

your code here

2

Refer the above image, the usage of additional tags within the code tag will syntax highlight a short VB script, avoiding the gutter (line numbers)

Public Class Form1
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        Dim xmlFile As XmlReader
        xmlFile = XmlReader.Create("MyVMS.xml", New XmlReaderSettings())
        Dim ds As New DataSet
        ds.ReadXml(xmlFile)
        DataGridView1.DataSource = ds.Tables(0)
        DataGridView1.Columns(0).HeaderText = "Id"
        DataGridView1.Columns(1).HeaderText = "VM Name"
        DataGridView1.Columns(2).HeaderText = "Shutoff Mode"
  
    End Sub
End Class

Avoid leaving spaces between tags inside “code” tag, as doing so could totally mess-up the code blocks. Just put everything tightly spaced like following

language=”VB” gutter=”false”, there are no spaces between language & = or = & the opening ”

The language (or lang) parameter controls how the code is syntax highlighted. The following languages are supported:

  • actionscript3
  • bash
  • clojure
  • coldfusion
  • cpp
  • csharp
  • css
  • delphi
  • erlang
  • fsharp
  • diff
  • groovy
  • html
  • javascript
  • java
  • javafx
  • matlab (keywords only)
  • objc
  • perl
  • php
  • text
  • powershell
  • python
  • r
  • ruby
  • scala
  • sql
  • vb
  • xml

If the language parameter is not set, it will default to “text” (no syntax highlighting).

Code in between the source code tags will automatically be encoded for display, you don’t need to worry about HTML entities or anything.

Configuration Parameters

The shortcodes also accept a variety of configuration parameters that you may use to customize the output. All are completely optional.

  • autolinks (true/false) — Makes all URLs in your posted code clickable. Defaults to true.
  • collapse (true/false) — If true, the code box will be collapsed when the page loads, requiring the visitor to click to expand it. Good for large code posts. Defaults to false.
  • firstline (number) — Use this to change what number the line numbering starts at. It defaults to 1.
  • gutter (true/false) — If false, the line numbering on the left side will be hidden. Defaults to true.
  • highlight (comma-seperated list of numbers) — You can list the line numbers you want to be highlighted. For example “4,7,19”.
  • htmlscript (true/false) — If true, any HTML/XML in your code will be highlighted. This is useful when you are mixing code into HTML, such as PHP inside of HTML. Defaults to false and will only work with certain code languages.
  • light (true/false) — If true, the gutter (line numbering) and toolbar (see below) will be hidden. This is helpful when posting only one or two lines of code. Defaults to false.
  • padlinenumbers (true/false/integer) — Allows you to control the line number padding. true will result in automatic padding, false will result in no padding, and entering a number will force a specific amount of padding.
  • title (string) — Set a label for your code block. Can be useful when combined with the collapse parameter.

regards,

rajesh


Windows7bugs | Script Copying Instructions

November 9, 2014

Hello guys

Once in a while we receive complaints about scripts copied from our blog causing issues. We regret those issues and apologizing to everyone who suffered due to. Our blog is totally free until date and unfortunately, different browsers behave differently while parsing the code tags.

We were using

 [ code ] [ /code ]

tag for long time, found that few scripts getting totally messed up with double quotes being showsn and &quote etc. This has forced us to start using

[ sourcecode ] [ /sourcecode ] 

and realized if we have more than one block of scripts, the 2nd and consecutive scripts blocks being totally garbled.

With reference to above said, we request you to kindly make sure that the scripts those you copy from our posts are thoroughly checked for special characters prior applied. Especially registry related scripts as such attempts could completely wreck your Windows registry databases.

We hope you read us clearly and continue supporting us.

Regards,


It’s been long time!

April 19, 2016

Hello guys!

I know, there were NOT much to post throughout last few months about Oracle as I am nose down into one of the development platforms that I hardly desired for developing business applications.

For me, it was always Oracle forms and reports. The easiest, the most robust development tools for BUSINESS applications which is supported by the ease of SQL, PL/SQL

I am doing loads of research with C# & SQL database, which will be the main technologies behind our next proposed ERP suite. After spending almost 15 years with Forms and reports, I don’t see Oracle is too keen about modernizing their most loved development tools & the latest release lacks loads of features those would have helped to reclaim the desktop based business applications.

Wondering whether there is still room for desktop applications, especially for businesses? dude! there is, and there will be!

 

So stay tuned, I will start posting my “findings” about C#, who knows may be some sample applications using Windows forms or WPF & Oracle database in near future!

regards,

rajesh

 


Oracle E-Business Suite R12.0 | Automating clone process

February 16, 2016

Hi guys

A clone is the exact replica of a production instance, against what you do all tests, custom development and patch deployments to insure that your attempts are NOT going to break the PRODUCTION instance once such are moved over to.

How often consultants & users may request for a fresh clone (with latest data) depends upon many factors. During the implementation time, a DBA could be bombarded with requests for cloning almost once in couple of days. Although I am “not a dba”, I have been doing cloning to learn & understand the technology from last couple of years time & trust me, it is NOT at all fun. Especially once after you are familiar with the tasks.

Throughout last few months I was trying to “fully automate” the entire cloning process and made significant advancements with the process. I will share my experiences with you today

Scenario:

We have a cron job initiated by “root” user, starting by 2:30 PM every Friday, that shuts down the application and database after running pre-cloning. The same script makes tar balls for both the database and application nodes in separate files and then copies the tar balls to our TEST instance server.

Logically once the tar balls are copied to TARGET (TEST) server, following activities are expected from the DBA

  1. Stop the application & database instances those are online in the TEST server
  2. Extract the tar balls copied from PRODUCTION instance to relevant folders
  3. Clone database tier, followed by application tier
  4. Tune the database with TEST server specific SGA/job queue processes etc parameters

What if I am too lazy & a scripting junkey who wants to automate the entire activities using shell scripts? The following demonstrates such an attempt

Why not a cron job? ;)

The first step will be, creating auto response files for both database and application nodes. I have already detailed a how to here

ebsclone.sh | This shell script calls a number of other shell scripts to facilitate the entire cloning process

Please note, my Oracle database user is “oraprod” and application manager is “applprod”. If you are planning to copy the below script(s), make sure you change the physical paths, user details according to your specific environment.

Both the database and application manager user accounts are enhanced with .bash_profile values. Hence most of my scripts will not populate the environment variables prior executing other scripts.

I am using “expect”, that YOU must install, if not already installed in order to automate the cloning process. If you are using Oracle linux, you can install expect by issuing the following command:

yum install expect -y
#!/bin/bash
# As a precaution to make sure the port pool is available during automated
# Cloning, we will kill all orphaned processes those were not closed during
# DB, APPS stop

# Kill all processes for both oraprod & applprod users
echo "Killing all processes for Oracle user"
pkill -u oraprod
echo "Killing all processes for Application user"
pkill -u applprod
echo "All processes for both Oracle and Application users were killed"

sleep 30

echo "$(date)"

#Remove the existing physical folder for database files
cd /u01
find oraprod -delete
echo "finished deleting Oracle top at $(date)"
#Extract files for database top from the cold backup archive
echo "Extract database backup file at $(date)"
time tar -zxf /u02/backup/PROD_DAILY_BACKUP_db.tar.gz
echo "Finished extracting database backup file at $(date)"

#Remove the existing physical folder for application files

cd /u03
find applprod -delete
echo "finished deleting Application top at $(date)"

#Extract files for application top from the cold backup archive
echo "Extract application backup file at $(date)"
time tar -zxf /u02/backup/PROD_DAILY_BACKUP_apps.tar.gz u06/applprod/PROD/apps
echo "Finished extracting application backup file at $(date)"

#Move the files around based on your configuration files (db.xml & apps.xml)

mv /u01/u05/oraprod /u01
mv /u03/u06/applprod /u03

#Change the ownership of the folders, so that corresponding users could read & execute files

chown -R oraprod:oinstall /u01/oraprod
chown -R applprod:oinstall /u03/applprod

########################################
#Start the cloning
########################################

echo "Database cloning phase starts now, $(date)"

#su - oraprod -c "perl /u01/oraprod/PROD/db/tech_st/10.2.0/appsutil/clone/bin/adcfgclone.pl dbTier /u01/clonescripts/db.xml"

/root/scripts/dbclone.sh

sleep 30

echo "Application cloning phase starts now, $(date)"

# su - applprod -c "perl /u03/applprod/PROD/apps/apps_st/comn/clone/bin/adcfgclone.pl appsTier /u01/clonescripts/apps.xml"

/root/scripts/appsclone.sh

echo "EBS Cloning completed, $(date)"
######################################
#Optional steps for changing database SGA parameters,
#startup configuration files to spfile etc
######################################
echo "Changing database parameters, $(date)"

/root/scripts/dbfix.sh

echo "Done! Application online with changed database parameters, $(date)"

Now I will copy the code for each script called within the ebsclone.sh script
dbclone.sh | script enabled with expect which will not ask for the apps password

#!/usr/bin/expect -f
set force_conservative 0  ;

# set to 1 to force conservative mode even if
# script wasn't run conservatively originally

if {$force_conservative} {
        set send_slow {1 .1}
        proc send {ignore arg} {
                sleep .1
                exp_send -s -- $arg
        }
}

set timeout -1

spawn su - oraprod -c "perl /u01/oraprod/PROD/db/tech_st/10.2.0/appsutil/clone/bin/adcfgclone.pl dbTier /u01/clonescripts/db.xml"

match_max 100000

expect -exact "\r
Enter the APPS password : "
send -- "apps\r"

expect eof

appsclone.sh | script enabled with expect which will not ask for the apps password

#!/usr/bin/expect -f
set force_conservative 0  ;

# set to 1 to force conservative mode even if
# script wasn't run conservatively originally

if {$force_conservative} {
        set send_slow {1 .1}
        proc send {ignore arg} {
                sleep .1
                exp_send -s -- $arg
        }
}

set timeout -1

spawn su - applprod -c "perl /u03/applprod/PROD/apps/apps_st/comn/clone/bin/adcfgclone.pl appsTier /u01/clonescripts/apps.xml"

match_max 100000

expect -exact "\r
Enter the APPS password : "
send -- "apps\r"

expect eof

dbfix.sh | Changing database parameters like SGA, job queue processes etc

#!/bin/bash
su - applprod -c "/u03/applprod/PROD/inst/apps/PRODBAK_erp-prodbak/admin/scripts/adstpall.sh apps/apps"
su - oraprod -c /root/scripts/dbalter.sh
su - applprod -c "/u03/applprod/PROD/inst/apps/PRODBAK_erp-prodbak/admin/scripts/adstrtal.sh apps/apps"

Finally dbalter.sh | All database alter commands are included within this file

#!/bin/bash
export ORACLE_HOME=/u01/oraprod/PROD/db/tech_st/10.2.0
export ORACLE_SID=PRODBAK

#http://www.cyberciti.biz/faq/unix-linux-test-existence-of-file-in-bash/
#Check whether spfile already exist
file="/u01/oraprod/PROD/db/tech_st/10.2.0/dbs/spfilePRODBAK.ora"
if [ -f "$file" ]
then
	echo "$file found. Aborting database configuration now"
exit;
else
	echo "$file not found."
fi

sqlplus "/ as sysdba" <<EOF
create spfile from pfile;
shutdown immediate;
startup;
alter system set sga_max_size=8G scope=spfile;
alter system set sga_target=8G scope=spfile;
alter system set job_queue_processes=10 scope=both;
shutdown immediate;
! cp /u01/oraprod/PROD/db/tech_st/10.2.0/dbs/initPRODBAK.ora /u01/oraprod/PROD/db/tech_st/10.2.0/dbs/initPRODBAK.ora.original
! >/u01/oraprod/PROD/db/tech_st/10.2.0/dbs/initPRODBAK.ora
! echo "spfile=/u01/oraprod/PROD/db/tech_st/10.2.0/dbs/spfilePRODBAK.ora" >>/u01/oraprod/PROD/db/tech_st/10.2.0/dbs/initPRODBAK.ora
startup;
exit;
EOF

The above five scripts should do what they are meant to. Just copy the files to same folder
Change the execute mode of ebsclone.sh

chmod +x ebsclone.sh

and execute the ebsclone.sh as “root” (attempts made with other users will fail the cloning)

#./ebsclone.sh

Prior attempting, please make sure all the above scripts are modified with absolute paths, referring to your existing partitions & other

Download the scripts here

References:

Sample expect script

https://community.oracle.com/thread/2558592?start=0&tstart=0

Linux: Find whether a file already exist

http://www.cyberciti.biz/faq/unix-linux-test-existence-of-file-in-bash/

 

Happy cloning!


Line Drilldown in GL Journal Screen Requires User Name and Password

February 11, 2016

Oracle Application World

Problem
One of my clients was complaining about error “You Have Insufficient Privileges For The Current Operation” while Line Drill down from GL Journal screen. Internet explorer version was 6.0.2900 with Java 6 update 21. Oracle suggestion in METALINK note “1106048.1“ is Uninstall all updates on Java 6 which are more than 15. What does it means, Java version should be Java 6 with Update 15 maximum. Downgrading Java is a problem as might some other Application requires latest Java Version. It’s always hectic to explain to the client with business reason. So this option out of scope. Later on I found out that issue is because of one option only and no need to uninstall all updates.
Solution
1. On the local computer, move to the Control Panel – choosing Start/Settings/Control Panel – Choose the Java icon
2. A window opens – choose the advanced tab
3. Locate the…

View original post 33 more words


Linux LVM (Logical Volume Manager) | AKA Spanned volumes

February 3, 2016

Hi guys

We’ve a EBS instance that totals almost 1TB physical size hosted on a high end IBM server & periodically we clone the instance to insure that the cold backups are reliable for DR purposes.

Recently we’ve decommissioned one HP ML110 G6 server with single xeon processor, 8GB memory that was dedicated for obsolete bio-metric monitoring and reporting running Windows 2003. I thought of using the same server for future restorations of EBS cold backups & realized that the server doesn’t support RAID 5 & moreover the built-in RAID is categorized under “fakeRAID”, which uses the built-in RAID technology, depending upon the CPU for the crippled RAID processing.

Using the HP Pavilion Easy Setup CD, I created an array and to my total disappointment found that Linux doesn’t read the fakeRAID while an installation is attempted.

The above were attempted because the ML110 G6 had 4 numbers of 500GB SATA HDD drives and I needed 1TB on a single volume. My database instance size as on date is 493GB, which would scream lack of space on a single 500GB partition. So I started reading about software RAID, which was too complex to setup with my minimal exposure to Linux. Further readings brought me to LVM (Logical Volume Manager) using which one can create spanned volumes as like in Windows.

Before proceeding further, please be aware of the RISKS associated with spanned volumes AKA LVM with multiple drives

How to?

We’ll consider a fresh installation of CentOS6/RHEL6/OEL6 for the exercises

Source thread (Please, please read)

Hardware: HP ML110 G6, 8GB memory, 4x500GB SATA HDD

Linux installation details

Installed Linux on HDD#1 (/dev/sda), 10GB boot, 4GB Swap, 110G / & balance as extended partition

Now, I am left with 3 HDDs, which are “untouched”, ie, no partitions are made

  1. /dev/sdb
  2. /dev/sdc
  3. /dev/sdd

As I have mentioned, my requirement was to have 1TB of storage for the cloning purposes, hence I chose 2x500GB (/dev/sdb, /dev/sdc)

First I created partitions using “fdisk”, the age old command line utility, even though better structured GUI is available with latest Linux distributions

Login to terminal as “root”

$fdisk /dev/sdb

n (new parition) -> p (primary partition) -> 1 (number of partitions) -> w (Write changes)

Repeated the same for /dev/sdc

$fdisk /dev/sdc

n (new parition) -> p (primary partition) -> 1 (number of partitions) -> w (Write changes)

We’ll use the following 3 commands to create our LVM

  1. pvcreate
  2. vgcreate
  3. lvcreate

create two physical volumes

$pvcreate /dev/sdb1 /dev/sdc1

create one volume group with the two physical volumes

$vgcreate VG_DATA /dev/sdb1 /dev/sdc1

create one logical volume

$lvcreate -l 100%FREE -n DATA VG_DATA

create the file system on your new volume

$mkfs.ext4 /dev/VG_DATA/DATA  #You may use ext3, based on your Linux distribution

$mkdir -p /u01

mount the volume (mount /dev/VG_DATA/DATA /u01)

That’s all folks, I have created my1st LVM aka spanned volume in Linux.

If you are planning to create logical volumes using multiple disks, be aware of the risks. You may lose millions worth data if no proper backups are taken and recovery could be a nightmare!

Not limited to total data loss, performance issues also should be considered, especially when such a setup hosts databases which require faster I/O.

for Windows7bugs

rajesh


Windows 10 | Hack to dirty desktop

January 17, 2016

 

Hi guys

Starting from Windows 8, Microsoft has clearly switched their target consumers to mobile users and snatched the clean desktop experience from power users.

Windows 10 is basically a huge PHONE OS, however, significant efforts were made by Microsoft to reduce the gap between a mobile OS and pure desktop experience by the addition of a semi effective start button. Yet it satisfy the frustrated me? Not entirely

For example, I have multiple versions of Oracle developer installed in my box, starting from Developer 6i, Developer 10g & Developer 11g in the same box & almost all elements within the developer stacks share the common names like forms developer, reports builder etc. Using the jump list was NEVER my cup of tea as it takes time, efforts to distinguish. Though the new start menu allows one to drag and drop the apps to desktop, send to desktop is a sure missing option which could truly confuse a person who switched from XP/7 recently.

I’m responsible a middle size IT infrastructure and was promoting the usage of classicshell, the free start button/ start menu alternative that brings a kind of Windows XP/7 style start button/menu experience back to both Windows 8.x and Windows 10 OS.

image

You can obtain ClassicShell here

With periodic updates, this freeware remains one of the best solutions for crippled start menu available with Windows 10 OS.

Install it, Open Classic start menu settings, check “Show all settings” & make the few settings as seen with the below images and you are all ready to enjoy a cleaner desktop experience

image

image

You can setup the most comfortable start menu style here

image

Skin allows you to disable the frames around the icons.

image

Once the above you are all good to start experiencing the classic start menu on your Windows 8/10 box

for Windows7bugs

rajesh


Oracle Weblogic | Reports 11g | cgicmd.dat | Key mapping issues

January 16, 2016

 

Hi guys

I’ve been installing and configuring Weblogic 10.3.6 & 12c (recently) and came across a peculiar issue, where the reports server failing to map the keys I’ve specified with cgicmd.dat file.

The best I could recollect from my memories was, I only added the keys to a single instance of cgicmd.dat file, as there are many instances of the same file once after classic domains are created.

Under linux installations you will find the file in 3 different locations once after the domain created and WLS_REPORTS server started.

 

[root@wls Middleware]# find /u01/Oracle/Middleware/ -name cgicmd.dat
/u01/Oracle/Middleware/user_projects/domains/ClassicDomain/servers/WLS_REPORTS/tmp/_WL_user/reports_11.1.2/uxabaw/configuration/cgicmd.dat
/u01/Oracle/Middleware/user_projects/domains/ClassicDomain/config/fmwconfig/servers/WLS_REPORTS/applications/reports_11.1.2/configuration/cgicmd.dat
/u01/Oracle/Middleware/Oracle_FRHome1/reports/conf/cgicmd.dat

[root@wls Middleware]#

image

Under usual scenarios you need to add the keys ONLY to the cgicmd.dat file present in

/u01/Oracle/Middleware/user_projects/domains/ClassicDomain/config/fmwconfig/servers/WLS_REPORTS/applications/reports_11.1.2/configuration/

folder.

With my latest installations of 12c & 11g, I had issue getting the keys mapped properly & after loads and loads of googling I decided to add the same key to all available instances of cgicmd.dat one after another.

So I started with the first instance of cgicmd.dat file, that was found under

/u01/Oracle/Middleware/user_projects/domains/ClassicDomain/servers/WLS_REPORTS/tmp/_WL_user/reports_11.1.2/uxabaw/configuration/cgicmd.dat

which is WLS_REPORTS temporary folder. I added the key, restarted the WLS_REPORTS server & the key was mapped as required!

This could be a nasty bug because I don’t remember adding the keys to multiple files while I tried out forms and reports 11g Release 2 almost 2 years back!

The most interesting part of the entire exercise is, once the key mapping happens successfully, you can remove the keys from cgicmd.dat file that in the temporary location and everything works! Could be the magic of cache Winking smile

So if you come across key mapping issues, you know where to look at for a quick fix.

for Windows7bugs

rajesh


Oracle 12c | Reports | Standalone server

January 14, 2016

 

Hi guys

One of my close associates & a person I respect as a legend, Iudith said the following with one of her recent mails to me:


Regarding all this WebLogic issue … I have a feeling that Oracle “used a cannon for killing a fly” ………
Maybe that complicated setup creates an environment which can support all kinds of other products,I really don’t know because I have mostly just heard about it.

From Oracle’s perspectives, this approach may provide them better scalability, however how far such complexities will appease the developer crowd remains a big concern.

While the modernization of Oracle forms and reports, the maximum sought legacy development means remain a frequently sought and discussed topic, Oracle is definitely NOT doing enough to regain the confidence of mortals who spent decades developing, especially by making each and every newer versions difficult to install and setup.

Less said, let us go back to the topic, how to create and configure a standalone report server instance for 12c environment. This is my 3rd post in a row about installing and configuring 12c products related to Forms and Reports

I can’t exactly remember which document says “In-process reports server has better accountability against a standalone reports instance”. I have referred minimum couple of dozen 12c related documents and tens of blogs to setup stuffs. Without arguing whether in-process server or a standalone instance is better to cater the reports services, let me list the activities one have to perform in order to setup

  1. Create a reports tools instance (Mandatory, if you are planning to use the same box for reports development)
  2. Create a reports server instance (OPTIONAL, only if you want to host a standalone reports instance)

Start WLST(Weblogic Scripting Tool) console, and execute the below commands one after another (Make sure the node manager & the Weblogic admin server services are already started)

 
connect("weblogic","password", "localhost:7001") 
createReportsToolsInstance(instanceName='rptools1', machine='AdminServerMachine') 
createReportsServerInstance(instanceName='repsvr_MYMACHINENAME', machine='AdminServerMachine') 
exit() 

Once successfully completed, restart the WLS_REPORTS application using the weblogic admin console. Once bitten, twice shy…I always restart the weblogic admin server and other servers to make sure nothing is broken in between…(paranoid I must be)

Restarting the WLS_REPORTS server causes the weblogic server to configure the newly created instances of reports tools and reports instance. A successful completion let you

  1. Start using the reports builder
  2. Access the standalone reports server instance

You need minimal configurations for the standalone reports server instance. Just setup the reports (.rdf files) path, disable the security elements and you are online!

Assuming you have already configured the weblogic server components following the previous posts, switch to the reports instance configuration folder

eg: D:\Weblogic\Middleware\Oracle_Home\user_projects\domains\base_domain\
config\fmwconfig\components\ReportsServerComponent\repsvr_RAJESH-PC

Where repsvr_RAJESH-PC is the name of the reports instance I have created.

image

You need to modify the “rwserver.conf” file, please check the below image for details

image

Save the file and restart the WLS_REPORTS server, so that the last modifications are in place!

Now we have to start the reports instance.

Switch to DOMAIN_HOME\bin folder

eg: D:\Weblogic\Middleware\Oracle_Home\user_projects\domains\base_domain\bin

and run startComponent.cmd repsvr_RAJESH-PC

Please check the below image for details

image

Once the report server instance starts successfully, you are all set to.

Calling the new instance

http://rajesh-pc:7777/reports/rwservlet?usr&server=repsvr_RAJESH-PC&desformat=PDF&destype=cache&report=LIST_BANKS&paramform=Yes

That’s all folks, as you could see OHS automatically maps the new reports instance and directs the jobs to it.

for Windows7bugs

rajesh


Follow

Get every new post delivered to your Inbox.

Join 66 other followers