How to change the timezone of Oracle SQL Developer / Oracle Data Modeler? - oracle-sqldeveloper

Each time I run Oracle SQL Developer or Oracle Data Modeler I receive this error message:
ora-01882 "timezone region not found"
Digging a this issue, I found that both Oracle SQL Developer and Oracle Data Modeler says that my timezone is Europe/Berlin, which is not listed into the Oracle's system view V$TIMEZONE_NAMES.
So, I need to change the timezone in Oracle SQL Developer (not the database) to match the most similar timezone found in V$TIMEZONE_NAMES.

If you need to change the time zone of Oracle SQL Developer (or Oracle Data Modeler), then this is how to do it:
Go to the installation directory of Oracle SQL Developer.
Open the file located at: sqldeveloper/bin/sqldeveloper.conf.
At the end of file, add the following line: AddVMOption -Duser.timezone=GMT-4.
You will need to change the value GMT-4 to one that match one of the timezones in V$TIMEZONE_NAMES.
And that’s it!

This worked for me
AddVMOption -Duser.timezone=GMT+5

Try:
Oracle Sql Developer 4.1.3
Open config file.
sqldeveloper/sqldeveloper/bin/sqldeveloper.conf
Add end of the file.
AddVMOption -Duser.timezone=GMT
Restart your Oracle Sql Developer.

For me this worked:
1)
When in Windows 8, make sure you have authorization/rights over the sqldeveloper folder
(for me this is C:\Program Files\sqldeveloper, do a right-mouse click here and choose "Properties..." and then "Security" tab and on that tab press the "Edit" button and give yourself all the rights. [I have to guess these names in English because my Windows is not English)]
2) then follow the steps from Rubens Mariuzzo above, except the last one
3) AddVMOption -Duser.timezone=GMT+1
SELECT * FROM v$timezone_names gave me both Europe/Amsterdam and Europe/Berlin as options (both are GMT+1 but my location is Europe/Amsterdam). However using either of these names stil gave the ora-01882 "timezone region not found", only after changing to "timezone=GMT+1" did the bug disappear

This worked for me
AddVMOption -Duser.timezone=GMT+7
Tq

Sri lanka
AddVMOption -Duser.timezone=GMT+5.30

Related

Why does running a query return 'table_oid' under messages and nothing under Data Output

Running any sort of query on pgAdmin 4 just returns a 'table_oid' under messages.
I am able to get the necessary data when running the query from the command line, for example
SELECT ST_MakePolygon(ST_GeomFromText('LINESTRING(75.15 29.53,77 29,77.6 29.5, 75.15 29.53)'));
I understand that table_oid refers to the object id of the table, but I have no idea how to access it.
Pardon me please if it is a simple question, but I am unable to find any resources online
Expected:
010300000001000000040000009A99999999C9524048E17A14AE873D4000000000004053400000000000003D4066666666666653400000000000803D409A99999999C9524048E17A14AE873D40
Actual:
table_oid
From pgAdmin 4 project tracker:
Temporary solution until next release and tested in my ubuntu 18.04 machine:
Replace these two 2 files:
/usr/share/pgadmin4/web/pgadmin/tools/sqleditor/__init_*_py
/usr/share/pgadmin4/web/pgadmin/tools/sqleditor/command.py
Link to files:
__init_*_.py
command.py
Note:
The first file's name is __init_*_py, without the *.
Try Squirrel SQL - Universal SQL Client. It's an extremely useful SQL client. I use it to access SQL Server, PostgreSQL, MySQL, Access. It's not as good looking as pgAdmin4.
Install JAVA first, if not already installed.
Install Squirrel SQL.
Download the latest PostgreSQL JDBC driver, e.g. postgresql-42.2.6.jar, and put it into a convenient location.
Open/Start Squirrel.
Click the Drivers Tab and scroll down to PostgreSQL. Double click PostgreSQL. A "Change Driver: PostgreSQL" dialog box/window will open.
Click the Extra Class Path tab and click the Add button. Navigate to and choose the PostgreSQL JDBC Driver that was downloaded in step 3. above.
Click the List Drivers button, "org.postgresql.Driver" should appear in the Class Name drop down box.
Click OK.
Setup PostgreSQL JDBC Driver
The driver should now be setup.
Click the Aliases tab to setup a connection to your database. See my example screenshots.
Setup Database Connection

Golden Gate ERROR OGG-05263 No GGSCHEMA clause

In OTN I am using these instructions to "try" and configure GoldenGate with a MSSQL Source DB to an Oracle12c Target DB
http://www.oracle.com/technetwork/articles/datawarehouse/oracle-sqlserver-goldengate-460262.html
Replicating Transactions Between Microsoft SQL Server and Oracle Database Using Oracle GoldenGate
Everything goes okay up till the command:
GGSCI (MSSQL) 2> ADD TRANDATA HRSCHEMA.EMP
Where I get the error:
ERROR OGG-05263 No GGSCHEMA clause was specified in the GLOBALS file. Please specify a GGSCHEMA shema name.
I searched and saw that currently there was no "GLOBALS" file. So I created one:
F:\GG\dirprm\globals.prm
And added one line:
GGSCHEMA hrschema
That did not help.
Still getting the same error.
Any suggestions?
Are there GoldenGate Environment variables that I need to have??
Thank-you in advace for your help.
I got the answer from Oracle Support:
The GLOBALS file should be in the main installation folder. Please remove the same from the dirprm file.
Also the GLOBALS file does not have extension. I could see that you have mentioned it as GLOBALS.prm
Made those changes and it works!

Can I set a default schema for a connection in Oracle sql developer 4?

Is there a way to set the default schema for a Database connection in Oracle SQL Developer version 4+? I see this link for previous versions:
http://www.javaforge.com/project/schemasel
...but I can't figure it out for Oracle SQL Developer version 4.
The way to do this at the tool level would be to run a session startup script.
Create a text file 'logon.sql' with the script "alter session set current_schema = yourschema;"
Save it anywhere - I recommend saving it somewhere in your database install location.
In SQL Developer go to Tools -> Preferences -> Database
Check the box for "Run connection startup script on each new database connection"
Browse and select the above file.
That should make you default to that schema every time you login.

SQL Developer- Session startup script

I would like to have every session in my SQL Developer to be set to the GMT timezone. Is there a way to setup a session startup script in SQL Developer for this?
You can create a script file, e.g. C:\Temp\startup.sql, containing:
alter session set time_zone = 'GMT';
Then go to the Preferences, from the Tools menu, and go to the top-level Database item in the panel on the left, and put the path to your file in 'filename for connection startup script' text box:
You can change other settings in your script as well, if they can't be set in the Preferences->Database->NLS section.
The settings are only picked up when you open a new connection - they don't seem to be reapplied when you reconnect or when you open a new SQL Worksheet under an existing connection.
When you connect the 'script output' window will say:
session SET altered.
In 4.0.1 anyway, but apparently not in 4.0.2; and if you then do something like:
select current_timestamp from dual;
then you'll see the GMT time regardless of your PC's locale settings:
CURRENT_TIMESTAMP
-----------------------------------
06-MAY-14 11.23.42.593143000 GMT
with the script, versus in my case this without:
CURRENT_TIMESTAMP
-----------------------------------
06-MAY-14 12.25.09.925466000 EUROPE
/LONDON
This is tested in version 4.0.1.14 and 4.0.2.15; I think it's always been possible but I'm not able to check previous versions.
I ran into this as well and have an alternative solution. I noticed this section of the Preferences
"Database" -> "NLS"
This shows some date/time formats. In my case the "default" for "Date Format" was "DD-MON-YY". I updated it to something more accurate and it then displays dates as I specified.
It does not show any output during the connection process but DOES 'alter the session'.

what driver to use when connecting to Oracle 10 with IBM RAD / Eclipse DTP?

I'm using IBM RAD 7.5.5 (which is basically eclipse 3.4 (ganymede) + plugins).
I'm trying to create a connection to Oracle 10 using the "Data Source Explorer" view.
When I create a new connection for Oracle, there are three "driver" options:
"Oracle 10 - Oracle OCI Driver Default"
"Oracle 10 - Oracle Thin Driver Default"
"Oracle 10 - Other Driver Default"
1 & 2 don't work for me because I need to connect to the db using a "Service Name", not an "SID". The dialog box does not give me the option of specifying a Service Name, and it does not allow me to manually specify the connection URL. (Service Name has a different URL syntax, uses a '\' instead of a ':", like so ...
With SID: jdbc:oracle:oci:#localhost:1521:the_sid
With Service Name: jdbc:oracle:oci:#localhost:1521\the_sevrice_name
So ... I want to use option #3 which allows me to specify the URL manually. The problem is I add the driver file ojdbc14.jar to the JAR list, but it keeps telling me "Invalid JAR definition; driver list not defined".
Can anyone help? I'm really stuck on this. :(
Thanks,
Rob
FYI, at long last I found a solution to my problem.
While I was never able to establish the connection with the "Service Name" using Eclipse/DTP "Data Source Explorer", I was able to establish the connection with "Service Name" using SQL Developer. Once connected with SQL Developer, I did a ...
select sys_context ('userenv','instance_name') from dual;
... to determine the database's SID.
With the SID I was able to connect with option #1 and the driver contained in ojdbc14.jar.
Thanks all, Rob
If you are stuck with a more recent version of Oracle (e.g. Oracle 12) on a recent RAD or Eclipse installation you should try to do the following:
Download the Oracle 12 ojdbc7.jar. If you are on java6 you should download ojdbc6.jar
Create a new connection
Select Oracle 12 - Other Driver Default
Press the [...] dot, remove the default ojdbc6.jar and add the jar you downloaded before
Insert database name, the url (as jdbc:oracle:thin:#server:port/service ), the username and password, check the save password box if you wish.
Click Next and then Finish. Eclipse will try to test the connection, if the driver is still giving you problems then you need to force Eclipse (or RAD) to save the connection and you can fix it later.
Now you can fix the driver properties. This step is necessary to eventually be able to call the thin client in the jar.
In the database connection list choose the new connection you just created and press right button > properties
Choose Driver Properties
Click on the delta icon (the small triangle) near the Drivers combo box.
Open the Properties tab, then edit the properties as follow:
Catalog - USER
connection url - jdbc:oracle:thin:#server:port/service
Database Name - db
Driver Class - oracle.jdbc.driver.OracleDriver
Now your connection test should be succesful.