Previous table appearing in new connection in Oracle database - oracle

Every time I create a new connection under the same common user on the SQL Developer tool it automatically copies the table(s) of the previous connection.
I am using Oracle Database 19c on the SQL developer tool.
In the below picture, there is a table having 2 columns.
In the below image, I have created a new connection, but it already has the previous tables.
troubleshooting steps I have followed so far -:
disconnected the previous connection: not solved
deleted the previous tables & connection: not solved
restarted SQL developer tool: not solved
deleted user and created again: this works but can't do it every time.
I have created a table using steps on this website: sqlserverguides
Please Advise :-)

The answer to your question here is that you are not doing what you think you are doing.
The objects newfirm and newtable are not tables, these are connections.
A connection needs a username and a password, a hostname to connect to, a port number, and a service name (or SID).
Once you are connected to a database server, all the "folders" you see under that connection are all related to the user used for the connection.
If you want to look at other users (be it sys or service users, or "people"), then you need to go to the folder "other users" in the same tree.
The screenshots you are showing there in your question only show 2 distinct connections (we don't know if the same details such as username + hostname were used) each with their own label/name (newfirm and newtable).
You can't "disconnect" a table, you also can't delete it .. you can drop it however which is likely what you meant.
In your screenshots, what you are pointing at and calling columns are actually tables.
Those things that you are pointing at and calling "previous table" and "new table" are not tables but connections (to a database server using a specific username).
You do not show any code you may be using, which would be useful.
If you want to drop a table (i.e. delete), you use the DROP command:
DROP TABLE user.tablename;
It is not possible for 2 tables with the same name to exist in the same schema (aka user).

Related

Oracle Privilege - User can create table but cannot write rows

A user has been configured on Oracle. Via this user, I can create an ODBC connection and an OCI connection, and these both test fine in Win10. Using Alteryx with the ODBC and OCI connection, we try to write data to a new table.
The table is created and appears in PL/SQL with the expected column names. However, the rows are never written and the connection just hangs at this point.
What could be wrong? I am not an Oracle Admin
Based on comments you were expecting oracle to commit without executing "commit" command explicitly. It's not enabled by default in oracle so you have to turn it on.
It's not possible to turn this on for the database, but on client apps only.
E.g. "set autocommit on" command in SQL Plus.
So you need to check docs for the client application you're connected with (presumably Alteryx is the one). It might have such a feature.

Specifying a database in JDBC URL for Netezza

When connecting to Netezza via JDBC, the database in the URL is a required field - e.g. the value sales in the example URL jdbc:netezza://main:5490/sales;user=admin;password=password
The first time I connect to a Netezza instance, I don't (necessarily) know the name of a database on the appliance. Guessing a database name is a very time consuming exercise.
In this scenario, what value should I provide? Is there a "use default" option, a way to list databases, or a specific database name that will always work (e.g. a system database)?
Netezza will always have one main database: system.
You cannot delete the system database.
I would suggest that you connect to jdbc:netezza://hostname:5480/system.
Once connected, you can list the databases that your user has access to, using
select database
from _v_database;
I can't answer definitively, but it appears that every Netezza appliance by default has a database named TESTDB. This is at least true for all the appliances to which I have access.
Users or administrators may be able to delete this database, but it's a good bet if you need a database to which to connect.

Pl-Sql User Connection

I've been starting oracle on my job. But i've been using MS all the time. Now i have problem on User-Shema structure. I tryed a create table with sql query, but table had been created in somewhere else then i wanted. (I've already created a user named LPA) I just wrote the query, and table is in the (GeneralDatabase) Tablespaces->Users->(Here). I want to create a table in LPA schema, under the table folder. I've been searching for it but i could'nt get it. So need some help please.
PS:I found that i need to connect with user, than write to query with TS_LPA(Thats my tablespace). But i also cant connect with the user LPA.(We can say this is my first problem)
In Oracle there is no "dbo" or default schema, in case that is what you are looking for. You must specify the target user account when you connect (log in) to the database, and that account will be used as the default schema for all of your subsequent actions. (This is similar to a home directory in Linux, where if I log in as williamr and create a file, it will belong to williamr and not some generic default account.)
In your case I suspect you are connecting as SYS or similar, in which case your table now belongs to SYS (or whoever you are connected as). You'll need to drop it and try again.
If you don't want to post the connect string you used to connect initially for some reason, then execute the following query to see your current schema:
select user, sys_context('userenv','current_schema') from dual;
(Normally user and sys_context('userenv','current_schema') will be the same, but worth double-checking.)
In PL/SQL Developer you can only issue connect commands from a Command window (not a SQL window). Alternatively you can use the 'log on' menu tool, or Session > Set Main Connection from the menu, or (best if you want to reuse it later) Tools > Define Connections, which has a 'Test...' button to validate a new connection. You'll need the username, password and database service name (not just username and password).
connect with LPA user.
specify the schema name before table name.
create table LPA.tbl_name(col1 datatype1,....);

Need help linking oracle tables in MS Access

I am having some issues connection to an oracle DB using MS Access.
If I use SQL Developer to connect to the Oracle DB I see pretty much every table and view in the DB however when I connect using MS Access I only get a selected few.
I tough it was because the user didn't have Select privileges on the tables I need so I requested the privilege and after a moth of waiting I finally got it but I still cant see the tables on the Access tool.
This is what I see on SQL Developer vs MS access. I need SFMFG.PWUI_CHAR_DEF_EXT to show on access table manager. Any help to solve this mystery is greatly appreciated.
Using Access 2010, if I select External Data ==> ODBC Database ==> Link to the datasource by creating a linked table, I get a windows dialogue of all the available datasources. When I log in to the one I want, I see the names of all the tables I am authorized to select from.
The Linked Table Manager only shows the tables for which there are existing links.

Oracle11g Database Synchornization

I have a WPF application with back-end as Oracle11gR2. We need to enable our application to work in both online and offline(disconnected) mode. We are using Oracle standard edition(with single instance) as client database. I am using Sequnece Numbers for Primary Key Columns. Is there anyway to sync my client and server database without any issues in Sequence number columns. Please note that we will restrict creation of basic(master) data to be created only in server.
There are a couple of approaches to take here.
1- Write the sync process to rebuild the server tables (on the client) each time with a SELECT INTO. Once complete, RENAME the current table to a "temp" table, and RENAME the newly created table with the proper name. The sync process should DROP the temp table as one of its first steps. Finally, recreate the indexes and you should be good-to-go.
2- Create a backup of the server-side database, write a shell script to copy it down and restore it on the client.
Each of these options will preserve your sequence numbers. Which one you choose really depends on your skills. If you're more of a developer, you can make #1 work. If you've got some Oracle DBA skills you should be able to make #2 work.
Since you're on 11g, there might be a cleaner way to do this using Data Pump.

Resources