2016年6月2日 星期四

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 /]# 


2016年5月18日 星期三

Oracle 系統帳號


"SYS",                          
"SYSTEM",                      
"OUTLN",                        
"DBSNMP",                      
"WMSYS",                        
"ORDSYS",                      
"ORDPLUGINS",                  
"MDSYS",                        
"CTXSYS",                      
"XDB",                          
"ANONYMOUS",                    
"WKSYS",                        
"WKPROXY",                      
"ODM",                          
"ODM_MTR",                      
"OLAPSYS",                      
"HR",                          
"OE",                          
"PM",                          
"SH",                          
"QS_ADM",                      
"QS",                          
"QS_WS",                        
"QS_ES",                        
"QS_OS",                        
"QS_CBADM",                    
"QS_CB",                        
"QS_CS",                        
"SCOTT",                        
"DIP",                          
"TSMSYS",                      
"ORACLE_OCM",                  
"DMSYS",                        
"SI_INFORMTN_SCHEMA",          
"MDDATA",                      
"SYSMAN",                      
"MGMT_VIEW"



select '"'||username||'",' as c
from sys.all_users where
trunc(created) = to_date('200XXXXXX','yyyymmdd')
or
trunc(created) = to_date('20XXXXXX','yyyymmdd')
order by user_id


2016年4月27日 星期三

sqlplus 參考


直接連線

10G 以後可以

sqlplus scott/tiger@//ipアドレス:ポート番号/SID

9i
sqlplus billyv@"(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.251.93.233)(PORT=1521))(CONNECT_DATA=(SID=orcl)(SERVER=dedicated)))"



密碼中有 @

sqlplus /nolog
SQL> alter user scott identified by "scott@test";
User altered.

SQL> connect scott/"scott@test";
Connected.

or
sqlplus scott/\”scott@test\”@TEST_DB


參數處理


set pagesize 0; -- 設9999的話還是會有斷行
set linesize 9999; --最小是1
set heading off;
set echo off;
set feedback off;--把 select X rows 關掉 -- 可是這樣會造成 spool 吐不出來
spool log.log
..................
spool off;

Opencl , linux

Ubuntu 14.04 LTS

ref:
https://software.intel.com/en-us/intel-opencl/faq
https://www.freedesktop.org/wiki/Software/Beignet/

Support OS List :
https://software.intel.com/en-us/intel-opencl

Download Runtime :
https://software.intel.com/en-us/articles/opencl-drivers#lin64


安裝 ubuntu 14.04 LTS Desktop

裝 vmtool
./vmware-install.pl


apt-get install nautilus-open-terminal
apt-get install openssh-server

apt-get install lsb-core
apt-get install rpm libnuma1 alien

apt-cache search opencl
apt-get install clinfo
apt-get install opencl-headers
apt-get install ocl-icd-dbg
apt-get install ocl-icd-libopencl1
apt-get install ocl-icd-opencl-dev
apt-get install ocl-icd-dev
apt-get install opencl-1.2-man-doc

裝 SDK
intel_sdk_for_opencl_2016_ubuntu_6.0.0.1049_x64.tgz
裝runtime
opencl_runtime_16.1_x64_ubuntu_5.2.0.10002.tgz

問題:
clinfo I: ICD loader reports no usable platforms
-->沒有裝 runtime

~# clinfo
Number of platforms:                             1
  Platform Profile:                              FULL_PROFILE
  Platform Version:                              OpenCL 1.2 LINUX
  Platform Name:                                 Intel(R) OpenCL
  Platform Vendor:                               Intel(R) Corporation
  Platform Extensions:                           cl_khr_icd cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store cl_khr_depth_images cl_khr_3d_image_writes cl_intel_exec_by_local_thread cl_khr_spir cl_khr_fp64


  Platform Name:                                 Intel(R) OpenCL
Number of devices:                               1
  Device Type:                                   CL_DEVICE_TYPE_CPU
  Device ID:                                     32902
  Max compute units:                             16
  Max work items dimensions:                     3
    Max work items[0]:                           8192
    Max work items[1]:                           8192
    Max work items[2]:                           8192
  Max work group size:                           8192
  Preferred vector width char:                   1
  Preferred vector width short:                  1
  Preferred vector width int:                    1
  Preferred vector width long:                   1
  Preferred vector width float:                  1
  Preferred vector width double:                 1
  Native vector width char:                      16
  Native vector width short:                     8
  Native vector width int:                       4
  Native vector width long:                      2
  Native vector width float:                     4
  Native vector width double:                    2
  Max clock frequency:                           2930Mhz
  Address bits:                                  64
  Max memory allocation:                         2092821504
  Image support:                                 Yes
  Max number of images read arguments:           480
  Max number of images write arguments:          480
  Max image 2D width:                            16384
  Max image 2D height:                           16384
  Max image 3D width:                            2048
  Max image 3D height:                           2048
  Max image 3D depth:                            2048
  Max samplers within kernel:                    480
  Max size of kernel argument:                   3840
  Alignment (bits) of base address:              1024
  Minimum alignment (bytes) for any datatype:    128
  Single precision floating point capability
    Denorms:                                     Yes
    Quiet NaNs:                                  Yes
    Round to nearest even:                       Yes
    Round to zero:                               No
    Round to +ve and infinity:                   No
    IEEE754-2008 fused multiply-add:             No
  Cache type:                                    Read/Write
  Cache line size:                               64
  Cache size:                                    262144
  Global memory size:                            8371286016
  Constant buffer size:                          131072
  Max number of constant args:                   480
  Local memory type:                             Global
  Local memory size:                             32768
  Error correction support:                      0
  Unified memory for Host and Device:            1
  Profiling timer resolution:                    1
  Device endianess:                              Little
  Available:                                     Yes
  Compiler available:                            Yes
  Execution capabilities:
    Execute OpenCL kernels:                      Yes
    Execute native function:                     Yes
  Queue properties:
    Out-of-Order:                                Yes
    Profiling :                                  Yes
  Platform ID:                                   0xb90a10
  Name:                                          Intel(R) Xeon(R) CPU           X5670  @ 2.93GHz
  Vendor:                                        Intel(R) Corporation
  Device OpenCL C version:                       OpenCL C 1.2
  Driver version:                                1.2.0.10002
  Profile:                                       FULL_PROFILE
  Version:                                       OpenCL 1.2 (Build 10002)
  Extensions:                                    cl_khr_icd cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store cl_khr_depth_images cl_khr_3d_image_writes cl_intel_exec_by_local_thread cl_khr_spir cl_khr_fp64