Thursday, June 29, 2017

Resolving 'ORA-00959: tablespace 'TABLE_SPACE' does not exist when importing db dump

This is a simple one.

I was importing data dump with following command.

impdp system/password schemas=db_dump_schema remap_schema=db_dump_schema:locally_mapped_schema directory=DB_DUMPS DUMPFILE=dump_file_name.dmp LOGFILE=DB_LOGS:import.log

But I got following error.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Master table "SYSTEM"."SYS_IMPORT_SCHEMA_05" successfully loaded/unloaded
Starting "SYSTEM"."SYS_IMPORT_SCHEMA_05":  system/******** schemas=db_dump_schema remap_schema=db_dump_schema:locally_mapped_schema directory=DB_DUMPS DUMPFILE=dump_file_name.dmp LOGFILE=DB_LOGS:import.log
Processing object type SCHEMA_EXPORT/USER
ORA-39083: Object type USER failed to create with error:
ORA-00959: tablespace 'IMPORTED_TABLE_SPACE' does not exist
Failing sql is:

Obliviously I've not mapped table space to an existing table space

So

1) Find out available table spaces

SELECT TABLESPACE_NAME, STATUS, CONTENTS FROM USER_TABLESPACES;

You'll see an output similar to


2) Remap table space to an existing one

impdp system/password schemas=db_dump_schema remap_schema=db_dump_schema:locally_mapped_schema directory=DB_DUMPS DUMPFILE=dump_file_name.dmp LOGFILE=DB_LOGS:import.log remap_tablespace=IMPORTED_TABLE_SPACE:SYSTEM,IMPORTED_SCHEMA_INDEX:SYSTEM


Thursday, June 22, 2017

Addressing 'Caused by: java.lang.RuntimeException: Cannot find System Java Compiler.' in Jenkins

I maintain this blog to keep track of common errors encountered in testing and how to solve them so that they'll be useful to anyone including myself.

So this is another one.

In this current CI environment I work, all the jobs run successfully, but when I added a new job for a TestNG project it complained about JAVA_HOME not being found.

Obviously in the environment where this happened, only JRE is installed and I didn't want to change any settings so that there's a possibility of it affecting other tests and jobs.


Solutions

 So the solution was to add a JDK specifically for this job.

01) Add JDK configuration in Jenkins global configuration (Jenkins -> Manage Jenkins -> Global tool configuration

 

Even if that specific JDK version is not in the environment, it's possible to download it automatically and install it. What you have to do is provide valid credential to download the binary.

NOTE : I'm using a rather old version of Jenkins here. So steps can be bit different. Specially from where JDK version can be added.

02) I've already configured the job. So this new JDK option did not show up automatically at job configuration UI. So had to restart Jenkins server

03) Now choose the JDK in Job configuration page.

 

04) Save the configuration and trigger a job. Now it should pick up the JDK version mentioned above and should no longer throw the initial error.

05) Then I ran into another issue and worth mentioning it here. Jenkins download the JDK version and when it tries to access and install it, that operation fails due to not having enough permission.

Software Deployment failure - The requested operation requires elevation

Solution


Turn off UAC in the client computers
 
To turn off UAC follow the steps below,
  1. Select Control Panel --> User Account
    1. For Windows 7 and Windows 2008 R2,
      1. click User Account Control Settings link.
      2. This opens the User Account Control Settings dialog showing the control level.
      3. Drag and choose the control level to Never Notify and click OK
    2. For Windows Vista and Windows 2008
      1. Click "Turn User Account Settings On or Off link
      2. Uncheck the "Use User Account Control (UAC) to protect your computer" option and click OK
  2. Close the Control Panel dialog.
  3. Restart the computer after disabling the UAC for the changes to take effect.