How to create a private temporary table in Oracle 19? - oracle19c

I am running Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production in a Docker container.
I created a user with CREATE SESSION and CREATE TABLE system privileges. User also has QUOTA UNLIMITED.
CREATE USER airflow IDENTIFIED BY pass;
GRANT CREATE SESSION TO airflow;
GRANT CREATE TABLE TO airflow;
ALTER USER airflow QUOTA UNLIMITED ON USERS;
With that user I attempted to create a private temporary table with the following query:
CREATE PRIVATE TEMPORARY TABLE ora$ppt_temp1 (
name varchar2(7),
age int,
employed int
) ON COMMIT PRESERVE DEFINITION;
I am accessing the database on Python 3.9.13 using SQLAlchemy 1.3.24.
I get the following error:
sqlalchemy.exc.DatabaseError: (cx_Oracle.DatabaseError) ORA-00903: invalid table name
I also get ORA-00903 when running the query from DBeaver. I have checked the private_temp_table_prefix and it is set to the default value of ORA$PTT_. I have read through the Oracle 19c documentation and several stack overflow questions and cannot see what I am missing here.
I suspect that there is some privilege I need to add or modify to make this work.

As stated this was a typo in the table name.

Related

how do I drop a Table and recreate it via informatica Pre sql?

We are Trying to Drop and recreate a table via Informatica Mapping using the Pre_Sql option. Informatica throws an Insufficient privilege error even though we have granted privileges to the Informatica user, is it possible to drop and create a table Via pre SQL or is there any other method to accomplish this issue.

Django and Elasticbeanstalk: a column that has been deleted on local hasn't been deleted on RDS

I deployed my project into eb and a form submission doesn't work on eb even though it works on local. And I found the cause.
One of the attribute of a model that is not allowed to be null still remains on RDS even though I removed it in the past.
Log error is like this
ERROR: null value in column "a_variable" violates not-null constraint
How can I handle with this problem? Is there a way to remove the column manually on RDS? I am using PostgreSQL as the db engine.
Your RDS database is just a normal PostgreSQL database. If you really need to access it directly, you can:
Create a security group to open up the PostgreSQL port (5432 with TCP) to your current IP address.
Add the security group to your RDS instance (temporarily, don't forget to remove it later)
Use psql on your local machine to connect to your RDS instance, with your django credentials.
Run the normal SQL command (ALTER TABLE table_name DROP COLUMN column_name;) to delete the column. Be careful! you're directly manipulating your database.
To be sure I would check the django-migrations table to see if all migrations were run correctly. you might run into problems with later migrations if that isn't the case.

AWS SCT error while connecting to Teradata

I am trying to connect AWS SCT to Teradata to migrate some tables to Redshift. However, while connecting to Teradata, I am getting the error which says -
"The specified account does not have sufficient privileges for working with the following object(s) :
Database 'DBC' : [SELECT]
Here is the snapshot of the error (Removed some connection details) :
What permissions should I request from the Teradata Admin to provide to the user so that I am able to access my required DB.
User connecting to Teradata should have SELECT access on DBC to pull object metadata to be converted into Redshift DDL
Following the docs, you'll need these permissions:
SELECT ON DBC
SELECT ON SYSUDTLIB
SELECT ON SYSLIB
SELECT ON <source_database>
CREATE PROCEDURE ON <source_database>
In the preceding example, replace the <source_database> placeholder with the name of the source database.

ERROR - The instance of SQL Server you attempted to connect to does not support CTAIP

I have created a new Azure SQL Data Warehouse database on a new logical server from the backup of a Azure SQL Data Warehouse database on a different logical server (using the Azure portal). I created the LOGINs on the new MASTER database for the users that would connect to the new Azure SQL Data Warehouse database. The users were restored to the new Azure SQL Data Warehouse database as expected per:
SYS.DATABASE_PRINCIPALS
Now when I attempt to connect with those users, I receive an error:
Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : The instance of SQL Server you attempted to connect to does not support CTAIP..
We use sql-server authentication, running the following on both the original and new MASTER:
CREATE LOGIN
the_userID
with password = 'xxxxxxxxxxxxxxxxx'
;
GO
and the following pattern on the original ADW database:
CREATE USER [the_userID] FROM LOGIN [the_userID]
;
GO
Is there any solution other than dropping and reCREATEing the users in the new ADW database?
CTAIP error is a rather poorly worded error message indicating the login (in master) does not have a corresponding user in the DW.
In this case, you need to drop the existing user in the DW and re-create it for the login in master.
It doesn’t work automagically (yet) because we track the association using security identifiers (SID) not names and the new login in master has a new/unique SID. AAD logins and contained users (not currently supported in DW) don’t have this problem.

Conditionally drop temporary table in Redshift

We are using http://aws.amazon.com/redshift/ and I am creating/dropping temporary tables in reports. Occasionally we encounter cases where someone has created a temporary table and failed to drop it.
In other databases, for instance PostgreSQL which Redshift is based on, I could simply:
DROP TEMP TABLE IF EXISTS tblfoo;
But that is a syntax error in Redshift. I can check for the existence of temporary tables myself using http://docs.aws.amazon.com/redshift/latest/dg/r_STV_TBL_PERM.html but that only works if I am a superuser and I am not running as a superuser. I could also go and swallow exceptions, but with my reporting framework I'd prefer not to go there.
So how can I, as a regular user and without generating database errors, conditionally drop a temporary table if it exists?
The test I ran showed that I could see other users' temp tables in stv_tbl_perm using a non-super user id. The cluster version I tested in is 1.0.797. Note that no users can see other users' temp tables in pg_class.