ORA-31603 Error When Get DDL For A Profile

Today I was getting the DDL for differents objects in a database, the problem is when I get the Profiles definition, by using the next query;

 
SELECT DBMS_METADATA.GET_DDL('PROFILE',PROFILE)
 FROM (SELECT UNIQUE PROFILE FROM DBA_PROFILES);  

ERROR:

ORA-31603: object "DEFAULT" of type PROFILE not found in schema "SYS"
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
ORA-06512: at "SYS.DBMS_METADATA", line 628
ORA-06512: at "SYS.DBMS_METADATA", line 1221
ORA-06512: at line 1

The problem is the default profile. It is make not sense export (import) and default profile fron one database to other. The solution is exclude the default profile like show below;

 
SELECT DBMS_METADATA.GET_DDL('PROFILE',PROFILE)
FROM (SELECT UNIQUE PROFILE FROM DBA_PROFILES)
WHERE profile != 'DEFAULT';

HTH – Antonio NAVARRO

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s