{"id":8403,"date":"2016-06-21T12:13:25","date_gmt":"2016-06-21T10:13:25","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/ora-01775-looping-chain-of-synonyms\/"},"modified":"2016-06-21T12:13:25","modified_gmt":"2016-06-21T10:13:25","slug":"ora-01775-looping-chain-of-synonyms","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/ora-01775-looping-chain-of-synonyms\/","title":{"rendered":"ORA-01775: looping chain of synonyms"},"content":{"rendered":"<h2>By Franck Pachot<\/h2>\n<p>.<br \/>\nThis error message is misleading. You may encounter it when you expect ORA-00942: table or view does not exist. Let&#8217;s explain<\/p>\n<p>I&#8217;m connected as SCOTT and create a PUBLIC SYNONYM for an object that do not exists:<\/p>\n<pre><code>\nSQL&gt; create public synonym MONEY for NOTHING;\nSynonym created.\n<\/code><\/pre>\n<p>No error message.<br \/>\nOnly when I read it I have an error message telling me that there are no table or view behind it:<\/p>\n<pre><code>\nSQL&gt; select * from NOTHING;\nselect * from NOTHING\n              *\nERROR at line 1:\nORA-00942: table or view does not exist\n<\/code><\/pre>\n<p>Let&#8217;s do the same but call it BONUS instead of MONEY:<\/p>\n<pre><code>\nSQL&gt; create public synonym BONUS for NOTHING;\nSynonym created.\n&nbsp;\nSQL&gt; select * from BONUS;\nno rows selected\n<\/code><\/pre>\n<p>No error here. Why? because I&#8217;ve a table that is called BONUS. So the name is resolved with the table and the synonym is not even tried.<\/p>\n<p>I&#8217;ll now drop that synonym and create it for the table BONUS. Same name for the public synonym and for the table.<\/p>\n<pre><code>\nSQL&gt; drop public synonym BONUS;\nSynonym dropped.\n&nbsp;\nSQL&gt; create public synonym BONUS for BONUS;\nSynonym created.\n<\/code><\/pre>\n<p>As user SCOTT, when I query BONUS the name is resolved as the table:<\/p>\n<pre><code>\nSQL&gt; show user\nUSER is \"SCOTT\"\nSQL&gt; select * from BONUS;\nno rows selected\n<\/code><\/pre>\n<p>As another user, when I query BONUS the name is resolved as the synonym, which finally reads SCOTT.BONUS:<\/p>\n<pre><code>\nSQL&gt; show user\nUSER is \"SCOTT\"\nSQL&gt; select * from BONUS;\nno rows selected\n<\/code><\/pre>\n<p>In 12c it is easy to see the final query:<\/p>\n<pre><code>\nSQL&gt; variable c clob\nSQL&gt; exec dbms_utility.expand_sql_text('select * from BONUS',:c);\nPL\/SQL procedure successfully completed.\n&nbsp;\nSQL&gt; print c\n&nbsp;\nC\n----------------------------------------------------------------------------------------------------------\nSELECT \"A1\".\"ENAME\" \"ENAME\",\"A1\".\"JOB\" \"JOB\",\"A1\".\"SAL\" \"SAL\",\"A1\".\"COMM\" \"COMM\" FROM \"SCOTT\".\"BONUS\" \"A1\"\n<\/code><\/pre>\n<p>But now, what happens when we drop the table?<\/p>\n<pre><code>\nSQL&gt; drop table SCOTT.BONUS;\nTable dropped.\n<\/code><\/pre>\n<p>Do you expect a ORA-00942: table or view does not exist?<\/p>\n<pre><code>\nSQL&gt; select * from BONUS;\nselect * from BONUS\n              *\nERROR at line 1:\nORA-01775: looping chain of synonyms\n<\/code><\/pre>\n<p>Here is the &#8216;looping chain of synonyms&#8217;. I ask for BONUS. The name resolution first check for an object in my schema, but there are none:<\/p>\n<pre><code>\nSQL&gt; select object_type from user_objects where object_name='BONUS';\nno rows selected\n<\/code><\/pre>\n<p>Then it looks for public synonym and there is one:<\/p>\n<pre><code>\nSQL&gt; select object_type from all_objects where owner='PUBLIC' and object_name='BONUS';\n&nbsp;\nOBJECT_TYPE\n-----------------------\nSYNONYM\n<\/code><\/pre>\n<p>So we check what it is a synonym for:<\/p>\n<pre><code>\nSQL&gt; select table_owner,table_name from all_synonyms where owner='PUBLIC' and synonym_name='BONUS';\n&nbsp;\nTABLE_OWNER  TABLE_NAME\n------------ ------------\nSCOTT        BONUS\n<\/code><\/pre>\n<p>And there it is interesting. Besides the column names that includes &#8216;TABLE&#8217; a synonym can reference any object. So it&#8217;s not just replacing the synonym with &#8216;SCOTT.BONUS&#8217; which would raise an ORA-00942. It is doing name resolution of BONUS in the context of the user SCOTT. Something similar to:<\/p>\n<pre><code>\nSQL&gt; alter session set current_schema=SCOTT;\nSession altered.\nSQL&gt; select * from BONUS;\n<\/code><\/pre>\n<p>And then, what do you expect from that? There is no table named BONUS but there is a public synonym&#8230; and you&#8217;re back to the begining:<\/p>\n<pre><code>\nselect * from BONUS\n              *\nERROR at line 1:\nORA-01775: looping chain of synonyms\n<\/code><\/pre>\n<p>Most of the time, you don&#8217;t have synonyms that reference other synonyms, so you don&#8217;t really have a &#8216;chain&#8217; of synonyms. Except when there is only synonym in the namespace and it&#8217;s a self-reference loop. So if you see ORA-01775, check if the referenced object is not missing.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>By Franck Pachot . This error message is misleading. You may encounter it when you expect ORA-00942: table or view does not exist. Let&#8217;s explain I&#8217;m connected as SCOTT and create a PUBLIC SYNONYM for an object that do not exists: SQL&gt; create public synonym MONEY for NOTHING; Synonym created. No error message. Only when&hellip;&nbsp;<\/p>\n","protected":false},"author":27,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","neve_meta_reading_time":"","_themeisle_gutenberg_block_has_review":false,"footnotes":""},"categories":[4133],"tags":[],"class_list":["post-8403","post","type-post","status-publish","format-standard","category-database"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v28.9 (Yoast SEO v28.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>ORA-01775: looping chain of synonyms - dbi services Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/ora-01775-looping-chain-of-synonyms\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"ORA-01775: looping chain of synonyms\" \/>\n<meta property=\"og:description\" content=\"By Franck Pachot . This error message is misleading. You may encounter it when you expect ORA-00942: table or view does not exist. Let&#8217;s explain I&#8217;m connected as SCOTT and create a PUBLIC SYNONYM for an object that do not exists: SQL&gt; create public synonym MONEY for NOTHING; Synonym created. No error message. Only when&hellip;&nbsp;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/ora-01775-looping-chain-of-synonyms\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi services Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/dbiservices\/\" \/>\n<meta property=\"article:published_time\" content=\"2016-06-21T10:13:25+00:00\" \/>\n<meta name=\"author\" content=\"Oracle Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@dbiservices\" \/>\n<meta name=\"twitter:site\" content=\"@dbiservices\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Oracle Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/ora-01775-looping-chain-of-synonyms\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/ora-01775-looping-chain-of-synonyms\\\/\"},\"author\":{\"name\":\"Oracle Team\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/bf7c7eb0bec165183207237c9d0ee1d5\"},\"headline\":\"ORA-01775: looping chain of synonyms\",\"datePublished\":\"2016-06-21T10:13:25+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/ora-01775-looping-chain-of-synonyms\\\/\"},\"wordCount\":371,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/#organization\"},\"articleSection\":[\"Database\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/ora-01775-looping-chain-of-synonyms\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/ora-01775-looping-chain-of-synonyms\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/ora-01775-looping-chain-of-synonyms\\\/\",\"name\":\"ORA-01775: looping chain of synonyms - dbi services Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\"},\"datePublished\":\"2016-06-21T10:13:25+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/ora-01775-looping-chain-of-synonyms\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/ora-01775-looping-chain-of-synonyms\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/ora-01775-looping-chain-of-synonyms\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ORA-01775: looping chain of synonyms\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\",\"name\":\"dbi services Blog\",\"description\":\"#BeSharing\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/#organization\",\"name\":\"dbi services\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/dbi-services-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/dbi-services-logo.png\",\"width\":512,\"height\":512,\"caption\":\"dbi services\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/dbiservices\\\/\",\"https:\\\/\\\/x.com\\\/dbiservices\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/dbi-services\\\/\",\"https:\\\/\\\/www.youtube.com\\\/user\\\/dbiservices\"],\"description\":\"Swiss IT consulting and services company specialized in efficient data infrastructures and platforms: databases, application servers, cloud, DevOps, digitalization, analytics, data quality and monitoring. Headquartered in Del\u00e9mont with offices in Nyon, Basel, Bern and Zurich.\",\"email\":\"info@dbi-services.com\",\"telephone\":\"+41 32 422 96 00\",\"legalName\":\"dbi services SA\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/bf7c7eb0bec165183207237c9d0ee1d5\",\"name\":\"Oracle Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/oracle-square.png\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/oracle-square.png\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/oracle-square.png\",\"caption\":\"Oracle Team\"},\"description\":\"Posts published under the Oracle Team account are collective contributions by the dbi services Oracle consultants. The practice covers the full Oracle Database lifecycle: architecture, migration and upgrade, high availability with RAC and Data Guard, backup and recovery, performance tuning, and engineered systems such as Oracle Database Appliance and Exadata. The team holds Oracle certifications up to Certified Master level and operates customer platforms under service level agreements.\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/author\\\/oracle-team\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"ORA-01775: looping chain of synonyms - dbi services Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/ora-01775-looping-chain-of-synonyms\/","og_locale":"en_US","og_type":"article","og_title":"ORA-01775: looping chain of synonyms","og_description":"By Franck Pachot . This error message is misleading. You may encounter it when you expect ORA-00942: table or view does not exist. Let&#8217;s explain I&#8217;m connected as SCOTT and create a PUBLIC SYNONYM for an object that do not exists: SQL&gt; create public synonym MONEY for NOTHING; Synonym created. No error message. Only when&hellip;&nbsp;","og_url":"https:\/\/www.dbi-services.com\/blog\/ora-01775-looping-chain-of-synonyms\/","og_site_name":"dbi services Blog","article_publisher":"https:\/\/www.facebook.com\/dbiservices\/","article_published_time":"2016-06-21T10:13:25+00:00","author":"Oracle Team","twitter_card":"summary_large_image","twitter_creator":"@dbiservices","twitter_site":"@dbiservices","twitter_misc":{"Written by":"Oracle Team","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/ora-01775-looping-chain-of-synonyms\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/ora-01775-looping-chain-of-synonyms\/"},"author":{"name":"Oracle Team","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bf7c7eb0bec165183207237c9d0ee1d5"},"headline":"ORA-01775: looping chain of synonyms","datePublished":"2016-06-21T10:13:25+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/ora-01775-looping-chain-of-synonyms\/"},"wordCount":371,"commentCount":0,"publisher":{"@id":"https:\/\/www.dbi-services.com\/#organization"},"articleSection":["Database"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/ora-01775-looping-chain-of-synonyms\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/ora-01775-looping-chain-of-synonyms\/","url":"https:\/\/www.dbi-services.com\/blog\/ora-01775-looping-chain-of-synonyms\/","name":"ORA-01775: looping chain of synonyms - dbi services Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2016-06-21T10:13:25+00:00","breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/ora-01775-looping-chain-of-synonyms\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/ora-01775-looping-chain-of-synonyms\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/ora-01775-looping-chain-of-synonyms\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"ORA-01775: looping chain of synonyms"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi services Blog","description":"#BeSharing","publisher":{"@id":"https:\/\/www.dbi-services.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.dbi-services.com\/#organization","name":"dbi services","url":"https:\/\/www.dbi-services.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2026\/09\/dbi-services-logo.png","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2026\/09\/dbi-services-logo.png","width":512,"height":512,"caption":"dbi services"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/dbiservices\/","https:\/\/x.com\/dbiservices","https:\/\/www.linkedin.com\/company\/dbi-services\/","https:\/\/www.youtube.com\/user\/dbiservices"],"description":"Swiss IT consulting and services company specialized in efficient data infrastructures and platforms: databases, application servers, cloud, DevOps, digitalization, analytics, data quality and monitoring. Headquartered in Del\u00e9mont with offices in Nyon, Basel, Bern and Zurich.","email":"info@dbi-services.com","telephone":"+41 32 422 96 00","legalName":"dbi services SA"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bf7c7eb0bec165183207237c9d0ee1d5","name":"Oracle Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/12\/oracle-square.png","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/12\/oracle-square.png","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/12\/oracle-square.png","caption":"Oracle Team"},"description":"Posts published under the Oracle Team account are collective contributions by the dbi services Oracle consultants. The practice covers the full Oracle Database lifecycle: architecture, migration and upgrade, high availability with RAC and Data Guard, backup and recovery, performance tuning, and engineered systems such as Oracle Database Appliance and Exadata. The team holds Oracle certifications up to Certified Master level and operates customer platforms under service level agreements.","url":"https:\/\/www.dbi-services.com\/blog\/author\/oracle-team\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/8403","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/27"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=8403"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/8403\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=8403"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=8403"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=8403"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}