An invalid synonym in Oracle is almost always a symptom, not the disease. A synonym itself has no validity flag you can flip: its status reflects whether the object it points to resolves correctly at the moment Oracle compiles a dependent object or you query the data dictionary. To make it valid, you restore the underlying object—correct the target name, recreate the missing object, grant the required privileges, or fix the schema resolution path—then recompile whatever depends on the synonym. In practice, the fix happens on the base object and the privileges around it; the synonym then reports VALID on its own.
That distinction matters because people often go looking for an ALTER SYNONYM ... VALID command, and there isn't one. Understanding why the dictionary shows INVALID, and what Oracle actually checks, is the fastest route to a durable fix rather than a temporary one that breaks again on the next recompile.
What "Invalid" Actually Means for an Oracle Synonym
A synonym is a stored alias. In the data dictionary view ALL_SYNONYMS, DBA_SYNONYMS, or USER_SYNONYMS, you can see its SYNONYM_NAME, TABLE_OWNER, TABLE_NAME, and DB_LINK. That view doesn't carry a status column you manage directly. When tools or queries show a synonym as invalid, they're usually inferring it from dependent objects: a view, procedure, package, or trigger that references the synonym was compiled and could not resolve the target, so the dependent object is marked INVALID.
There's a second, practical sense in which people say a synonym is "invalid." They mean it doesn't work: selecting through it raises ORA-00980 (synonym translation is no longer valid), ORA-01775 (looping chain of synonyms), ORA-00942 (table or view does not exist), or ORA-01031 (insufficient privileges). These are the errors to triage, because each points to a different root cause.
So the goal isn't to "validate the synonym." It's to make the resolution path succeed so that dependent objects recompile to VALID and queries through the synonym return rows. Keep that framing and the steps below fall into place.
It's also worth separating two timing behaviors. Stored PL/SQL (procedures, functions, packages, triggers) is compiled when created and typically recompiled on first use after a dependency changes, using deferred or automatic recompilation. Views, by contrast, are validated when created and generally checked again the next time they're referenced in a way that forces recompilation. That's why a view can sit INVALID for a while and then heal itself after you restore the base table—no manual action required—while a package may need an explicit recompile before it reads as VALID.
First, Confirm What's Really Broken
Before changing anything, gather facts. Run these as the schema owner or as a DBA, and note what each returns.
A quick way to test resolution without touching anything is to try selecting from the synonym with ROWNUM limited, or to run SELECT * FROM synonym_name WHERE 1=0;. If that succeeds, the synonym resolves and your problem is probably privileges on a specific column or a stale dependent object rather than the synonym itself.
The audit view DBA_DEPENDENCIES (or ALL_DEPENDENCIES) tells you which objects reference the synonym, so you know what will need recompiling:
Write down the target and the dependents. Everything downstream follows from matching the symptom to the cause.
Match the Error to the Cause
Different errors tell different stories. Here's how to read the common ones.
ORA-00980 (synonym translation is no longer valid). The synonym points to an object that no longer exists, was renamed, or moved to another schema. This is the most common cause after a table rebuild, a schema migration, or a dropped-and-recreated object. The synonym text is intact; the target is gone.
ORA-00942 (table or view does not exist). The target may exist, but the current user can't see it—often a missing SELECT grant, or the object lives in a schema the user doesn't have rights to. It can also mean the synonym points at the wrong owner.
ORA-01775 (looping chain of synonyms). Synonym A points to synonym B, which points back to A, or a chain never reaches a real object. Someone created a synonym in the same schema with the same name as its target, or two schemas each define a synonym resolving to the other.
ORA-01031 (insufficient privileges). The target exists and resolves, but the user lacks the privilege—common when the synonym points across schemas and the grant was never issued or was revoked.
Objects INVALID but queries work. This is normal in PL/SQL after a dependency change; the object recompiles automatically on next execution. Don't "fix" what isn't broken unless a recompile is genuinely needed.
Once you've identified the error, the repair is targeted rather than shotgun.
Repair Path 1: The Target Is Missing or Renamed
If ORA-00980 or ORA-00942 points to a missing or renamed object, restore the target first. Options, in order of preference:
1: Recreate the missing object in the correct schema if it was dropped and you have the DDL or a backup. 2: Point the synonym at the new name if the object was renamed: drop and recreate the synonym (there's no in-place edit).
3: Recreate the synonym with the correct owner if it was pointing at the wrong schema.
If the object moved to a different database, you'll need a database link in the synonym rather than a local reference. The CREATE SYNONYM ... FOR owner.table@dblink form resolves through the link, and its validity then depends on the link being reachable and the credentials working—another failure point to check if the synonym still misbehaves after you fix the local reference.
A useful check after recreating: query ALL_SYNONYMS again and confirm TABLE_OWNER and TABLE_NAME match the restored object, then select through the synonym to confirm rows come back.
Repair Path 2: Privileges Are the Blocker
If the target exists but the user hits ORA-00942 or ORA-01031, the fix is a grant, not a synonym change. The schema that owns the target must grant the privilege to the schema or role using the synonym.
A few conditions worth checking when a grant seems present but access still fails:
Role grants versus direct grants. Privileges acquired through a role work for normal SQL, but not for definer's-rights stored PL/SQL and not for some operations that require direct grants. If the synonym is used inside a procedure owned by another schema, a role-based grant may not be enough; a direct grant to the owner may be required. Public versus private synonyms. A public synonym visible to everyone still requires the underlying privilege. Creating a public synonym does not grant access. Revoked or expired grants. Confirm with SELECT * FROM all_tab_privs WHERE table_name = 'ORDERS';.
After granting, recompile dependents (next path) and retest.
Repair Path 3: Looping or Mis-Resolved Synonym Chains
ORA-01775 usually means a synonym resolves to another synonym of the same name, or two schemas point at each other. The cause is often a public synonym shadowing a private one, or a local synonym created with the same name as its remote target.
To untangle it:
1: List every synonym with that name across schemas: SELECT owner, synonym_name, table_owner, table_name FROM all_synonyms WHERE synonym_name = 'X'; 2: Follow the chain until it reaches a real table or times out. 3: Drop the redundant or mis-pointing synonym so exactly one definition resolves to a real object. 4: If a public synonym and a private synonym share a name, decide which should win—private synonyms take precedence for the owning schema, so the conflict is usually a design mistake.
After cleanup, test resolution with a query the same way you did initially.
Repair Path 4: Schema and Resolution Order Problems
Oracle resolves unqualified names by checking the current schema first, then public synonyms. Problems arise when:
A local object shadows the synonym. A table or view in the current schema has the same name as the synonym you meant to use. Rename or drop the shadowing object, or qualify the reference. CURRENT_SCHEMA was changed. Applications that switch schemas can resolve synonyms differently. Confirm the session schema with SELECT SYS_CONTEXT('USERENV','CURRENT_SCHEMA') FROM dual;. optimizer_use_invisible_indexes or edition-based redefinition is involved—rare, but editioning views and synonyms interact in ways that can surprise you during rolling upgrades.
These cases don't show as "invalid synonym" so much as "wrong object resolved," but they're worth ruling out before you recreate anything.
Recompile Dependent Objects to Clear INVALID Status
Once the target and privileges are fixed, dependent views, procedures, packages, functions, and triggers may still show INVALID until they're recompiled. Recompiling is the step that actually flips the status.
UTL_RECOMP is the standard approach when many invalid objects remain; it handles parallel recompilation and tracks remaining invalids. DBMS_UTILITY.COMPILE_SCHEMA is simpler and serial. Either way, recheck the count of INVALID objects afterward:
Expect zero for the objects you touched. If some remain, check that their target privileges and names are truly correct—recompilation failure usually means the dependency still can't resolve, and the compiler error message points at the specific line and object.
A caution: recompiling can sometimes be forced by a simple SELECT from the dependent view, because Oracle validates lazily. So if you see INVALID but the view works fine, a query may clear it. That's normal; it isn't a reason to run recompiles blindly across a busy production schema.
Validate Without Breaking Anything
Because invalid objects are often harmless until used, remove or descripe before recompiling in production. A few safety habits:
Reproduce in a lower environment with the same schema/privilege layout before touching production. Snapshot the current dependency and privilege state so you can revert a grant or recreated synonym. Recompile during low-traffic windows; recompiling large packages can lock and introduce brief plan regressions. Test the actual application path, not just a direct select, because a synonym may resolve for you as DBA but fail for the application's least-privileged user.
The success check is simple: the specific query or procedure that failed now succeeds, and ALL_OBJECTS.STATUS shows VALID for the dependents. If it doesn't, the cause is almost always a privilege-vs-role mismatch or a name that still resolves to the wrong object.
Prevention: Keeping Synonyms Valid After Changes
Most synonym invalidation happens during migrations, object rebuilds, and deployments. A few practices cut the recurrence:
Version DDL that owns both the object and its synonyms. When a table is rebuilt, recreate its synonyms in the same script. Prefer qualified names in application SQL where feasible; synonyms are convenient but add an indirection layer that can mask ownership mismatches. Grant sparingly and directly for cross-schema PL/SQL paths, since role grants don't cover all cases. Monitor INVALID objects regularly with a scheduled dictionary query so you catch breakage before an application does. Document synonym targets so a rename or move prompts a synonym review.
None of these changes what the synonym is; they just keep its target and privileges aligned so it never needs "fixing" on an emergency basis.
FAQ
Can I alter a synonym in place to fix an invalid target? No. Oracle has no ALTER SYNONYM to change the target. You drop and recreate it, or restore the object it already points to.
Does a synonym have its own validity status I can set? Not that you set. Status is inferred from dependent objects and from whether resolution succeeds. Fix the target and privileges, then recompile.
Why does my object stay INVALID after I recompile? The compiler still can't resolve a dependency—usually a missing direct grant (role grants won't help inside definer's-rights PL/SQL) or a name pointing at the wrong object. Read the compilation error and confirm the exact target.
Is a public synonym safer than a private one? No. They behave differently in resolution order, and public synonyms still need underlying privileges. Choose based on who should see the name, not on validity.
Bottom Line
Making an "invalid" synonym valid is really making its resolution path valid. Diagnose whether the target is missing, renamed, mis-owned, or blocked by privileges; fix that; then recompile the dependents and confirm with a real query. The synonym itself never needs its status changed—it only needs something correct to point at and a user with the right to reach it. Keep object and synonym DDL together in your deployment scripts, grant directly where cross-schema PL/SQL is involved, and the invalid-synonym surprise largely disappears.