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

Rman-- basic command

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

Share

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

RMAN basic command

(1) start and shut down the database

RMAN > shutdown immediate

RMAN > startup

(2) execute operating system commands

RMAN > host

/ / exit

Exit

(3) execute SQL statement

RMAN > SQL 'ALTER SYSTEM SWITCH LOGFILE'

It is important to note that the sql environment in rman cannot execute SELECT statements, and even if the execution does not report an error, it will not produce a result.

(4) View the default configuration

RMAN > show all

# # set retention policy redundancy to 1CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default # # backup optimized to offCONFIGURE BACKUP OPTIMIZATION OFF; # default # # the default configuration channel is disk, and if it is sbt, it is CONFIGURE DEFAULT DEVICE TYPE TO DISK for tape device # default # # default configuration: controlfile does not automatically back up CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default # # controlfile automatic backup location CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO'% Fidelity; # default # # backup type is backupset, and the parallelism of backup type is 1. Compressed backup COMPRESSEDCONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default # # copy of data file backup is 1CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; copy of # default # # archive log file backup is 1CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default # # backup set size has no upper limit CONFIGURE MAXSETSIZE TO UNLIMITED # default # # Database encryption technology is offCONFIGURE ENCRYPTION FOR DATABASE OFF # default # # Database encryption algorithm 'AES128'CONFIGURE ENCRYPTION ALGORITHM' AES128' # default CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE' DEFAULT' OPTIMIZE FOR LOAD TRUE; # default## archive log deletion policy is NONECONFIGURE ARCHIVELOG DELETION POLICY TO NONE # default # # the snapshot of controlfile is named... When the control file is lost, use snapcf_orcl.f to copy to the control file directory. CONFIGURE SNAPSHOT CONTROLFILE NAME TO'/ oracle/orcl/oracle/dbs/snapcf_orcl.f'; # default

(5) modify the default RMAN parameter settings

# # retention backup expires for 7 days, for data files. (redundancy-based backup and time-based backup)

RMAN > configure retention policy to recovery window of 7 days

# # Control the automatic backup of files. (when the tablespace changes, it is best to back up the control file. The following command will back up the control file automatically.)

# # about control files: / oracle/orcl/oracle/dbs/snapcf_orcl.f (control files are set to automatic backup)

# the following data files are backed up at any time.

# / oracle/orcl/flash_recovery_area/orcl/control02.ctl,/oracle/orcl/oradata/orcl/control01.ctl

RMAN > configure controlfile autobackup on

RMAN > configure controlfile autobackup format for device type disk to'% F'

# set multiple channels to speed up the execution. Only one channel is opened by default.

RMAN > CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO BACKUPSET

# # Verification Channel

RMAN > backup spfile

# backups are placed in multiple directories and automatically based on redundant backups

/ tmp/ / oracle/backup/rman/

(1) change the number of backups

RMAN > CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 2

RMAN > CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 2

(2) Custom channel

RMAN > configure channel 2 device type disk format'/ tmp/%U','/oracle/backup/rman/%U'

(3) db_recovery_file_dest value is set to empty

SQL > show parameter db_re

NAME TYPE VALUE

-

Db_recovery_file_dest string / oracle/orcl/flash_recovery_ar

Ea

Db_recovery_file_dest_size big integer 3882M

Db_recycle_cache_size big integer 0

SQL > alter system set db_recovery_file_dest=''

# # RMAN configuration Optimization

RMAN > CONFIGURE BACKUP OPTIMIZATION ON

# # backup Compression

RMAN > CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO compressed backupset

# # encrypted backup. For security reasons

RMAN > CONFIGURE ENCRYPTION FOR DATABASE ON

# modify temporary variables:

Run {

Allocate channel a1 type disk

Allocate channel a2 type disk

Backup database

Release channel A1;-- release channel

Release channel a2;-- release channel

}

Execute in script

Write run in file an and use @ to execute

Rman target / @ / oracle/backup/rman/a

Run {

Allocate channel A1 type disk maxpiecesize 1g;-set the size of the backup slice to 1G and replace it with more than 1G.

Allocate channel a2 type disk maxpiecesize 1g

Backup database filesperset 3;-- three files in one backup set

Release channel A1;-- release channel

Release channel a2;-- release channel

}

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