Amazom Redshift View deleted automatically - view

CREATE OR REPLACE VIEW viewname AS select from
tablename;
I have created a View in database i is automatically deleted some time interval.
Tried many times same issue occured.
any possibilities to resolve this issue?
Advance thanks

Related

Creating Hive View - Turn off metadata lookup from Hive Metastore

Is it possible to create a hive view on top of a nonexistent hive table or views?. This ability will help us deploy the hive DDL without any order at the time of refresh (migrating tables or views from one environment to another). In our environment, we have views built on top of another view. If we deploy them in any order, with the default setup some of the views may fail saying the underlying table/view doesn't exist. Looking to see if we can turn off the metadata lookup from hive metastore so that the type checks are not done at the time of view creation. It can be enforced after the deployment or at the time of querying the view for data retrieval because by that time all the views/tables will be completely deployed and there won't be any type checking related errors.
I checked on the internet for pointers but I couldn't find any. Any suggestions in this regard will be helpful to us.
Thanks in advance.
Add IF NOT EXISTS to all create statements and run all several times until errors disappear.
If executed 2 times in the wrong order like this, second run will succeed without any error:
drop view if exists my_view;
create view if not exists my_view as select from table1; --fails first time, succeeds on second run
drop table if exists table1;
create table if not exists table1(id int);

Oracle Apex ORA-00942: table or view does not exist but it does exist

I worked on an App using my personal workspace. Exported the same and later installed it on a Developer Team workspace.
Several of my pages are getting the ORA-00942: table or view does not exist while running, which doesn't make sense since the tables do exist (I tested this using the 'SQL Commands' option).
Funny thing is that the same code I'm using is actually applied on a different app within the same workspace and it runs perfectly.
Is this normal behavior? Might be due to workspace's configuration?
Thanks!
It could be a "permissions" issue:
http://www.dba-oracle.com/sf_ora_00942_table_or_view_does_not_exist.htm
Answer: There are several common operations that cause a ORA-00942
error:
Table owner name not specified when logged-in as a non-creator of the table.
ORA-00942 on table import (imp or impdp).
ORA-00942 on materialized view refresh.
...
This ORA-00942 error on insert is common when the user you are
signed-on as does not have permission to see the table!
Either make the table public and grant DML privileges:
connect myuser/mypass
create public synonym testtable for myuser.testtable
grant insert, select, update, delete on mytable to public;
Also, review the various replies to this thread. For example:
https://stackoverflow.com/a/36165446/421195
Because this post is the top one found on stackoverflow when searching
for "ORA-00942: table or view does not exist insert", I want to
mention another possible cause of this error (at least in Oracle 12c):
a table uses a sequence to set a default value and the user executing
the insert query does not have select privilege on the sequence. This
was my problem and it took me an unnecessarily long time to figure it
out.
First thing I would check is the parsing schema for the application - see Shared Components -> Security Attributes.
If this is not the same between the two instances of your application, that's the likely explanation.

mlog$_ objects without mviews after dmbs_redefinition

I'm not a DBA, but let's hope I'll be able to describe our current Problem.
We have a rather large partitioned table that we reorganize regularly via dbms_redefinition.start_redef_table(..) etc. . We had collision with other stuff going on in our database, so this has failed a few times in the past. But it hasn't failed in the last few month. Since the last failure we have reorganized each of the partitions, so the table and all partitions are in a healthy state. We are not experiencing any performance issues due to possible mview updates.
Apparently after one of those failures some mlog$_xxx and rupd$_xxx objects started showing up. Today we have over 100 mlog$_xxx objects and over 30 rupd$_xxx objects. And it keeps getting more. This worries me.
Following did not work: drop materialized view log on xxx;
stating me
ORA-12002 that there is no materialized view log on xxx.
when I do: select * from dba_mviews; ... then I get no results
I'm confused now. I have a table and I have mview logs, but I have no mview in between.
We made a database copy to a test machine and I was able to drop the table. But the mlog$_xxx objects were still there.
Can somebody help me on how to clean up this mess?
we contacted Oracle Support and they suggested to delete obj$ and sum$ entries. It worked. Don't try this at home!!!

How to (un)mark an Oracle table read-only for the owner?

In my Oracle instance I have a table. It existed just fine for many years without problems, I run thousands of queries per day on it (through my software), mostly selects and inserts, with rare (once-a-week) updates.
Today, a week after the last update, I ran an update against it and it failed with an ORA-00942: table or view does not exist.
I am the owner of that table. I'm pretty sure that database didn't change much during the week, certainly not this table.
I can select from it just fine: select * from table_x, but updates and inserts fail: insert into table_x select * from table_x where 1 = 0 with the weird ORA-00942.
Since I'm the owner, the usual visibility and privilege problems don't seem to apply, and googling, sadly, doesn't help. I'm sure I'm missing something really simple, so any suggestions are very welcome.
How did I make an Oracle table read-only (or invisible) for myself (the owner)?
It's partitioned (not sure if that helps). It's about 50GB in size, half of that indexes (not sure if that helps either).
EDIT: Here's a screenshot of the sample statement from PL/SQL Developer:
Once I ran the same situation, according to the trace file and little googling which referenced to Materialized View Log which is associated with master table.
Use the following command to drop the materialized view log
DROP MATERIALIZED VIEW LOG ON <table_x>

How to put logon username trigger?

can anyone help me with this one!
I would like to have a trigger in Oracle, which finds out the user's Windows logon name.
The user name should be added in to table "Product" (column "username"), after insertion of other data in the table "Product".
Thanks in advance for any help you are able to provide.
How to make one trigger that operates on all tables? Otherwise, I got a lot of triggers in the database.In SQL Developer can be selected only one table. I wish one trigger that takes username information and add's it to that table I insert data at that moment.

Resources