Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

A case study of restoring oracle Database by nbu

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

Today, I will talk to you about the case study of nbu recovery of oracle database. Many people may not know much about it. In order to make you understand better, the editor summarized the following content for you. I hope you can get something according to this article.

1. Install the operating system

2. Install the database system

3. Install nbu software and configuration

-- install client

Upload SYMCnbclient_Linux-RedHat2.6.18_7.5.0.2.tar

Edit Native hosts

Vi / etc/hosts

Add: 192.168.99.252 hdnbu1

Decompress:

[root@scmtest U01] # tar-xvf SYMCnbclient_Linux-RedHat2.6.18_7.5.0.2.tar

[root@scmtest u01] # cd SYMCnbclient_Linux-RedHat2.6.18_7.5.0.2

[root@scmtest SYMCnbclient_Linux-RedHat2.6.18_7.5.0.2] #. / install

During the process, enter the backup server: hdnbu1

Then use the oracle user to execute:

[root@scmtest bin] # su-oracle

[oracle@scmtest ~] $cd / usr/openv/netbackup/bin

[oracle@scmtest bin] $. / oracle_link

Thu Feb 21 14:03:02 CST 2013

All Oracle instances should be shutdown before running this script.

Please log into the Unix system as the Oracle owner for running this script

Do you want to continue? (YBO) [n] y

LIBOBK path: / usr/openv/netbackup/bin

ORACLE_HOME: / software/oracle/product/10.2.0/db1

Oracle version: 10.2.0.5.0

Platform type: x86_64

Linking LIBOBK:

Ln-s / usr/openv/netbackup/bin/libobk.so64 / software/oracle/product/10.2.0/db1/lib/libobk.so

Done

Please check the trace file located in / tmp/make_trace.23602

To make sure the linking process was successful.

4. Edit the initial parameter file

At this time, it needs to be modified, such as what disk was originally used, what disk is used now, etc.

After editing it is as follows:

*. _ addm_auto_enable=FALSE

*. _ b_tree_bitmap_plans=FALSE

*. _ db_block_numa=1

*. _ enable_NUMA_optimization=FALSE

*. _ optimizer_cartesian_enabled=FALSE

*. _ optimizer_skip_scan_enabled=FALSE

* .archive_lag_target=1800

* .audit_file_dest='/software/oracle/admin/ncerp/adump'

* .background_dump_dest='/software/oracle/admin/ncerp/bdump'

* .compatible='10.2.0.5.0'

* .control_files='/u01/ncerp/control/control01.ctl','/u01/ncerp/control/control02.ctl'

* .core_dump_dest='/software/oracle/admin/ncerp/cdump'

* .db_block_size=8192

* .db_cache_size=4294967296

* .db_create_file_dest='/u01/ncerp/flash_recover'

* .db_domain=''

* .db_file_multiblock_read_count=16

* .db_name='ncerp'

* .java_pool_size=33554432

* .job_queue_processes=10

* .large_pool_size=33554432

* .log_archive_dest_1='location=/u01/ncerp/arch'

* .log_archive_format='%s_%t_%r.log'

* .max_dump_file_size='1024'

* .open_cursors=1000

* .optimizer_dynamic_sampling=4

* .optimizer_index_cost_adj=40

* .parallel_max_servers=5

* .pga_aggregate_target=2147483648

* .processes=800

* .recyclebin='OFF'

* .shared_pool_size=838860800

* .undo_management='AUTO'

* .undo_tablespace='UNDOTBS1'

5. Set up the corresponding directory according to the parameter file

[oracle@scmtest] $mkdir-p / u01/ncerp/control/

[oracle@scmtest U01] $mkdir-p / app/oracle/admin/ncerp/cdump

[oracle@scmtest U01] $mkdir-p / app/oracle/admin/ncerp/bdump

[oracle@scmtest U01] $mkdir-p / app/oracle/admin/ncerp/adump

[oracle@scmtest U01] $mkdir-p / app/oracle/admin/ncerp/pfile

[oracle@scmtest U01] $mkdir-p / u01/ncerp/flash_recover

[oracle@scmtest U01] $mkdir-p / u01/ncerp/arch

[oracle@scmtest ncerp] $mkdir oradata

Note: these should correspond to the parameter file, otherwise it won't start!

6. Restore control files

Export ORACLE_SID=ncerp

[oracle@scmtest U01] $rman target /

Recovery Manager: Release 10.2.0.5.0-Production on Thu Feb 21 14:17:10 2013

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

Connected to target database (not started)

RMAN > startup nomount pfile='/u01/ncpfile.ora'

Oracle instance started

Total System Global Area 5217714176 bytes

Fixed Size 2103536 bytes

Variable Size 905971472 bytes

Database Buffers 4294967296 bytes

Redo Buffers 14671872 bytes

Query the control files to be restored from the nbu server

Hdnbu1:/tmp # bplist-C RD162-t 4-R-b-l / | more

-rw-rw---- oracle dba 10747904 Mar 28 11:26 / c Murat 3383507379-20130328-0b

-rw-rw---- oracle dba 11010048 Mar 28 11:25 / c Murray 2177845250-20130328-0d

-rw-rw---- oracle dba 10747904 Mar 28 11:25 / cntrl_9202_1_811250475

-rw-rw---- oracle dba 10747904 Mar 28 11:25 / cntrl_7788_1_811250456

-rw-rw---- oracle dba 10747904 Mar 28 11:25 / c Murat 3383507379-20130328-0a

-rw-rw---- oracle dba 11010048 Mar 28 11:24 / c Murray 2177845250-20130328-0c

-rw-rw---- oracle dba 114032640 Mar 28 11:17 / al_7786_1_811249961

-rw-rw---- oracle dba 123207680 Mar 28 11:17 / al_7785_1_811249961

-rw-rw---- oracle dba 3670016 Mar 28 11:17 / al_9200_1_811249960

-rw-rw---- oracle dba 3932160 Mar 28 11:17 / al_9199_1_811249959

-rw-rw---- oracle dba 11010048 Mar 28 09:25 / c Murray 2177845250-20130328-0b

-rw-rw---- oracle dba 10747904 Mar 28 09:25 / c Murat 3383507379-20130328-09

-rw-rw---- oracle dba 10747904 Mar 28 09:25 / cntrl_9197_1_811243259

-rw-rw---- oracle dba 10747904 Mar 28 09:25 / cntrl_7783_1_811243253

RMAN > run

2 > {

3 > allocate channel C1 type 'sbt_tape'

4 > send 'NB_ORA_CLIENT=RD162'

5 > restore controlfile from'/ cntrl_24145_1_828414748'

6 > release channel C1

7 >}

Using target database control file instead of recovery catalog

Allocated channel: c1

Channel c1: sid=874 devtype=SBT_TAPE

Channel C1: Veritas NetBackup for Oracle-Release 7.5 (2012050902)

Sent command to channel: c1

Starting restore at 2013-03-28 12:41:30

Channel c1: restoring control file

Channel c1: restore complete, elapsed time: 00:05:16

Output filename=/u02/ncerp/control/control01.ctl

Output filename=/u02/ncerp/control/control02.ctl

Finished restore at 2013-03-28 12:46:47

Released channel: c1

7. Restore database files

Check here to see if the database has been mount

SQL > select status from v$instance

STATUS

-

MOUNTED

RMAN > run {

ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE'

Send 'NB_ORA_CLIENT=RD162'

Set newname for datafile'/ backup/ncerp/oradata/system01.dbf' to'/ u02max ncerpUniverse oradataUniver system01.dbf'

Set newname for datafile'/ backup/ncerp/oradata/system02.dbf' to'/ u02max ncerpUniverse oradataUniver system02.dbf'

Set newname for datafile'/ backup/ncerp/oradata/nnc_index03_1.dbf' to'/ u02max ncerpUniverse oradataUnique ncregions index03 characters 1.dbf'

Set newname for datafile'/ backup/ncerp/oradata/undotbs1.dbf' to'/ u02max ncerp Universe oradata Universe undotbs1.dbf'

Set newname for datafile'/ backup/ncerp/oradata/sysaux01.dbf' to'/ u02 to ncerp / oradata / sysaux01.dbf'

Set newname for datafile'/ backup/ncerp/oradata/users01.dbf' to'/ u02Universe ncerpUniverse oradataUniverse users01.dbf'

Set newname for datafile'/ backup/ncerp/oradata/nnc_data01_1.dbf' to'/ u02 * * ncerp *

Set newname for datafile'/ backup/ncerp/oradata/nnc_data01_2.dbf' to'/ u02 * * ncerp *

Set newname for datafile'/ backup/ncerp/oradata/nnc_data01_3.dbf' to'/ u02 * * ncerp *

Set newname for datafile'/ backup/ncerp/oradata/nnc_data01_4.dbf' to'/ u02 * * ncerp * oradata * ncpromodata01 * * 4.dbf'

Set newname for datafile'/ backup/ncerp/oradata/nnc_data02_1.dbf' to'/ u02 * * ncerp *

Set newname for datafile'/ backup/ncerp/oradata/nnc_data02_2.dbf' to'/ u02 * * ncerp * oradata * ncpromodata02 * 2.dbf'

Set newname for datafile'/ backup/ncerp/oradata/nnc_data03_1.dbf' to'/ u02 @ ncerp * * oradata * *

Set newname for datafile'/ backup/ncerp/oradata/nnc_data03_2.dbf' to'/ u02 * * ncerp *

Set newname for datafile'/ backup/ncerp/oradata/nnc_data03_3.dbf' to'/ u02 * * ncerp *

Set newname for datafile'/ backup/ncerp/oradata/nnc_data03_4.dbf' to'/ u02 * * ncerp * oradata * ncroomdata03 * * 4.dbf'

Set newname for datafile'/ backup/ncerp/oradata/nnc_index02_1.dbf' to'/ u02max ncerpUniverse oradataUnique ncregions index02percent 1.dbf'

Set newname for datafile'/ backup/ncerp/oradata/nnc_index01_1.dbf' to'/ u02max ncerpUniverse oradataUnique ncregions index01percent 1.dbf'

Set newname for datafile'/ backup/ncerp/oradata/nnc_index01_2.dbf' to'/ u02max ncerpUniverse oradataUnique ncregions index01 / 2.dbf'

Set newname for datafile'/ backup/ncerp/oradata/nnc_index01_3.dbf' to'/ u02max ncerpUniverse oradataUnique ncregions index01percent 3.dbf'

Set newname for datafile'/ backup/ncerp/oradata/nnc_index01_4.dbf' to'/ u02max ncerpUniverse oradataUnique ncregions index01percent 4.dbf'

Set newname for datafile'/ backup/ncerp/oradata/iufo01.dbf' to'/ u02 to ncerp / oradata / iufo01.dbf'

Set newname for datafile'/ backup/ncerp/oradata/iufo02.dbf' to'/ u02 to ncerp / oradata / iufo02.dbf'

Set newname for datafile'/ backup/ncerp/oradata/nnc_data03_5.dbf' to'/ u02 * * ncerp *

Restore database

Switch datafile all

}

The vi res_test.sh content is as follows:

Export ORACLE_SID=ncerp

Rman target / select max (SEQUENCE#) from v$archived_log

MAX (SEQUENCE#)

-

3651

SQL > select * from (select status,SEQUENCE#,COMPLETION_TIME from v$archived_log where SEQUENCE# > = 5485 order by SEQUENCE# desc) where rownum recover database using backup controlfile until cancel

ORA-00279: change 86837184 generated at 03/28/2013 01:55:53 needed for thread 1

ORA-00289: suggestion: / u02/ncerp/arch/5464_1_800011778.log

ORA-00280: change 86837184 for thread 1 is in sequence # 5464

Specify log: {= suggested | filename | AUTO | CANCEL}

Auto

ORA-00308: cannot open archived log' / u02 Acer ncerp Archard 5464Canada 800011778.log'

ORA-27037: unable to obtain file status

Linux-x86_64 Error: 2: No such file or directory

Additional information: 3

ORA-00308: cannot open archived log' / u02 Acer ncerp Archard 5464Canada 800011778.log'

ORA-27037: unable to obtain file status

Linux-x86_64 Error: 2: No such file or directory

Additional information: 3

ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below

ORA-01152: file 1 was not restored from a sufficiently old backup

ORA-01110: data file 1:'/ u02max ncerpUniver oradata Univer system01.dbf'

It indicates that 3556 of this archive log is required.

So when you restore, recover from this log!

It can also be run in the background.

Export ORACLE_SID=ncerp

Rman target /

Run

{

Set archivelog destination to'/ u01 Compact ncerp Archetype

ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE'

Send 'NB_ORA_CLIENT=RD162'

Restore archivelog sequence between 3556 and 3562 thread 1

RELEASE CHANNEL ch00

}

9. Database recovery

SQL > ALTER DATABASE RENAME FILE'/ backup/ncerp/redo/redo01.log' TO'/ u02Accord redomax redomax 01.log'

SQL > ALTER DATABASE RENAME FILE'/ backup/ncerp/redo/redo02.log' TO'/ u02According to ncerp / redomax

SQL > ALTER DATABASE RENAME FILE'/ backup/ncerp/redo/redo03.log' TO'/ u02According to ncerp / redomax

SQL > ALTER DATABASE RENAME FILE'/ backup/ncerp/redo/redo04.log' TO'/ u02qrr _ r _ r

SQL > ALTER DATABASE RENAME FILE'/ backup/ncerp/redo/redo05.log' TO'/ u02Accord redomax redomax 05.log'

SQL > ALTER DATABASE RENAME FILE'/ backup/ncerp/redo/redo06.log' TO'/ u02Accord redomax redomax 06.log'

SQL > recover database using backup controlfile until cancel

ORA-00279: change 2418426514 generated at 01/10/2013 21:58:37 needed for thread

one

ORA-00289: suggestion: / u03/app/oracle/oradata/arch/1052_1_800727819.log

ORA-00280: change 2418426514 for thread 1 is in sequence # 1052

Specify log: {= suggested | filename | AUTO | CANCEL}

Auto

SQL > recover database using backup controlfile until cancel

ORA-00279: change 2418716975 generated at 01/11/2013 09:50:06 needed for thread

one

ORA-00289: suggestion: / u03/app/oracle/oradata/arch/1070_1_800727819.log

ORA-00280: change 2418716975 for thread 1 is in sequence # 1070

Specify log: {= suggested | filename | AUTO | CANCEL}

Cancel

Note: if the above log may be a little large, we need to adjust it, such as deleting the log group, and then re-add the log to the new location

10. Open the database

SQL > alter database open resetlogs

Database altered.

Create temporary tablespaces

After reading the above, do you have any further understanding of the case study of nbu restoring oracle database? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report