After the operation of the machines referred to a different note of a heterologous rman restore operation to restore the machine rman

Referred to a different operation after reducing machine rman

After the reduction was far from the main library test library by rman backup because the backup is in standby database backup, database restore state after it is readonly, standby_file_management parameter is auto.
First need to alter database clear logfile group log group; let the database creates a log file on disk.
1 problems, physical redo log file does not exist, then log Group 4 state current, can not be changed operate in readonly mode. Issue 2, and does not correspond to undo tablespace control file parameter file


SQL> alter database rename file '/redo1/redo/redo04a.log' to '/u3/redo1/redo/redo04a.log';
alter database rename file '/redo1/redo/redo04a.log' to '/u3/redo1/redo/redo04a.log'
*
ERROR at line 1:
ORA-01511: error in renaming log/data files
ORA-01621: cannot rename member of current log if database is open
ORA-00312: online log 4 thread 1: '/redo1/redo/redo04a.log'
ORA-00312: online log 4 thread 1: '/redo2/redo/redo04b.log'


SQL> alter database clear logfile group 4;
alter database clear logfile group 4
*
ERROR at line 1:
ORA-00349: failure obtaining block size for '/redo1/redo/redo04a.log'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 9


SQL> alter database drop logfile group 4 ; ----- even if successful, does not delete files on the disk, you need to manually delete
the ALTER Database drop logfile Group 4
*
ERROR AT Line 1:
ORA-01623: log 4 IS Current log ORCL instance for (Thread. 1) - CAN Not drop
ORA-00312: Thread Online log. 1. 4: '/redo1/redo/redo04a.log'
ORA-00312: Thread Online log. 1. 4: '/redo2/redo/redo04b.log'


SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.

Total System Global Area 4.2758E+10 bytes
Fixed Size 2262656 bytes
Variable Size 4966058368 bytes
Database Buffers 3.7447E+10 bytes
Redo Buffers 342855680 bytes
Database mounted.
SQL> alter database rename file '/redo1/redo/redo04a.log' to '/u3/redo1/redo/redo04a.log';
alter database rename file '/redo1/redo/redo04a.log' to '/u3/redo1/redo/redo04a.log'
*
ERROR at line 1:
ORA-01511: error in renaming log/data files
ORA-01275: Operation RENAME is not allowed if standby file management is
automatic.


SQL> show parameter standby;

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
standby_archive_dest string ?/dbs/arch
standby_file_management string AUTO
SQL> alter system standby_file_management='manual';
alter system standby_file_management='manual'
*
ERROR at line 1:
ORA-02065: illegal option for ALTER SYSTEM


SQL> alter system set standby_file_management='manual' scope=both;

System altered.

SQL> alter database rename file '/redo1/redo/redo04a.log' to '/u3/redo1/redo/redo04a.log';

Database altered.

SQL> alter database rename file '/redo2/redo/redo04b.log' to '/u3/redo2/redo/redo04b.log';

Database altered.

SQL> alter database clear logfile group 4; ---- let the database creates a log file on disk

Database altered.

SQL> alter database open;

Database altered.

SQL> select open_mode from v$database;

OPEN_MODE
--------------------
READ ONLY

SQL> desc v$log;
Name Null? Type
----------------------------------------- -------- ----------------------------
GROUP# NUMBER
THREAD# NUMBER
SEQUENCE# NUMBER
BYTES NUMBER
BLOCKSIZE NUMBER
MEMBERS NUMBER
ARCHIVED VARCHAR2(3)
STATUS VARCHAR2(16)
FIRST_CHANGE# NUMBER
FIRST_TIME DATE
NEXT_CHANGE# NUMBER
NEXT_TIME DATE

SQL> select GROUP# ,STATUS,MEMBERS from v$log;

GROUP# STATUS MEMBERS
---------- ---------------- ----------
1 UNUSED 2
2 UNUSED 2
3 UNUSED 2
4 CURRENT 2
5 UNUSED 2
6 UNUSED 2
7 UNUSED 2
8 UNUSED 2

8 rows selected.

SQL> alter system switch logfile;
alter system switch logfile
*
ERROR at line 1:
ORA-16000: database open for read-only access


SQL> alter database recover managed standby database finish force;
alter database recover managed standby database finish force
*
ERROR at line 1:
ORA-00283: recovery session canceled due to errors
ORA-16157: media recovery not allowed following successful FINISH recovery


SQL> alter database commit to switchover to primary;

Database altered.

SQL> select open_mode from v$database;

OPEN_MODE
--------------------
MOUNTED

SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-30012: undo tablespace 'UNDOTBS1' does not exist or of wrong type
Process ID: 20472
Session ID: 769 Serial number: 3


SQL> create undo tablespace undotbs2 datafile'/u3/undotbs2.dbf' size 10g autoextend off;
create undo tablespace undotbs2 datafile'/u3/undotbs2.dbf' size 10g autoextend off
*
ERROR at line 1:
ORA-01109: database not open


SQL> alter tablespace UNDOTBS1 offline;
alter tablespace UNDOTBS1 offline
*
ERROR at line 1:
ORA-01109: database not open

SQL> create pfile='/u3/pfile.ora' from spfile;

File created.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@FIHSER68 ~]$ vi /u3/pfile.ora -----将undo_tablespace参数删除
[oracle@FIHSER68 ~]$ sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.4.0 Production on Wed Mar 27 11:57:12 2019

Copyright (c) 1982, 2013, Oracle. All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> shutdown immediate;
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.
SQL> startup nomount pfile='/u3/pfile.ora';
ORACLE instance started.

Total System Global Area 4.2758E+10 bytes
Fixed Size 2262656 bytes
Variable Size 5234493824 bytes
Database Buffers 3.7178E+10 bytes
Redo Buffers 342855680 bytes

SQL> alter database mount;

Database altered.

SQL> alter database open;

Database altered.

SQL> show parameter undo;

The TYPE of VALUE NAME
------------------------------------ ----------- ------------------------------
undo_management String AUTO
the UNDO_RETENTION Integer 900
UNDO_TABLESPACE String UNDOTBS10 ---- this is a control file records . UNDO_TABLESPACE
SQL> open_mode from the SELECT v $ Database;

OPEN_MODE
--------------------
READ WRITE

SQL> create spfile from pfile='/u3/pfile.ora';

File created.

After the reduction was far from the main library test library by rman backup because the backup is in standby database backup, database restore state after it is readonly, standby_file_management parameter is auto.
First need to alter database clear logfile group log group; let the database creates a log file on disk.
1 problems, physical redo log file does not exist, then log Group 4 state current, can not be changed operate in readonly mode. Issue 2, and does not correspond to undo tablespace control file parameter file


SQL> alter database rename file '/redo1/redo/redo04a.log' to '/u3/redo1/redo/redo04a.log';
alter database rename file '/redo1/redo/redo04a.log' to '/u3/redo1/redo/redo04a.log'
*
ERROR at line 1:
ORA-01511: error in renaming log/data files
ORA-01621: cannot rename member of current log if database is open
ORA-00312: online log 4 thread 1: '/redo1/redo/redo04a.log'
ORA-00312: online log 4 thread 1: '/redo2/redo/redo04b.log'


SQL> alter database clear logfile group 4;
alter database clear logfile group 4
*
ERROR at line 1:
ORA-00349: failure obtaining block size for '/redo1/redo/redo04a.log'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 9


SQL> alter database drop logfile group 4 ; ----- even if successful, does not delete files on the disk, you need to manually delete
the ALTER Database drop logfile Group 4
*
ERROR AT Line 1:
ORA-01623: log 4 IS Current log ORCL instance for (Thread. 1) - CAN Not drop
ORA-00312: Thread Online log. 1. 4: '/redo1/redo/redo04a.log'
ORA-00312: Thread Online log. 1. 4: '/redo2/redo/redo04b.log'


SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.

Total System Global Area 4.2758E+10 bytes
Fixed Size 2262656 bytes
Variable Size 4966058368 bytes
Database Buffers 3.7447E+10 bytes
Redo Buffers 342855680 bytes
Database mounted.
SQL> alter database rename file '/redo1/redo/redo04a.log' to '/u3/redo1/redo/redo04a.log';
alter database rename file '/redo1/redo/redo04a.log' to '/u3/redo1/redo/redo04a.log'
*
ERROR at line 1:
ORA-01511: error in renaming log/data files
ORA-01275: Operation RENAME is not allowed if standby file management is
automatic.


SQL> show parameter standby;

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
standby_archive_dest string ?/dbs/arch
standby_file_management string AUTO
SQL> alter system standby_file_management='manual';
alter system standby_file_management='manual'
*
ERROR at line 1:
ORA-02065: illegal option for ALTER SYSTEM


SQL> alter system set standby_file_management='manual' scope=both;

System altered.

SQL> alter database rename file '/redo1/redo/redo04a.log' to '/u3/redo1/redo/redo04a.log';

Database altered.

SQL> alter database rename file '/redo2/redo/redo04b.log' to '/u3/redo2/redo/redo04b.log';

Database altered.

SQL> alter database clear logfile group 4; ---- let the database creates a log file on disk

Database altered.

SQL> alter database open;

Database altered.

SQL> select open_mode from v$database;

OPEN_MODE
--------------------
READ ONLY

SQL> desc v$log;
Name Null? Type
----------------------------------------- -------- ----------------------------
GROUP# NUMBER
THREAD# NUMBER
SEQUENCE# NUMBER
BYTES NUMBER
BLOCKSIZE NUMBER
MEMBERS NUMBER
ARCHIVED VARCHAR2(3)
STATUS VARCHAR2(16)
FIRST_CHANGE# NUMBER
FIRST_TIME DATE
NEXT_CHANGE# NUMBER
NEXT_TIME DATE

SQL> select GROUP# ,STATUS,MEMBERS from v$log;

GROUP# STATUS MEMBERS
---------- ---------------- ----------
1 UNUSED 2
2 UNUSED 2
3 UNUSED 2
4 CURRENT 2
5 UNUSED 2
6 UNUSED 2
7 UNUSED 2
8 UNUSED 2

8 rows selected.

SQL> alter system switch logfile;
alter system switch logfile
*
ERROR at line 1:
ORA-16000: database open for read-only access


SQL> alter database recover managed standby database finish force;
alter database recover managed standby database finish force
*
ERROR at line 1:
ORA-00283: recovery session canceled due to errors
ORA-16157: media recovery not allowed following successful FINISH recovery


SQL> alter database commit to switchover to primary;

Database altered.

SQL> select open_mode from v$database;

OPEN_MODE
--------------------
MOUNTED

SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-30012: undo tablespace 'UNDOTBS1' does not exist or of wrong type
Process ID: 20472
Session ID: 769 Serial number: 3


SQL> create undo tablespace undotbs2 datafile'/u3/undotbs2.dbf' size 10g autoextend off;
create undo tablespace undotbs2 datafile'/u3/undotbs2.dbf' size 10g autoextend off
*
ERROR at line 1:
ORA-01109: database not open


SQL> alter tablespace UNDOTBS1 offline;
alter tablespace UNDOTBS1 offline
*
ERROR at line 1:
ORA-01109: database not open

SQL> create pfile='/u3/pfile.ora' from spfile;

File created.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@FIHSER68 ~]$ vi /u3/pfile.ora -----将undo_tablespace参数删除
[oracle@FIHSER68 ~]$ sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.4.0 Production on Wed Mar 27 11:57:12 2019

Copyright (c) 1982, 2013, Oracle. All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> shutdown immediate;
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.
SQL> startup nomount pfile='/u3/pfile.ora';
ORACLE instance started.

Total System Global Area 4.2758E+10 bytes
Fixed Size 2262656 bytes
Variable Size 5234493824 bytes
Database Buffers 3.7178E+10 bytes
Redo Buffers 342855680 bytes

SQL> alter database mount;

Database altered.

SQL> alter database open;

Database altered.

SQL> show parameter undo;

The TYPE of VALUE NAME
------------------------------------ ----------- ------------------------------
undo_management String AUTO
the UNDO_RETENTION Integer 900
UNDO_TABLESPACE String UNDOTBS10 ---- this is a control file records . UNDO_TABLESPACE
SQL> open_mode from the SELECT v $ Database;

OPEN_MODE
--------------------
READ WRITE

SQL> create spfile from pfile='/u3/pfile.ora';

File created.

Guess you like

Origin www.cnblogs.com/yaoyangding/p/12046807.html