Forum Stats

  • 3,815,358 Users
  • 2,259,005 Discussions
  • 7,893,052 Comments

Discussions

SQLcl Version 22.1.0.90.1611: what happend to "AddVMOption -Duser.home"?

User273940_Dagmar
User273940_Dagmar Member Posts: 5 Blue Ribbon

Hello,

we have several machines with RAC. In former versions of SQLcl we set

AddVMOption -Duser.home=/common/shared/path/for/all/machines

as fist line in file 'sqlcl/bin/sql' in order to have the same alias and history files for all machines.

With the new version we are getting this error:

line 65: AddVMOption: command not found

What happend to Duser.home and is there a workaround?

Best regards, Dagmar

Best Answer

  • user9540031
    user9540031 Member Posts: 172 Silver Badge
    Answer ✓

    Hello,

    With the new version we are getting this error:

    line 65: AddVMOption: command not found

    This looks like a plain bash script error.

    If you diff the original Oracle-suppliedbin/sql script between versions 21.4.1 and 22.1, you'll see that the only change regarding the AddVMOption function, is that previously it was defined at line 63, and now it's at line 64, due to 1 added line in the heading comments.

    In former versions of SQLcl we set

    AddVMOption -Duser.home=/common/shared/path/for/all/machines

    as first line in file 'sqlcl/bin/sql'

    How did you do that? Does the result still read as valid Bash shell?

    Regards,

    User273940_Dagmar

Answers

  • User273940_Dagmar
    User273940_Dagmar Member Posts: 5 Blue Ribbon

    /usr/java/jdk-11/bin/java -version

    openjdk version "11" 2018-09-25

    OpenJDK Runtime Environment 18.9 (build 11+28)

    OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)

  • user9540031
    user9540031 Member Posts: 172 Silver Badge
    Answer ✓

    Hello,

    With the new version we are getting this error:

    line 65: AddVMOption: command not found

    This looks like a plain bash script error.

    If you diff the original Oracle-suppliedbin/sql script between versions 21.4.1 and 22.1, you'll see that the only change regarding the AddVMOption function, is that previously it was defined at line 63, and now it's at line 64, due to 1 added line in the heading comments.

    In former versions of SQLcl we set

    AddVMOption -Duser.home=/common/shared/path/for/all/machines

    as first line in file 'sqlcl/bin/sql'

    How did you do that? Does the result still read as valid Bash shell?

    Regards,

    User273940_Dagmar
  • user9540031
    user9540031 Member Posts: 172 Silver Badge

    Rather than make changes to the Oracle-supplied bin/sql script, you might use:

    export JAVA_TOOL_OPTIONS="-Duser.home=/common/shared/path/for/all/machines"

    in the calling shell, then use the (unmodified) bin/sql script.

    Regards,

  • User273940_Dagmar
    User273940_Dagmar Member Posts: 5 Blue Ribbon

    Thank you, @user9540031

    You are right, I needed to put my "AddVMOption -Duser.home=/common/shared/path/for/all/machines" AFTER this block.

    AddVMOption()

    {

     APP_VM_OPTS[${#APP_VM_OPTS[*]}]="$*"

    }