Database Administrators
Q&A for database professionals who wish to improve their database skills
Latest Questions
1
votes
1
answers
1121
views
Oracle SQL Developer: Copy paste tables, with 2 different instances, with different table structure
Here I have 2 difference instances, one is called DEV and one is called SIT2. I created a public database link, called DBLINKSIT2(Basically just to create a bridge between DEV and SIT2) and I need to copy all(make a backup) the tables from DEV to SIT2, with additional filtration and joining with ano...
Here I have 2 difference instances, one is called DEV and one is called SIT2. I created a public database link, called DBLINKSIT2(Basically just to create a bridge between DEV and SIT2) and I need to copy all(make a backup) the tables from DEV to SIT2, with additional filtration and joining with another table called LKUP.CTL_RWA_VERSION Below is the syntax that I have that is running in DEV.
begin
for r in (select DISTINCT TABLE_NAME from all_tab_columns where owner = 'DDSHIST' and COLUMN_NAME = 'SNAPSHOT_DT')
loop
begin
execute immediate 'INSERT INTO ||r.table_name|| @DBLINKSIT2
select a.*
from DDSHIST.||r.table_name|| a
INNER JOIN LKUP.CTL_RWA_VERSION b ON a.SNAPSHOT_DT = b.SNAPSHOT_DT and a.DDS_VERSION = b.DDS_VERSION
WHERE b.GOLDEN_COPY = 'N'';
exception when others then null;
end;
end loop;
end;
I put COLUMN_NAME = 'SNAPSHOT_DT' because some of the tables do not contain this column. So the joining condition is both SNAPSHOT_DT are the same, and DDS_VERSION are the same, WHERE golden copy in LKUP table = 'Y'. then loop the script, and insert into @DBLINKSIT2.
But I can't get the script to run and I don't know where I am getting this wrong.
Any help would be appreciated. Thank you.
Chun
(11 rep)
Aug 5, 2016, 07:35 AM
• Last activity: Jul 30, 2025, 11:06 AM
0
votes
1
answers
150
views
how to get explain plan from pl/sql function call?
consider this working pl/sql block: declare o_result boolean; io_error varchar2(30000); tab1 someTable1; tab2 someTable2; begin tab1(1).col1 := 'str'; tab1(1).col2 := 1; tab2(1).col1 := 'str'; tab2(1).col2 := 0.5; tab2(1).col3 := 6; o_result := some_function(io_error, 2,'str', 5, to_date('01-JAN-23'...
consider this working pl/sql block:
declare
o_result boolean;
io_error varchar2(30000);
tab1 someTable1;
tab2 someTable2;
begin
tab1(1).col1 := 'str';
tab1(1).col2 := 1;
tab2(1).col1 := 'str';
tab2(1).col2 := 0.5;
tab2(1).col3 := 6;
o_result := some_function(io_error, 2,'str', 5, to_date('01-JAN-23','DD-MON-YY'), to_date('31-DEC-23','DD-MON-YY'), 4, 'A', tab1, tab2, 'str', 'B', 'str');
end;
how to get the explain plan for pl/sql function calls where its inputs are dates and custom types?
gabriel119435
(119 rep)
Feb 20, 2024, 07:44 PM
• Last activity: Jul 18, 2025, 02:02 PM
0
votes
1
answers
393
views
How to print content of refcursor within a PL/SQL procedure?
**This question concerns Oracle PL/SQL (Oracle version 12c/19c) and Oracle SQL Developer (version 20.4).** I have a procedure which calls a dynamically generated SELECT statement and save results into `sys_refcursor`. I would like to print content of the refcursor within the procedure and show it in...
**This question concerns Oracle PL/SQL (Oracle version 12c/19c) and Oracle SQL Developer (version 20.4).**
I have a procedure which calls a dynamically generated SELECT statement and save results into
sys_refcursor
. I would like to print content of the refcursor within the procedure and show it in ouput window of Oracle SQL Developer.
So far, I was able to only return the refcursor from procedure through OUT parameter and bind variable, and then print it. My current code of the procedure looks like this:
create or replace procedure cursor_show (rc_out OUT sys_refcursor) is
v_sql varchar2(1000);
v_rc sys_refcursor;
begin
--other statements generating SELECT
v_sql := 'select ...'; --my SELECT
open v_rc for v_sql; --get data
rc_out := v_rc; --return refcursor
end;
To print results, I need to call these statements:
var x refcursor;
execute cursor_show (:x);
print x;
I would like to encapsulate print
into procedure cursor_show
to get something like this:
create or replace procedure cursor_show is
v_sql varchar2(1000);
v_rc sys_refcursor;
begin
--other statements generating SELECT
v_sql := 'select ...'; --my SELECT
open v_rc for v_sql; --get data
print v_rc; --print data
end;
After that, I would be able to call the procedure and print the refcursor content with one-row statement execute cursor_show;
.
However, once I tried to compile such procedure, I received this error message:
Error(51,11): PLS-00103: Encountered the symbol "V_RC" when
expecting one of the following: := . ( @ % ;
The symbol ":=" was substituted for "V_RC" to continue.
Could you please advise how to call print
statement within body of the procedure?
user311946
Oct 21, 2024, 12:43 PM
• Last activity: Jul 18, 2025, 07:40 AM
0
votes
1
answers
159
views
How to get DML SQL of uncommited statements in Oracle 19c?
I'd like to know if there is a way to get the DML (`insert`, `delete`) SQL of uncommitted statements in Oracle 19c in my own session? For example, if I have typed some statements and I haven't committed them and I've closed my worksheet, can I get them back? Another example of this. Say I've done so...
I'd like to know if there is a way to get the DML (
Is there a way I can get this as SQL statements? I thought I could get them in the *Log* but no... Surely there has to be a way but I haven't found it.
Can you help me out?
insert
, delete
) SQL of uncommitted statements in Oracle 19c in my own session?
For example, if I have typed some statements and I haven't committed them and I've closed my worksheet, can I get them back? Another example of this. Say I've done some deletes using the SQL Developer GUI, selecting the rows I want to delete and then clicking the delete icon (without haven't committed nor made a rollback
yet).

Metafaniel
(203 rep)
Mar 11, 2022, 06:35 PM
• Last activity: Jul 12, 2025, 05:03 AM
0
votes
1
answers
194
views
Counting failed attempt
Here is my code: create table failed_login_attempts( login_id number(5) primary key, date_created timestamp default systimestamp, email varchar2(110), ip varchar2(24), mac varchar2(18), attempt number(1), isLocked number(1) ); I want to count `attempt` column and if `5` then `isLocked` become 1 from...
Here is my code:
create table failed_login_attempts(
login_id number(5) primary key,
date_created timestamp default systimestamp,
email varchar2(110),
ip varchar2(24),
mac varchar2(18),
attempt number(1),
isLocked number(1)
);
I want to count
attempt
column and if 5
then isLocked
become 1 from 0;
How can I make query, view or procedure?
MikeJ
(13 rep)
May 7, 2021, 01:11 AM
• Last activity: Jun 29, 2025, 04:03 PM
0
votes
2
answers
714
views
Aggregate Query in SQL Developer
[![enter image description here][1]][1] Below is my query. i get an error msg. it works when i remove the fields without the sum. I have added a screen shot of the data. Thanks! SELECT S.PRODUCT_ID, SUM(DISTINCT S.AWARD_AMT), SUM(DISTINCT S.EST_AMT), SUM(PMT.PMT_AMT), S.CREATE_DT, S.APPROVE_BY, S.EV...

chels
(1 rep)
May 28, 2020, 01:57 AM
• Last activity: Jun 29, 2025, 02:02 PM
0
votes
1
answers
1311
views
How to view databases and tables after 'imp' import using Oracle SQL developer
Maybe that's a wrong form of answer... The problem is: I've got an Oracle database dump file (very old, created with imp utility) At last, I've imported it. The command was `imp file=E:\Downloads\db_dispatcher\disp.dmp full=y` The console shows me there was success. [![enter image description here][...
Maybe that's a wrong form of answer...
The problem is:
I've got an Oracle database dump file (very old, created with imp utility)
At last, I've imported it. The command was
Now when I open my Oracle SQL developer and create any connection, I can't list my database (there must be at least one): in 'tables' section I only see this system stuff.
I the DB name should be 'meltshop', so I tried to find it in my Windows Services list. But there's none.
Oracle SQL developer 19, Windows 10. DB was created in 2009.
I am a newbie with Oracle(
The last year I worked with MySql database. Maybe here are any similarities?
I also have
imp file=E:\Downloads\db_dispatcher\disp.dmp full=y
The console shows me there was success. 

php
interface; the config shows me
$DBNAME = "/orcl.meltshop";
$DBLOGIN = "ml2_rt";
Instance, version, etc.:
select instance_name, host_name, version from v$instance;
INSTANCE_NAME
----------------
HOST_NAME
----------------------------------------------------------------
VERSION
-----------------
xe
DESKTOP-T6U2873
11.2.0.2.0
The log of my last try:
google disk
Victor Gorban
(101 rep)
Jun 26, 2019, 01:21 PM
• Last activity: Apr 10, 2025, 12:06 AM
0
votes
2
answers
576
views
Migration from MySQL to Oracle generates empty tables
I'm using SQL Developer to migrate a database from MySQL 5.7 to Oracle 18c XE. The problem is that the tables are generated but empty, even though I'm specifying that the data should move online. I also looked at the scripts, and there's no data either. What I see in the log is `DataMove.DISABLE_CON...
I'm using SQL Developer to migrate a database from MySQL 5.7 to Oracle 18c XE. The problem is that the tables are generated but empty, even though I'm specifying that the data should move online. I also looked at the scripts, and there's no data either.
What I see in the log is
DataMove.DISABLE_CONSTRAINTS_FAILED
. How to fix this?
These are the migration options:

ps0604
(51 rep)
Mar 10, 2019, 06:27 PM
• Last activity: Apr 5, 2025, 10:14 AM
0
votes
2
answers
1053
views
How do you change the storage parameters of a already made table (sql developer)?
**Summarize the problem** I have been given 6 tables that have all been created already and I was told to change the storage parameters of those tables. the issue I run into is that I can only change pctfree, pctused, initrans and max trans and not the others (initial, next, pctincrease and maxexten...
**Summarize the problem**
I have been given 6 tables that have all been created already and I was told to change the storage parameters of those tables. the issue I run into is that I can only change pctfree, pctused, initrans and max trans and not the others (initial, next, pctincrease and maxextents)
**Provide details and any research**
I have done a lot of research, yet some of them do not work with sql developer at all. Whilst the others do work but as stated only for the 4 storage parameters.
**When appropriate, describe what you’ve tried**
alter table CUSTOMERS
pctused 20 pctfree 80;
This works perfectly for those two, but I am unable to add the others. From what I found online, this was in fact the only thing that worked for me.
I appreciate all input!
XileVoid
(107 rep)
Sep 2, 2020, 06:53 AM
• Last activity: Feb 26, 2025, 06:23 AM
0
votes
3
answers
2870
views
REGEXP_SUBSTR to split delimited values
I have a field called `FREQUENCY` and it has values like `'10,0;30'`. How do I write a regular expression to get the result like this: FREQUENCY 10 0 30
I have a field called
FREQUENCY
and it has values like '10,0;30'
. How do I write a regular expression to get the result like this:
FREQUENCY
10
0
30
Jayachandran Jayaseelan
(1 rep)
Mar 23, 2021, 10:40 AM
• Last activity: Feb 19, 2025, 01:00 AM
0
votes
0
answers
20
views
Oracle SQL Developer hangs post launch
Oracle SQL Developer hangs post launch gets hanged, we are using Oracle SQL Developer 23.1.1 and we have JDK 11.0.17 installed.
Oracle SQL Developer hangs post launch gets hanged, we are using Oracle SQL Developer 23.1.1
and we have JDK 11.0.17 installed.
sush007
(1 rep)
Feb 11, 2025, 08:27 AM
0
votes
0
answers
109
views
SQLDeveloper encoding and export database
I've been requested to make a dump of an Oracle 11g EE Database. However, i can't use the Oracle Data Pump utility, since I have no direct access to the host machine, nor I think the db user have the correct privileges. So I opted for using the Database export utility that SQL Developer provides. Bu...
I've been requested to make a dump of an Oracle 11g EE Database. However, i can't use the Oracle Data Pump utility, since I have no direct access to the host machine, nor I think the db user have the correct privileges.
So I opted for using the Database export utility that SQL Developer provides. But I do have the following doubts:
- Am I actually viewing the correct encoding through SQL Developer? I'm asking this because I can see there's a lot of question marks inside some tables. I'm wondering if the application that saved the data used the wrong encoding, or if SQL Developer is using the wrong encoding and i'm not viewing it correctly.
- How do I export with the correct encoding? I'm aware that SQL Developer has an utility that would allow the user to export a script file with both DDL and DML instructions, but it asks me to specify the file encoding.
I've make some tests myself, but since i do not trust the tools i've used completely (EG: WinMerge does not recognise the Windows equivalent of ISO 8859-15, as far as i know), i'm wondering if anyone has been in my shoes and tried better.
The internal encoding of the DB should be WE8ISO8859P15, which I think it is the equivalent of ISO 8859-15. When I try to use the Export functionality of SQLDeveloper, it asks me in which encoding the file should use.
I've used this utility twice: exporting both a ISO 8859-15 Windows equivalent (can't remember it right now, i'll update this section asap) and a UTF-8 encoding. Both WinMerge and Meld tells me that the only difference between the files are the encoding (and not the characters)
Dont Throw Me Away
(1 rep)
Jan 6, 2025, 04:11 PM
0
votes
1
answers
439
views
SQL Developer: View only permissions
I am using SQL Developer, generally to assist in writing reports against various databases but there is one application that is run on an annual basis and at the end of that processing (about a 3 hour window) I use FME to further process the records that were added during that time frame. I am limit...
I am using SQL Developer, generally to assist in writing reports against various databases but there is one application that is run on an annual basis and at the end of that processing (about a 3 hour window) I use FME to further process the records that were added during that time frame. I am limited to view only permissions on the Oracle table(s) and that is all I really need to do my job.
There is a CRM who insists that during that 3 hour window when this particular application is being used by customers outside the organization no one within the organization should access any other parts of the application or any associated database tables. Not for any technical reason, I understand, but because the CRM is afraid that somehow using the tables during that time frame (customers outside the organization are uploading data during that 3 hour window) will somehow potentially cause a problem for the customers.
Recently, in order to get a general idea of the number of records I would later be processing, I ran a small
SELECT
query. Unfortunately, I inadvertently ran it at the tail-end of the 3 hour window, a little while before the black-out period was scheduled to end.
Apparently, the CRM had advised the DBA to report if anyone internally accesses the database during the applications 3 hour window. The CRM ended up at my desk screaming that no one within the organization was to be using the database in any capacity during the applications 3 hour window.
My questions are the following:
Does running a SELECT
query on a view only table interfere with any other processes that might be updating the tables in a database?
Or is the CRM being overly cautious?
The CRM is apparently lobbying for me to be written up for this transgression. So I am looking for some technical information to support my defense.
Gaberax
(11 rep)
Oct 1, 2021, 09:28 PM
• Last activity: Dec 30, 2024, 06:02 PM
0
votes
0
answers
52
views
SQL Developer app crashes
I have downloaded SQL developer on my Mac running OS Sonoma 14.1.2 but as soon as i launch it it quits unexpectedly. I have installed latest JDK 11. I don't seem to find the reason for its crash. I executed sqldeveloper.sh in terminal and i encountered following error line 16: [: missing `]'/Library...
I have downloaded SQL developer on my Mac running OS Sonoma 14.1.2 but as soon as i launch it it quits unexpectedly. I have installed latest JDK 11. I don't seem to find the reason for its crash. I executed sqldeveloper.sh in terminal and i encountered following error
line 16: [: missing `]'/Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home
Wasim Wani
(101 rep)
Oct 20, 2024, 06:33 AM
• Last activity: Oct 20, 2024, 08:41 AM
1
votes
0
answers
45
views
Oracle SQL Developer - Find Database Object -- schema checkboxes shift position on restart - anyone have a fix for this?
I'm using Oracle SQL Developer Version 21.4.1.349 on Windows We have a large number of schemas. I only work with 3 of them. When I need to find something using the Find Database Object function, I only want to search those 3 schemas. I check just those boxes. Here's where it gets weird. Every time I...
I'm using Oracle SQL Developer Version 21.4.1.349 on Windows
We have a large number of schemas. I only work with 3 of them.
When I need to find something using the Find Database Object function, I only want to search those 3 schemas. I check just those boxes.
Here's where it gets weird. Every time I quit and reopen SQL developer (which I occasionally need to do because it freezes randomly, or I need to restart my laptop), it still has 3 boxes checked... but they're the wrong ones. The checks shift upwards by 1 position.
For example, if I had schemas named alpha beta gamma delta epsilon zeta eta theta and so on... and I cared about and checked gamma, epsilon, and eta. Upon a restart, the checked boxes will now be beta, delta, and zeta.
It's not just a visual bug, searching will search the contents of the newly checked schemas instead of the ones I originally selected.
Has anyone run into this? Is there a fix? It's really annoying. Not as annoying as the random freezing, but it seems there's no fix for that one.
Thank you!
J.C.
(11 rep)
May 16, 2024, 05:55 PM
0
votes
0
answers
141
views
See an arbitrary SQL statement in oracle enterprise manager
I like to see any sql statement in the Oracle Enterprise Manager (oem) Cloud Control 13c, e.g. in the active session history. A simple select is not shown in any view. After some research I found in the manual (e.g.: https://www.oracle.com/technetwork/database/manageability/owp-sql-monitoring-128746...
I like to see any sql statement in the Oracle Enterprise Manager (oem) Cloud Control 13c, e.g. in the active session history.
A simple select is not shown in any view. After some research I found in the manual (e.g.: https://www.oracle.com/technetwork/database/manageability/owp-sql-monitoring-128746.pdf) , that **SQL monitoring is automatically started when a SQL statement either runs in parallel or has consumed at least 5 seconds of combined CPU and I/O time in a single
execution**.
So from my point of view I must be sure that an SQL statement runs at least 5 seconds to appear in the oem.
Can I do this by an addition in the SQL statement (like an sleep), or can I change the default in the oem?
Is there an best practice for this?
Any help is appreciated
Update:
Thanks to Paul W : /*+ monitor */ did the trick.
select /*+ monitor */ * from table;
makes the query appear in the oem.
th0rn
(1 rep)
Apr 8, 2024, 02:19 PM
• Last activity: Apr 10, 2024, 05:55 PM
0
votes
0
answers
303
views
How to get last executed statement on a particular table in Oracle?
Trying to identify what ghost process is inserting records into a particular table. Is there a way to get the exact query?
Trying to identify what ghost process is inserting records into a particular table. Is there a way to get the exact query?
Dhaval Mohandas
(19 rep)
Feb 21, 2024, 12:13 PM
0
votes
1
answers
65
views
Use Field Value as where clause statement
is it possible to use the select statement result as where clause statement/Condition in oracle SQL? Eg: ``` Condition_txt(FIELD) = 'AND b.mpal03d >= TO_DATE('01/10/2012','DD/MM/YYYY')' (Value of field) ```
is it possible to use the select statement result as where clause statement/Condition in oracle SQL? Eg:
Condition_txt(FIELD) = 'AND
b.mpal03d >= TO_DATE('01/10/2012','DD/MM/YYYY')'
(Value of field)
iHateBugs
(3 rep)
Feb 19, 2024, 07:28 AM
• Last activity: Feb 19, 2024, 04:33 PM
13
votes
1
answers
38100
views
"New query window" shortcut for Oracle SQL Developer
I'm used to Ctrl-N to give me a new query window in SSMS. How do I do it in Oracle?
I'm used to Ctrl-N to give me a new query window in SSMS. How do I do it in Oracle?
birdus
(253 rep)
Apr 12, 2019, 09:50 PM
• Last activity: Nov 14, 2023, 08:02 PM
0
votes
0
answers
548
views
Cannot cannot to database using sql developer: a connection attempt failed because the connected party did not properly respond after a period
I am using a windows laptop and installed sql developer version 23.1.0. When I input the connection details for my database I get the following error: >a connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because co...
I am using a windows laptop and installed sql developer version 23.1.0. When I input the connection details for my database I get the following error:
>a connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
My colleagues, using a macbook, are able to connect using the same creds. Anyone have any idea what is going on?
I have searched the web but nothing is helping so far.
Connection to the oracle database should be successful.
What is in a name
(9 rep)
Nov 1, 2023, 06:47 PM
• Last activity: Nov 2, 2023, 02:52 AM
Showing page 1 of 20 total questions