Oracle simple data migration script

Source: Internet
Author: User
Set the IP addresses of all nodes to regular static addresses, and then modify the etchosts file of each node, as shown in 172.16.20.100node0.

Set the IP addresses of all nodes to regular static addresses, and then modify the/etc/hosts file of each node, as shown in 172.16.20.100 node0.

#! /Bin/bash
# Function:
# Backup user_data
# History:
# Copyright @ 2011 zhaohaihua
Export extfile = 'date' + % Y % m % d % H % m''
Export bak_dir =/home/Oracle/data_bak
Su-oracle-c "exp user01/user01 file = $ bak_dir/user01. $ extfile. dmp compress = y full = y log = n"
Cd $ bak_dir
Tar-zcvf user01.20.extfile.dmp.tar.gz user01. $ extfile. dmp
Scp $ bak_dir/user01. $ extfile. dmp. * root@192.168.0.23:/home/oracle/bak/
Rm-rf/home/oracle/data_bak/user01 .*


#00 00 ***/bin/bash/home/bak. sh

Ssh password-less access
1. Generate the key first
# Cd/root/. ssh/
# Ssh-keygen-t dsa
Then press enter until you get it in the. ssh directory.
Id_sda? Id_sda.pub files
2. # cp id_sda.pub authorized_keys
3. Copy the. ssh folder to overwrite the. ssh directory between nodes.
# Scp-r/root/. ssh node1
4. preacquisition
Set the IP addresses of all nodes to regular static addresses, and then modify the/etc/hosts file for each node, as shown below:
172.16.20.100 node0
In this way, nodes can be accessed by node0 for short, rather than by lengthy IP addresses.

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.