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

How to make oracle10g rman backup under linux

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

How to do oracle10g rman backup under linux? in view of this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.

RMAN is a database backup and recovery tool provided by Oracle. Rman can be used to back up the database conveniently. Oracle databases can be run in archived and non-archived mode, and the difference between the two lies in the handling of redo log. In archive mode, when a redo log is full, the contents of the redo log will be written to the archive file. After that, the redo log can continue to be used. If it is in non-archive mode, the redo log will be directly overwritten. The recovery of the database generally requires archived files, which records the operation of the database, so the production database is generally run in archive mode to prevent data loss.

1. Set the RMAN backup preparation for ORACLE:

1. View the existing operation mode of the database

Sql > select name,log_mode from v$database

NAME LOG_MODE

--

BIGSUN NOARCHIVELOG # non-archiving mode

You can also view it through the following statement

Sql > archive log list; (conn / as sysdba)

Database log mode No Archive Mode

Automatic archival Disabled # non-archiving mode

Archive destination / export/data/oracle/product/10.0.0.2/dbs/arch

Oldest online log sequence 28613

Current log sequence 28615

Databases that are not in archive mode need to be changed to archive mode before RMAN backups can take place. The steps are as follows:

1. SQL > alter system set log_archive_dest_1='location=/oracle/oracle10g/log/archive_log'

The meaning of this statement is to determine the path of archived logs. In fact, Oracle 10g can generate multiple copies of the same log and save multiple locations in case of accidents.

For example, to add another log location, use the following statement

SQL > alter system set log_archive_dest_2='location=/oracle/oracle10g/log2/archive_log'

two。 Shut down the database

SQL > shutdown immediate

3. Startup data mount status:

SQL > startup mount

4. Modify the database to archive mode:

SQL > alter database archivelog

5. Open the database and query:

SQL > alter database open

Modify the log file naming format:

SQL > alter system set log_archive_max_processes = 5

SQL > alter system set log_archive_format = "archive_%t_%s_%r.log" scope=spfile

After the modification is completed, you can check whether the log mode has been modified successfully!

Sql > select name,log_mode from v$database

NAME LOG_MODE

--

BIGSUN ARCHIVELOG # Archive Mode

Second, use script to realize RMAN automatic backup.

Note: level 0 full backup; level 1 differential backup; level 2 incremental backup

First create three new script files in the / data/rmanbak/script/ directory of the linux oracle server and give each script execution permissions.

Bakl0.sh script

RUN_STR= "

BAK_LEVEL=0

Export BAK_LEVEL

ORACLE_HOME=/opt/app/oracle/10.2.0

Export ORACLE_HOME

ORACLE_SID=orcl

Export ORACLE_SID

RMAN_LOG_FILE=$ {0} .out

Echo Script $0 > > $RMAN_LOG_FILE

Echo = started on `date` = > > $RMAN_LOG_FILE

Echo > > $RMAN_LOG_FILE

Chmod 666 $RMAN_LOG_FILE

$RMAN nocatalog target sys/admin msglog $RMAN_LOG_FILE append > $RMAN_LOG_FILE

Echo = started on `date` = > > $RMAN_LOG_FILE

Echo > > $RMAN_LOG_FILE

Chmod 666 $RMAN_LOG_FILE

$RMAN nocatalog target sys/admin msglog $RMAN_LOG_FILE append

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

Servers

Wechat

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

12
Report