2016年6月9日 星期四

ORACLE parameter file (PFILE , SPFILE)

CREATE PFILE='/tmp/initoradbtst.ora.2016053102' from spfile='/oracle/10g/product/10.2.0/db/dbs/spfileoradbtst.ora';

CREATE spfile='/oracle/10g/product/10.2.0/db/dbs/spfileoradbtst.ora' from PFILE='/oracle/10g/product/10.2.0/db/dbs/initoradbtst.ora'  ;


10g 這邊只能 create pfile from spfile 或是 creare spfile form pfile

會在 ORACLE_HOME/dbs 底下先找 spfile 跟 pfile . (順序要再確認)

在啟動的時候可以指定 startup PFILE='絕對路徑';


--controll file 比較麻煩 要 recreate  . 而且 scn 不對還要 resetlog

2016年6月2日 星期四

Squid3 ubuntu



Squid3 安裝


http://www.ez2o.com/Blog/Post/Ubuntu-Install-Proxy-Server-Squid


apt-get install squid

vi /etc/squid3/squid.conf

設定允許所有人連入 Proxy :

將 http_access allow localhost  改為 http_access allow all

將 http_access deny all 註解

/etc/init.d/squid restart

在 Wget 使用 proxy


Via ~/.wgetrc file:
use_proxy=yes http_proxy=127.0.0.1:8080
or
via -e options placed after the URL:
wget ... -e use_proxy=yes -e http_proxy=127.0.0.1:8080 ...

用 ftp proxy 的時候 用 -e ftp_proxy=127.0.0.1:8080


在 yum 使用 proxy



$ export http_proxy=http://proxy:3128
$ export ftp_proxy=http://proxy:3128
$ yum update
If you want to make the proxy settings permanent, you can add a proxy directive to /etc/yum.conf:
$ grep proxy /etc/yum.conf
proxy=http://proxy:3128











=END

AWK 使用 Quota ' '

https://www.gnu.org/software/gawk/manual/html_node/Quoting.html

$ awk 'BEGIN { print "Here is a single quote <'\''>" }'
-| Here is a single quote <'>

$ awk "BEGIN { print \"Here is a single quote <'>\" }"
-| Here is a single quote <'>

$ awk 'BEGIN { print "Here is a single quote <\47>" }'
-| Here is a single quote <'>
$ awk 'BEGIN { print "Here is a double quote <\42>" }'
-| Here is a double quote <">

$ awk -v sq="'" 'BEGIN { print "Here is a single quote <" sq ">" }'
-| Here is a single quote <'>







==END

Linux Mint / Ubuntu Natty apt update






Medibuntu has now been shut down


source.list 要抓掉
http://askubuntu.com/questions/356794/the-medibuntu-project-has-come-to-an-end-what-do-i-do-now


aptitude purge medibuntu-keyring rm -f /etc/apt/sources.list.d/medibuntu.list aptitude update
aptitude purge $(dpkg-query -W -f='${PackageSpec}\t${Maintainer}\n' '*' |\ grep medibuntu-maintainers@lists.launchpad.net |\ cut -f1)




archive.ubuntu.com 跟 security.ubuntu.com 換成 old-releases.ubuntu.com


 perl -p -i.bak -e 's/security.ubuntu.com|archive.ubuntu.com/old-releases.ubuntu.com/g' sources.list


Header 錯誤


E: Encountered a section with no Package: header 
E: Problem with MergeList /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_natty_main_binary-i386_Packages 
E: The package lists or status file could not be parsed or opened.

sudo rm -vf /var/lib/apt/lists/* 

Next, generate a new one by running a simple update:
sudo apt-get update





2016年5月30日 星期一

Linux add new HD

http://linoxide.com/file-system/create-mount-extend-xfs-filesystem/


先在 VC 完成配置 掛載給 guest

然後到

[root@db3 ~]# fdisk -l

Disk /dev/sdb: 17482.2 GB, 17482234881024 bytes
255 heads, 63 sectors/track, 2125427 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/sda: 64.4 GB, 64424509440 bytes
255 heads, 63 sectors/track, 7832 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0009d767

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              64        7833    62401536   8e  Linux LVM

Disk /dev/sdc: 171.8 GB, 171798691840 bytes
255 heads, 63 sectors/track, 20886 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_db3-lv_root: 27.4 GB, 27376222208 bytes
255 heads, 63 sectors/track, 3328 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_db3-lv_swap: 33.8 GB, 33848033280 bytes
255 heads, 63 sectors/track, 4115 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_db3-lv_home: 2671 MB, 2671771648 bytes
255 heads, 63 sectors/track, 324 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

[root@db3 ~]# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/vg_db3-lv_root
                      26315036  10435876  14542432  42% /
tmpfs                 33050200       232  33049968   1% /dev/shm
/dev/sda1               495844     38022    432222   9% /boot
/dev/mapper/vg_db3-lv_home
                       2568144     70116   2367572   3% /home
/dev/sdc             167690240 136033260  31656980  82% /hissp1/temp
/dev/sdb             17070408088 12905911056 4164497032  76% /hissp1/oradbf
f6n1:/exp            21441282048 9812445888 11628836160  46% /exp
[root@db3 ~]# cd /proc/scsi/sg
[root@db3 sg]# cat device_hdr devices
host    chan    id      lun     type    opens   qdepth  busy    online
1       0       0       0       5       1       1       0       1
2       0       0       0       0       1       32      0       1
2       0       1       0       0       1       32      0       1
2       0       2       0       0       1       32      0       1
[root@db3 sg]# echo "- - -" > /sys/class/scsi_host/host2/scan
[root@db3 sg]# cat device_hdr devices
host    chan    id      lun     type    opens   qdepth  busy    online
1       0       0       0       5       1       1       0       1
2       0       0       0       0       1       32      0       1
2       0       1       0       0       1       32      0       1
2       0       2       0       0       1       32      0       1
2       0       3       0       0       1       32      0       1
[root@db3 sg]# fdisk -l

Disk /dev/sdb: 17482.2 GB, 17482234881024 bytes
255 heads, 63 sectors/track, 2125427 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/sda: 64.4 GB, 64424509440 bytes
255 heads, 63 sectors/track, 7832 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0009d767

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              64        7833    62401536   8e  Linux LVM

Disk /dev/sdc: 171.8 GB, 171798691840 bytes
255 heads, 63 sectors/track, 20886 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_db3-lv_root: 27.4 GB, 27376222208 bytes
255 heads, 63 sectors/track, 3328 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_db3-lv_swap: 33.8 GB, 33848033280 bytes
255 heads, 63 sectors/track, 4115 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_db3-lv_home: 2671 MB, 2671771648 bytes
255 heads, 63 sectors/track, 324 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/sdd: 10885.2 GB, 10885165114368 bytes
255 heads, 63 sectors/track, 1323379 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

[root@db3 sg]#

[root@db3 /]# mkfs.xfs /dev/sdd
mkfs.xfs: /dev/sdd appears to contain an existing filesystem (LVM2_member).
mkfs.xfs: Use the -f option to force overwrite.
[root@db3 /]# mkfs.xfs -f /dev/sdd
meta-data=/dev/sdd               isize=256    agcount=10, agsize=268435455 blks
         =                       sectsz=512   attr=2, projid32bit=0
data     =                       bsize=4096   blocks=2657511014, imaxpct=5
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0
log      =internal log           bsize=4096   blocks=521728, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
[root@db3 /]# mount /dev/sdd /hissp1exp
[root@db3 /]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_db3-lv_root
                       26G   10G   14G  42% /
tmpfs                  32G  232K   32G   1% /dev/shm
/dev/sda1             485M   38M  423M   9% /boot
/dev/mapper/vg_db3-lv_home
                      2.5G   69M  2.3G   3% /home
/dev/sdc              160G  130G   31G  82% /hissp1/temp
/dev/sdb               16T   13T  3.9T  76% /hissp1/oradbf
f6n1:/exp              20T  9.2T   11T  46% /exp
/dev/sdd              9.9T   33M  9.9T   1% /hissp1exp
[root@db3 /]#