Database Utilities (MOSC)

MOSC Banner

Datapump export exclude internal users with $ in schema name

edited Dec 4, 2018 2:01PM in Database Utilities (MOSC) 9 commentsAnswered ✓

Hi,

I am trying to run a datapump export and dynamically create the schemas list by setting a system variable I can call into the expdp command.  Things work except for excluding the schemas with a $ in them.

I set my system variable with:

SCHEMAS=`sqlplus -s / <<EOF

set echo off;

set head off;

set feedback off;

set verify off;

set trimspool on;

set trimout on;

set lines 32000

select listagg(username,',') within group (order by username)

from dba_users

where username not in ('ANONYMOUS','APEX_PUBLIC_USER','APPQOSSYS','AUDSYS','CTXSYS','DBSNMP','DIP',

'EXFSYS','EXP','FLOWS_030000','FLOWS_FILES','GSMADMIN_INTERNAL','GSMCATUSER','GSMUSER','MDDATA',

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center