Posted
Filed under Linux
[원문]http://blog.beany.co.kr/archives/2157

작업환경

  • CentOS

System 설정

아래의 명령을 실행하여 sysctl.conf 파일을 편집합니다.

1
vi /etc/sysctl.conf

아래와 같이 net.ipv4.ip_forward 값을 1 로 변경합니다. 재부팅시에 적용이 됩니다.

1
net.ipv4.ip_forward = 1

아래의 명령을 이용하여 직접 Kernel 변수를 수정할 수 있습니다.

1
echo 1 > /proc/sys/net/ipv4/ip_forward

iptables 설정

MASQUERADE 설정

1
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Network Interface (eth0) 을 통한 Port Forwarding

1
iptables -t nat -A PREROUTING -p tcp -i eth0 --dport ${port} -j DNAT --to ${IP:Port}

특정 IP 를 통한 Port Forwarding

1
iptables -t nat -A PREROUTING -p tcp -d ${IP} --dport ${Port} -j DNAT --to-destination ${IP:Port}

Local Port Forwarding

1
iptables -t nat -A PREROUTING -p tcp -d ${IP} --dport ${Port} -j REDIRECT --to-port ${Port}
2014/01/24 17:34 2014/01/24 17:34
Posted
Filed under ORACLE

[원문] : http://netmaid.tistory.com/archive/20130910

Oracle Linux 는 기본적으로 Red Hat Enterprise Linux 와 동일합니다.

따라서 CentOS 하고도 동일합니다. 단지 내부적으로 최적화를 위해서 몇가지 configuration 이 변경된 것으로 알고 있습니다. 자세한 사항은 http://en.wikipedia.org/wiki/Oracle_Linux 를 참고합니다.

이하 최신 Oracle Linux 6.4 를 기준으로 설치하고, Oracle DB 12c Release 1 을 설치해봅니다.

1. Oracle Linux 설치

다운로드 이후에, iso 이미지를 이용하여 설치를 진행합니다.

중간에 서버의 용도를 선택하는데 여기서 Database Server 로 선택합니다.

2. 네트워크 설정

CentOS 와 동일합니다. 참고: http://netmaid.tistory.com/91

DNS 도 설정합니다. 설정하지 않으면, 오라클 도메인을 찾지 못하여 업데이트가 안될 수도 있습니다.

3. 최신으로 업데이트

yum update 로 진행합니다.

4. Oracle DB 12c Release 1 다운로드

오라클 홈페이지에서 다운로드합니다. Linux x86-64 버전의 linuxamd64_12c_database_1of2.zip, linuxamd64_12c_database_2of2.zip 파일을 다운로드합니다.

scp 를 이용하여 설치하려는 서버로 업로드합니다.

참고: http://netmaid.tistory.com/23

5. 압축해제

$ unzip linuxamd64_12c_database_1of2.zip
$ unzip linuxamd64_12c_database_2of2.zip

6. 오라클 계정 생성

Oracle DB 는 보안상 root 계정으로 설치할 수 없게 되어 있습니다. 별도의 계정을 만듭니다.

$ adduser oracle

5번에서 압축해제한 파일이 root 권한으로 되어 있으므로, oracle 계정 공간으로 옮기고 권한도 바꿉니다.

$ mv database /home/oracle
$ chown -R oracle:oracle /home/oracle/database

7. Xfce 설치

Oracle DB 는 GUI 환경에서 설치를 진행합니다. 원격의 GUI 환경에서 접속하여 Oracle DB 를 설치합니다.

원격의 GUI 환경으로는 Xubuntu 를 선택했습니다. Xubuntu 는 Xfce 를 기본 xwindow 로 탑재하고 있습니다.

따라서 Oracle Linux 서버에도 Xfce 를 설치합니다.

Xfce 를 설치하려면 EPEL 저장소를 추가해야 합니다.

$ yum install wget
$ wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
$ rpm -ivh epel-release-6.8.noarch.rpm

Xfce 를 설치합니다.

$ yum groupinstall Xfce

추가로 폰트, 인증 모듈, 유틸 모듈도 설치합니다.

$ yum install xorg-x11-fonts-Type1 xorg-x11-fonts-misc
$ yum install xorg-x11-xauth xorg-x11-utils

참고:

8. ssh 를 통해서 xwindow 접속이 가능하도록 설정

sshd_config 를 수정하여 다음의 3개를 활성화시킵니다.

$ vi /etc/ssh/sshd_config
.....
X11Forwarding yes
X11DisplayOffset 10 
X11UseLocalhost yes

9. Xubuntu 를 설치한 서버에서 Oracle Linux 로 접속

터미널 창을 띄우고 ssh 로 -X 옵션을 지정하여 접속합니다. (원격으로 xwindow 를 활성화하여 접속하는 것입니다)

$ ssh -X oracle@oracle_linux_ip

10. hostname 점검

원격으로 접속을 성공했으면, hostname 과 ip 를 확인합니다.

$ cat /etc/sysconfig/network | grep HOSTNAME
HOSTNAME = test.domain.com

$ vi /etc/hosts
127.0.0.1 test test.domain.com localhost localhost.localdomain localhost4 localhost4.localdomain4
::1       test test.domain.com localhost localhost.localdomain localhost4 localhost4.localdomain4

제대로 설정되지 않으면 DB 설치 진행 중에 다음과 같은 오류 메시지가 뜰 것입니다.

PRVF-0002 : Could not retrieve local nodename

참고:

11. DB data 디렉토리 생성

root 권한으로 디렉토리를 생성합니다. 생성한 디렉토리는 oracle 계정 권한으로 만듭니다.

$ su root
$ mkdir /oradata
$ chown oracle:oracle /oradata

12. limits.conf 변경

root 권한으로 보안 설정을 바꿉니다. 이는 성능을 높이기 위해 시스템 자원을 많이 사용할 수 있도록 설정하는 것입니다. 이 설정을 바꾸지 않으면, 나중에 DB 설치 진행 중에 경고가 뜹니다.

$ vi /etc/security/limits.conf
.....
oracle	soft	nproc	2047
oracle	hard	nproc	16384
oracle	soft	nofile	1024
oracle	hard	nofile	65536

참고:

13. sysctl.conf 변경

root 권한으로 시스템 설정을 바꿉니다. 이 설정을 바꾸지 않으면, 나중에 DB 설치 진행 중에 경고가 뜹니다.

$ vi /etc/sysctl.conf
.....
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
fs.aio-max-nr = 1048576
fs.file-max = 6815744

net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576

참고:

14. Oracle DB 를 위한 종속적인 패키지 설치

root 권한으로 Oracle DB 설치에서 필요한 패키지를 추가로 설치해둡니다.

$ yum install compat-libcap1 gcc gcc-c++ ksh compat-libstdc++-33 libaio-devel

15. 시스템을 리부팅

12번과 13번에서 시스템 설정을 변경했기 때문에 root 권한으로 리부팅을 합니다.

$ sudo shutdown -r now

16. Oracle DB 설치

리부팅이 완료되면, 9번처럼 원격의 Xubuntu 에서 oracle 계정 권한으로 서버에 접속합니다. Oracle DB 를 설치합니다.

$ cd database
$ ./runInstaller

GUI 에 따라서 진행합니다. 오라클 계정이 있다면, 최신 업데이트를 받을 수 있습니다. 그리고, 중간에 새로운 database 를 생성하는 옵션으로 설정합니다. (대부분은 이것을 선택할 것입니다.)

설치를 진행하다가 다음 화면에서 멈춥니다.

17. root 로 스크립트 설치

다른 터미널을 통해서 Oracle Linux 서버에 root 권한으로 접속합니다.

GUI 에서 명시한 대로 스크립트를 실행합니다.

$ /home/oracle/app/oraInventory/orainstRoot.sh
$ /home/oracle/app/oracle/product/12.1.0/dbhome_1/root.sh

18. Oracle DB 설치 계속

스크립트를 실행한 뒤에 GUI 를 계속 진행합니다. 그러면 설치가 마무리 됩니다.

19. 방화벽 설정

외부 서버에서 접속이 가능하도록 방화벽의 포트를 개방합니다.

$ vi /etc/sysconfig/iptables
.....
.....

참고:

20. 접속 테스트

Oracle DB 설치 참고 문서:

2014/01/24 10:25 2014/01/24 10:25
Posted
Filed under Linux

[원문] : http://vitkalovav.blogspot.kr/2013/07/prvf-0002-could-not-retrieve-local.html


PRVF-0002 : Could not retrieve local nodename

Issue:

While Oracle 12c Installation on Linux (my case OEL6 update 4) you could get an error.

Solution 1:

1. check hostname:
cat /etc/sysconfig/network | grep HOSTNAME
HOSTNAME = test.localdomain

2. check hosts:
cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6


3. change /etc/hosts like:
127.0.0.1 test test.localdomain
::1 test test.localdomain


4. Run installer

Solution 2:

1. setup system variable like

$ ORACLE_HOSTNAME=test.localdomain
$ export ORACLE_HOSTNAME
2014/01/24 10:23 2014/01/24 10:23
Posted
Filed under asp,asp.net

If you want to change it, you need to do this on the client, as Remus already mentioned. The client is creating the connection pool.

You can specify the connection pooling properties in your connection string that you use to connect to SQL Server. The most important properties are:

  • Pooling : which can be true or false - use pooling or not
  • MinPoolSize : minimum size of connection pool; default is 10
  • MaxPoolSize : maximum size of connection pool; default is 100

So if you want to enable pooling and have min. 20, max. 250 connections, you could use this connection string:

server=MyServer;database=MyDatabase;Pooling=True;Min Pool Size=25;Max Pool Size=250

For more details, see the MSDN docs or check out the Connection Strings web site.

Marc

2014/01/23 18:08 2014/01/23 18:08
Posted
Filed under asp,asp.net

netstat -an | find "80" | find /c "ESTABLISHED"

80 is port number

if i set port number , i get total of port number !

2014/01/23 18:01 2014/01/23 18:01
Posted
Filed under Link

In Part 1 of the HOWTO we built the virtual machine and configured the Oracle Linux 6 operating systems. Here we continue with the Database 12c installation.

In order to install Database 12c your VM has to meet some prerequisites as outlined in the Database Installation Guide for Linux. Most of the pre-installation tasks can be completed by installing the 12cR1 Pre-install RPM. Let’s open a terminal console and install this package.

[root@ol6 ~]# yum install oracle-rdbms-server-12cR1-preinstall.x86_64
Loaded plugins: refresh-packagekit, security
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package oracle-rdbms-server-12cR1-preinstall.x86_64 0:1.0-8.el6 will be installed
...
--> Finished Dependency Resolution

Dependencies Resolved

===============================================================================================================================================================================================================
 Package                                                             Arch                                  Version                                             Repository                                 Size
===============================================================================================================================================================================================================
Installing:
 oracle-rdbms-server-12cR1-preinstall                                x86_64                                1.0-8.el6                                           ol6_latest                                 15 k
Installing for dependencies:
 compat-libcap1                                                      x86_64                                1.10-1                                              ol6_latest                                 17 k
 compat-libstdc++-33                                                 x86_64                                3.2.3-69.el6                                        ol6_latest                                183 k
 gcc-c++                                                             x86_64                                4.4.7-3.el6                                         ol6_latest                                4.7 M
 ksh                                                                 x86_64                                20100621-19.el6_4.4                                 ol6_latest                                686 k
 libaio-devel                                                        x86_64                                0.3.107-10.el6                                      ol6_latest                                 13 k
 libstdc++-devel                                                     x86_64                                4.4.7-3.el6                                         ol6_latest                                1.6 M

Transaction Summary
===============================================================================================================================================================================================================
Install       7 Package(s)

Total download size: 7.2 M
Installed size: 23 M
Is this ok [y/N]: y
Downloading Packages:
(1/7): compat-libcap1-1.10-1.x86_64.rpm                                                                                                                                                 |  17 kB     00:00
...
Installed:
  oracle-rdbms-server-12cR1-preinstall.x86_64 0:1.0-8.el6

Dependency Installed:
  compat-libcap1.x86_64 0:1.10-1            compat-libstdc++-33.x86_64 0:3.2.3-69.el6      gcc-c++.x86_64 0:4.4.7-3.el6      ksh.x86_64 0:20100621-19.el6_4.4      libaio-devel.x86_64 0:0.3.107-10.el6
  libstdc++-devel.x86_64 0:4.4.7-3.el6

Complete!
[root@ol6 ~]#

The pre-install RPM automatically creates the Oracle software owner account (named oracle). Let’s set a password for the account.

[root@ol6 ~]# passwd oracle
Changing password for user oracle.
New password:
BAD PASSWORD: it is based on a dictionary word
Retype new password:
passwd: all authentication tokens updated successfully.
[root@ol6 ~]#

Next you need to create the Oracle base and the Oracle inventory directories:

[root@ol6 ~]# mkdir -p /u01/app/oracle
[root@ol6 ~]# chown -R oracle:oinstall /u01/app/oracle/
[root@ol6 ~]# chmod -R 775 /u01/app/oracle/
[root@ol6 ~]#
[root@ol6 ~]# mkdir -p /u01/app/oraInventory
[root@ol6 ~]# chown -R oracle:oinstall /u01/app/oraInventory/
[root@ol6 ~]# chmod -R 775 /u01/app/oraInventory/

Time to switch to the oracle user. Logout from your current session and login back as oracle.

You will need the Database 12c Release 1 installation for Linux. Start the internet browser inside your virtual machine and go to the Database download section of OTN.

db12c_install_55

Download the two zip files to a convenient location (/home/oracle will do nicely). After both files are in place use unzip to extract their contents.

[root@ol6 ~]$ unzip /home/oracle/*.zip

Run the Oracle Universal Installer by executing:

[root@ol6 ~]$ /home/oracle/database/runInstaller.sh

db12c_install_56

As this is a test installation you do not have to register it with Oracle Support. Uncheck the “I wish to receive security updates via Oracle Support” box and click Next.

db12c_install_57

Select “Skip software updates” and click Next.

db12c_install_58

Select “Create and configure a database” and click Next.

db12c_install_59

Select “Server class” and click Next.

db12c_install_60

Make sure the installation type is set to “Single instance” and click Next.

db12c_install_61

Select “Advanced install” and click Next.

db12c_install_62

Select English for your product language and click Next.

db12c_install_63

Set the edition to Enterprise and click Next.

db12c_install_64

Set the Oracle base to /u01/app/oracle and the Oracle home to /u01/app/oracle/product/12.1.0/dbhome_1.

db12c_install_65

Set the inventory directory to /u01/app/oraInventory and the inventory owner to oinstall.

db12c_install_66

Set the database type to General Purpose and click Next.

db12c_install_67

Set the database name and SID to orcl and uncheck the “Create as Container database” option.

db12c_install_68

Leave the memory settings by default and go to the Character sets tab.

db12c_install_69

Set the database character set to Unicode (AL32UTF8).

db12c_install_70

At the Sample schemas tab select the “Create database with sample schemas”. This will install some sample data that you can experiment with.

db12c_install_71

Select File system as the database storage option and set the path to /u01/app/oracle/oradata.

db12c_install_72

You have no Cloud Control installation in this test setup, so skip the registration and click Next.

db12c_install_73

Do not enable the archivelog mode. Click Next.

db12c_install_74

Select “Use the same password for all accounts” and set the system password for your database.

db12c_install_75

Set all the groups to dba and click Next.

db12c_install_76

The installer presents you with a summary of the upcoming installation. Click Install.

db12c_install_77

Give the installer some time to copy the oracle binaries to the specified location.

db12c_install_78

At some point you will be asked to execute a pair of configuration scripts. Open a terminal console, become root and run the scripts in the specified order.

[oracle@ol6 ~]$ su -
Password: 
[root@ol6 ~]# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
[root@ol6 ~]# /u01/app/oracle/product/12.1.0/dbhome_1/root.sh
Performing root user operation for Oracle 12c

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/product/12.1.0/dbhome_1

Enter the full pathname of the local bin directory: [/usr/local/bin]:
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...


Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
[root@ol6 ~]# 

Close the terminal and click OK in the Execute configuration scripts dialog.

db12c_install_79

After the database binaries are in place the installer will launch the Database Configuration Assistant (DBCA). The assistant will create the orcl database and will insert the sample data into it.

db12c_install_80

When DBCA completes it will display a dialog with the address of your Enterprise Manager console. Take a note of the URL and click OK.

db12c_install_81

The installation is now completed. Click Close to exit the installer.

Open a browser and type in the Enterprise Manager URL.

db12c_install_82

Login as user system (use the system password you set during the database installation).

db12c_install_83

You can see your Database 12c up and running.

2014/01/22 12:32 2014/01/22 12:32
Posted
Filed under Linux

vncserver - port  : 5901
방화벽에서 5901포트를 개방 한다.

1. login as root
2. yum install vnc
3. yum install vnc-server
4. insert "vncserver" in command line
5. yum install tigervnc-server (의존성 때문에 2~4) 과정에서 설치가 됨.

구동 명령어
 - service vncserver restart
 - service vncserver start
 - service vncserver stop

if i execute  "service vncserver restart" then
  "nc server no displays configured" in command line

resoluction
vi /etc/sysconfig/vncservers

insert to endline this
VNCSERVERS="1:root"

good luck!!

2014/01/21 19:09 2014/01/21 19:09
Posted
Filed under Linux
/etc/vsftpd/vsftpd.conf 설정파일에 아래 내용을 추가하면 됩니다. anon_max_rate=0 - 익명 무제한 설정 시(0으로 설정 시 무제한) local_max_rate=-0 - 사용자 무제한 설정 시(0으로 설정 시 무제한) 5000000 < -- 5M 설정 후 vsftpd 재시작 #service vsftpd restart 또는 #/etc/init.d/vsftpd restart
2014/01/14 20:47 2014/01/14 20:47