Tuesday, October 13, 2009

Sybase: Download Adaptive Server Enterprise 15.0.3 Developer's Edition

Adaptive Server Enterprise 15.0.3 Developer's Edition on Windows

    * ASE 15.0.3 Windows Server
http://download.sybase.com/eval/1503/ase1503_winx86.zip

 Adaptive Server Enterprise 15.0.3 Developer's Edition on Linux

    * ASE 15.0.3 x86 Linux Server
    * ASE 15.0.3 x86 64 bit Linux Server
http://download.sybase.com/eval/1503/ase1503_linuxx86-64.tgz
    * ASE 15.0.3 x86 64 bit Linux on POWER

For ASE 15.0.3 Quick Installation Guides click on the appropriate operation system.

    * ASE Quick Install Guide - Windows
    * ASE Quick Install Guide - Solaris
    * ASE Quick Install Guide - Linux
http://www.sybase.com/files/Product_Overviews/ase_installguide_lxqig.pdf

Thursday, October 1, 2009

Create Oracle Database Link access SQL Server

Just finished a project: customer A use Oracle Database 10G, customer B user SQL Server 2005.
Need read SQL Server from Oracle Database.

Here is how:

Request: Microsoft Windows 32 bit OS
Memory Great than 2 Giga-Byte

1. First Download oracle for windows from otn.oracle.com

http://www.oracle.com/technology/software/products/database/index.html
Oracle Database 10g Release 1 (10.1.0.1.0) for Microsoft Windows

2. Download Oracle Database 10g Release 1 patch 10.1.0.5 for Microsoft Windows
3. Uncompress files
4. Start Installation
5. “Oracle Transparent Gateway for Microsoft SQL Server” has to bee install

(Manual attached: b14270.pdf)

6. Create a Database for convert (SID name = ora)
7. Notice the “Database Character Set” to
8. Create a Listener for connection
9. Setup MS SQL Server (Host Name and Database Name)
10. create a user in SQL Server for Oracle connection (User Name: cyx Password:testora)
11. Create a user in Oracle Server for operation (User Name: cyx Password: cyx)
12. Setup 4 configure files:

tnsnames.ora /listener.ora /inittg4msql.ora /tg4msql_tx.sql
(Files attached)

13. Create Database Link in Oracle:

create database link msql connect to "cyx" identified by "testora" using 'tg4msql';

14. Create Mirror Table in Oracle:

create table t2008_test
as
select *
from t2008_geo@msql;

15. Export Mirror Talbe by using command “exp”:

set ORACLE_SID=ora
exp cyx/cyx file=test.dmp table=t2008_test

PS:For save some memory and 3 services has been set to Manual:
OracleCSService /OracleORACLE_HOMETNSListener /OracleServiceORA
Please start these 3 services before your operation.


For More info and screen shoot please left commit and let me know.

Debian: Add a new hard driver

With fast storage coast (movie,photo and music) I have to add an new 1.5TB hard driver on my Debian Home Server.

The server had a hard driver on /dev/sda already.

First shutdown the server:

# halt

Then add the hard driver with power and data cable.

Power on wait for the boot up then login as ROOT and input:

# fdisk /dev/sdb
n --create a new partition

Format a partition:
# mkfs -t ext3 -V /dev/sdb1

Create a mount directory:
# mkdir /home2

Mount it:
#mount -t ext3 /dev/sdb1 /home2

Automatic mount at start up:
# vi /etc/fstab
Add:
/dev/sdb1 /home2 ext3 defaults 0 2

CentOS: Config FTP server - vsftp service

On CentOS vsftp is the most pop FTP service, to install login as ROOT and input:

# yum -y install vsftpd db4-utils

To config vsftp service, update config file:/etc/vsftpd/vsftpd.conf

For virtual user use:

anon_world_readable_only=NO
anonymous_enable=NO
ftpd_banner=Welcome to LambertDatabase FTP Server.
chroot_local_user=YES
guest_enable=YES
guest_username=vftpuser
hide_ids=YES
listen=YES
listen_address=192.168.0.35
local_enable=YES
max_clients=100
max_per_ip=2
nopriv_user=ftp
pam_service_name=ftp
pasv_enable=YES
pasv_max_port=65535
pasv_min_port=64000
session_support=NO
use_localtime=YES
user_config_dir=/etc/vsftpd/users
userlist_enable=YES
userlist_file=/etc/vsftpd/user_list
xferlog_enable=YES
anon_umask=0027
local_umask=022
async_abor_enable=YES
connect_from_port_20=YES
dirlist_enable=YES
download_enable=YES
write_enable=YES


Set allow user list:
# vi /etc/vsftpd/user_list
vftpuser


# vi /etc/vsftpd/denied_users
root


# touch /etc/vsftpd/accounts.tmp
# mkdir /etc/vsftpd/users


Set up virtual user ftp owner account:
# useradd vftpuser -d /home/ftp -s /sbin/nologin

Set pam:
# vi /etc/pam.d/ftp
auth required /lib64/security/pam_userdb.so db=/etc/vsftpd/accounts
account required /lib64/security/pam_userdb.so db=/etc/vsftpd/accounts


Create user & password List file:
# vi /etc/vsftpd/accounts.tmp
testftp #username
test1234 #password


To create a new virtual user account’s access right:
# vi /etc/vsftpd/users/testftp

dirlist_enable=YES
download_enable=YES
write_enable=YES
anon_world_readable_only=no
anon_upload_enable=yes
anon_other_write_enable=yes
local_root=/home/ftp/testftp


Create db file:
# /usr/bin/db_load -T -t hash -f /etc/vsftpd/accounts.tmp /etc/vsftpd/accounts.db
# chmod 600 /etc/vsftpd/accounts.db


Restart the service:
# service vsftpd restart

Set up iptable / firewall for PASV mode:
#vi /etc/sysconfig/iptables
Add:
-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 64000:65535 -j ACCEPT

# service vsftpd restart
# service iptables restart


Set up SELinux:
# setsebool -P ftpd_disable_trans 1
# chcon -R -h -t public_content_t /home/ftp

CentOS: Install Samba and settings for file sharing

For sharing file in the home or company, I always recommended Samba.

To install Samba under CentOS:

# yum install samba

To start Samba service:

# /sbin/service smb restart

# chkconfig --levels 35 smb  on


To config Samba share folder:

# vi /etc/samba/smb.conf

Modify:

[global]
load printers = No
hosts allow = 127., 192.168.0. #allow intranet IP
workgroup = WORKGROUP

[homes]
comment = Private Home Directories
read only = No
browseable = No

[public]
comment = Public Stuff
path = /home/public
read only = No

[www]
path = /home/www
valid users = leo
read only = No
create mask = 0755
browseable = No

To test this conf file:

# testparm

# mkdir /home/public
# chmod -R 777 /home/public


Set up SELinux:

# setsebool -P samba_enable_home_dirs=1
# chcon -R -t samba_share_t /home/public

Setup a new Samba only account's password:

# useradd "username" -d /home/"username" -s /sbin/nologin
# smbpasswd -a "username"

CentOS: Install MySQL Server

To install MySQL under CentOS, login as ROOT and input:

# yum install mysql-server

To start the service:

# service mysqld restart

Which will give some message:

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h testserver1 password 'new-password'

Use mysqladmin setup the password.

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.

Set mysql service automatic start after reboot:

# chkconfig --levels 35 mysqld on


Set up mysql service port:

# /sbin/service mysqld stop
# vi /etc/my.cnf
modify: port=3306
/sbin/service mysqld start

To change mysql data directory:

# mkdir /home/mysql
# chown -R mysql:mysql /home/mysql
# chcon -R -h -t mysqld_db_t /home/mysql

# service mysqld stop
# mv /var/lib/mysql/* /home/mysql
# vi /etc/my.cnf

Modify:
#datadir=/var/lib/mysql
datadir=/home/mysql

# vi /etc/init.d/mysqld

Modify:
#get_mysql_option mysqld datadir "/var/lib/mysql"
get_mysql_option mysqld datadir "/home/mysql"

# service mysqld start

Check MySQL log file:

# cat /var/log/mysqld.log

Add a new remote user:
mysql> GRANT ALL PRIVILEGES ON *.* TO admin@"%" IDENTIFIED BY 'mysql' WITH GRANT OPTION;