"Failed to Parse Access Policies for table" in vertica - vertica

I have renamed one column name cust_addr to customer_address from Customers table, using below query:
Alter table Customers rename column cust_addr to customer_address;
Now, when am trying to access the data from Customers table, am getting below error:
Select * from Customers;
[Code: 6482, SQL State: VX001] [Vertica][VJDBC](6482) ERROR: Failed to parse Access Policies for table "Customers" [Column "cust_addr" does not exist]
I have checked this cust_addr column is not present in Customers tables now. But still getting this error.
Can anyone please help me to resolve this.

Find the access policy that is not working now:
SELECT * FROM access_policy WHERE table_name='Customers' AND column_name='cust_addr';
Keep that information.
Then -
DROP ACCESS POLICY ON Customer FOR COLUMN cust_addr;
.. And create the new access policy for customer_address.

Related

Using oracle seq generator in Informatica Mapping [duplicate]

I use SQL developer and i made a connection to my database with the system user, after I created a user and made a another connection with that user with all needed privileges.
But when I try to proceed following I get the SQL Error
ORA-00942 table or view does not exist.:
INSERT INTO customer (c_id,name,surname) VALUES ('1','Micheal','Jackson')
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.
To reproduce the problem, execute the following SQL as user1:
create sequence seq_customer_id;
create table customer (
c_id number(10) default seq_customer_id.nextval primary key,
name varchar(100) not null,
surname varchar(100) not null
);
grant select, insert, update, delete on customer to user2;
Then, execute this insert statement as user2:
insert into user1.customer (name,surname) values ('michael','jackson');
The result will be "ORA-00942: table or view does not exist" even though user2 does have insert and select privileges on user1.customer table and is correctly prefixing the table with the schema owner name. To avoid the problem, you must grant select privilege on the sequence:
grant select on seq_customer_id to user2;
Either the user doesn't have privileges needed to see the table, the table doesn't exist or you are running the query in the wrong schema
Does the table exist?
select owner,
object_name
from dba_objects
where object_name = any ('CUSTOMER','customer');
What privileges did you grant?
grant select, insert on customer to user;
Are you running the query against the owner from the first query?
Case sensitive Tables (table names created with double-quotes) can throw this same error as well. See this answer for more information.
Simply wrap the table in double quotes:
INSERT INTO "customer" (c_id,name,surname) VALUES ('1','Micheal','Jackson')
You cannot directly access the table with the name 'customer'. Either it should be 'user1.customer' or create a synonym 'customer' for user2 pointing to 'user1.customer'. hope this helps..
Here is an answer: http://www.dba-oracle.com/concepts/synonyms.htm
An Oracle synonym basically allows you to create a pointer to an object that exists somewhere else. You need Oracle synonyms because when you are logged into Oracle, it looks for all objects you are querying in your schema (account). If they are not there, it will give you an error telling you that they do not exist.
I am using Oracle Database and i had same problem. Eventually i found ORACLE DB is converting all the metadata (table/sp/view/trigger) in upper case.
And i was trying how i wrote table name (myTempTable) in sql whereas it expect how it store table name in databsae (MYTEMPTABLE). Also same applicable on column name.
It is quite common problem with developer whoever used sql and now jumped into ORACLE DB.
in my case when i used asp.net core app i had a mistake in my sql query. If your database contains many schemas, you have to write schema_name before table_name, like:
Select * from SCHEMA_NAME.TABLE_NAME...
i hope it will helpful.

magento 404 on cms page in adminhtml in module cms->page

I have trouble when I click on Admin -> CMS -> Page and I get 404error. Maybe any body had this error early? How to debug router in magento? and i think this is community or local extensions.
I explain the error she code
in app/code/core/Mage/Adminhtml/Block/Cms/Page/Grid.php
$collection->setFirstStoreFlag(true);
when, application get first store for get all pages on the first.
after if first storage in table cms_page_store not exist in table core_store then I get error and 404 error not found.
How to fix I run two queries on my mysql server first delete all not exist store in table core_page_store by this query
delete from `cms_page_store` where `store_id` not in(
select `core_store`.`store_id` as `id` from `core_store`
);
and delete all page in not exist store from cms_page by this query:
delete from `cms_page` where `page_id` not in(
select `cms_page_store`.`page_id` as `id` from `cms_page_store`
);
and finish it's work, please if you read the answer you need create dump table cms_page_store and cms_page for repair the table if you make error.

Can we get "ORA-00942: table or view does not exist" error if the user is not able to log into the DB?

My application is giving the "ORA-00942: table or view does not exist" error when in prod environment. Locally it works just fine(when tested locally I am accessing staging DB). On checking the DB in prod I found tables to be there but we have still not populated the values.
To answer your question, no. You cannot receive an ORA-00942 if you are not even connected to the database.
To address your further comments it is probably a matter of properly identifying the table and schema it is in.
conn system/manager;
grant select on hr.employees to scott;
conn scott/scott;
select * from employees;
ORA-00942: table or view does not exist
select * from hr.employees;
<return data>
Alternatively you can create a synonym for the table in the scott schema:
create or replace synonym scott.employees for hr.employees;
This will allow the failed query to succeed as the scott schema has an object called employees in its scope.

How to create a temporary table in ORACLE with READ ONLY access

I am using CREATE GLOBAL TEMPORARY TABLE script to create a temporary table in the oracle DB but its showing SQL Error: ORA-01031: insufficient privileges. I Want to create a temp table with Read only access. Plz help me out in this.
What we are trying to achieve is:
We have to create a table in the destination database which is always GreenPlum.
In source database(Oracle) we are getting a select query from the USER for example: "select * from ABC A join DEF D on A.Col1=D.col1" then we are creating TEMP TABLE(In case of Oracle) on top of it for example "CREATE GLOBAL TEMPORARY TABLE table101 AS (select * from ABC A join DEF D on A.Col1=D.col1)".
Then using this TEMP table we get the required information from INFORMATION_SCHEMA for example "select * from ALL_TAB_COLUMNS where table_name='table101' ".By this we will get the column_name,data_type,character_maximum_length etc information. Using this information we can get "create table Statement" using Javascript .
Then we store this Create table statement in a variable & run it in Execute Row script(Step in pentaho data integration tool) which will create the Table in the destination DB.
Problem is that we have read only access in oracle. now what to do.
NOTE: In short, we are creating a table in the destination DB using the select statement from the source DB. Means structure of the table in Dest DB depends on the select query in Source DB.
If the target database is also an oracle database then you should be able to set up a database link there to the source database and use a "CREATE TABLE AS SELECT * FROM +source table+#+database link+;"
Whoops, I just noticed that this is from 2014. Oh well, maybe it well help future inquirers.

Oracle Create Table without Insert permission

Is it possible in oracle dbms for a user to have the permission to create a table but not have the permission to insert in it although the same user just created it?
Thank you in advance!
Short answer:
No, it's not.
Longer answer:
You can do pretty much anything you want. If you want to restrict insert access the usual method would be to create the table in a different schema. Assuming you have a table emp in the schema hr, which you wanted to access from the schema 'users`:
You would grant users permission to SELECT from the table emp when connected as hr:
grant select on emp to users
or, if you also want users to be able to UPDATE emp:
grant select, update on emp to users
Lastly, when connected as users, you prefix the table name with the schema it is located in:
select * from hr.emps
You can now select from the table but not insert into it.

Resources