Doubt on Synonym
Hi,
Is it possible to create a Synonym for a schema (User) ???
Can anyone comment on this please.
Thanks in advance
Nirmal
Message was edited by:
MIND
it lets me create the synonym for the user as above but I can't use it to reference tables owned by new_schema_owner.What you actually did was to create a synonym for a non-existent table:
michaels> show user
User is "SCOTT"
michaels> create synonym some_synonym for scott
Synonym created.
michaels> select * from user_synonyms where synonym_name = 'SOME_SYNONYM'
SYNONYM_NAME TABLE_OWNER TABLE_NAME DB_LINK
SOME_SYNONYM SCOTT SCOTT
Similar Messages
-
Need suggestions about synonyms
We are using Oracle 10g (10.2.0.5).
I have few doubts about synonyms. Please find the below..
1.What is schema based synonym switching?
2. How it will work and to understand explain with the example...
3. what are advantages and disadvantages of schema based synonym switching?
4. Can we implement it in Oracle 10g? or It is new in Oracle 11g?
Thanks in advance..>
You don't want to use synonyms, as they are a maintenance nightmare (you need too many, the objects may not exist and so on) and have negative performance implications.
>
I've never been involved in any issues where synonyms were responsible for any performance issues. Can you provide an example of that?
Sure there is maintenance involved as this is with any database object. Need too many? That's like saying don't use tables or indexes because you will need too many. How many you need is entirely dependent on how you use them.
Yes, the underlying object may not exist. This is perfectly valid even though I have no object named 'abc' in the scott schema
create synonym foobar for abcJust saying the synonym may not exist has no weight as an argument for me. You need to explain why that is a negative, if you believe it is, and why you think that negative (and any others you care to mention) outweighs the positives.
Actually I'm more surprised you didn't highlight what I think is one of the biggest 'gotchas' developers may need to be aware of. That is how the improper maintenance of synonyms in various environments can wasted time and resources of the technical team chasing down problems that wouldn't otherwise exist if the synonyms were maintained properly. Namely a missing synonym or one pointing to the wrong (or wrong version of an) object. Sometimes the first check you need to make is whether your query SELECT * FROM EMP is really querying what you think it is. -
We have Oracle9i, i have seen about synonym.
I have some doubts...
1. Is that we can create synonym for objects like Packages, stored
procedures,views and Functions.
2. How Synonyms helpful in user privileges?.
3. What is Public and Private Synonyms?
I have seen some documents but they couldnot clear my doubts....
Any one can help me in this pleaseA quick example :
SQL> desc myusers
Name Null? Type
USERNAME NOT NULL VARCHAR2(30)
USER_ID NOT NULL NUMBER
CREATED NOT NULL DATE
SQL> grant create session to toto identified by toto;
Grant succeeded.
SQL> grant select on myusers to toto;
Grant succeeded.
SQL> grant create synonym to toto;
Grant succeeded.
SQL> conn toto/toto@H89UCBAC
Connected.
SQL> desc myusers
ERROR:
ORA-04043: object myusers does not exist
SQL> desc h89ucbac.myusers
Name Null? Type
USERNAME NOT NULL VARCHAR2(30)
USER_ID NOT NULL NUMBER
CREATED NOT NULL DATE
SQL> create synonym myusers for h89ucbac.myusers;
Synonym created.
SQL> desc myusers
Name Null? Type
USERNAME NOT NULL VARCHAR2(30)
USER_ID NOT NULL NUMBER
CREATED NOT NULL DATE
SQL> HTH,
Nicolas. -
Question on Synonyms and Implicit Cursor
Hi,
I've two doubts.
Question1:
Why Oracle is allowing me to create a synonym even base object does not exist in database.
For example in below example user ABC and object def doesnt exist in my database. Why I didnt get any error while creating a synonym.
Connected to Oracle Database 11g Express Edition Release 11.2.0.2.0
Connected as hr
SQL> CREATE SYNONYM test_syn FOR ABC.def;
Synonym created
SQL> Question2:
In PL/SQL after closing the cursor if we use any cursor attribute it will throw exception like invalid cursor. Why it is not happening in case of implicit cursor.
Or
Does Oracle close implicit cursor(SQL) ?
declare
begin
UPDATE emp
SET ename = 'SURI';
COMMIT;
dbms_output.put_line(SQL%rowcount);
end;Many thanks for all your help.
Cheers,
SuriSuri wrote:
Hi,
I've two doubts.
Question1:
Why Oracle is allowing me to create a synonym even base object does not exist in database.
For example in below example user ABC and object def doesnt exist in my database. Why I didnt get any error while creating a synonym.If you look in the all_dependencies view you will see that it's created as "NON-EXISTENT", so oracle knows it's non existent, it just doesn't treat it as an error.
As it says in the documentation:
http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_7001.htm#SQLRF01401
A dependency is created and if the target object is changed or dropped etc. the synonym becomes invalid... but that doesn't mean it cannot exist.
Question2:
In PL/SQL after closing the cursor if we use any cursor attribute it will throw exception like invalid cursor. Why it is not happening in case of implicit cursor.Would you care to demonstrate what you mean with some code. -
Expdp / impdp - Private synonyms using DB link not imported
Hi
I'd appreciate any help with this.
We are taking an export (expdp) of a database on Oracle EE 10.2.0.3 in Prod and then importing it into an identical DB on 10.2.0.5 in Dev.
I doubt the minor version difference is an issues, but I mention it for completeness.
Our expdp in prod used to look like this:
expdp agdba/x directory=DATA_PUMP_DIR dumpfile=X.DMP logfile=X.LOG schemas=A,B,C,D
We have changed it to:
expdp agdba/x directory=DATA_PUMP_DIR dumpfile=X.DMP logfile=X.LOG full=y EXCLUDE=SCHEMA:"IN ('E', 'F')"
( so basically do a full export, but exclude schemas E & F )
The impdp in dev has not changed (we import one schema at a time):
impdp agdba/x DUMPFILE=X.DMP LOGFILE=imp_X.LOG SCHEMAS=A DIRECTORY=DATA_PUMP_DIR TABLE_EXISTS_ACTION=SKIP
DB user AGDBA has been granted the DBA role...
The Issue:_
Private synonyms that use a DB link are NOT imported, but private synonyms that do NOT use a DB link ARE imported.
I can fix the issue by simply recreating the private synonyms using the DB link - e.g.:
CREATE SYNONYM EVENTLOGTBL FOR EVENTLOGTBL@FCISTOSMS;
Things were working fine until we change the expdp to use FULL. I see a few posts about synonyms and FULL=Y issues, but nothing quite like our problem.
Any ideas?
Thanks,
AndreasAndreas Hess wrote:
So the problem is expdp FULL=Y for some reason does not export synonyms that refer to objects via DB links. I doubt that ... More than few times a week I refresh non-prod databases from a prod db, (it is schema level export not FULL=Y), and two of the schema own db links, and others have synonyms pointing to them. I have never encountered synonym problem (except that if db_links are invalid then impdp takes extremely long time to timeout while compiling pl/sql code.). We normally change db_links after the impdp is done, or (while it is importing table via another session).
I just re-ran sqlfile option with include=db_link,synonym option and i can see statements that create synonyms and create db links.
However i think the order in which impdp runs might be the source of your problem ... see this
Starting "ME"."SYS_SQL_FILE_SCHEMA_01": ME/******** dumpfile=xxxx.%u.dmp directory=xxxx_exp schemas=schema1,schema2,schema3 sqlfile=schema.sql include=db_link,synonym
Processing object type SCHEMA_EXPORT/SYNONYM/SYNONYM <<<< Synonyms are created first
Processing object type SCHEMA_EXPORT/DB_LINK <<<< db_links come later
Job "ME"."SYS_SQL_FILE_SCHEMA_01" successfully completed at 08:32:02So, it is conceivable that if you drop synonyms/db_links from your schemas before impdp, some synonyms will fail to create properly. This could be a version specific issue, mine is 11.2 and I don't see failures for synonym creation, i.e. no error messages while impdp. Next time you could try to drop objects except db_links and see if you still have the same issue.
Raj -
Import/export sequeces, synonyms...?
hi.
I´m working whit Oracle9i on Windows2K3
I'm doing some test with IMP/EXP utility and I have some doubts...
I´m testing two ways to restore a tablespace:
The first one:
I´ve exported a tablespace with this comand "exp file=c:\tablespace.dmp tablespaces=OMIS"
Then I´ve dropped that tablespace wiht "drop tablespace cascade constraint".
Finally, I´ve to restored that tablespace using Exp command "Exp file=c:\tablespace.dmp fromuser=omi touser=omi"
In this manner, in addition to the tables and indexes. all other objects was imported also.
Tablespace Omis was fully restored.
However, the other way is to export the tablespace OMIS on the same way, but instead of deleting only that tablespace, I´ve delete the whole database simulating a disaster scenario.
Then, I create database again, including the user owner of the objects, and the tablespace.
After this, I use the same command EXP as before and tables and indexex are imported, but the all other objects as synonyms, sequences, functions or procedures, besides other not appear in the scheme...
Can someone explain why this is happening?
There is something beyond my comprehension ...
ThanksThe purpose of this type of backup is that i need to send the generated file by FTP every day, and therefore I need that it be as small as possible. All critical data are in that tablespace, on the other site there are only log tables, trace tables, etc... and that occupy approximately half the size of the database.
I´ve checked the transportable tablespaces as you suggested but isn´t usefull for me because it requires place the tablespace offline, and that isn´t possible.
I have ear something about of generate a .txt file wiht the scripts to create that objects (synonym, procedure, ect...) when running the export... Can you tell me something about?
Could that be usable for me?
Regards -
Original Import doubt on indexes
Hi All,
First of all, I wish you a Happy New Year to you all
I have been learning most of the stuffs in oracle DB from here. Thanks for that to all.
Recently, I got an original export dump (exp) to import in the database.. and I have imported in the database.
but, some doubts I had about the import.
The export log ended as below:
+. . exporting table GILRFILES 17336 rows exported+
+. . exporting table FLY7 0 rows exported+
+. . exporting table KOCHC 19645 rows exported+
+. exporting synonyms+
+. exporting views+
+. exporting stored procedures+
+. exporting operators+
+. exporting referential integrity constraints+
+. exporting triggers+
+. exporting indextypes+
+. exporting bitmap,functional and extensible indexes+
+. exporting posttables actions+
+. exporting materialized views+
+. exporting snapshot logs+
+. exporting job queues+
+. exporting refresh groups and children+
+. exporting dimensions+
+. exporting post-schema procedural objects and actions+
+. exporting statistics+
Export terminated successfully without warnings.*
I executed the below import command:
imp userid=JRET/JRET file=F:\oracle\need\SALLOOONI.dmp fromuser=JRET*
The import ended with the below lines:
+. . importing table "GILRFILES" 17336 rows imported+
+. . importing table "FLY7" 0 rows imported+
+. . importing table "KOCHC" 19645 rows imported+
Import terminated successfully without warnings.*
My doubt is...
Where are the indexes, synonyms, procedures and functions which are exported in exp dump but they are not visibly displayed in the import. When I executed a command to import index I got the warning stating "This was done by SYS not by you" and an error stating " Already exists'. When I asked one of my friend he said indexes will be imported in imp command when the above imp command is issued.
Is this true..? can some one put some light on this.
Thanks in advance
NONUDAY
Edited by: 897910 on Jan 1, 2012 10:44 PMHi Dean,
Dean Gagne wrote:
Any object in the dumpfile owned by T24 would be imported. If it existed, an error would be reported.
DeanThanks I got the answer. The exp dump had objects like index, view, procedure, etc..
As when they are imported from user JRET from the exp dump which has all the objects and they are imported as well.
Thanks for your input Dean.
NONUDAY -
Viewing different user's constraints, triggers, synonyms etc.
I have a doubt as to how to view a different user's constraints, triggers, synonyms. If, we have to see a different user's tables, we use the syntax,
select * from username.table_name
provided we have select rights on that table of the user. Similarly, do we need view rights on the other user's indexes.
Please help in solving my doubt as i need it resolved urgently.do we need view rights on the other user's indexes.No, once the appropriate access to the concerned object has been granted, any indexes on that object (if appropriate) will automatically be used by the database.
Once you have access to the other users tables, the indexes on that table automatically are visible to you.
You could see the objects using ALL_OBJECTS or the ALL_INDEXES dictionary view. -
How can one lookup synonyms in Pages?
Hi,
I would like to lookup synonyms for certain words from within Pages (ideally by highlighting a word and left-clicking on it from the popup menu). I couldn't find such a function.
Any suggestions how to achieve this (maybe via Applescript?).
Thanks in advance,
Marc BaadenI think support for the French language is less than impressive on the Mac. MS Word has built in French and German thesauri, but I do not know of any good independent dictionary or thesaurus. I would love being contradicted here, by the way.
Le Petit Robert is available of course, but you have to carry around the CD for random controls that you have not pirated the software, and I doubt it integrates well with Pages.
My German dictionary is WordLookup. Actually WordLookup is just a way to access dictionary data, but it works well, and you can call it from Pages using Services. It is not a thesaurus, but moving back and forth to the English translations, you can usually find good synonyms. -
hi i have a doubt....
in fbl1n transaction, there are open items and cleared items.
in it the cleared items for certain document types such as invoice etc is not present in the open item table (bsik)
however the cleared items for document types such as general voucher its present in the open items table (bsik)
is this possible as all cleared item entries shld b present in the open item table with an indicator set for cleared or not...
plz exlain!Hi
There are 2 tables(open and Closed Items) in FI for Account Payables and Account Receivables and GL accounts
1.Account payables: BSIK is Open Items and BSAK is Closed items
2.Account Receivables; BSID and BSAD for OPEN and closed items
3/GL accounts : BSIS and BSAS for Open and Closed Items
<b>Reward points for useful Answers</b>
Regards
Anji -
Doubt in creation of a new object
Hi All,
I have one doubt in creation of a new object.If a new object is to be created and it is not a subtype
of any existing object, then what should we enter in the Program field for creating the object?
I hope I am clear with my question.
Thanks in Advance,
Saket.Hi Saket,
Following will be required for created a custom business object.
1. Object Type - ZTEST (Internal Techincal Key)
2. Object Name - ZTESTNAME (Technical Key Name)
3. Name - TEST (Name of BO, it is used while selecting the object type)
4. Description - (Short Description of BO)
5. Program - ZTESTPROGRAM (ABAP program in which the methods of the object type are implemented)
6. Application - A or B.. etc (Area to which your BO is related)
Please remember that you can learn these basic things by giving F1 help on those fields and in HELP.SAP.COM.
Regards,
Gautham Paspala -
Hi Everyone,
Can we read and validate the attachment of the mail.If so how to do it.
Thanks in advance,
SakthiHi Sakthi,
Please refere the below links:
http://help.sap.com/saphelp_nw2004s/helpdata/en/ad/bf93409c663228e10000000a1550b0/frameset.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/0d/52b240ac052817e10000000a1550b0/frameset.htm
Let me know if you have any doubts regarding this.
Thanks,
sekhar. -
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 -
PI' RFC Connection pool doubt.
Hi PI exports:
i have a doubt about pi' RFC Connection pool ,pi RFC receive channel can set the conn pool size ,but when start the rfc receiver channel ,is there always only one Connection pool ,or there is only one Connection pool instance?
thinks
Edited by: kevin liang on Oct 19, 2009 6:45 AMHi,
Connection poolins size means how many number of connection you want to make open to send data to ECC, We can define maximum number of connection in Receiver RFC Adapter,Go to additional parameters section and define Max Number of connection give the number there,thats it.Internally it works as Connection poolin mechanism.
Regards,
Raj
Maybe you are looking for
-
Why did FootPrints product and support go to crap?
Why did BMC buy Numara FootPrints and then build a new product, named it FootPrints, called it an upgrade, but required customers to uninstall FootPrints and reinstall it fresh, then rebuild the whole thing from scratch? By the way... in my opinion,
-
Premiere CC 2014.1 Blu-ray MPEG 2 export causing error in Sony DVD Architect Pro
I've filed a Bug Report for this but wanted to post here in case it helps anyone else or on the off chance someone can give me a solution / better work around. Something has changed in the results of a Blu-ray MPEG2 export from Premiere 2014.1 vs tho
-
Variable works in Dev but not in Test in Webi report
Hi All, I have written a variable to calculate Average. It works fine for all entries in Dev. But when I transport it to Test Environment, it works fine for some entries and does not work for some entries. Any suggestions? This is happening in WEBI R
-
We are a DVD replicator in San Jose, CA. http://www.newcyberian.com. Lately we receive so many DVD masters from our clients that do not have PCM or AC3 audio stream. They play fine on most DVD players but we know that's a violation of the DVD spec. I
-
How Do I Secure an Emailed PDF to the Recipient's PC?
Hi All, How can an emailed PDF be tied to a recipient's PC so that it can only be viewed on that PC? I do not want to use password control or high-end 3rd party systems, e.g. FileOpen, LockLizard, etc. I only care about restricting access (viewing),