Archive for the ‘Oracle’ Category

How To Upload Excel/Text File Data Into Oracle Table Using TOAD

February 27th, 2017, posted in Oracle
FacebookTwitterGoogle+Share

n this we will explain how to put Excel or text file data into an Oracle table. You can do this easily in SQL Server with a Copy (Ctrl+C) of the data from Excel then open the target table into edit mode and Paste (Ctrl+V). Done.

But this will not work in Oracle.

In an Oracle database you can do it using the import command. I will show you each and every step with snapshots.

Step 1 : Open TOAD.

Step 2 : Write the following query to create a test table:

  1. Create table TESTTABLE
  2. (
  3. NAME varchar2(20),
  4. Address varchar2(100),
  5. RollNo integer
  6. )

Step 3 : Now my table is ready. It’s time to create the data in an Excel file.

Step 4 : Go to Database -> Import -> Table Data.

Step 5 : Select the table you want to import the Excel data to.

Step 6 : Click on show data. Now execute the data button to enable the use. Click on that.

Step 7 : After clicking on Execute Wizard the following screen will open:

Next ->

Step 8 : Now, browse to your Excel file – > Next ->

Next ->

Step 9 : Choose the sheet and click on AutoMap. The AutoMap button will automatically bind your Excel sheet column data with the Oracle table column.

Next ->

Next ->

Here your Excel data has been bound with the table columns. Next ->

Step 10 : Click on Execute to finish the process. It may ask for sheet selection. Click on Okay with the desired sheet.

Here is your uploaded data:

Step 11 : Commit the Task by clicking on the commit button.

Using the preceding procedure you can easily import Excel data. You can also import text flat files data. All steps are nearly the same. The only change is the following step. In this import I need to choose the separator for the flat file. Apart from any separators you can use fixed width. In the attached example I used a comma separator.

I think the procedure is very clear with snapshots. If you have found any mistake in concept, please do comment.

Your comments will make me perfect in the future.

Thanks for reading.

 

FacebookTwitterGoogle+Share

Refresh Materialized View

February 16th, 2017, posted in Oracle
FacebookTwitterGoogle+Share

Problem sys@standby> startup mount; ORACLE instance started. Total System Global Area 835104768 bytes Fixed Size 2217952 bytes Variable Size 490735648 bytes Database Buffers 335544320 bytes Redo Buffers 6606848 bytes Database mounted. sys@standby> alter database recover managed standby database using current logfile disconnect; alter database recover managed standby database using current logfile disconnect * ERROR at line 1: ORA-01153: an incompatible media recovery is active Cause This indicates a currently running media recovery process. Action sys@standby> alter database recover managed standby database cancel; sys@standby> alter database recover managed standby database using current logfile disconnect; Note When shutting down physical standby database, firstly turn off media recovery process. Otherwise the next time when starting up redo apply again, you will encounter error ORA-01153.

Refresh Materialized View

NAME: Refresh Materialized View
SHORT CODE: OZFEARNMV
MODULE: Oracle Trade Management

Description: Refresh Materialized Views for Promotional Payments and Indirect Inventorty Tracking
Navigation: Oracle Trade Management Responsibility -> View -> Requests -> Submit a new request -> Select Single Request -> Click ‘OK’ -> Select Name of concurrent program / report.

Report Parameters:

  • mv_name : Name of the Materialized View
FacebookTwitterGoogle+Share

ORA-0131 Insufficient privileges

December 11th, 2016, posted in Oracle
FacebookTwitterGoogle+Share

ORA-0131: Insufficient privileges,ORA-0131,Insufficient privileges,ORA 0131,ORA Error, Insufficient, privileges,DEBUG CONNECT SESSION,system privilege,Debugging requires the DEBUG CONNECT,ORA Debugging,ORA Debugging,ORA Debugging requires,Oracle APPS DBA,ORACLE DBA,ORACLE DB,
Title :
Getting “ORA-01031: insufficient privileges” error when trying to Debug.

Description :
When trying to debug a procedure, package, etc., the following error messages are received:

ORA-01031: insufficient privileges

Cause :
The Oracle user or schema account does not have the required Oracle rights to debug an object.

Resolution :
Ensure the User or Schema has all the required Oracle privileges granted for debugging objects on that database.

1. connect as sysdba
2. exec the sql:
 grant debug connect session to XXXXXX;

or
grant DEBUG ANY PROCEDURE to XXXXXX;;

FacebookTwitterGoogle+Share

Check Number Of Oracle Users With Different Queries

June 17th, 2016, posted in Oracle
FacebookTwitterGoogle+Share

Query # 1 :

desc v$license
Name Null? Type
----------------------------------------- -------- ----------------
SESSIONS_MAX NUMBER
SESSIONS_WARNING NUMBER
SESSIONS_CURRENT NUMBER
SESSIONS_HIGHWATER NUMBER
USERS_MAX NUMBER
CPU_COUNT_CURRENT NUMBER
CPU_CORE_COUNT_CURRENT NUMBER
CPU_SOCKET_COUNT_CURRENT NUMBER
CPU_COUNT_HIGHWATER NUMBER
CPU_CORE_COUNT_HIGHWATER NUMBER
CPU_SOCKET_COUNT_HIGHWATER NUMBER

 

Query # 2 :

select sessions_current from v$license;

 

Query # 3 :

select SESSIONS_CURRENT,SESSIONS_HIGHWATER,CPU_COUNT_CURRENT,CPU_COUNT_HIGHWATER from v$license;

 

Query # 4 :

SELECT USERNAME FROM DBA_USERS

 

Query # 5 :

SELECT distinct user_id from FND_LOGINS

 

Query # 6 :

SELECT distinct user_id from icx_sessions

 

Query # 7 :

SELECT distinct user_id from FND_USER

 

Query #8:


select application_name,responsibility_name,
security_group_name, user_name,
greatest(u.start_date, ur.start_date, r.start_date) start_date,
least(nvl(u.end_date, nvl(ur.end_date, r.end_date)),
nvl(ur.end_date, nvl(u.end_date, r.end_date)),
nvl(r.end_date, nvl(u.end_date, ur.end_date))) end_date
from fnd_user u,fnd_user_resp_groups ur,
fnd_responsibility_vl r,fnd_application_vl a, 
fnd_security_groups_vl s
where a.application_id = r.application_id
and u.user_id = ur.user_id
and r.application_id = ur.responsibility_application_id
and r.responsibility_id = ur.responsibility_id
and ur.start_date  sysdate
and u.start_date  sysdate
and r.start_date  sysdate
and ur.security_group_id = s.security_group_id
order by application_name,responsibility_name,security_group_name, user_name

 

Query # 9 :


select application_name,responsibility_name,
security_group_name, user_name,
greatest(u.start_date, ur.start_date, r.start_date) start_date,
least(nvl(u.end_date, nvl(ur.end_date, r.end_date)),
nvl(ur.end_date, nvl(u.end_date, r.end_date)),
nvl(r.end_date, nvl(u.end_date, ur.end_date))) end_date
from fnd_user u,fnd_user_resp_groups ur,
fnd_responsibility_vl r,fnd_application_vl a, 
fnd_security_groups_vl s
where a.application_id = r.application_id
and u.user_id = ur.user_id
and r.application_id = ur.responsibility_application_id
and r.responsibility_id = ur.responsibility_id
and ur.start_date  sysdate
and u.start_date  sysdate
and r.start_date  sysdate
and ur.security_group_id = s.security_group_id
order by application_name,responsibility_name,security_group_name, user_name

 

FacebookTwitterGoogle+Share