I have logged in as system and have created a user by name DEMO.
There is another connection Myconnection. Under Myconnection there is a table
Dept; I am still connected to database with SYSTEM connection.
Now when I execute the query
GRANT select
ON DEPT
TO demo it says table does not exist. How to fix this?!!
Related
I am a beginner to ireports.I want to create an ireport with oracle 11g using the default tables present in xe. I used EMP table from xe and it showed error ORA-00942 table or view does not exist when i run the query select * from EMP.
Please help!!!
Generally speaking, you should connect to user that contains tables you'd like to use in the report you're creating. So, if it is EMP table and it belongs to Scott, connect as Scott.
By default, its username/password combination is scott/tiger (all lower case). There's a chance that it (user) is locked. If so, connect to the database via SQL*Plus or SQL Developer or any other tool you use (as a privileged user, such as SYS or SYSTEM if there's no other you have - I presume you don't) and do the following:
alter user scott account unlock;
alter user scott identified by tiger;
After that, establish connection to Scott in iReport (providing previously mentioned credentials) and you should be able to query the EMP table.
I am new to oracle. I have created the user axsaum in DB and logged in as the same user. When I try to access
select * from user_tables or dba_tables
its throwing error as table not exist
Please suggest me why i dont have privilege to access default tables?
how to access those?
SQL> select * from user_tables;
* ERROR at line 1: ORA-00942: table or view does not exist
SQL> select * from dba_tables;
* ERROR at line 1: ORA-00942: table or view does not exist
I think you need to give previliages to newly created user
you can use grant for giving permission to user
once permission given you can see tables as well as can perfrom DML and DDL on DB
for gratting previliages
for all permissions you can use
GRANT DBA TO axsaum ;
For other permissions you use below
GRANT CONNECT TO axsaum ;
GRANT SELECT ANY TABLE to axsaum
is a system privilege grant that allows user to select from any Table or View.
GRANT SELECT on some_table to axsaum
is an object privilege grant that allows user to select from Table.
GRANT SELECT, UPDATE ON some_table TO axsaum;
This code works perfectly in R-Studio but there is no way to make it work in MS Management studio. It keeps on saying that:
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'myserver\LOCAL01'.
That is not my user give it is a trusted connection. Can someone help me understand it?
ALTER PROCEDURE [dbo].[TESTIM] AS
BEGIN
SET LANGUAGE ENGLISH
CHECKPOINTÂ
DBCCÂ DROPCLEANBUFFERS
EXEC sp_execute_external_script
#language = N'R'
, #script = N'
con <- "Server=myserver\\LOCAL;Database=mydb;Trusted_Connection=true";
sql <- RxInSqlServer(connectionString = con, shareDir = "c:\\TMP");
local <- RxLocalSeq(sql);
rxSetComputeContext(local)
ff <- RxSqlServerData(sqlQuery = "select top 1 * from mytable", connectionString = con);
t = rxImport(ff);
OutputDataSet <- data.frame(SUCCESS = TRUE);
'
WITH RESULT SETS (([SUCCESS] BIT))
END
So, when you execute sp_execute_external_script it executes under one of 20 Windows user accounts (worker accounts) that has been created during installation of SQL Server R Services. These accounts are created for the purpose of running tasks under a security token belonging to the SQL Server Trusted Launchpad service.
This works very well, but if you need to create a SQL connection inside your R script (as in your case) and you use trusted connection (Windows Authentication), you are executing under the user account mentioned above ('myserver\LOCAL01' in your case), and that account need to be given permission to log in to the SQL Server instance on your behalf.
To do this:
In SQL Server Management Studio, in Object Explorer, expand Security, right-click Logins, and select New Login.
In the Login - New dialog box, click Search.
Click Object Types and select Groups. Deselect everything else.
In Enter the object name to select, type SQLRUserGroup and click Check Names.
The name of the local group associated with the instance's Launchpad service should resolve to something like instancename\SQLRUserGroup. Click OK.
By default, the login is assigned to the public role and has permission to connect to the database engine.
Click OK.
That should do it (the above steps are copied from here.
If you want to read more about the user accounts you can have a look at my blog-post "Microsoft SQL Server R Services - Internals III".
Hope this helps!
Niels
I want to access a system table from within my ASP.Net application. Currently the application connects to the database StudentPortal with a user account of: WebAppClient.
When I try to run the following query logged in as WebAppClient I get the error:
The user does not have permission to perform this action.`
How can I grant access so that my user account can query that system table?
This is my full query:
SELECT TOP 1
100 - r.SystemIdle AS CPU
FROM (
SELECT
rx.record.value('(./Record/#id)[1]', 'int') AS record_id,
rx.record.value('(./Record/SchedulerMonitorEvent/SystemHealth/SystemIdle)[1]', 'int') AS SystemIdle
FROM (
SELECT CONVERT(XML, record) AS record
FROM sys.dm_os_ring_buffers
WHERE
ring_buffer_type = N'RING_BUFFER_SCHEDULER_MONITOR' AND
record LIKE '%<SystemHealth>%') AS rx
) AS r
ORDER BY r.record_id DESC
The user must be granted the "View Server State" permissions to view sys DMVs.
Here is the MS KB article.
Actual Satement: GRANT View Server STATE TO <user>
All the time when I'm trying login myself to sqlplus I log on to SQL> but I don`t know what I have to do to got Main user account for example [oracle#host01~] ?
The SQL> prompt is the default in SQLPlus. You can change it on the commnadline, once logged in, to a custom string. try:
set sqlprompt "_USER'#'_CONNECT_IDENTIFIER > "
to show your user and the DB you are connected to.
from this page, we can see the following default keywords that you can use:
_CONNECT_IDENTIFIER Connection identifier used to make connection, where available.
_DATE Current date, or a user defined fixed string.
_EDITOR Specifies the editor used by the EDIT command.
_O_RELEASE Full release number of the installed Oracle Database.
_O_VERSION Current version of the installed Oracle Database.
_PRIVILEGE Privilege level of the current connection.
_SQLPLUS_RELEASE Full release number of installed SQL*Plus component.
_USER User name used to make connection.