Sign Up to our social questions and Answers to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers to ask questions, answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This category lists all questions related to Oracle SQL database
Oracle SQL Query to Find User Permissions
To check current user permission in oracle execute the following queries: First Query: SELECT * FROM USER_SYS_PRIVS WHERE USERNAME = USER; The result of this query would be: USERNAME PRIVILEGE ADMIN_OPTION HR CREATE VIEW NO HR UNLIMITED TABLESPACE NO HR CREATE DATABASE LINK NO HR CREATE SEQUENCE NORead more
To check current user permission in oracle execute the following queries:
First Query:
The result of this query would be:
Second Query:
Third Query:
hope this help.
See lessORA-01427: single-row subquery returns more than one row
Hello Garcia, The message of the ORA error is so descriptive it's pointing the query that causing the issue and the issue it self which is nothing but the sub query returned more than one row and this is not correct specially that you are using "=" operator not logical operator like "IN" or "NOT IN"Read more
Hello Garcia,
The message of the ORA error is so descriptive it’s pointing the query that causing the issue and the issue it self which is nothing but the sub query returned more than one row and this is not correct specially that you are using “=” operator not logical operator like “IN” or “NOT IN”. It’s up to your requirement.
See lessORA-01017 invalid username password logon denied
Please make sure of the credentials, because this error is quite clear enough that either the username or password is incorrect. Note : In Oracle 11g the credentials are CASE sensitive it's a default feature of newly oracle 11g database creation. Now if you want to make sure whether this feature isRead more
Please make sure of the credentials, because this error is quite clear enough that either the username or password is incorrect.
Note : In Oracle 11g the credentials are CASE sensitive it’s a default feature of newly oracle 11g database creation.
Now if you want to make sure whether this feature is enabled or not you can go to sqlplus then execute the following SQL command.
if you get ” TRUE ” value then the the password is case sensitive otherwise it isn’t.
you can also disable this feature by executing the following SQL command :
See lessORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
ORA-00054 referring to the table you are trying to update it is already locked by another session that made a query for an update on the same table and not committed or rolled back yet. It could be a form or another session. The action you could take to solve the problem is to commit or roll back thRead more
ORA-00054 referring to the table you are trying to update it is already locked by another session that made a query for an update on the same table and not committed or rolled back yet. It could be a form or another session.
The action you could take to solve the problem is to commit or roll back the changes from the other session, causing the lock before performing the current action. There is a query also to help you identify which session that causing the lock on your table so that you can kill the session immediately.
Above query has been taken from oracle-base then from the output of above query you can use SID and SERIAL# to kill the session by executing the following statement.
See lessWhich one do better performance NOT IN vs NOT EXISTS ?
Hi @Maran Firstly It’s not about the difference in performance only because they are not the same when dealing with nulls in the data. for example, we want to check how many employees are not managers of other employees by using NOT IN SELECT COUNT (*) FROM EMPLOYEES WHERE EMPLOYEE_ID NOT IN (SELECTRead more
Hi Maran Firstly
It’s not about the difference in performance only because they are not the same when dealing with nulls in the data.
for example, we want to check how many employees are not managers of other employees by using NOT IN
the result will be :
This means all employees are managers in this case.
let’s then take the same example but using NOT EXISTS
the result will be :
So here, out of 101 employees, there are 89, not managers.
The most crucial thing is NULL represented in the manager_id column for the first employee 101 (Steven King). So wherever null is there while using NOT IN or IN, the evaluation of the inner query will be either FALSE or NULL and will return no records.
So now, when it comes to performance, it depends on the amount of data that both subquery and the outer query returns. If they are small, then IN is typically more appropriate. And vise versa. But remember, we have assumed that there are no nulls in the subquery result.
Regards
See lessHow to select a random row in SQL& MySQL?
Hi Sam I don't know what the case you need this to, but anyway you can use the following query to get random row from employees table as an example. 1- Oracle : SELECT * FROM (SELECT * FROM EMPLOYEES ORDER BY DBMS_RANDOM.VALUE) WHERE ROWNUM = 1 2- MySQL : SELECT column FROM table ORDER BY RAND() LIMRead more
Hi Sam
I don’t know what the case you need this to, but anyway you can use the following query to get random row from employees table as an example. 1- Oracle :
2- MySQL :
The idea here in both examples is to get all rows in employees table but in random orders then using ROWNUM in Oracle and LIMIT clause in MySQL to return one row from them.
See lessHow to grant read and write on directory in oracle ?
To give a particular user permission on oracle directory we can use the following commands: — Grant read permission to oraask user GRANT READ on DIRECTORY &directory_name to oraask; — Grant write permission to oraask user GRANT WRITE on DIRECTORY &directory_name to oraask; — Grant read/writeRead more
To give a particular user permission on oracle directory we can use the following commands:
— Grant read permission to oraask user
— Grant write permission to oraask user
— Grant read/write permissions to oraask user at one command
Hope this helpful.
ORA-29275 partial multibyte character
Hello Rain , Oracle Descritption for this error is given below: ORA-29275: partial multibyte character Cause: The requested read operation could not complete because a partial multibyte character was found at the end of the input. Action: Ensure that the complete multibyte character is sent from theRead more
Hello Rain ,
Oracle Descritption for this error is given below:
ORA-29275:
partial multibyte character
Cause: The requested read operation could not complete because a partial multibyte character was found at the end of the input.
Action: Ensure that the complete multibyte character is sent from the remote server and retry the operation. Or read the partial multibyte character as RAW.
Mainly reason for this type or ora error is that there is a junk/invisible or special character available ,but unfortunately the cause and action that oracle give it to us is not that much descriptive, so to investigate more and figure out the problem and fix it let’s try this:
First try to select columns individually like below example:
until reach to the column that causing your problem and raise this ORA error.
so far so good for now that we identified the column that has junk/invisible character we can fetch the column data and overcome this issue by using CONVERT function in oracle like below example :
Hope that this answer was helpful.
See lessUsing between on sysdate instead of TRUNC
Use TO_DATE Function. SELECT sum(column3) from table1 where column1 = ‘XXXXXAA12’ and column2 between to_date (<yor val>,<your format>) and to_date (<yor val>,<your format>);
Use TO_DATE Function.
SELECT sum(column3)
See lessfrom table1
where column1 = ‘XXXXXAA12’
and column2 between to_date (<yor val>,<your format>) and to_date (<yor val>,<your format>);
How to order by number inside of character for a query like ’25 AB’ ,’30 MT’ ?
Use REGEXP_SUBSTR Syntax : REGEXP_SUBSTR( string, pattern [, start_position [, nth_appearance [, match_parameter [, sub_expression ] ] ] ] ) code : SELECT t.*, REGEXP_SUBSTR (COL1, '(d+)') as sort_by_col FROM test_table t Order by sort_by_col ; Result : application2 25 AB 30 AB 3125 50 50000 AS740TRead more
Use REGEXP_SUBSTR
See less