CloneDB is a new feature launched by Oracle11.2.0.3. It uses the new DirectNFS introduced by 11 GB. It directly uses the backup of the target database, and does not need to COPY the backup to
CloneDB is a new feature launched by Oracle 11.2.0.3. It uses the new Direct NFS introduced by 11 GB. It directly uses the backup of the target database, and does not need to COPY the backup to
CloneDB is a new feature launched by Oracle 11.2.0.3. It uses the new Direct NFS introduced by 11 GB. It directly uses the backup of the target database, without copying the backup to the clone environment, so that a backup can clone multiple databases for different purposes. It also uses the copy-on-write technology, so that only modified blocks in the backup can be applied to the clone database, which greatly saves the space for the clone database, it also improves the database cloning speed.
This feature is tested in the following way. It involves three servers, all of which are 32-bit RHEL 6.3 operating systems and the database version is 11.2.0.4.
NFS server:
Host Name: node3.being.com
IP: 192.168.2.13
Shared path:/u01
Production database:
Host Name: node1.being.com
IP: 192.168.2.11
ORACLE_HOME:/u01/app/oracle/product/11.2.0.4/db_1
ORACLE_SID: prod
Mount point:/backup/prod/
Clone database:
Host Name: node2.being.com
IP: 192.168.2.12
ORACLE_HOME:/u01/app/oracle/product/11.2.0.4/db_1
ORACLE_SID: orcl
Mount point:/prod/backup
I. Prepare the NFS Environment
First, check the disk information of node3.
[Root @ node3 ~] # Df-h
Filesystem Size Used Avail Use % Mounted on
/Dev/sda2 5.8 GB 3.9G 1.6G 72%/
Tmpfs 504 M 0 504 M 0%/dev/shm
/Dev/sda4 20G 172 M 19G 1%/u01
Here, we plan to share/u01 as an NFS disk.
Add the following content to the main configuration file/etc/exports of NFS Server:
/U01 * (rw, no_root_squash)
Here, note that the/u01 Permission is the default 755 Permission at the beginning of/u01. After node1 is mounted, the file cannot be created and "Permission denied" is reported ".
Modify/u01 Permissions
[Root @ node3 ~] # Chmod 757/u01/
Restart the rpcbind and nfs services
[Root @ node3 ~] #/Etc/init. d/rpcbind restart
Stopping rpcbind: [FAILED]
Starting rpcbind: [OK]
[Root @ node3 ~] #/Etc/init. d/nfs restart
Shutting down NFS daemon: [FAILED]
Shutting down NFS mountd: [FAILED]
Shutting down NFS quotas: [FAILED]
Starting NFS services: [OK]
Starting NFS quotas: [OK]
Starting NFS mountd: [OK]
Starting NFS daemon: [OK]
Check whether the configuration is successful
[Root @ node3 ~] # Showmount-e 192.168.2.13
Export list for 192.168.2.13:
/U01 *
Set the rpcbind and nfs services to start automatically
[Root @ node3 ~] # Chkconfig rpcbind on
[Root @ node3 ~] # Chkconfig nfs on
2. Mount the NFS file system on the production database
Log On As root and create a backup directory
[Root @ node1 ~] # Mkdir/backup/prod
Mount the nfs disk provided by node3
[Root @ node1 ~] # Showmount-e 192.168.2.13
Export list for 192.168.2.13:
/U01 *
[Root @ node1 ~] # Mount 192.168.2.13:/u01/backup/prod/
[Root @ node1 ~] # Df-h
Filesystem Size Used Avail Use % Mounted on
/Dev/sda2 7.7 GB 3.6G 3.8G 49%/
Tmpfs 400 M 184 M 217 M 46%/dev/shm
/Dev/sda1 194 M 27 M 158 M 15%/boot
/Dev/sda4 28G 11G 16G 41%/u01
192.168.2.13:/u01 20G 172 M 19G 1%/backup/prod
After mounting, you cannot modify the file owner and group for/backup/prod. For example, if you want to set this directory to exclusive for oracle users, the result is as follows:
[Root @ node1 ~] # Chown oracle. oinstall/backup/prod/
Chown: changing ownership of '/backup/prod/': Invalid argument
Later, it was found that this was not necessary. The/backup/prod permissions in node1 correspond to the/u01 permissions in node3, both of which are 757. I create a file in this directory as an oracle user. The owner and group of the file are oracle and oinstall respectively.
Set to auto mount upon startup
Add the following content in/etc/rc. local:
Mount 192.168.2.13:/u01/backup/prod/
3. Mount the NFS file system on the cloned Database
Log On As root and create a backup directory.
[Root @ node2 ~] # Mkdir-p/prod/backup
Mount the NFS shared disk provided by node3