Data Pump expdp to ASM daily [message #512048] |
Thu, 16 June 2011 13:37 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.gravatar.com/avatar/e1d6f311b3f520a9d56278d3029f6c86?s=64&d=mm&r=g) |
s197oo302
Messages: 50 Registered: January 2011 Location: seoul
|
Member |
![michael.oh78](/forum/theme/orafaq/images/skype.png)
|
|
i succeeded to expdp to ASM diskgroup such as
create directory asmexpdir as '+RECO/FILTDB/EXPDP';
grant read,write on directory asmexpdir to oraasfs;
expdp oraasfs/oraasfs2301 directory=asmexpdir dumpfile=SBSR_EXP.dmp tables=TM_SFS_CUST_01 logfile=EXPDP_LOG:SBSR_EXP.log
SUCCESS MESSAGE
. . exported "ORAASFS"."TM_SFS_CUST_01" 387.2 MB 817684 rows
Master table "ORAASFS"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for ORAASFS.SYS_EXPORT_TABLE_01 is:
+RECO/filtdb/expdp/sbsr_exp.dmp
Job "ORAASFS"."SYS_EXPORT_TABLE_01" successfully completed at 03:34:59
And I like to run this daily and delete after 14 days.
but it show error, what can be the solution to run this script?
#!/bin/bash
#Script to Perform Datapump Export backup Every Day
################################################################
#Change History
#================
#DATE AUTHOR s970302@gmail.com LAST-CHANGE
#--------- ----------------------- --------------------------------- -----------
#16-JUN-2011 Michael Wu SCRIPT FOR FULL EXPORT filtdb 01-JUN-2011
################################################################
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export ORACLE_SID=filtdb1
export PATH=$PATH:$ORACLE_HOME/bin;/u01/app/common/oracle/sql:.:/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/admin
expdp oraasfs/oraasfs2301@FILTDB dumpfile=CUST-`date '+%d%m%Y_%H%M%S'`.dmp directory=asmexpdir logfile=EXPDP_LOG:CUST-`date '+%d%m%Y_%H%M%S'`.log EXCLUDE=STATISTICS CONTENT=ALL JOB_NAME=CUST_EXPDP_FILTDB tables=TM_SFS_CUST_01
############################################################################
#Removing 7 days old dump files
find +RECO/FILTDB/EXPDP -mtime +13 -exec rm {} \;
######################################################################################
ERROR MESSAGE
sh expdp.sh
expdp.sh: line 16: /u01/app/common/oracle/sql:.:/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/admin: No such file or directory
Export: Release 11.2.0.2.0 - Production on Fri Jun 17 03:31:41 2011
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
ORA-39002: invalid operation
ORA-39070: Unable to open the log file.
ORA-29283: invalid file operation
ORA-06512: at "SYS.UTL_FILE", line 536
ORA-29283: invalid file operation
|
|
|
|
|
Re: Data Pump expdp to ASM daily [message #512074 is a reply to message #512065] |
Thu, 16 June 2011 15:32 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
John Watson
Messages: 8944 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
Hi - there is a semicolon on your PATH setting, that might cause some issues. And (unrelated to your reported problem) this
find +RECO/FILTDB/EXPDP -mtime +13 -exec rm {} \;
will not work, you cannot use file system utilities on an ASM device, because it doesn;t have a file system.
I would try a much simpler, fully qualified, log file name.
Hope this helps.
John.
[update: no, I just remembered, the log file does have to be in an Oracle directory, I think?]
[Updated on: Thu, 16 June 2011 15:37] Report message to a moderator
|
|
|
Re: Data Pump expdp to ASM daily [message #512382 is a reply to message #512074] |
Mon, 20 June 2011 00:09 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.gravatar.com/avatar/e1d6f311b3f520a9d56278d3029f6c86?s=64&d=mm&r=g) |
s197oo302
Messages: 50 Registered: January 2011 Location: seoul
|
Member |
![michael.oh78](/forum/theme/orafaq/images/skype.png)
|
|
I am succesful with DATA_PUMP_DIR, I don't know what's difference with EXPDP_LOG directory and I can't find any log saved in DATA_PUMP_DIR. something is wrong but I finish EXPDP with script.
chmod also same drwxrwxrwx 2 oracle oinstall 4096 Apr 5 02:23 log(DATA_PUMP_DIR), drwxrwxrwx 2 oracle oinstall 4096 Jun 17 03:50 EXPLOG(EXPDP_LOG)
I might utilize this script but I like to found out where is error.
Thank you.
SQL> select * from dba_directories
2 where upper(directory_name) = 'EXPDP_LOG';
OWNER DIRECTORY_NAME
------------------------------ ------------------------------
DIRECTORY_PATH
--------------------------------------------------------------------------------
SYS EXPDP_LOG
/home/oracle/EXPDP/EXPLOG
SQL> select * from dba_directories
2 where upper(directory_name) = 'DATA_PUMP_DIR';
OWNER DIRECTORY_NAME
------------------------------ ------------------------------
DIRECTORY_PATH
--------------------------------------------------------------------------------
SYS DATA_PUMP_DIR
/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/log/
[Updated on: Mon, 20 June 2011 00:09] Report message to a moderator
|
|
|
|
Re: Data Pump expdp to ASM daily [message #512396 is a reply to message #512389] |
Mon, 20 June 2011 02:01 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](http://www.gravatar.com/avatar/e1d6f311b3f520a9d56278d3029f6c86?s=64&d=mm&r=g) |
s197oo302
Messages: 50 Registered: January 2011 Location: seoul
|
Member |
![michael.oh78](/forum/theme/orafaq/images/skype.png)
|
|
I want to use /home/oracle/EXPDP as my log directory as expdplog.
and the Result is
OS level:
[oracle@filtdb01 EXPDP]$ ls -ld /home/oracle/EXPDP/
drwxrwxrwx 2 oracle oinstall 4096 Jun 20 14:25 /home/oracle/EXPDP/
[oracle@filtdb01 EXPDP]$ ls -l /home/oracle/EXPDP/
total 0
[oracle@filtdb01 EXPDP]$ df .
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/VGExaDb-LVDbSys1
30963708 14504340 14886504 50% /
SQL LEVEL:
SQL> select table_name, grantee, privilege
2 from dba_tab_privs
3 where table_name in ('EXPDPLOG', 'DATA_PUMP_DIR');
TABLE_NAME GRANTEE PRIVILEGE
------------------------------ ------------------------------ ----------------------------------------
DATA_PUMP_DIR EXP_FULL_DATABASE READ
DATA_PUMP_DIR EXP_FULL_DATABASE WRITE
DATA_PUMP_DIR IMP_FULL_DATABASE READ
DATA_PUMP_DIR IMP_FULL_DATABASE WRITE
EXPDPLOG ORAASFS READ
DATA_PUMP_DIR ORAASFS READ
EXPDPLOG ORAASFS WRITE
DATA_PUMP_DIR ORAASFS WRITE
SQL> select granted_role, default_role
2 from dba_role_privs
3 where grantee=upper('oraasfs')
4 ;
GRANTED_ROLE DEF
------------------------------ ---
DATAPUMP_EXP_FULL_DATABASE NO
EXP_FULL_DATABASE NO
DBA YES
CONNECT YES
DATAPUMP_IMP_FULL_DATABASE NO
RESOURCE YES
TT_CACHE_ADMIN_ROLE YES
SQL> select privilege
2 from dba_sys_privs
3 where grantee=upper('oraasfs')
4 ;
PRIVILEGE
----------------------------------------
CREATE ANY TRIGGER
SELECT ANY DICTIONARY
ALTER ANY OUTLINE
CREATE VIEW
CREATE ANY TABLE
CREATE TABLE
CREATE ANY PROCEDURE
UPDATE ANY TABLE
INSERT ANY TABLE
CREATE SESSION
EXECUTE ANY TYPE
PRIVILEGE
----------------------------------------
EXECUTE ANY PROCEDURE
SELECT ANY TABLE
MANAGE TABLESPACE
ALTER TABLESPACE
CREATE ANY TYPE
CREATE TRIGGER
ALTER ANY TABLE
UNLIMITED TABLESPACE
CREATE ANY OUTLINE
CREATE PROCEDURE
CREATE DATABASE LINK
PRIVILEGE
----------------------------------------
CREATE TABLESPACE
Thank You
[Updated on: Mon, 20 June 2011 02:16] Report message to a moderator
|
|
|
|
|
Re: Data Pump expdp to ASM daily [message #512530 is a reply to message #512529] |
Mon, 20 June 2011 19:56 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](http://www.orafaq.com/forum/images/custom_avatars/136107.jpg) |
BlackSwan
Messages: 26766 Registered: January 2009 Location: SoCal
|
Senior Member |
|
|
expdp dbadmin/admindb directory=LOG_FILE_DIR dumpfile=test.dmp logfile=test.log schemas=dbadmin
Command line above produced results below
bcm@bcm-laptop:~$ ls -ltr /u01/app/oracle/product/11.2.0/dbhome_1/demo/schema/log/
total 540
-rw-r----- 1 oracle dba 1573 2010-05-07 11:19 ext_1v3.log
-rw-r----- 1 oracle dba 540672 2011-06-20 17:54 test.dmp
-rw-r--r-- 1 oracle dba 2942 2011-06-20 17:54 test.log
It is trivial to test the basics. First make it work; then make it fancy!
|
|
|