Oracle 18 xe weirdness - can't login as new user - oracle

I'm getting reacquainted with Oracle after several years and Oracle 18 XE is causing some problems. I use SQLDeveloper to connect as the SYSTEM user. Then when I create a new user cpp it says that is an invalid user name. I have to prefix new users with c##, so I created the user c##cpp. The c##cpp user is there under Other Users.
But when I try to create a new connection as the c##cpp user the connection fails. I've also tried creating the connection as just cpp, but that fails too.
What's up with creating users in Oracle 18 XE?
-------Update showing my connection parameters-------
I get the same error if I try to connect with SID XE.

Welcome back to Oracle.
Since you've been away, we added a Multitenant architecture. There is a Container Database - it has common users, with names like C##user.
What you're looking for is the actual database where your data is going to live, that's called a pluggable database. There you would go back to creating users, just like you did back before you left.
Make sure you connect to the pluggable database service. The default would be 'XEPDB1' - connect to THAT as sys or system, and then create your users.

It looks like the problem is that Oracle doesn't like lower case user names. When I put the username in double quotes the connection succeeds:
This is on Oracle 11. I gave up on Oracle 18 XE and installed Oracle 11. What a ridiculous waste of time.

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.

Using Oracle "Create User" command does not automatically create an associated schema

I'm just getting started with Oracle data export and import and things worked perfectly fine the first time around. But then I came back next day repeated the exact same steps on the same systems, but get ORA-01435: user does not exist error.
System Specs for all machines:
-OS: Windows 2012 R2 x64
-Oracle Server: Oracle 11G Express x64
Objective:
I'm exporting data from Oracle server 1 and importing to Oracle server 2.
Procedure:
Export data dump is successful from Oracle server 1.
but when importing the data dump on Oracle server 2, I follow this procedure:
-Stop IIS service
net stop WAS
Create Schema/user account and Grant privileges before import
net stop WAS
sqlplus / as sysdba;
CREATE user PIE1 identified by PASS1;
GRANT ALL PRIVILEGES TO PIE1;
GRANT IMP_FULL_DATABASE TO PIE1;
According to oracle, all goes well, but look at the first image bellow. In DBeaver, I can see that only the User account PIE1 has been created, but NO schema.
Oracle issue 1. User account created, but not the Schema
Question 1: According to Oracle, the command "Create User" IS supposed to also create an associated Schema. Anyone have an idea why this is no longer working for me? It worked once the night before.
I then continue the import procedure as follows:
imp PIE1/PASS1#xe file=c:\Backups\AVUSER2_6_7.dmp log=c:\Backups\import.log fromuser=AVUSER2_6_7 touser=PIE1;
But get the following error:
Oracle claims the User doesn't exist even though it does
Oracle claims the User doesn't exist even though it does. I repeated the entire procedure and even created an identical import/export user account and credentials, and this error still comes up.
Question 2: Any idea why Oracle "Can't find" a user account that's clearly in the database?
Additional Info:
Checked that my windows account is in admin group
Checked that my windows account is in ORA_DBA group
Opened all CMD prompt as Admin
As you implied, users and schemas as the same in Oracle, you can't have a user without a schema. No idea about DBeaver, but as there are other users that aren't listed under 'schemas' (according to your second image - ANONYMOUS, DIP, ...) that seems to be unrelated.
(Purely a guess, but perhaps the user you're connect as in DBeaver just doesn't have visibility of any objects owned by those users - maybe it only lists users it can see in all_objects, say. Pure speculation, but you could investigate that by looking at the data dictionary while connect through SQL*Plus as the same user. According to this old forum post, there is an option to hide empty schemas...)
The import is connecting successfully as PIE1 - you'd get a different error, ORA-01017, if it wasn't and you wouldn't see the 'Connected to...' banner or anything after that.
Your import command has a trailing semicolon that should not be there. The "importing ... objects into" message shows that it's trying to import into the PIE1; user and not the one you actually created, PIE1. Remove that semicolon and try again.
Incidentally, you can probably also remove the #xe TNS alias and stick to a local connection, assuming the environment is configured as it was whenyou ran SQL*Plus. You should also consider using datapump expdp/impdp rather than the legacy exp/imp.

How do I connect to oracle apex database through JDBC?

I have got a workspace in apex.oracle.com , Now , I want to connect to that database through JDBC from ubuntu-14.04 machine. please explain the steps , From where should I download the drivers and what should be the arguments in
DriverManager.getConnection();
step by step please. Thank you
You will not be able to connect to the database that's supporting the APEX instance on apex.oracle.com. If you are hosting your own instance, it's no different than connecting to any other Oracle database.A quick code snippet can be found here: http://www.java2s.com/Code/Java/Database-SQL-JDBC/TestOracleJDBCDriverInstallation.htm. You will need a password for the user/schema that you wish to connect to. If you don't have one, then talk to your DBA.
BTW, please remember that no production-type application and data should be used on the public APEX instance.
Maybe your problem is (or was) that you cannot connect via JDBC using the users you administered in your APEX workspace.
It seems to me that APEX users are not regular users for DB connections via JDBC. If my assumption is right, then you need to create database user with sufficient privileges to access the workspace tables.

How to create a database in Oracle using JDBC?

I want to create a new database on an Oracle server via JDBC. I cannot seem to connect to the database without providing an SID: using a URL like jdbc:oracle:thin:#//[IP]:1521 results in an error of "ORA-12504, TNS:listener was not given the SID in CONNECT_DATA"
Alternatively, if I log into a specific SID, I can run most DDL commands except for CREATE DATABASE foo which fails with an error of "ORA-01100: database already mounted"
How am I supposed to create a database if I cannot connect to the server without specifying a specific database and cannot create a database if I am already logged into a specific database?
AFAIK creating a database needs an internal and direct connection which can only be done by logging in directly on the server (normally a user account called 'oracle').
One reason for that: users are stored in the database itself. No database = no user to connect to by an external client.
Please also note Justin's comment about oracles database schemas. This is probably what you are looking for
What you need are following commands:
CREATE TABLESPACE CREATE USER and few GRANT ... TO ... -- to have rights to connect and create objects, at least

how to create a clean oracle database without excess tables in oracle 11g

why am i seeing these , ready made tables inside my newly created connection in my oracle 11g express, via oracle sql developer?,
what i did was, I just created a new connection, with username as system, and password as sasori....then when i clicked the "tables",
i saw alot of tables in it which i didn't created my self
AQ$_DEF$_AQERROR_F
AQ$_INTERNET_AGENTS
AQ$_INTERNET_AGENT_PRIVS
AQ$_QUEUE_TABLES
DEF$_DESTINATION
DEF$_PROPAGATOR
DEF$_PUSHED_TRANSACTIONS
LOGMNRC_DBNAME_UID_MAP
LOGMNRC_GSBA
and etc.etc...etc....
how can i create a new connection w/o those tables automatically created
A new database comes with a couple of standard users. This allows you to manage the database. One of the tasks is to create your own users.
First you create a connection as user system.
When you are connected as system, you can now create a new user.
Make a new connection using this new users credentials.

Resources