Moving files in ASM [message #399801] |
Fri, 24 April 2009 03:15 |
hristo
Messages: 258 Registered: May 2007
|
Senior Member |
|
|
Hi all!
Im trying to move files in ASM, from one dir to another.
This is what I done so far:
col name format a50
SELECT sequence#, name
FROM v$archived_log
ORDER BY sequence#;
SEQUENCE# NAME
---------- --------------------------------------------------
2200 +ORA_3/db31/archive/arc02200_0646474821.003
2201 +ORA_3/db31/archive/arc02201_0646474821.003
2202 +ORA_3/db31/archive/arc02202_0646474821.003
That is not all my archivelogs, but the last three. Just so I know the SEQUENCE#.
Then this (I know that putting a backup on the same disc group is not very smart, but this is for training):
SQL> CREATE DIRECTORY archdir AS '+ORA_3/DB31/archive';
Directory created.
SQL> CREATE DIRECTORY tempdir AS '+ORA_3/DB31/backup';
Directory created.
SQL>
set serverout on
DECLARE
v_archivedir VARCHAR2(30) := 'ARCHDIR';
v_tempdir VARCHAR2(30) := 'TEMPDIR';
v_asm_logname VARCHAR2(100);
v_win_logname VARCHAR2(100);
v_first_log_seq NUMBER := 2200;
v_last_log_seq NUMBER := 2202;
CURSOR c_logs IS
SELECT name
FROM v$archived_log
WHERE sequence# BETWEEN v_first_log_seq AND v_last_log_seq
ORDER BY sequence#;
BEGIN
FOR i IN c_logs LOOP
v_asm_logname := SUBSTR(i.name, 25);
v_win_logname := SUBSTR(i.name, 25);
DBMS_FILE_TRANSFER.COPY_FILE(v_archivedir,
v_asm_logname,
v_tempdir,
v_win_logname);
END LOOP;
END;
/
This is the error I get:
ORA-19505: failed to identify file "+ORA_3/DB31/archive/2200_0646474821.003"
ORA-15173: entry '2200_0646474821.003' does not exist in directory 'archive'
ORA-06512: at "SYS.DBMS_FILE_TRANSFER", line 84
ORA-06512: at "SYS.DBMS_FILE_TRANSFER", line 193
ORA-06512: at line 23
The file name is incorrect. It should be
+ORA_3/db31/archive/arc02200_0646474821.003
But why is the first four signs deleted?
I guess many of you have a lot of clues
Regards
Hristo
|
|
|
|
|
|