Linux 下通过wget下载Oracle补丁

客户迁移数据,同时升级数据库。我们使用wget命令直接下载Oracle补丁至客户服务器,只需有一个Metalink账号就好。

以下转载自骨骨学习笔记:http://hi.baidu.com/edeed/blog/item/ff6709f7b26af433720eecea.html

在下载的过程中,可以视同tailf download.log命令监视下载情况。

 

1. 使用命令下载:

wget -c –http-user=user –http-password=pwd –output-document=patch.zip “download_url” -o download.log &

各参数含义如下:

-c 表示断点续传
–http-user metalink帐号
–http-password metalink密码
–output-document 下载的文件名
“download_url” 下载地址(右击”下载”按钮后复制的链接地址)
-o 输出日志文件名

注意:http,output前为两个-,因为linux命令中,完整命令前都为–,但是显示在博客上,–变成了—,请自行改正!

2. 网页下载:

点此访问下载页

在此页面选择要现在的文件, 然后右击”下载”按钮后, 复制各链接地址备用. 如图:

3.举例(下载oracle 11.2.0.2.0 for linux x86_64):

先建立下载目录, 并设置metalink用户名密码:

$ mkdir -p /u01/software/11g
$ cd /u01/software/11g
$[email protected]
$PASSWORD=jbgsn

然后开始下载此七个文件(注意下载链接中的matalink用户名已经通过变量$USERNAME替换掉了):

$ wget -c –http-user=$USERNAME –http-password=$PASSWORD \
–output-document=p10098816_112020_Linux-x86-64_1of7.zip \
“https://updates.oracle.com/Orion/Download/process_form/p10098816_112020_Linux-x86-64_1of7.zip?file_id=34840697&aru=13149219&userid=o-$USERNAME&email=$USERNAME&patch_password=&patch_file=p10098816_112020_Linux-x86-64_1of7.zip” \
-o download1.log &

$ wget -c –http-user=$USERNAME –http-password=$PASSWORD \
–output-document=p10098816_112020_Linux-x86-64_2of7.zip \
“https://updates.oracle.com/Orion/Download/process_form/p10098816_112020_Linux-x86-64_2of7.zip?file_id=34840698&aru=13149219&userid=o-$USERNAME&email=$USERNAME&patch_password=&patch_file=p10098816_112020_Linux-x86-64_2of7.zip” \
-o download2.log &

$ wget -c –http-user=$USERNAME –http-password=$PASSWORD \
–output-document=p10098816_112020_Linux-x86-64_3of7.zip \
“https://updates.oracle.com/Orion/Download/process_form/p10098816_112020_Linux-x86-64_3of7.zip?file_id=34840699&aru=13149219&userid=o-$USERNAME&email=$USERNAME&patch_password=&patch_file=p10098816_112020_Linux-x86-64_3of7.zip” \
-o download3.log &

$ wget -c –http-user=$USERNAME –http-password=$PASSWORD \
–output-document=p10098816_112020_Linux-x86-64_4of7.zip \
“https://updates.oracle.com/Orion/Download/process_form/p10098816_112020_Linux-x86-64_4of7.zip?file_id=34840703&aru=13149219&userid=o-$USERNAME&email=$USERNAME&patch_password=&patch_file=p10098816_112020_Linux-x86-64_4of7.zip” \
-o download4.log &

$ wget -c –http-user=$USERNAME –http-password=$PASSWORD \
–output-document=p10098816_112020_Linux-x86-64_5of7.zip \
“https://updates.oracle.com/Orion/Download/process_form/p10098816_112020_Linux-x86-64_5of7.zip?file_id=34840707&aru=13149219&userid=o-$USERNAME&email=$USERNAME&patch_password=&patch_file=p10098816_112020_Linux-x86-64_5of7.zip” \
-o download5.log &

$ wget -c –http-user=$USERNAME –http-password=$PASSWORD \
–output-document=p10098816_112020_Linux-x86-64_6of7.zip \
“https://updates.oracle.com/Orion/Download/process_form/p10098816_112020_Linux-x86-64_6of7.zip?file_id=34840708&aru=13149219&userid=o-$USERNAME&email=$USERNAME&patch_password=&patch_file=p10098816_112020_Linux-x86-64_6of7.zip” \
-o download6.log &

$ wget -c –http-user=$USERNAME –http-password=$PASSWORD \
–output-document=p10098816_112020_Linux-x86-64_7of7.zip \
“https://updates.oracle.com/Orion/Download/process_form/p10098816_112020_Linux-x86-64_7of7.zip?file_id=34840712&aru=13149219&userid=o-$USERNAME&email=$USERNAME&patch_password=&patch_file=p10098816_112020_Linux-x86-64_7of7.zip” \
-o download7.log &

可以查过查看各downloadX.log日志了解下载进度和下载速度.

–End–

普人特福的博客cnzz&51la for wordpress,cnzz for wordpress,51la for wordpress