The Oracle database is backed up by both cold and hot backups, and the implementation process for both of these backups is documented as follows:
One, Oracle Cold backup
Concept
The process of completing all physical system file copies in a closed state, also known as offline backup
Suitable for non-archive mode (Noarchivelog), the database is in a consistent state
Steps
- Start by getting all the physical file locations of the database running in the running library, and then shutting down the database (shutdown) within the plan
- Perform a copy of the physical home to the backup path or backup device
- Start the database immediately after the backup is complete to provide normal service
How to script cold standby scripts
First, you should find out the database data files, log files, control files, and the location of the temporary files in the relevant view.
Note: do not oradata directly under the CP, because the production library files are usually distributed in different disks, different places, so in the view to get the real path
Cold backup operation
1) Check the log mode of the Oracle database, and if it is an archive mode, you will need to set the database to Noarchivelog mode (non-archive mode) for cold backup.
sql> archive log list Database log mode No archive mode Automatic a Rchival Enabled//enabled is represented as an archive mode archive destination/u01/admin/denver/archdest Oldest online log sequence 1 current log sequence 1 sql> startup Mount ORACLE instance started. Total System Global area 422670336 bytes Fixed size 1336960 bytes Variable Size 314575232 Bytes Database buffers 100663296 bytes Redo buffers 6094848 bytes database mounted. sql> ALTER DATABASE Noarchivelog database altered. Sql> Archive Log List Database log mode No archive mode Automatic archival Disabled Disabled expressed as archive mode archive destination/u01/admin/denver/archdest oldest online log sequence 1 Cu Rrent log sequence 1 sql> ALTER DATABASE open; Database altered.
2) View information about the instance and database
Sql> select Instance_name,version,status,archiver,database_status from V$instance; instance_name VERSION STATUS ARCHIVE database_status ------------------------------------------ --------------------------- orcl 10.2.0.1.0 OPEN STOPPED ACTIVE sql> Select Dbid,name,log_mode from V$database; DBID NAME log_mode ------------------------------- 1242732291 ORCL noarchivelog
3) View data file and status information
Sql> select File_name,tablespace_name,status,online_status from Dba_data_files; file_name tablespace STATUS online_ --------------------------------------------------------------- ------------------ /u01/app/oracle/oradata/orcl/undotbs01.dbf UNDOTBS1 AVAILABLE ONLINE /u01/ APP/ORACLE/ORADATA/ORCL/SYSTEM01.DBF system AVAILABLE system /u01/app/oracle/oradata/orcl/ SYSAUX01.DBF sysaux AVAILABLE ONLINE /u01/app/oracle/oradata/orcl/users01.dbf USERS AVAILABLE online /u01/app/oracle/oradata/orcl/example01.dbf EXAMPLE AVAILABLE online /u01/ APP/ORACLE/ORADATA/ORCL/TBS1_1.DBF TBS1 AVAILABLE ONLINE /u01/app/oracle/oradata/orcl/tbs1_2.dbf TBS1 AVAILABLE ONLINE
4) View data file
Sql> select name from V$datafile; NAME -------------------------------------------------------------------------------- /u01/app/oracle/ ORADATA/ORCL/SYSTEM01.DBF /u01/app/oracle/oradata/orcl/undotbs01.dbf /u01/app/oracle/oradata/orcl/ SYSAUX01.DBF /u01/app/oracle/oradata/orcl/users01.dbf /u01/app/oracle/oradata/orcl/example01.dbf / U01/APP/ORACLE/ORADATA/ORCL/TBS1_1.DBF /u01/app/oracle/oradata/orcl/tbs1_2.dbf
5) View Temporary files
Sql> select name from V$tempfile; NAME -------------------------------------------------------------------------------- /u01/app/ Oracle/oradata/orcl/temp01.dbf
6) View Log file
Sql> Select member from V$logfile; MEMBER ------------------------------------------------------------ /u01/app/oracle/oradata/orcl/ Redo2a.rdo /u01/app/oracle/oradata/orcl/redo2b.rdo /u01/app/oracle/oradata/orcl/redo1a.rdo /u01/ App/oracle/oradata/orcl/redo3a.rdo /u01/app/oracle/oradata/orcl/redo3b.rdo /u01/app/oracle/oradata/ Orcl/redo1b.rdo
7) View Control files
Sql> select name from V$controlfile; NAME ------------------------------------------------------------ /u01/app/oracle/oradata/orcl/ Control01.ctl /u01/app/oracle/oradata/orcl/control02.ctl
8) Create a backup directory
Sql> Ho Mkdir/u01/app/oracle/coolbak
9) Use the connector to generate the copy File command
sql> Select ' Ho cp ' | | name | | '/u01/app/oracle/coolbak ' from v$controlfile; ' HOCP ' | | name| | ' /u01/app/oracle/coolbak ' --------------------------------------------------------------------------------- - ho cp/u01/app/oracle/oradata/orcl/control01.ctl/u01/app/oracle/coolbak ho cp/u01/app/oracle/oradata/ Orcl/control02.ctl/u01/app/oracle/coolbak
Save the above input as Tmpbak.sql
Sql> Save/tmp/tmpbak.sql; Created File/tmp/tmpbak.sql
Oracle database Cold backup and hot backup operation grooming