Sunday, August 26, 2012

Extending existing Virtual Box/VMware partition

Create new virtual disk with dynamic space DiskNew.vdi with total space
VBoxManage clonehd DiskOld.vmdk DiskNew.vdi --existing
Remove DiskOld.vmdk in Settings
Add DiskNew.vdi
Boot into Windows
Disk Management compmgmt.msc
Right click C:
Click Extend Volume
Select the extra unpartitioned space and click Finish


image

 

image

 

image

image

Friday, August 24, 2012

Install Java plugin for firefox in RHEL/Oracle Linux

  1. Close Firefox
  2. Install Java RPM from here : http://www.java.com/en/download/linux_manual.jsp?locale=en
  3.  cd /usr/lib64/firefox
  4. mkdir plugins
  5. cd plugins
  6. ll
  7. If there is existing link to java plugin delete it
  8. ln -s /usr/java/jre1.7.0_06/lib/amd64/libnpjp2.so .
  9. Start firefox and go to about:plugins to verify if Java plugin is installed

Thursday, August 23, 2012

How to uninstall a Windows service


Method 1 - You can use the SC tool (Sc.exe) included in the Resource Kit.
Open a Command Prompt and enter
sc delete <service-name>
 
Method 2 - Download and use delserv command line utility. This is a legacy tool developed for Windows 2000. In current Window XP boxes this was superseded by sc described in method 1.

delserv delete <service-name>
 
Method 3 - manually delete registry entries
Windows services are registered under the following registry key.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
Search for the sub-key with the service name under referred key and delete it.

Tuesday, August 21, 2012

Migrating/Copying Database

  1. Login as DBA user and note the tablespace name

SQL> SELECT tablespace_name FROM dba_tablespaces;

  1. Perform a full export from the source database

SQL> exp system/manager FULL=y FILE=export.dmp

  1. Move the dump file to the target database server. If using FTP, be sure to copy it in binary format to avoid file corruption.
  2. Create a database on the target server.
  3. Before importing the dump file, create tablespaces, using the same tablespace name.
  4. Login as DBA user & perform a full import. IGNORE=y instructs Oracle to ignore any creation errors during the import and permit the import to complete.

SQL> imp system/manager FULL=y IGNORE=y FILE=export.dmp

Monday, August 20, 2012

ORA-00904: “MAXSIZE”: invalid identifier

I was trying to export from a database. I use Oracle 11g Release 11.2.0.3. My export activity was terminated due to this error:

EXP-00008: ORACLE error 904 encountered
ORA-00904: “MAXSIZE”: invalid identifier
EXP-00000: Export terminated unsuccessfully

This was what I got from Oracle Support:

Applies to:

Oracle Server - Enterprise Edition - Version: 10.1.0.2 to 10.2.0.4 - Release: 10.1 to 10.2
Information in this document applies to any platform.
***Checked for relevance on 22-SEP-2011***

Symptoms

  • ORA-904 occurs when using a release 11g export client to export from release 10g database.
    Export succeeds when using any 10g export client (10.2.0.1 ... 10.2.0.4).

Example:
Using export client (11.1.0.7) to export from 10.2.0.4 database
exp scott/****** file=d:\exp.dmp
Export: Release 11.1.0.7.0 - Production on Fri Oct 2 10:14:24 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
server uses WE8ISO8859P15 character set (possible charset conversion)
. exporting pre-schema procedural objects and actions
. exporting foreign function library names for user SCOTT
. exporting PUBLIC type synonyms
. exporting private type synonyms
. exporting object type definitions for user SCOTT
About to export SCOTT's objects ...
. exporting database links
. exporting sequence numbers
. exporting cluster definitions
. about to export SCOTT's tables via Conventional Path ...
. . exporting table BONUS
EXP-00008: ORACLE error 904 encountered
ORA-00904: "MAXSIZE": invalid identifier
. . exporting table DEPT
EXP-00008: ORACLE error 1003 encountered
ORA-01003: no statement parsed
. . exporting table EMP
EXP-00008: ORACLE error 904 encountered
ORA-00904: "MAXSIZE": invalid identifier
. . exporting table SALGRADE
EXP-00008: ORACLE error 1003 encountered
ORA-01003: no statement parsed
. exporting synonyms
. exporting views
. exporting stored procedures
. exporting operators
. exporting referential integrity constraints
. exporting triggers
. exporting indextypes
. exporting bitmap, functional and extensible indexes
EXP-00008: ORACLE error 942 encountered
ORA-00942: table or view does not exist
EXP-00024: Export views not installed, please notify your DBA
EXP-00000: Export terminated unsuccessfully

  • Analysis shows this occurs when the following query is run by export client:

ksedmp: internal or fatal error
ORA-00904: "MAXSIZE": invalid identifier
Current SQL statement for this session:
SELECT INIEXT, SEXT, MINEXT, MAXEXT, PCTINC, BLOCKS, LISTS, GROUPS, EXTENTS, PCACHE, TS_TYPE, TSNAME, ISONLINE, BLOCKSIZE, HSCOMPRESS, MAXSIZE FROM SYS.EXU9STOU WHERE FILENO = :1 AND BLOCKNO = :2 AND TSNO = :3

Cause

When export any objects export client run a query agains dictionary view SYS.EXU9STOU to gather storage parameters about object segments.

Since release 11g this view has been updated by a new column MAXSIZE. When using the release 11g export client the utility expect the MAXSIZE column SYS.EXU9STOU of source database.
Given the fact that this column is unavailable in 10g the ORA-904 is reported.

11g
---
SQL> descr SYS.EXU9STOU;
Name                          Null?    Type
----------------------------- -------- ------------------
OWNERID                       NOT NULL NUMBER
TSNO                          NOT NULL NUMBER
FILENO                        NOT NULL NUMBER
BLOCKNO                       NOT NULL NUMBER
INIEXT                        NOT NULL NUMBER
SEXT                          NOT NULL NUMBER
MINEXT                        NOT NULL NUMBER
MAXEXT                        NOT NULL NUMBER
PCTINC                        NOT NULL NUMBER
BLOCKS                        NOT NULL NUMBER
LISTS                                  NUMBER
GROUPS                                 NUMBER
EXTENTS                       NOT NULL NUMBER
PCACHE                                 VARCHAR2(7)
TS_TYPE                                NUMBER
TSNAME                                 VARCHAR2(30)
ISONLINE                               NUMBER
BLOCKSIZE                              NUMBER
HSCOMPRESS                             NUMBER
MAXSIZE                                NUMBER

Solution

  • Please use the release 10g export client to export from a 10g database.
  • Once the export dump has been created you'd have to use the release 11g import client to import into your 11g database.

    To solve this use Oracle 10g client to export the Oracle 10g database and then use the 11g client to import into 11g database

    Wednesday, August 15, 2012

    Workaround for using Subversion 1.7 with Hudson 2.1.2

    Hudson version 2.1.2 has support for SVN 1.6 via Hudson Subversion Plug-in. But I wanted the magic of centralized metadata so upgraded to SVN 1.7. Hudson needs to be upgraded to 2.2.1 to take advantage of SVN 1.7 so as a workaround you can use the following build step:-

    1. Install SVN client 1.7 on the server : http://www.collab.net/downloads/subversion
    2. Go to Hudson build job->Configure
    3. Disable Source Code management via Subversion
    4. Add Build Step->Execute Windows batch command:-
    image

    Basically you are deleting code and checking out manually rather than Hudson plugin doing it.

    Tuesday, August 14, 2012

    Accessing windows share from Linux

     

    Determine your IP Address
    You will need to give your Linux computer a location when trying to access shared folders. This location is your PC's IP address. In the Command Prompt type ipconfig and you will see your IP address (it probably starts with 192). My IP address is shown below as 192.168.1.117
    Mount a Windows shared folder in Linux

    Accessing the shared folder from Linux
    There are two very easy ways to access shared folders in Linux. The easiest way (in Gnome) is to press (ALT+F2) to bring up the run dialog and type smb:// followed by the IP address and the folder name. As shown below, I need to type smb://192.168.1.117/Shared. If you have your Windows account that requires a password, you will need to enter the password to access the shared folder.
    Mount a Windows shared folder in Linux

    Accessing all shared folders from Linux
    Linux automatically detects and connects to Windows networks. In Gnome, by going to Places and then Network you will automatically see all the Windows networks. You can then navigate through the Windows networks and connect to the shared folder. This is an easy way to manage your shared folders if you have many Windows networks with shared folders.

    Making it easier
    By bookmarking your shared folder you can access it from the Gnome menu.

    Sunday, August 12, 2012

    Remote Access to the RHEL/Oracle Linux Desktop via Windows

    Remote desktop support should is installed by default during the operating system installation process. If it has been installed, a Remote Desktop option will be available in the RHEL desktop System -> Preferences menu. Another useful way to check whether this package is installed is to run the following command from a terminal window (Applications -> System Tools -> Terminal):

    rpm -q vino


    If the rpm command reports package vino is not installed then the next step is to perform the installation. This can be performed either using the Add/Remove Software tool, launched by selecting Applications -> Add/Remove Software —>search for vino—>select the checkbox next to the item in the results list and click on Apply to install the package. Alternatively, to install from a terminal window, enter the following:



    su -
    yum install vino


    Once the installation is complete, the Remote Desktop option will now appear in the System -> Preferences menu.





    Activating Remote Desktop Access



    The next step in setting up remote desktop access is to activate it and define some basic security settings. These settings are configured in the Remote Desktop Preferences dialog. To access this dialog, open the desktop System menu and select Preferences followed by Remote Desktop. When selected, the following window will appear:



    RHEL 5 Remote Desktop Access preferences



    In this dialog the following configuration options are available:




    • Allow others to view your desktop - Activates remote desktop access for viewing purposes.




    • Allow other users to control your desktop - Allows users accessing your remote desktop to control the desktop. In other words the remote user can do anything to your desktop that they want using their mouse and keyboard as if they were sitting physically at the local system.




    • Ask you for confirmation - When selected, this option causes a dialog to appear warning you of an attempt by a remote user to connect and prompting you to confirm or deny the connection. If you are likely to want to log in remotely you will need to turn this off since you will not be at the local system to accept your own connection.




    • Require the user to enter this password - Specifies a password which must be entered by the remote user to access your desktop. It is strongly advised that you select this option and specify a password.



    Finally this screen specifies the command to run on the remote system to access the desktop. Once you have configured Remote Desktop access you are almost ready to try connecting.







    Firewall Configuration (insecure way)



    By default, the RHEL firewall is both enabled and configured to block insecure remote desktop access. Before proceeding, therefore, it is necessary to allow VNC traffic to pass uneventfully through the firewall. Before performing this task it is important to know that the remote desktop system uses TCP/IP port 5900 to access the screen 0 (the main screen of your desktop) for communicating between the client and server systems.



    1. Start the Firewall configuration tool (System -> Administration -> Security Level and Firewall) and enter your root password when prompted to do so.



    2. Select the Other Ports option and click on the Add button to open the Add Port dialog.



    3. Add port 5900 for protocol tcp and click OK.



    4. Repeat the previous stop for port 5900 udp.



    5. Click on the Apply button followed by OK to exit the firewall tool.





    Accessing a Remote RHEL Desktop using vncviewer



    Remote desktop access from other Linux based systems can be achieved using the vncviewer tool. This tool is contained within a package named vnc which may be installed on RHEL using the following command sequence in a terminal window:



    su -
    yum install vnc


    The vncviewer tool is available for a wide range of operating systems and a quick internet search will likely provide numerous links providing details on how to obtain and install this tool on your chosen platform.



    To access a remote desktop using vncviewer, execute the following command in a terminal window:



    vncviewer hostname:0


    where hostname is either the hostname or IP address of the remote system. Alternatively, run the command without any options to be prompted for the details of the remote server:



    Specifying the remote host for RHEL remote desktop access



    If you configured the remote system to prompt to approve a connection a dialog will appear on the remote system. Until the connection is approved the vncviewer session will wait. Once approved, or if no approval is required, VNC will prompt for the password (assuming one was defined):



    Entering a password to gain access to a remote RHEL desktop



    Accessing a Remote Linux Desktop from a Windows System



    In order to access an RHEL remote desktop from a Windows system the first step is to install a Windows VNC client on the Windows system like TightVNC http://www.tightvnc.com



    hostname:5900 (screen 0 in VNC uses port 5900). TightVNC assumes port 5900 if none is specified



     



    Secure sessions can be established by creating SSH tunnel between the systems so that VNC can use this secure tunnel to connect. Similarly you should be able to use WINSCP for FTP or Putty for SSH from Windows to Linux

    Saturday, August 11, 2012

    Please check if this file is opened in another program

    image

    ---> Make sure file/directory is not read-only

    image

     

    image

    image

    image

    ---> Make sure that User has full control over the file

    image

    Wednesday, August 08, 2012

    Running NUnit in Visual Studio 2010

    It is possible to use NUnit as an external tool in the new 2010 version.

    The first step is download and install the latest version of NUnit since older versions are not compatible with .NET 4.

    Now go to Tools -> External Tools:

    Visual Studio 2010 External Tools

    View -> Toolbars -> Customize:

    Visual Studio 2010 Customize Toolbars

    Press the New button and enter a name. Now open the Commands tab and add the external command (usually External Command 1 when you don’t have any other external commands) to the toolbar:

    Visual Studio 2010 Toolbars

    When clicking the NUnit button in the new toolbar the NUnit GUI starts and loads your test suite.

    Tuesday, August 07, 2012

    Running NUnit on Hudson

    1. Add the NUnit Plugin to Jenkins
    2. In your project go to Configure -> Build -> Add a build step
    3. In the dropdown scroll down to -> Execute Windows Batch Command
    4. Ensure this step is placed after your MSBuild step
    5. Add the following, replacing the variables:

      [PathToNUnit]\bin\nunit-console.exe [PathToTestDll]\Selenium.Tests.dll /xml=nunit-result.xml

    6. Under Post-build Actions, tick Publish NUnit test result report
    7. For the textbox Test report XMLs, enter "nunit-result.xml"
    Once you project has been built, NUNit will now run and the results will be viewable either on the Dashboard(if you hover over the Weather report icon) or on the project page under Last Test Result.

    You could also run the command from within Visual Studio or as part of you local build process.

    Here's two blog posts I used for reference.

    1-Hour Guide to Continuous Integration Setup: Jenkins meets .Net (2011)
    Guide to building .NET projects using Hudson (2008)

    Saturday, August 04, 2012

    Hudson: svn authentication cancelled

    The Hudson was building all projects without any issues since it was installed. All of a sudden yesterday my inbox was filled with failure reports, Hudson was not able to build any of the projects. Stack trace":


    ERROR: svn: authentication cancelled
    org.tmatesoft.svn.core.SVNCancelException: svn: authentication cancelled
        at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.cancel(SVNErrorManager.java:37)
        at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.cancel(SVNErrorManager.java:32)
        at org.tmatesoft.svn.core.internal.wc.DefaultSVNAuthenticationManager.getNextAuthentication(DefaultSVNAuthenticationManager.java:200)
        at hudson.scm.FilterSVNAuthenticationManager.getNextAuthentication(FilterSVNAuthenticationManager.java:42)
        at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:537)
        at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:273)
        at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:261)
        at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.exchangeCapabilities(DAVConnection.java:516)
        at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.open(DAVConnection.java:98)
        at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.openConnection(DAVRepository.java:1001)
        at org.tmatesoft.svn.core.internal.io.dav.DAVRepository.testConnection(DAVRepository.java:97)
        at hudson.scm.SubversionSCM$DescriptorImpl.checkRepositoryPath(SubversionSCM.java:1686)
        at hudson.scm.SubversionSCM.repositoryLocationsExist(SubversionSCM.java:1826)
        at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:506)
        at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:469)
        at hudson.model.AbstractProject.checkout(AbstractProject.java:898)
        at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:391)
        at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:340)
        at hudson.model.Run.run(Run.java:1090)
        at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:301)
        at hudson.model.ResourceController.execute(ResourceController.java:93)
        at hudson.model.Executor.run(Executor.java:122)
    Finished: FAILURE


    This usually results if the authentication has failed. Verify hudson SVN credentials.