当前位置:网站首页>Migrate Oracle database from windows system to Linux Oracle RAC cluster environment (3) -- set the database to archive mode

Migrate Oracle database from windows system to Linux Oracle RAC cluster environment (3) -- set the database to archive mode

2022-06-25 02:23:00 Rsda DBA_ WGX

hold Oracle Database from Windows System migration to Linux Oracle Rac Cluster environment (3)—— Set the database to archive mode

One 、 Check if the database is in archive mode

--  node 1: No Archive Mode 
SQL> archive log list;
Database log mode	       No Archive Mode
Automatic archival	       Disabled
Archive destination	       USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     15
Current log sequence	       17

--  node 2: No Archive Mode 
SQL> archive log list;
Database log mode	       No Archive Mode
Automatic archival	       Disabled
Archive destination	       USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     1
Current log sequence	       2

Two 、 Open archive mode

stay oracle rac In a cluster environment , To set a node to archive mode or non archive mode , Other nodes must be shut down .

1、 Set nodes rac1 Archive mode

(1) Close the node 2 Example

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

2、 At the node rac1 Perform the following operations on

(1) Normal shutdown , Then start the database to mount state

--  Close instance 
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

--  Start database to  mount  state 
SQL> startup mount
ORACLE instance started.

Total System Global Area  638853120 bytes
Fixed Size		    2255952 bytes
Variable Size		  507511728 bytes
Database Buffers	  121634816 bytes
Redo Buffers		    7450624 bytes
Database mounted.

(2) Use alter database Command to open archive mode

SQL> alter database archivelog;

Database altered.

(3) Close the node 1 Example

SQL> shutdown immediate
ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.

3、 At the node rac2 Perform the following operations on

(1) Then start the database to mount state

--  node  rac2  In the off state 
--  Start database to  mount  state 
SQL> startup mount
ORACLE instance started.

Total System Global Area  638853120 bytes
Fixed Size		    2255952 bytes
Variable Size		  465568688 bytes
Database Buffers	  163577856 bytes
Redo Buffers		    7450624 bytes
Database mounted.

(2) Use alter database Command to open archive mode

SQL> alter database archivelog;

Database altered.

(3) Close the node 1 Instance archiving mode of

SQL> alter database archivelog;

Database altered.

4、 Open database , View archive status

--  node 1
SQL> startup
ORACLE instance started.

Total System Global Area  638853120 bytes
Fixed Size		    2255952 bytes
Variable Size		  507511728 bytes
Database Buffers	  121634816 bytes
Redo Buffers		    7450624 bytes
Database mounted.
Database opened.

--  View archive status 
SQL> archive log list;
Database log mode	       Archive Mode
Automatic archival	       Enabled
Archive destination	       USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     1
Next log sequence to archive   2
Current log sequence	       2

--  node 2
SQL> alter database open;

Database altered.

--  View archive status 
SQL> archive log list;
Database log mode	       Archive Mode
Automatic archival	       Enabled
Archive destination	       USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     15
Next log sequence to archive   17
Current log sequence	       17

3、 ... and 、 Set the location of the archive

When the database is in archive mode , During log switching, the background process will automatically generate archive logs .

1、 View the number of archive processes

SQL> show parameter LOG_ARCHIVE_MAX_PROCESSES

NAME				     TYPE	 VALUE
------------------------------------ ----------- ------------------------------
log_archive_max_processes	     integer	 4

2、 Look at the archive

The current archive location is :/u01/app/oracle/flash_recovery_area/HISDB/archivelog

SQL> select sequence#, name from v$archived_log;

 SEQUENCE# NAME
--------------------------------------------------------------------------------
	17
/u01/app/oracle/flash_recovery_area/HISDB/archivelog/2022_06_17/o1_mf_1_17_kbr52
8s8_.arc

	18
/u01/app/oracle/flash_recovery_area/HISDB/archivelog/2022_06_17/o1_mf_1_18_kbr52
d2g_.arc

	19
/u01/app/oracle/flash_recovery_area/HISDB/archivelog/2022_06_17/o1_mf_1_19_kbr52
g87_.arc

	 2
/u01/app/oracle/flash_recovery_area/HISDB/archivelog/2022_06_17/o1_mf_2_2_kbr52d
rp_.arc

	20
/u01/app/oracle/flash_recovery_area/HISDB/archivelog/2022_06_17/o1_mf_1_20_kbr52
hdo_.arc

3、 Modify the location of the archive log to :+BAK/hisdb/archivelog

modify log_archive_dest_1 The parameter points to the defined archive location :

SQL> alter system set log_archive_dest_1 = 'location=+BAK' scope = both sid='*';

System altered.

--  contrast log_archive_dest  and log_archive_dest_1  Differences in setting archiving  
-- alter system set log_archive_dest='+DATA' 
-- alter system set log_archive_dest_1='location=+DATA' 

4、 Look at the archive

--  Cut the log 
SQL> alter system switch logfile;

System altered.

SQL> alter system switch logfile;

System altered.

SQL> alter system switch logfile;

System altered.

SQL> select sequence#, name from v$archived_log;

 SEQUENCE# NAME
--------------------------------------------------------------------------------
	17
/u01/app/oracle/flash_recovery_area/HISDB/archivelog/2022_06_17/o1_mf_1_17_kbr52
8s8_.arc

	18
/u01/app/oracle/flash_recovery_area/HISDB/archivelog/2022_06_17/o1_mf_1_18_kbr52
d2g_.arc

	19
/u01/app/oracle/flash_recovery_area/HISDB/archivelog/2022_06_17/o1_mf_1_19_kbr52
g87_.arc

	 2
/u01/app/oracle/flash_recovery_area/HISDB/archivelog/2022_06_17/o1_mf_2_2_kbr52d
rp_.arc

	20
/u01/app/oracle/flash_recovery_area/HISDB/archivelog/2022_06_17/o1_mf_1_20_kbr52
hdo_.arc

	21
+BAK/hisdb/archivelog/2022_06_17/thread_1_seq_21.262.1107612429

	22
+BAK/hisdb/archivelog/2022_06_17/thread_1_seq_22.263.1107612429

	23
+BAK/hisdb/archivelog/2022_06_17/thread_1_seq_23.264.1107612429

	24
+BAK/hisdb/archivelog/2022_06_17/thread_1_seq_24.265.1107612453

	25
+BAK/hisdb/archivelog/2022_06_17/thread_1_seq_25.266.1107612453

		26
+BAK/hisdb/archivelog/2022_06_17/thread_1_seq_26.267.1107612457

	 3
+BAK/hisdb/archivelog/2022_06_17/thread_2_seq_3.268.1107612601

	 4
+BAK/hisdb/archivelog/2022_06_17/thread_2_seq_4.269.1107612605

	 5
+BAK/hisdb/archivelog/2022_06_17/thread_2_seq_5.270.1107612607


14 rows selected.
原网站

版权声明
本文为[Rsda DBA_ WGX]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/176/202206242253453609.html