How to change archive destination folder on oralce 11g

old Archive destination            /u01/ora/db/tech_st/11.1.0/dbs/arch
 New  Archive destination       /u01/Arch_BKP

Note:- Check your Database running with SPfile or Pfile.

SELECT DECODE(value, NULL, 'PFILE', 'SPFILE') "Init File Type" 
   FROM sys.v_$parameter WHERE name = 'spfile';
SQL> show parameter spfile;
SQL> SELECT DECODE(value, NULL, 'PFILE', 'SPFILE') "Init File Type"
         FROM v$parameter WHERE name = 'spfile';


If Database using SPfile than directly use below statement or restart Archive-log.

SQL> alter system set log_archive_dest='/u01/Arch_BKP' scope=spfile;


Steps:-1
 Connect to SQL as sysdba

[ora@sujeet 11.1.0]$ sqlplus / as sysdba  

 Steps:-2
Down Database
SQL> shutdown immediate;


 Steps:-3
Start with Mount
SQL> startup mount

 Steps:-4
If your Database in Archive mode:-

SQL> archive log list

Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /u01/ora/db/tech_st/11.1.0/dbs/arch
Oldest online log sequence     8
Next log sequence to archive   9
Current log sequence           9

Change noarchive mode


SQL> alter database noarchivelog;

Database altered.

SQL> archive log list
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            /u01/ora/db/tech_st/11.1.0/dbs/arch
Oldest online log sequence     10
Current log sequence           11

 Steps:-5
You have 2 option to change Archive destination:-

1. edit the init.ora parameter file (Pfile)

 OR
Set other Archive destination location.
my Location= /u01/Arch_BKP

SQL> alter system set log_archive_dest='/u01/Arch_BKP' scope=spfile;

 Steps:-6
Change Archive Mode



SQL> alter database archivelog;

Database altered.


SQL> archive log list

Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /u01/Arch_BKP
Oldest online log sequence     8
Next log sequence to archive   9
Current log sequence           9

 Steps:-7

Open Database:-
 SQL> alter database open;

Database altered.

SQL> alter system switch logfile;

System altered.



 

No comments:

ORA-00059: Maximum Number Of DB_FILES Exceeded in 19C database

When I am adding datafile to my 19C database facing the below error. SQL> alter tablespace DATA  add datafile '/u01/data/data15.dbf...