Detailed Oracle 11G restart uard restart process
Scenario: restart the database, do not restart the linux system, so you do not need to consider listening programs,
# Linux input lsnrctl start
1. Close the database
1.1 shut down the master database
Shutdown immediate;
SQL> SHUTDOWN IMMEDIATE;
Database closed.
Database dismounted.
Oracle instance shut down.
SQL>
1.2 close the slave Database
Alter database recover managed standby database cancel;
Shutdown immediate;
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
Database altered.
SQL> SHUTDOWN IMMEDIATE;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
2. Start the database,
When enabled, enable the standby database to start the standby database listening, and then enable the primary database
2.1 start the slave Database
# Startup mount;
# Alter database recover managed standby database;
# Alter database open;
# You do not need to set the archive here. The Archive setting takes effect permanently. Just start startup.
STARTUP;
SQL> STARTUP;
ORACLE instance started.
Total System Global Area 5344731136 bytes
Fixed Size 2213136 bytes
Variable Size 3489663728 bytes
Database Buffers 1811939328 bytes
Redo Buffers 40914944 bytes
Database mounted.
Database opened.
SQL>
2.2 start the master database
STARTUP;
SQL> STARTUP;
ORACLE instance started.
Total System Global Area 1.1358E + 10 bytes
Fixed Size 2216744 bytes
Variable Size 8589937880 bytes
Database Buffers 2751463424 bytes
Redo Buffers 13946880 bytes
Database mounted.
Database opened.
SQL>
/* Replace the following process. The database is originally archived, so it will be restarted after it is closed. The database is also archived.
Startup mount;
Alter database archivelog;
Alter database open ;*/
2.3 start the standby Database Application
Alter database recover managed standby database;
Alter database recover managed standby database;
This command is a dead command and will be stuck here all the time, but archive logs are already synced in the background, unless manually disabled.
Alter database open; -- the slave DATABASE does not have to be in the OPEN state. You just need to start the archive and be applied. This command does not need to be executed.
2.4 check to check whether the archive is applied in a timely manner
First, check the archiving log synchronization of the slave database.
SQL> SELECT NAME, applied FROM v $ archived_log;
......
NAME
--------------------------------------------------------------------------------
APPLIED
---------
/Data/oracle/oradgdata/standby_archive/41520866_821708334.dbf
YES
/Data/oracle/oradgdata/standby_archive/201720867_821708334.dbf
YES
/Data/oracle/oradgdata/standby_archive/41520868_821708334.dbf
YES
NAME
--------------------------------------------------------------------------------
APPLIED
---------
/Data/oracle/oradgdata/standby_archive/41520869_821708334.dbf
YES
2800 rows selected.
SQL>
If all the logs are YES, the archived logs are synchronized.
Run check on the master database:
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination/oracle/app/oracle/flash_recovery_area/archivelog
Oldest online log sequence 20869
Next log sequence to archive 20871
Current log sequence 20871
SQL>
Execute check in the slave Database
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination/data/oracle/oradgdata/standby_archive
Oldest online log sequence 20869
Next log sequence to archive 0
Current log sequence 20871
SQL>
The Current log sequence of the master database and slave database is 20871, and the latest archive log applied on the slave database is YES, which indicates that the data synchronization of the master database and slave database is consistent.
Restarting uard is complete. Here, the SQL command window for executing 2.3 is forcibly closed.
The next time we execute the Step 2.3, we can add disconnect from session to the end. This is what we can accept to disconnect the session after the command is executed, you can use this connection to execute other commands.
-------------------------------------- Split line --------------------------------------
References:
Important configuration parameters of Oracle Data Guard
Configure Oracle 11g Data Guard based on the same host
Explore Oracle 11g elastic uard
Oracle Data Guard (RAC + DG) archive deletion policies and scripts
Role conversion for Oracle Data Guard
FAL gap in Oracle Data Guard logs
Oracle 11g Data Guard Error 16143 Heartbeat failed to connect to standby
-------------------------------------- Split line --------------------------------------