In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The manual way to manage database backups is usually to perform file operations on the database, a process that requires full participation and manual completion by administrators. As opposed to using RMAN, manual administration no longer relies entirely on system-defined parameters for configuration.
Manual cold preparation steps
In the case of a complete database shutdown, we can backup the database completely by copying the database's data files, control files, and redo log files.
Login database:
# sqlplus sys as sysdba
First check the file location:
SQL> select file_name from dba_data_files;SQL> select name from v$controlfile;SQL> select group#,member,status from v$logfile;
Safe shutdown of database:
SQL> shutdown immediate;
Then create three backup directories: datafile,controlfile, redofile, and copy the corresponding files to these three directories at once.
For database recovery, you only need to copy the backup data to the original location, and then start the database.
Manual hot standby procedure
Data needs to be placed in archive mode when using online hot standby.
SQL> archive log list;Database log mode Archive ModeAutomatic archival EnabledArchive destination USE_DB_RECOVERY_FILE_DESTOldest online log sequence 27Next log sequence to archive 29Current log sequence 29SQL>
Display is on. Check the progress status normally:
[root@temp-test ~]# ps -ef|grep arcoracle 8724 1 0 Nov06 ? 00:00:02 ora_arc0_orcloracle 8726 1 0 Nov06 ? 00:00:04 ora_arc1_orcloracle 8728 1 0 Nov06 ? 00:00:02 ora_arc2_orcloracle 8730 1 0 Nov06 ? 00:00:02 ora_arc3_orcl
Set redundancy of archive log files to ensure data security:
View archive log related parameters:
SQL> show parameter log_archive_dest;
Create three directories to store three identical archive logs as redundant backups:
[oracle@temp-test ~]$ mkdir -p /data/app/backup/arc{1.. 3} [oracle@temp-test ~]$ ll /data/app/backup/total 0drwxr-xr-x 2 oracle oinstall 6 Nov 7 13:44 arc1drwxr-xr-x 2 oracle oinstall 6 Nov 7 13:44 arc2drwxr-xr-x 2 oracle oinstall 6 Nov 7 13:44 arc3
Set up 3 archive directories:
SQL> alter system set log_archive_dest_1='location=/data/app/backup/arc1 mandatory';System altered.SQL> alter system set log_archive_dest_2='location=/data/app/backup/arc2 optional';System altered.SQL> alter system set log_archive_dest_3='location=/data/app/backup/arc3';System altered.
View settings information:
SQL> show parameter log_archive;
mandatory refers to the directory where log archiving is mandatory. Log data can only be switched after successful archiving. optional refers to optional. Log archiving can also be switched if archiving fails. If optional directory is damaged, log archiving will not be affected.
Perform log switching and archive files are saved to the specified directory:
SQL> alter system switch logfile;System altered.
Three identical archive files were generated:
[oracle@temp-test backup]$ tree /data/app/backup//data/app/backup/├── arc1│ └── 1_29_959021937.dbf├── arc2│ └── 1_29_959021937.dbf└── arc3 └── 1_29_959021937.dbf
Set the minimum number of logs that must be successfully archived. Two must be successfully archived:
SQL> alter system set log_archive_min_succeed_dest=2;System altered.SQL> show parameter log_archive_min_succeed_Dest;NAME TYPE VALUE------------------------------------ ----------- ------------------------------log_archive_min_succeed_dest integer 2
Since there are only three redundant files in total, an error will be reported if the number set is greater than 3.
Back up your data and view the corresponding data file for the table space:
SQL> col file_name for a47SQL> col tablespace_name for a10SQL> select file_id,file_name,tablespace_name from dba_data_files; FILE_ID FILE_NAME TABLESPACE---------- ----------------------------------------------- ---------- 4 /data/app/oracle/oradata/orcl/users01.dbf USERS 3 /data/app/oracle/oradata/orcl/undotbs01.dbf UNDOTBS1 2 /data/app/oracle/oradata/orcl/sysaux01.dbf SYSAUX 1 /data/app/oracle/oradata/orcl/system01.dbf SYSTEM 5 /data/app/oracle/oradata/orcl/example01.dbf EXAMPLE
Here we backup USER table, ID 4, put the table in backup mode:
SQL> alter tablespace users begin backup;Tablespace altered.
To view the backup status, the user table with ID 4 is displayed as active:
SQL> select * from v$backup; FILE# STATUS CHANGE# TIME---------- ------------------ ---------- --------- 1 NOT ACTIVE 0 2 NOT ACTIVE 0 3 NOT ACTIVE 0 4 ACTIVE 1529624 07-NOV-17 5 NOT ACTIVE 0
Then directly use the cp command of the system to copy the data files under the corresponding directory to the backup directory. Then end backup mode:
SQL> alter tablespace users end backup;Tablespace altered.SQL> select * from v$backup; FILE# STATUS CHANGE# TIME---------- ------------------ ---------- --------- 1 NOT ACTIVE 0 2 NOT ACTIVE 0 3 NOT ACTIVE 0 4 NOT ACTIVE 1529624 07-NOV-17 5 NOT ACTIVE 0
Writes the current redo log information to the archive log file:
SQL> alter system archive log current;System altered.# Checkpoint consistency restored after some time SQL> select checkpoint_change#, file# from v$datafile;CHECKPOINT_CHANGE#FILE#---------------------------- 1530603 1 1530603 2 1530603 3 1530603 4 1530603 5
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: 225
*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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un