Full-Library cold backup of shell scripts

Source: Internet
Author: User

#!/bin/bashbackup_dir=/oracle/backuplog_file= $ORACLE _base/admin/$ORACLE _sid/cold_backup_$oracle_sid.logecho   "Backuping cold backup"  > $log _filedata>> $log _filesqlplus -s /  As sysdba <<eof >> $log _fileset pagesize 0 linesize 1000  feedback off heading offspool file_copy_$oracle_sid.shselect  ' cp  ' | | name | | '   $backup _dir/'  from v\ $controlfile;select  ' cp  ' | | file_name| | '   $backup _dir/'  from dba_data_files;select  ' cp  ' | | member| | '   $backup _dir/'  from v\ $logfile; spool offshutdown immediate;! bash file_copy_$oracle_sid.shstartupexit; eofrm -r file_copy_$oracle_sid.shif [ -e  $ORACLE _home/dbs/init$oracle_sid.ora ] thencp  $ORACLE _home/dbs/init$oracle_sid.ora  $backup _dir/fiif [ -e  $ORACLE _home/dbs/ spfile$oracle_sid.ora ]then#cp  $ORACLe_home/dbs/spfile$oracle_sid.ora  $backup _dir/fiif [ -e  $ORACLE _home/dbs/orapw$oracle_sid  ]then#cp  $ORACLE _home/dbs/orapw$oracle_sid  $backup _dir/fiecho  "cold backup  Finished. " >>  $log _filedata>> $log _file


PS: Source "Linux-based Oracle database Management", the code is extensible, the current script is relatively single

Full-Library cold backup of shell scripts

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.