> CentOS > CentOS教程 >

centos 共享文件夹及oracle的表变量

1.centos 无密码共享文件夹

(1) 安装samba

yum -y install samba samba-client
(2)修改配置文件

vim  /etc/samba/smb.conf
 

# See smb.conf.example for a more detailed config file or
# read the smb.conf manpage.
# Run 'testparm' to verify the config is correct after
# you modified it.

[global]
workgroup = SAMBA
security = user
passdb backend = tdbsam
    map to guest = Bad User
printing = cups
printcap name = cups
load printers = yes
cups options = raw
[homes]
comment = Home Directories
valid users = %S, %D%w%S
browseable = No
read only = No
inherit acls = Yes

[printers]
comment = All Printers
path = /var/tmp
printable = Yes
create mask = 0600
browseable = No

[print$]
comment = Printer Drivers
path = /var/lib/samba/drivers
write list = @printadmin root
force group = @printadmin
create mask = 0664
directory mask = 0775
[rpt]
   path = /rpt_data
   comment = temp Directories
   writable = yes
   browseable = yes
   guest ok = yes
rpt是我添加的要共享的配置信息,samba v4.1.1版本不支持share和server,当security设置为
user后需要加一行map to guest = Bad User才能允许无密码访问。

(3)开放端口

firewall-cmd --permanent --add-port=139/tcp
firewall-cmd --permanent --add-port=445/tcp
systemctl restart firewalld #(重启防火墙)
关闭SELinux  vi  /etc/selinux/config

将SELINUX=enforcing改为SELINUX=disabled

(4)重启服务

#重启smb和nmb服务
systemctl restart smb
systemctl restart nmb
在Windows系统上按下“win+r”键,输入"\\共享文件夹的IP地址"

2.oracle的表变量

表变量的定义

type temp_table is table of RPT_SALSES_FGS_DAILY_temp%rowtype
index by binary_integer;
temp_fgs temp_table;
 

表变量的赋值

select  *  bulk collect  into temp_fgs from  fgs_xc 

将表变量的值插入到RPT_SALSES_FGS_DAILY_temp表中,并且temp_fgs 字段与RPT_SALSES_FGS_DAILY_temp字段相对应

 for i in 1..temp_fgs.COUNT loop
      INSERT INTO RPT_SALSES_FGS_DAILY_temp VALUES temp_fgs (i);
   end loop;
 

(责任编辑:IT)