Synonyms in sqlloader
Hi,
I am new to Oracle development.
Can we use SYNONYMS instead of tables in sqlloader ctl file?
I just want to know (if there is any) other than tables that we can use to import data with sqlloader.
Thanks.
Hello,
Yes you can use SYNONYM but it must specify a local Table only. Else, you'll have the following error:
Error: LDR 606
Text: Object %s in INTO TABLE clause is not a local table
Cause: The synonym specified in the INTO TABLE clause in the SQL*Loader
control file specifies a remote object via a database link. Only a
synonym for an existing local table can be specified in the INTO TABLE
clause.
Action: Ensure that a local table name or a synonym for a local table is fully
specified in the INTO TABLE clause. The table must already exist.Hope this help.
Best regards,
Jean-Valentin
Similar Messages
-
Updating a table from two nodes simultaneously using sqlloader- Issues..
Hi,
I have a two node RAC. I have a table called PARTS1, has an PK+Index on PART column, Again this has a sequence. Now I am loading data on PARTS1 table using sqlloader from both nodes at the same time. What issues will come?
Since one column of this table has a PK+Sequence+Index, there will be a contention issue with the block while updating records.. am I right? What other isues might appear here?
Thanks in advance,
Lily.user7993571 wrote:
Consider two databases
db10gA and db10gB which is having a db link from A to B
There is a user A in db10gA
and another user B in db10gB
the user require to insert,update,delete records of user B tables
so how is the DML privileges are granted to user A to perform these tasks at db10gB database
whether it is the type of db link decides to do these tasks
whether any synonym created at db10gA side might help to do the jobUser A will act on behalf of the user who has created the DBLINK; for example if you have created the DBLINK with a user having a DBA role; and grant the DBLINK access to A, A can act on behalf of the DBA who has created the DBLINK. -
Hi Guys,
I4m trying to use a SQLLOADER in a table. This user that m need to use is not owner of this table.
I don4t know what grants this user need to use SQLLOADER.
Thanks for allU need to have been granted insert priv on the table in question. You may have to create a private synonym in your local schema for the table, so that you may not need to prefix the tablename with owner name. that is scott.emp.
I hope this helps.
Timothy -
AWM: Can not see the synonyms in the mappings pane
Hi, using the AWM 11.2.0.1.0A, in the mappings pane under the item Synonyms does not appear any synonyms although there are some of them (private synonyms) in the user's scheme.
Any hint?
Thanks.I just tried this in 11.2.0.1 and the synonym showed up in AWM. I ran the following (in the sample GLOBAL schema)
create synonym prod_table for product_dim;
Note that product_dim is a table in the GLOBAL schema, and I ran the above statement as GLOBAL.
I then attached AWM as GLOBAL and saw prod_table show up in the synonyms folder of the mappings pane. What are you doing that is different from this? -
How can I access a database remote without using dblink, synonyms,aliases?
My store procedure access a remote tables using dblink, synonyms, alias, but by business company requirenments I nedd to use another data base access method. My PL/SQL statement looks like
select c.cus_id, c.cus_name, p.bankaccno
into v_cus_id, v_cus_name, v_bankaccno
from customer c, payment@finantial p
where c.cus_id = p.cus_id
Are any method else to connect to several remote databases concurrently?
If Yes, plase say me how is it, or tell me where do I obtain some examples, or any documentation.
Edited by: user518321 on Apr 21, 2009 1:58 PM
Ok, But I must not use any of these data base access method, metioned: dbliks, aliases, synonyms.
Edited by: user518321 on Apr 21, 2009 2:05 PM
Ok, It is enough for now, I am surprised for the response time and for their arguments, thanks a lot.
Edited by: user518321 on Apr 21, 2009 2:50 PMIf you want to access a table in a remote database using SQL, you will need a database link. It would be exceptionally odd for the business to require that you access a remote database and to prohibit the use of database links. What is the business reason for that combination?
If you want to look into rather more esoteric solutions, you could load a JDBC driver for the remote database, write a Java stored procedure that queries the remote table using that JDBC driver, and then cobble together some PL/SQL that joins the two result sets. You won't be able to reference the remote table in SQL and the solution won't scale well as data volumes increase and you'll be writing a whole lot of code to manually join tables together, but it does avoid database links. Of course, whatever concerns lead to the ban on database links would probably apply to loading a JDBC driver into the database and writing Java stored procedures to access the remote database, but since you haven't explained the reasoning behind the restrictions, we're just guessing.
Justin -
Migrating from SQL to ORACLE 11g : naming length Issue using synonyms...
Hi,
In sql I have maximum length of objects is 98 char
now i m migrating it into oracle , i m using synonyms for it ..
it is showing synonyms created ...
but it gets converted into encrypted forms,
due to this i m not able to use actual synonyms that i have created
so tell me how can i create synonyms of more than 30 characters
If this is not possible , then wht else solution by which i can solve ma problem.
please give me solution asap!!!!!!!Create synonym name with more than 30 character.
-
How to load date and time from text file to oracle table through sqlloader
hi friends
i need you to show me what i miss to load date and time from text file to oracle table through sqlloader
this is my data in this path (c:\external\my_data.txt)
7369,SMITH,17-NOV-81,09:14:04,CLERK,20
7499,ALLEN,01-MAY-81,17:06:08,SALESMAN,30
7521,WARD,09-JUN-81,17:06:30,SALESMAN,30
7566,JONES,02-APR-81,09:24:10,MANAGER,20
7654,MARTIN,28-SEP-81,17:24:10,SALESMAN,30my table in database emp2
create table emp2 (empno number,
ename varchar2(20),
hiredate date,
etime date,
ejob varchar2(20),
deptno number);the control file code in this path (c:\external\ctrl.ctl)
load data
infile 'C:\external\my_data.txt'
into table emp2
fields terminated by ','
(empno, ename, hiredate, etime, ejob, deptno)this is the error :
C:\>sqlldr scott/tiger control=C:\external\ctrl.ctl
SQL*Loader: Release 10.2.0.1.0 - Production on Mon May 31 09:45:10 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Commit point reached - logical record count 5
C:\>any help i greatly appreciated
thanks
Edited by: user10947262 on May 31, 2010 9:47 AMload data
infile 'C:\external\my_data.txt'
into table emp2
fields terminated by ','
(empno, ename, hiredate, etime, ejob, deptno)Try
load data
infile 'C:\external\my_data.txt'
into table emp2
fields terminated by ','
(empno, ename, hiredate, etime "to_date(:etime,'hh24:mi:ss')", ejob, deptno)
this is the error :
C:\>sqlldr scott/tiger control=C:\external\ctrl.ctl
SQL*Loader: Release 10.2.0.1.0 - Production on Mon May 31 09:45:10 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Commit point reached - logical record count 5
C:\>
That's not an error, you can see errors within log and bad files. -
SQL Developer "Locks-Up" when Expanding Synonym Folder
It appears that every time I try and expand the Synonyms folder for a database user with many synonyms (hundreds?) SQL Developer hangs. If I try and stop the loading synonyms by cancelling the task (View Task Progress -> Cancel), the "Loading" process continues, the database connection is locked, and I can't close SQL Developer (short of killing the application via Task Manager). To re-create the issue, try connecting to an eBusiness Suite database as APPS and expand the Synonyms folder. Is this a know issue, it seems like an obvious bug?
Hi,
You are correct, this is an obvious bug -- at least for connections to a remote database. I logged an internal bug for this:
Bug 12842181 - CANCEL ON PUBLIC SYNONYMS QUERY FOR REMOTE DB CAUSES HANG
A similar old bug is:
Bug 6618400 - CANCEL ON PUBLIC SYNONYMS QUERY HAS NO EFFECT.
Perhaps the reason this bad behavior hasn't gotten more attention is the existence of the 'Apply Filter...' feature available in the context menu for all object nodes. Filtering has progressed far beyond the state commented about in this old forum post:
Synonym filter
Regards,
Gary Graham
SQL Developer Team -
How create synonym for more than one user
Hi,
In a DB I have more than one schema. For example:
1) User1 has these tables:
Menu
Employes
Zipcode
Billing etc..
2) User2 has only the a personalized table Menu
3) User3 has only the a personalized table Menu
How can enable User2, User3 and other to use the tables Employes, Zipcode, Billing etc. of schema User1 ?
I think with synonyms. Can You help to write a script in order to create this ?
I hope in Your Help.
Thank You and Best Regards.
GaetanoHi Gaetano,
If I understand your requirement correctly User2, User3 and other users should be able to access tables owned by User1. If that's the case, synonyms won't help at all.
Read up any English dictionary and you'll understand what a synonym is.
What you need to do (as User1) is: GRANT the appropriate privilege (SELECT, UPDATE...) on the tables to the other users.
Oh, btw: what is a 'personalized table Menu'? I never heard that.
Regards,
Guido -
How to use synonyms on multiple word search ?
We use context with multiword search like this one :
select * from my_table where contains(my_text,'the small building near the river')>0
Now we have specific synonyms in a thesaurus. How do we write the contains clause ?
contains(my_text,'syn(the,thes) and syn(small,thes) and syn(building,thes) and syn(near,thes) and syn (river,thes)')>0 does not fin the synonym for "small building"="house" for instance
contains(my_text,'syn(the small building near the river,thes)')>0 does only for synonyms on the full sentence.
More generally is there an Oracle Document which describes how to use SYN, FUZZY and combine them, since
the reference documentation gives only limited information on this ?
Have a nice dayThe thesaurus functionality is not currently built for stuff like this.
if you want to combine fuzzy and thesaurus, I am assuming you want to do fuzzy first, to correct any misspelling,
then thesaurus on the "corrected" spellings? You'd have to do something like:
1. take the query and run ctx_query.explain to break it down and do the fuzzy expansion
2. work through the fuzzy expansion and build a new query string by sticking SYN() around each
expanded word
As for thesaurus expansion and phrase, these are not compatible. Thesaurus expansions use "," and "|", and so
you cannot have a phrase of thesaurus expansions.
I see what you're getting at, but you would need sub phrase detection, phrase equivalence, etc., which is
currently beyond the thesaurus function capability.
You can use themes (ABOUT) on phrases, and it will do something like what you are describing. You might want
to check that out. -
Bug in tree view of synonyms owned by other user
Hi,
I'm connecting into Oracle 10.2.0.3 whith SQL Developer 1.5.3.0.53 and user SYS as SYSDBA. When I browse tree view of synonyms of another user, the synonyms that include database link don't display !!! If I connect whith that user the synonyms are displayed correct.
Is this a bug ? There are a solution ?
Thanks !
About
Oracle SQL Developer 1.5.0.53
Versão 1.5.0.53
Build MAIN-53.38
Copyright © 2005,2008 Oracle. All Rights Reserved.
IDE Version: 11.1.1.0.22.49.35
Product ID: oracle.sqldeveloper
Product Version: 11.1.1.53.38
Component Version
========== ======
CVS Version Internal to Oracle SQL Developer (client-only)
Oracle IDE 1.5.0.53.38
Plataforma Java(TM) 1.6.0_06
Versioning Support 1.5.0.53.38Hi there,
while we support dblinks, we dont support following them thru on synonyms or browsing them either. This is a feature right now and you can vote for this as a feature in a later release by submitting a feature request at sqldeveloper.oracle.com -
How to create materialized view based on a synonym
Hi all,
I am trying to create simple materialized view based on a synonym and that synonym is pointing a view in other database (using dblink). I am getting table or view not found error . I am able to select synonym if i use select but not in materialized view. Please help me.
Thanks,The best way to do this is to create a materialzed view based on the underlying code of the original view. If you don't have this handy, issue the following in sqlplus:
select text
from user_views
where view_name = 'NAME_OF_VIEW'
You can then cut and paste the sql statement into your create materialized view statement.
Please note, you will probable have to set the long parameter to a higher value to reveal the complete statement for example:
SQL> set long 2048 -
Create a public synonym for a db link - "Connection desccriptor not found".
I want to create a public synonym for a db link.
The existing db link name is tst.world ( which is in db links table and is working fine).
I created the following db link using the following command:
create public synonym "syn.world" for "tst.world";
It created the synonym successfully.
If I try the following, it throws error "Connection desccriptor not found".
select * from [email protected];
It says "Connection desccriptor not found".
Any suggestions.
Thanks in Advance.Well then, lookup the Documentation on the CREATE SYNONYM statement in the SQL Language Reference manual.
The documentation lists the types of objects which you can create synonyms for.
You can create synonyms for objects referenced across DBLinks.
You cannot create synonyms for DBLinks.
Hemant K Chitale -
Creating a foreign key constraint on a synonym of table in another schema.
Hi,
I am having two user operapps and oper
owner of table po_vendors is operapps ,i have created a synonym in oper with select permission.
now i am trying to create a foreign key.
ALTER TABLE OPS_BR_VENDORS ADD ( FOREIGN KEY (VENDOR_ID) REFERENCES PO_VENDORS (VENDOR_ID));
the bolded po_vendors is the synonym for the table po_vendors in operapps.
i am getting the below error message.
SQL> ALTER TABLE OPS_BR_VENDORS ADD ( FOREIGN KEY (VENDOR_ID) REFERENCES PO_VENDORS (VENDOR_ID));
ALTER TABLE OPS_BR_VENDORS ADD ( FOREIGN KEY (VENDOR_ID) REFERENCES PO_VENDORS (VENDOR_ID))
ERROR at line 1:
ORA-01031: insufficient privileges.
i have given dba privileges to oper user.
Please advice.1) You cannot create a constraint on a synonym. You have to specify a physical table (i.e. OPERAPPS.PO_VENDORS)
2) The owner of the OPS_BR_VENDORS table will need to have the REFERENCES permission on the PO_VENDORS table granted directly (not via a role).
Justin -
Retrieve data from a synonym in oracle database through db connect
Hi Everyone,
I have created certain synonym for some tables in oracle. I want to retrieve data from it through db connect but where through source system and then selecting database tables, only tables and views are available.
Synonyms are not available to create data sources and retrieve the data from it. Why is it so. Is this a limitation of db connect.
Can anyone please let me know about it.
Thanks,
Joshua.Hi,
You want to import data from an external Oracle database into your BW 3.X. To do this, you can connect the external database to the BW 3.X release as a source system using the external database connect. BW 3.X here represents BW 3.0, BW 3.1 and BW 3.5 because in other (DB relevant) parts, all 3 versions are based on the same source code.
General information
The above function allows you to load data from an external Oracle database (not a BW database) into your BW 3.0 system.
There may also be constellations which cannot be used directly through the DB Connect access. However, it should be possible to find an adequate, customer-specific solution for most of these scenarios.
In such situations, the resulting work falls into the area of Consulting and cannot be handled via Support.
Successful implementation of a connection requires corresponding expertise and experience in the use of the source database in the areas:
- Tools
- SQL syntax
- DB-specific functions
Corresponding knowledge of the source application is also required to ensure that semantically relevant data arrives in the BW system.
Procedure
You should execute the following steps to connect the source system (Q) to the BW system (BW):
Installing the client software on an BW application server
Of course, you only need to install the client software if you are using BW with a non-Oracle database.
Use the Oracle setup program on the database CD (runInstaller on Unix) to start the OracleInstaller. Follow the program instructions and the DB installation instructions to install the Oracle Client software on BW.
Testing connection setup from BW to Q
After you install the client software on BW, try to set up a connection from BW to the server on Q. You may need to adjust the tnsnames.ora or sqlnet.ora files for this, to introduce the Oracle systems (to which contact should be made) to BW. You can test the connection by executing the command "tnsping QDB" on BW to check whether the client has established contact to the QDB database on the Q system.
Creating a separate U user in Q
We recommend that you create a separate U user in Q for connection to BW. This means that authorization and administration questions can be solved centrally.
Displaying data sources in Q for the U user
To provide U data for users other than U, you can create views on other user tables as user U:
CREATE OR REPLACE VIEW viewname AS
SELECT * FROM QDB.tablename
You may have to grant SELECT privileges to user U in the QDB schema:
GRANT select ON QDB.tablename TO U
Of course, you can also restrict or reformat data in the view arrangement (for example, change from internal date format into the SAP date format). JOIN operations using several tables are also available.
!!! Synonyms do not yet work!!!
Synonyms that you can create as described below are another option for providing a complete table for the user U:
CREATE SYNONYM synoname FOR QDB.tablename
!!! Synonyms do not (yet) work!!!
After you have displayed the require data for user U, you can simply use
SELECT * FROM <view or table>
on the Q system to check which data is returned.
You can now open a link to Q as user U in the BW system with SQLPLUS and check, using the same SELECT, whether this data is also seen in the Oracle client. If this is not the case, there is probably a connection problem.
Creating a connection from BW to Q in BW
Including data sources of user U user in Q in BW.
Solution
Supported BW, Basis and BW 3.0B database versions, Basis 6.20 Support Package 2 (or higher)
Oracle 8.1 (or higher, see below)
Possible problems
- Synonyms do not (yet) work!
Up to now, only tables and views have been used as data sources for the DB Connect from the R3 Basis. As soon as synonyms are also used in the Basis, you will be able to convert created views (or even replicated tables) to synonyms as a workaround.
With Basis 6.40 at the earliest, therefore as of BW 3.5, you will also be able to use synonyms. Until then, the following will help:
CREATE VIEW <view_on_synonym> AS SELECT * FROM <synonym>
- The source DB must have at least the release version of the BW DB.
Oracle only ensures the support of client-server links if the version of the client is not higher than that of the server. So if BW has Oracle version 8.1 and, as in the case of Dbconnect, is run as a client against the server of the source database, the source database must have at least release Oracle 8.1 or higher.
Of course, you have the option to install the Oracle client software of a lower version and then use this for the DB connect. This is also the procedure used to work with a DB connect on external databases of other vendors.
Furthermore, the implementation of the DBconnect function in BW uses SAP Basis functions. Specifications of Oracle 8.1 database catalogs are used here. The source database must therefore have at least Version 8.1.
- Oracle Client Software Version
If you want to connect from an Oracle BW DB to an Oracle source DB, for the DB connect you naturally use the client software that you already installed on each application server.
If you want to connect from a non-Oracle BW DB to an Oracle source DB, check item 3 of note 521230 to see which Oracle client software version is released with your BW R3 kernel and use this version.
- Date and time fields in Oracle and their conversion into SAP-compatible column formats
Example with a DATE field:
Since a SAP table does not have a DATE field (date values are NUMC(8) and time specifications are NUMC(6)), we will use the Oracle DBA_TABLES system table as an example.
SQL> desc dba_tables;
The Oracle DBA_TABLES system table has a LAST_ANALYZED field. This is a DATE type field and is recognized as a date field of 7 characters by DBA_CONNECT. However, the import does not work because the DATE is a 7-byte conglomerate of "...century, year, month, date, hour, minute and second." (extract from the Oracle documentation).
To make this DATE field legible for DB connect, you must use the TO_CHAR function in a VIEW. This should display the following examples:
SQL> select LAST_ANALYZED from dba_tables
where table_name like 'RS%' and rownum < 10 ;
The formatting used here is the default used implicitly by SQLPLUS.
SQL> select to_char(LAST_ANALYZED,'YYYYMMDD') as dat from dba_tables where table_name like 'RS%' and rownum < 10 ;
The result now has the SAP compatible format YYYYMMDD and should be loaded correctly by the DB connect as a date.
SQL> select to_char(LAST_ANALYZED,'HH24MISS') as tim from dba_tables where table_name like 'RS%' and rownum < 10 ;
The result now has the SAP compatible format HHMMSS and should be loaded correctly by the DB connect as a time.
You can use the following example for more detailed experiments:
SQL> select to_char(
TO_DATE('03-FEB-2001 04:05:06','DD-MON-YYYY HH24:MI:SS'),
'YY-MM-DD HH24-MI-SS') as datim from dual;
with the result:
DATIM
01-02-03 04-05-06
When you create a VIEW and use the TO_CHAR function (or other functions), you should easily be able to avoid problems with the interpretation of date/time specifications (and other reformatting).
Details about the functions and the formats are contained in the Oracle documentation.
- Special characters
A words that contain special characters can only be imported correctly if the code pages in BW and in the source system are identical. If the code pages are not the same, DB Connect can be used if the characters to be imported appear under the first 127 characters of the character set.
The use of multibyte code pages in the source system for saving data using character sets with more than 256 characters (Kanji, Katakana, Hiragana, Korean, Chinese, Tagalog, Khmer, Arabic, Cherokee, and so on) can cause the characters to become corrupt.
For questions concerning the code pages, also refer to the FAQ note 606359 and question/answer 19 that appears there.
Maybe you are looking for
-
Issue with Skip Level Hierarchy in OBIEE 11g
Hi, I have implemented Ragged and Skip Level Hierarchy as explained in the links below in OBIEE 11g RPD. (checked the 'Ragged' and 'Skipped Levels' check boxes) http://www.rittmanmead.com/2010/07/obiee-11gr1-support-for-ragged-skip-level-value-based-
-
Implementing a template from BW
Hi, Can someone please tell me how to implement a Template used for BW reports in my BSP application ? Importing the template is not helping as error message 'Object Expected' is thrown. Thanks
-
My iPod classic 120 GB is not recognized on MacBook pro
I have tried all the resets and other recommended remedies but I can't get my MacBook or my hp pc to recognize the iPod. The battery is fully charged, all music plays. What next can I do?
-
Hi all, Does anyone have experience with MIDI (Musical Instrument Digital Interface) and LabVIEW? Any pointers would be appreciated. Regards, Paul
-
How do I get my whole picture to show on the screen where I can see the entire image?
How do I get my whole picture to show on the screen where I can see the whole image?