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

Save Oracle as ~

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

Share

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

In many application scenarios, in order to prevent the occurrence of disasters and the loss of important data, remote disaster recovery solutions are at various levels. Then the database has undoubtedly become the key protection object of the manufacturer, so let's learn the backup mechanism of Oracle.

Oracle backup can be divided into logical export / import and physical backup / restore.

Logical backup: in fact, the exp/imp command is used to realize the data information of the table library.

Export:

Exp -? in CMD command mode Check the help for a brief introduction to two parameters and using the format

1) owner users to export: format is'(user1, user2,.., userN) 'specifies the tables for which users are exported. If one user does not exist, a warning will not affect the export of another user table.

The format is as follows: exp system/system owner= (user1,user2) file=D:/path-> file to save path-> owner equals multiple parameters should be enclosed in parentheses

2) tables tables to export: format is'(table1, table2,..., tableN) 'specifies which tables are exported. You can choose multiple table backups flexibly at a time.

The format is: exp system/system tables= (tables1,tables2) file=D:/path.dmp

The basic format is more or less the same. I hope you can read the help manual more often (reference must)

Import:

The DOS command is called through the host instruction in sql*plus. Note that the Oracle 9i command incremental export inctype has been abandoned, and the import uses the imp command imp -? Under SQL*PLUS, you have to hit host first.

Import format: imp system/system file=D:/path.dmp with parameter tables= (user1,user2) this command imports only the two tables user1,user2.

SQL > host imp system/system file=D:/path.dmp tables= (user1,user2); how to use it in SQL*PLUS

Whether importing or exporting, ORACLE_SID 's default environment variable library is used without specifying parameters, and SID knowledge has been covered earlier.

Physical backup / restore

Divided into two categories: cold backup and hot backup

What is cold backup, simply shut down the database, copy library files, these files are data files, control files, log files, online BEDOLOG and Init.org (optional).

Cold backup step

1) close the database shutdown normal (shut down normally)

2) currently in SQL*PLUS environment, SQL > host copy D:\ oracle\ product\...\ oradata\ test (path to the original library) E:\ Backup (path to backup location)

Parsing: in fact, it is to copy the database stored on disk as files (blocks) to another folder to save it.

Recovery is easier, as long as the database is closed and the backup library is copied to the old library location

What is hot backup: some people also call it a smooth upgrade to back up the database under the startup state, because many application scenarios will never allow you to shut down a database, with the exception of a highly available cluster, so it is necessary to master hot backup (the database must be in archive mode).

What is archived mode: when we start the database, there will be a lot of initialization information, including the Redo Buffer redo buffer size, then our database has online redo logs, which record additions, deletions, changes, queries, and other operations. An Oracle database has at least two archived redo logs. In non-archived mode, switch the second online redo log after the first archive log is full. When the second archive log is full, switch to write the first online redo log, and the new content overwrites the old log record, which will result in content loss. If you are in archive mode, switching after an online redo log is full will be archived and copied to another directory, which relatively avoids data loss.

Hot backup step

1) first, we enter the database into the mount phase and modify the archiving mode, with the following command

SQL > alter database mount

SQL > alter database archivelog

2) then we open the data to facilitate the operation of the database

SQL > alter database open

3) check whether the archiving mode is enabled

SQL > archive log list

4) enable tablespace backup mode

SQL > alter tablespace users begin backup

5) backup tablespace

SQL > host copy D:\ app\....\ oradate\ xx.dbf D:\ Backup

6) turn off tablespace backup

SQL > alter tablespace users end backup

7) backup control files

SQL > alter database backup controlfile to''reuse

8) backup control file script

SQL > alter database backup controllfile to trace

In the tracking file controlled by Oracle_home\ intsance_name\ udump, copy the file to the backup directory, the hot backup is completed, and the detailed knowledge points will continue to be improved.

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