Make a Batch file for "Exp"
SHAN2009Oct 19 2009 — edited Nov 10 2009Hi,
I am using Oracle 11g Enterprise Database Release 1, I have created a Batch file it Will Export the Specified Schema During the Run Time.
Below Script i have used in the Batch File
SET HEAD OFF;
SET FEEDBACK OFF;
SET PAGESIZE 0;
SET LINESIZE 2000;
SET ECHO OFF;
spool Exp_SYSDATE.log
SELECT 'HOST MKDIR C:\BACKUP\'||TO_CHAR(SYSDATE,'DY_DD-Mon-YYYY')||'\;'FROM DUAL;
SELECT 'HOST EXP USERID=SYSTEM/ORACLE OWNER=(&CLIENT_NAME) FILE=C:\BACKUP\'||TO_CHAR(SYSDATE,'DY_DD-MON-YYYY')||'\EXP_'||HOST_NAME||'_'||TO_CHAR(SYSDATE,'DY_DD-MON-YYYY_HH24-MI-SS')||'.DMP LOG=C:\BACKUP\'||TO_CHAR(SYSDATE,'DY_DD-MON-YYYY')||'\EXP_'||HOST_NAME||'_'||TO_CHAR(SYSDATE,'DY_DD-MON-YYYY_HH24-MI-SS')||'.LOG;' FROM V$INSTANCE;
SPOOL OFF;
@Exp_SYSDATE.log
EXIT
While Executing the Batch file it will ask for the CLIENT_NAME as Below
Enter value for client_name: Client2009
old 1: SELECT 'HOST EXP USERID=SYSTEM/ORACLE OWNER=(&CLIENT_NAME) FILE=C:\BACKUP\'||TO_CHAR(SYSDATE,'DY_DD-MON-YYYY')||'\EXP_'||HOST_NAME||'_'||TO_CHAR(SYSDATE,'DY_DD-MON-YYYY_HH24-MI-SS')||'.DMP LOG=C:\BACKUP\'||TO_CHAR(SYSDATE,'DY_DD-MON-YYYY')||'\EXP_'||HOST_NAME||'_'||TO_CHAR(SYSDATE,'DY_DD-MON-YYYY_HH24-MI-SS')||'.LOG;' FROM V$INSTANCE
new 1: SELECT 'HOST EXP USERID=SYSTEM/ORACLE OWNER=(Client2009) FILE=C:\BACKUP\'||TO_CHAR(SYSDATE,'DY_DD-MON-YYYY')||'\EXP_'||HOST_NAME||'_'||TO_CHAR(SYSDATE,'DY_DD-MON-YYYY_HH24-MI-SS')||'.DMP LOG=C:\BACKUP\'||TO_CHAR(SYSDATE,'DY_DD-MON-YYYY')||'\EXP_'||HOST_NAME||'_'||TO_CHAR(SYSDATE,'DY_DD-MON-YYYY_HH24-MI-SS')||'.LOG;' FROM V$INSTANCE
HOST EXP USERID=SYSTEM/ORACLE OWNER=(Client2009) FILE=C:\BACKUP\MON_19-OCT-2009\EXP_TEST_MON_19-OCT-2009_15-28-52.DMP LOG=C:\BACKUP\MON_19-OCT-2009\EXP_TEST_MON_19-OCT-2009_15-28-52.LOG;
I like to hide this Output Values OLD 1: & NEW 1: in the Screen
After that Export Start
Connected to: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
About to export specified users ...
. exporting pre-schema procedural objects and actions
. exporting foreign function library names for user Client2009
. exporting PUBLIC type synonyms
. exporting private type synonyms
. exporting object type definitions for user Client2009
About to export Client2009's objects ...
. exporting database links
. exporting sequence numbers
. exporting cluster definitions
. about to export Client2009's tables via Conventional Path ...
. . exporting table Table1 159 rows exported
. . exporting table Table2 159 rows exported
. . exporting table Table3 0 rows exported
and So on
My Requirement is to Hide the information of tables are Exported and the Row Count. Because this Batch File is Executed by My Client.
Please Advice on this.
Thank U
Shan
Edited by: SHAN@2009 on Oct 19, 2009 3:37 PM