Home » RDBMS Server » Server Administration » Moving files in ASM (10.2.0.4, Win2003 x64, RAC)
Moving files in ASM [message #399801] Fri, 24 April 2009 03:15 Go to next message
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 Smile

Regards
Hristo
Re: Moving files in ASM [message #399812 is a reply to message #399801] Fri, 24 April 2009 03:43 Go to previous messageGo to next message
babuknb
Messages: 1736
Registered: December 2005
Location: NJ
Senior Member

Quote:
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


Use "ASMCMD" tool; confirm us directory/files available or not.

Babu
Re: Moving files in ASM [message #399813 is a reply to message #399812] Fri, 24 April 2009 03:47 Go to previous messageGo to next message
hristo
Messages: 258
Registered: May 2007
Senior Member
Hi!

Thanks for your fast reply, Babu. But I have fixed it now. I had to change
SUBSTR(i.name,25);

to 

SUBSTR(i.name,21);


Regards
Hristo
Re: Moving files in ASM [message #399816 is a reply to message #399813] Fri, 24 April 2009 03:53 Go to previous message
babuknb
Messages: 1736
Registered: December 2005
Location: NJ
Senior Member

Great.

Thanks for the feedback.

Babu
Previous Topic: Drop user taking very long
Next Topic: Error during in creating partitioning table (merged 3)
Goto Forum:
  


Current Time: Sun Dec 01 17:55:50 CST 2024