In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces Oracle DG from the library Rman how to achieve backup recovery testing, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
1. System initialization and database installation
Slightly
two。 Parameter file recovery
RMAN > startup nomount
Startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file'/ U01ActionAccord product 11.2.0.4 Universe dbsUnix inittest.ora'
Starting Oracle instance without parameter file for retrieval of spfile
Oracle instance started
Total System Global Area 1068937216 bytes
Fixed Size 2260088 bytes
Variable Size 301990792 bytes
Database Buffers 754974720 bytes
Redo Buffers 9711616 bytes
RMAN > restore spfile from'/ U01Universe tools Universe 20170310 Universe fullbacks Testoft 20170310 '3839'
Starting restore at 2017-03-10 15:14:11
Allocated channel: ORA_DISK_1
Channel ORA_DISK_1: SID=1345 device type=DISK
Channel ORA_DISK_1: restoring spfile from AUTOBACKUP / U01/tools/20170310/full_TEST_20170310_3839
Channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 2017-03-10 15:14:12
SQL > shutdown immediate
[oracle@DB_TEST dbs] $cd $ORACLE_HOME/dbs
[oracle@DB_TEST dbs] $strings spfiletest.ora > inittest.ora
[oracle@DB_TEST dbs] $mkdir-p / U01/app/oracle/oradata/test/
[oracle@DB_TEST dbs] $mkdir-p / U01/app/oracle/fast_recovery_area/test/
[oracle@DB_TEST dbs] $mkdir-p / U01/app/oracle/fast_recovery_area/TEST/arch
[oracle@DB_TEST dbs] $mv spfiletest.ora spfiletest.ora_bak
SQL >! mkdir-p / U01/app/oracle/admin/test/adump
SQL > startup nomount
ORACLE instance started.
Total System Global Area 2.0310E+10 bytes
Fixed Size 2262008 bytes
Variable Size 3355446280 bytes
Database Buffers 1.6911E+10 bytes
Redo Buffers 40865792 bytes
SQL > create spfile from pfile
File created.
SQL > shutdown immediate
ORA-01507: database not mounted
ORACLE instance shut down.
SQL > startup nomount
ORACLE instance started.
Total System Global Area 2.0310E+10 bytes
Fixed Size 2262008 bytes
Variable Size 3355446280 bytes
Database Buffers 1.6911E+10 bytes
Redo Buffers 40865792 bytes
3. Control file recovery
Restore standby control files by backup, and then create new control files for incomplete recovery
RMAN > restore standby controlfile from'/ U01Universe tools Universe 20170310 Universe fullbacks Testoods 20170310 '3838'
Starting restore at 2017-03-10 15:29:28
Allocated channel: ORA_DISK_1
Channel ORA_DISK_1: SID=96 device type=DISK
Channel ORA_DISK_1: restoring control file
Channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Output file name=/U01/app/oracle/oradata/test/control01.ctl
Output file name=/U01/app/oracle/fast_recovery_area/test/control02.ctl
Finished restore at 2017-03-10 15:29:29
RMAN > alter database mount
Database mounted
Released channel: ORA_DISK_1
SQL > select open_mode from v$database
OPEN_MODE
-
MOUNTED
4. Data file recovery
RMAN > catalog start with'/ U01Universe tools Universe 20170310'
Searching for all files that match the pattern / U01/tools/20170310
List of Files Unknown to the Database
= =
File Name: / U01/tools/20170310/arch_TEST_20170310_3835
File Name: / U01/tools/20170310/full_TEST_20170310_3836
File Name: / U01/tools/20170310/full_TEST_20170310_3839
File Name: / U01/tools/20170310/full_TEST_20170310_3837
File Name: / U01/tools/20170310/full_TEST_20170310_3838
Do you really want to catalog the above files (enter YES or NO)? Yes
Cataloging files...
Cataloging done
List of Cataloged Files
=
File Name: / U01/tools/20170310/arch_TEST_20170310_3835
File Name: / U01/tools/20170310/full_TEST_20170310_3836
File Name: / U01/tools/20170310/full_TEST_20170310_3839
File Name: / U01/tools/20170310/full_TEST_20170310_3837
File Name: / U01/tools/20170310/full_TEST_20170310_3838
RMAN > restore database
Restore to the specified sequence
RMAN > recover database until sequence 5545
Starting recover at 2017-03-10 15:34:27
Using channel ORA_DISK_1
Starting media recovery
Oracle Error:
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1:'/ U01OnOnOnActionoradataUniplesSystem01.dbf'
Media recovery complete, elapsed time: 00:00:01
Finished recover at 2017-03-10 15:34:28
5. Rebuild control file
SQL > alter database backup controlfile to trace as'/ U01 Universe tools Universe 20170310 Universe control.trc'
SQL > shutdown immediate
SQL > startup nomount
[oracle@DB_TEST 20170310] $rm-rf / U01/app/oracle/oradata/test/control01.ctl
[oracle@DB_TEST 20170310] $rm-rf / U01/app/oracle/fast_recovery_area/test/control02.ctl
SQL > @ create_controlfile.sql
SQL > select open_mode from v$database
OPEN_MODE
-
MOUNTED
Rebuild the control file:
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "TEST" RESETLOGS FORCE LOGGING ARCHIVELOG
MAXLOGFILES 40
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1'/ U01 SIZE SIZE 100m BLOCKSIZE 512
GROUP 2'/ U01 SIZE SIZE 100m BLOCKSIZE 512
GROUP 3'/ U01 SIZE SIZE 100m BLOCKSIZE 512
GROUP 4'/ U01 SIZE SIZE 100m BLOCKSIZE 512
GROUP 5'/ U01 SIZE SIZE 100m BLOCKSIZE 512
GROUP 6'/ U01 SIZE SIZE 100m BLOCKSIZE 512
GROUP 7'/ U01 SIZE SIZE 100m BLOCKSIZE 512
GROUP 8'/ U01 SIZE SIZE 100m BLOCKSIZE 512
GROUP 9'/ U01 SIZE SIZE 100m BLOCKSIZE 512
GROUP 10'/ U01 SIZE SIZE 100m BLOCKSIZE 512
GROUP 11'/ U01 SIZE SIZE 100m BLOCKSIZE 512
GROUP 12'/ U01 SIZE SIZE 100m BLOCKSIZE 512
DATAFILE
'/ U01OnOnOnApplash oracleandoradataUniple testUniverse system01.dbf'
'/ U01OnOnApplink oracleandoradataUniplicateTestUnix01.dbf'
'/ U01OnOnOnApplash oradataUniplicateUndotbs01.dbf'
'/ U01OnOnOnApplink oracleandoradataUniplicateUS01.dbf'
'/ U01 apprenticespact oradataUniverse testUniDATA 01.dbf'
'/ U01 apprenticeship oracle.oradataActionTestUniverse index01.dbf'
'/ U01 apprenticespact oradataUniverse testUniDATA 02.dbf'
'/ U01 apprenticespact oradataUniverse testUniverse data03.dbf'
'/ U01 apprenticeship oracle.oradataActionTestUniverse index02.dbf'
'/ U01 apprenticeship oracle.oradataActionTestUniverse index03.dbf'
CHARACTER SET ZHS16GBK
6. Incomplete recovery of database
Select file#,checkpoint_change# from v$datafile
Select checkpoint_change# from v$database
Check the hidden parameter value: _ allow_resetlogs_corruption (the goal of the whole adjustment is to force the database to start. After setting this parameter, Oracle will skip some consistency checks during the database Open process, so that the database may skip the inconsistent state and Open is open)
Col KSPPINM for a30
Col KSPPSTVL for a30
Col KSPPDESC for a30
Set line 200
SELECT ksppinm, ksppstvl, ksppdesc
FROM x$ksppi x, x$ksppcv y
WHERE x.indx = y.indx AND ksppinm ='_ allow_resetlogs_corruption'
SQL > alter system set "_ allow_resetlogs_corruption" = true scope=spfile
SQL > shutdown immediate
SQL > startup mount
SQL > alter database open resetlogs
Database altered.
SQL > alter system set "_ allow_resetlogs_corruption" = FALSE scope=spfile
SQL > shutdown immediate
SQL > startup
ORACLE instance started.
Total System Global Area 2.0310E+10 bytes
Fixed Size 2262008 bytes
Variable Size 3355446280 bytes
Database Buffers 1.6911E+10 bytes
Redo Buffers 40865792 bytes
Database mounted.
Database opened.
SQL >
The data recovery process is complete at this point.
7. Monitoring and tnsnames.ora profile recovery
Listener.ora
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = DB_TEST) (PORT = 1521))
)
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = test)
(ORACLE_HOME = / U01/app/oracle/product/11.2.0.4)
(SID_NAME = test)
)
(SID_DESC =
(GLOBAL_DBNAME = test00_DGMGRL)
(ORACLE_HOME = / U01/app/oracle/product/11.2.0.4)
(SID_NAME = test)
)
)
LISTENER1532 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = DB_TEST) (PORT = 1532))
)
)
)
SID_LIST_LISTENER1532 =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = test)
(ORACLE_HOME = / U01/app/oracle/product/11.2.0.4)
(SID_NAME = test)
)
(SID_DESC =
(GLOBAL_DBNAME = test00_DGMGRL)
(ORACLE_HOME = / U01/app/oracle/product/11.2.0.4)
(SID_NAME = test)
)
)
LISTENER1522 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = DB_TEST) (PORT = 1522))
)
)
)
SID_LIST_LISTENER1522 =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = test)
(ORACLE_HOME = / U01/app/oracle/product/11.2.0.4)
(SID_NAME = test)
)
)
LISTENER1523 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = DB_TEST) (PORT = 1523))
)
)
)
SID_LIST_LISTENER1523 =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = test)
(ORACLE_HOME = / U01/app/oracle/product/11.2.0.4)
(SID_NAME = test)
)
)
LISTENER1525 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = DB_TEST) (PORT = 1525))
)
)
)
SID_LIST_LISTENER1525 =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = test)
(ORACLE_HOME = / U01/app/oracle/product/11.2.0.4)
(SID_NAME = test)
)
)
LISTENER1528 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = DB_TEST) (PORT = 1528))
)
)
)
SID_LIST_LISTENER1528 =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = test)
(ORACLE_HOME = / U01/app/oracle/product/11.2.0.4)
(SID_NAME = test)
)
)
LISTENER1526 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = DB_TEST) (PORT = 1526))
)
)
)
SID_LIST_LISTENER1526 =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = test)
(ORACLE_HOME = / U01/app/oracle/product/11.2.0.4)
(SID_NAME = test)
)
)
SUBSCRIBE_FOR_NODE_DOWN_EVENT_LISTENER=OFF
Tnsnames.ora
# tnsnames.ora Network Configuration File: / U01/app/oracle/product/11.2.0.4/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
TEST01 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = DB_TEST) (PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = test)
)
)
You can start listening through lsnrctl start / lsnrctl start LISTENER1522/lsnrctl start LISTENER1523/lsnrctl start LISTENER1525, test the connectivity of service names through tnsping test01, and view the startup listening port through netstat-luntp.
8. Data verification
SQL > alter session set current_schema=TEST
SQL > select UPDATE_TIME from table_name where rownum
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.