<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>

<channel>
	<title>윤지 &#38; 윤형's House</title>
	<atom:link href="http://blog.dinux.kr/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://blog.dinux.kr</link>
	<description>Just another WordPress weblog</description>
	<pubDate>Tue, 27 Apr 2010 09:21:21 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Install Postgresql and pgadmin3 in Ubuntu</title>
		<link>http://blog.dinux.kr/?p=296</link>
		<comments>http://blog.dinux.kr/?p=296#comments</comments>
		<pubDate>Tue, 27 Apr 2010 09:21:21 +0000</pubDate>
		<dc:creator>최 태현</dc:creator>
		
		<category><![CDATA[Database]]></category>

		<category><![CDATA[PostgreSQL]]></category>

		<category><![CDATA[Server]]></category>

		<guid isPermaLink="false">http://blog.dinux.kr/?p=296</guid>
		<description><![CDATA[PostgreSQL 8.2 version will be installed in Ubuntu 7.10 (Gutsy Gibbon)
sudo apt-get install postgresql-8.2 postgresql-client-8.2 postgresql-contrib-8.2
sudo apt-get install pgadmin3
This will install the database server/client, some extra utility scripts and the pgAdmin GUI application for working with the database.
Configuring postgresql in Ubuntu
Now we need to reset the password for the ‘postgres’ admin account for the server
sudo [...]]]></description>
			<content:encoded><![CDATA[<p>PostgreSQL 8.2 version will be installed in Ubuntu 7.10 (Gutsy Gibbon)</p>
<p>sudo apt-get install postgresql-8.2 postgresql-client-8.2 postgresql-contrib-8.2</p>
<p>sudo apt-get install pgadmin3</p>
<p>This will install the database server/client, some extra utility scripts and the pgAdmin GUI application for working with the database.</p>
<p><strong>Configuring postgresql in Ubuntu</strong></p>
<p>Now we need to reset the password for the ‘postgres’ admin account for the server</p>
<p>sudo su postgres -c psql template1<br />
template1=# ALTER USER postgres WITH PASSWORD ‘password’;<br />
template1=# \q</p>
<p>That alters the password for within the database, now we need to do the same for the unix user ‘postgres’:</p>
<p>sudo passwd -d postgres</p>
<p>sudo su postgres -c passwd</p>
<p>Now enter the same password that you used previously.</p>
<p>from here on in we can use both pgAdmin and command-line access (as the postgres user) to run the database server. But before you jump into pgAdmin we should set-up the PostgreSQL admin pack that enables better logging and monitoring within pgAdmin. Run the following at the command-line</p>
<p>we need to open up the server so that we can access and use it remotely - unless you only want to access the database on the local machine. To do this, first, we need to edit the postgresql.conf file:</p>
<p>sudo gedit /etc/postgresql/8.2/main/postgresql.conf</p>
<p>Now, to edit a couple of lines in the ‘Connections and Authentication’ section</p>
<p>Change the line</p>
<p>#listen_addresses = ‘localhost’</p>
<p>to</p>
<p>listen_addresses = ‘*’</p>
<p>and also change the line</p>
<p>#password_encryption = on</p>
<p>to</p>
<p>password_encryption = on</p>
<p>Then save the file and close gedit.</p>
<p>Now for the final step, we must define who can access the server. This is all done using the pg_hba.conf file.</p>
<p>sudo gedit /etc/postgresql/8.2/main/pg_hba.conf</p>
<p>Comment out, or delete the current contents of the file, then add this text to the bottom of the file</p>
<p>DO NOT DISABLE!<br />
# If you change this first entry you will need to make sure that the<br />
# database<br />
# super user can access the database using some other method.<br />
# Noninteractive<br />
# access to all databases is required during automatic maintenance<br />
# (autovacuum, daily cronjob, replication, and similar tasks).<br />
#<br />
# Database administrative login by UNIX sockets<br />
local all postgres ident sameuser<br />
# TYPE DATABASE USER CIDR-ADDRESS METHOD</p>
<p># “local” is for Unix domain socket connections only<br />
local all all md5<br />
# IPv4 local connections:<br />
host all all 127.0.0.1/32 md5<br />
# IPv6 local connections:<br />
host all all ::1/128 md5</p>
<p># Connections for all PCs on the subnet<br />
#<br />
# TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD<br />
host all all [ip address] [subnet mask] md5</p>
<p>and in the last line, add in your subnet mask (i.e. 255.255.255.0) and the IP address of the machine that you would like to access your server (i.e. 138.250.192.115). However, if you would like to enable access to a range of <a class="iAs" href="http://www.ubuntugeek.com/howto-setup-database-server-with-postgresql-and-pgadmin3.html#" target="_blank">IP addresses<img src="http://images.intellitxt.com/ast/adTypes/mag-glass_10x10.gif" alt="" /></a>, just substitute the last number for a zero and all machines within that range will be allowed access (i.e. 138.250.192.0 would allow all machines with an IP address 138.250.192.x to use the database server).</p>
<p>That’s it, now all you have to do is restart the server</p>
<p>sudo /etc/init.d/postgresql-8.2 restart</p>
<p>That’s it you can start using postgresql in Ubuntu</p>
<p><strong>Create a Database from command line</strong></p>
<p>You can also use pgadmin3 for all postgresql related</p>
<p>To create a database with a user that have full rights on the database, use the following command</p>
<p>sudo -u postgres createuser -D -A -P mynewuser</p>
<p>sudo -u postgres createdb -O mynewuser mydatabase</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dinux.kr/?feed=rss2&amp;p=296</wfw:commentRss>
		</item>
		<item>
		<title>phpPgAdmin 사용하기</title>
		<link>http://blog.dinux.kr/?p=294</link>
		<comments>http://blog.dinux.kr/?p=294#comments</comments>
		<pubDate>Thu, 22 Apr 2010 08:50:04 +0000</pubDate>
		<dc:creator>최 태현</dc:creator>
		
		<category><![CDATA[.Mac]]></category>

		<category><![CDATA[Database]]></category>

		<category><![CDATA[How to]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[PostgreSQL]]></category>

		<guid isPermaLink="false">http://blog.dinux.kr/?p=294</guid>
		<description><![CDATA[If your PostgreSQL server is running on the same server as the  webserver, phpPgAdmin&#8217;s default   configuration will work &#8220;out-of-the-box&#8221;; if not, you&#8217;ll need to edit  the configuration file located   at conf/config.inc.php. It should be self-explanatory.  There&#8217;s also a &#8220;backup&#8221; copy of the   installation file &#8220;conf/config.inc.php-dist&#8220;.
One problem [...]]]></description>
			<content:encoded><![CDATA[<p>If your PostgreSQL server is running on the same server as the  webserver, phpPgAdmin&#8217;s default   configuration will work &#8220;out-of-the-box&#8221;; if not, you&#8217;ll need to edit  the configuration file located   at <code>conf/config.inc.php</code>. It should be self-explanatory.  There&#8217;s also a &#8220;backup&#8221; copy of the   installation file &#8220;<code>conf/config.inc.php-dist</code>&#8220;.</p>
<p>One problem which occurs quite often is the error message &#8220;<code>Login  disallowed for security reasons</code>&#8220;,   which occurs when trying to login as a user with an empty password, a  common situation on (presumably well-protected)   development machines. To enable this kind of login, set the option <code>$conf['owned_only']</code> in    <code>conf/config.inc.php</code> to <code>true</code>.</p>
<p>&#8216;extra_login_security&#8217; =</p>
<p>If extra login security is true, then logins via phpPgAdmin with no  password or certain usernames (pgsql, postgres, root, administrator)<br />
will be denied.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dinux.kr/?feed=rss2&amp;p=294</wfw:commentRss>
		</item>
		<item>
		<title>12 Ways Libraries Are Good for the Country</title>
		<link>http://blog.dinux.kr/?p=292</link>
		<comments>http://blog.dinux.kr/?p=292#comments</comments>
		<pubDate>Tue, 20 Apr 2010 08:30:18 +0000</pubDate>
		<dc:creator>최 태현</dc:creator>
		
		<category><![CDATA[Library]]></category>

		<guid isPermaLink="false">http://blog.dinux.kr/?p=292</guid>
		<description><![CDATA[MOST AMERICANS KNOW what they can expect from a library. And  librarians know what it takes to provide comprehensive access to every  recorded detail of human existence. It takes support.
Libraries are ready when they are needed, ready to enrich our minds  and defend our right to know, just as other institutions protect [...]]]></description>
			<content:encoded><![CDATA[<p><strong>MOST AMERICANS KNOW</strong> what they can expect from a library. And  librarians know what it takes to provide comprehensive access to every  recorded detail of human existence. It takes support.</p>
<p>Libraries are ready when they are needed, ready to enrich our minds  and defend our right to know, just as other institutions protect our  safety and property. Without sound minds, however, the American dream of  safe streets and secure homes will never be fulfilled.</p>
<p>Libraries safeguard our freedom and keep democracy healthy. To  library advocates everywhere—Friends, trustees, board members, patrons,  and volunteers—<em>American Libraries</em> offers this gift of 12 ideals  toward which we strive. It will take all of us, in a spirit of pride and  freedom, to maintain libraries as a living reality in a free nation  into the 21st century.</p>
<p><strong>1. Libraries inform citizens.</strong> Democracy vests supreme power in  the people. Libraries make democracy work by providing access to  information so that citizens can make the decisions necessary to govern  themselves. The public library is the only institution in American  society whose purpose is to guard against the tyrannies of ignorance and  conformity, and its existence indicates the extent to which a  democratic society values knowledge, truth, justice, books, and culture.</p>
<p><strong>2. Libraries break down boundaries.</strong> Libraries provide free  family literacy programs for low-literate, illiterate, and  non-English-speaking people. In addition, hundreds of librarians across  America lead outreach programs that teach citizenship and develop  multilingual and multicultural materials for their patrons. Libraries  serve the homebound elderly, prisoners, and other institutionalized  individuals, the homeless, and the blind and hearing-impaired.</p>
<p><strong>3. Libraries level the playing field.</strong> Economists have cited a  growing income inequity in America, with the gap between the richest and  poorest citizens becoming wider year by year. By making all its  resources equally available to all members of its community, regardless  of income, class, or other factors, the library levels the playing  field. Once users have access to the library’s materials, they have the  opportunity to level the playing field outside the library by learning  to read, gaining employment, or starting a business.</p>
<p><strong>4. Libraries value the individual</strong>. Library doors swing open  for independent thinking without prejudgment. Libraries offer  alternatives to the manipulations of commercialism, from the excellence  of public-television productions to the freethinking of renegade  publishers and the vision of poets and artists outside the mainstream  business of art and literature.</p>
<p><strong>5. Libraries nourish creativity.</strong> In the library we are all  children. By stimulating curiosity—parent to the twin forces of  creativity and imagination—even the most focused and specialized library  serves the purpose of lifting the mind beyond its horizons. Libraries  store ideas that may no longer work but can serve as the raw material  that, cross-fertilized in the innovative mind, may produce answers to  questions not yet asked.</p>
<p><strong>6. Libraries open kids’ minds.</strong> Bringing children into a  library can transport them from the commonplace to the extraordinary.  From story hours for preschoolers to career planning for high schoolers,  children’s librarians make a difference because they care about the  unique developmental needs of every individual who comes to them for  help. Children get a handle on personal responsibility by holding a  library card of their own, a card that gives them access to new worlds  in books, videos, audiotapes, computers, games, toys, and more.</p>
<p><strong>7. Libraries return high dividends.</strong> What do Gallo wines, the I  Can’t Believe It’s Yogurt chain, and billboard-sign giant Metromedia  have in common? Libraries made millionaires out of each of these  companies’ grateful owners by providing crucial start-up information  when they were no more than wannabe business titans. Libraries are there  to help people with more personal goals, too. The seed money expended  for these and other success stories? Less than $20 per capita per year  in tax dollars.</p>
<p><strong>8. Libraries build communities.</strong> No narrow definition of  community will work in a library. Each community has its libraries and  its special collections. Libraries validate and unify; they save lives,  literally and by preserving the record of those lives.  Community-building means libraries link people with information.  Librarians have become experts at helping others navigate the Internet.  Before there was talk of cyberspace, there were libraries, paving the  way for the superhighway.</p>
<p><strong>9. Libraries make families friendlier.</strong> The American family’s  best friend, the library, offers services guaranteed to hone coping  skills. Homework centers, literacy training, parenting materials,  after-school activities, summer reading programs, outreach—like the  families they serve, libraries everywhere are adapting to meet new  challenges.</p>
<p><strong>10. Libraries offend everyone.</strong> Children’s librarian Dorothy  Broderick contends that every library in the country ought to have a  sign on the door reading: “This library has something offensive to  everyone. If you are not offended by something we own, please complain.”  This willingness and duty to offend connotes a tolerance and a  willingness to look at all sides of an issue that would be good for the  nation in any context; it is particularly valuable when combined with  the egalitarianism and openness that characterize libraries.</p>
<p><strong>11. Libraries offer sanctuary</strong>. Like synagogues, churches,  mosques, and other sacred spaces, libraries can create a physical  reaction, a feeling of peace, respect, humility, and honor that throws  the mind wide open and suffuses the body with a near-spiritual pleasure.  But why? Perhaps it is because in the library we are answerable to no  one; alone with our private thoughts, fantasies, and hopes, we are free  to nourish what is most precious to us with the silent companionship of  others we do not know.</p>
<p><strong>12. Libraries preserve the past.</strong> Libraries preserve the  record; a nation, a culture, a community that does not understand its  own past is mired in its own mistakes. Libraries enable us to  communicate through distance and time with the living and the dead. It  is a miracle kept available by the meticulous sorting, storing,  indexing, and preservation that still characterizes library work—work  that will carry, in the electronic environment, challenges and a price  tag yet unknown.</p>
<p><span style="font-size: x-small;">Adapted from “12 Ways Libraries Are Good for the  Country,” <em>American Libraries</em> 26 (December 1995): 1113–19.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dinux.kr/?feed=rss2&amp;p=292</wfw:commentRss>
		</item>
		<item>
		<title>Mac OS X Snow Leopard : PHP + OCI8</title>
		<link>http://blog.dinux.kr/?p=281</link>
		<comments>http://blog.dinux.kr/?p=281#comments</comments>
		<pubDate>Thu, 08 Apr 2010 01:55:42 +0000</pubDate>
		<dc:creator>최 태현</dc:creator>
		
		<category><![CDATA[.Mac]]></category>

		<category><![CDATA[Apache2]]></category>

		<category><![CDATA[Oracle]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Server]]></category>

		<guid isPermaLink="false">http://blog.dinux.kr/?p=281</guid>
		<description><![CDATA[


Mac OS X Snow Leopard 에서 Oracle 10.g 설치하기 를 통해 Oracle을 설치했다는 전제하에 PHP에 OCI8을 설치하는 방법입니다.
먼저 OCI8 module이 제대로 설치되어 있는지 확인합니다.
env  &#124;  grep  -­E  &#8221;(ORACLE)&#124;(DYLD)&#8221;
ORACLE_SID=y2love
ORACLE_BASE=/Users/Y2Love
DYLD_LIBRARY_PATH=/Users/oracle/oracle/product/10.2.0/db_1/lib
ORACLE_HOME=/Users/oracle/oracle/product/10.2.0/db_1

와 같이 나오면 됩니다.

그러면 이제 PECL command를 실행시켜 OCI8 module을 설치합니다. 이때 저는 sudo를 사용해야 됨에 따라 root 계정 환경변수에 먼저 Oracle 환경변수를 .bash_profiled에 넣어줬습니다.
sudo -i
root# vi .bash_profile
export [...]]]></description>
			<content:encoded><![CDATA[<p class="storytitle">
<p class="storytitle">
<h1 class="storytitle"></h1>
<p class="storytitle"><a rel="bookmark" href="http://blog.dinux.kr/?p=278" target="_self">Mac OS X Snow Leopard 에서 Oracle 10.g 설치하기</a> 를 통해 Oracle을 설치했다는 전제하에 PHP에 OCI8을 설치하는 방법입니다.</p>
<p class="storytitle">먼저 OCI8 module이 제대로 설치되어 있는지 확인합니다.</p>
<p class="storytitle">env  |  grep  -­E  &#8221;(ORACLE)|(DYLD)&#8221;</p>
<p class="storytitle"><em>ORACLE_SID=y2love<br />
ORACLE_BASE=/Users/Y2Love<br />
DYLD_LIBRARY_PATH=/Users/oracle/oracle/product/10.2.0/db_1/lib<br />
ORACLE_HOME=/Users/oracle/oracle/product/10.2.0/db_1</em>
</p>
<p class="storytitle">와 같이 나오면 됩니다.</p>
<p class="storytitle"><span id="more-281"></span></p>
<p class="storytitle">그러면 이제 PECL command를 실행시켜 OCI8 module을 설치합니다. 이때 저는 sudo를 사용해야 됨에 따라 root 계정 환경변수에 먼저 Oracle 환경변수를 .bash_profiled에 넣어줬습니다.</p>
<p class="storytitle">sudo -i</p>
<p class="storytitle">root# vi .bash_profile</p>
<p class="storytitle"><em>export ORACLE_HOME=/Users/oracle/oracle/product/10.2.0/db_1<br />
export DYLD_LIBRARY_PATH=$ORACLE_HOME/lib<br />
export ORACLE_SID=ORCL<br />
PATH=$PATH:$ORACLE_HOME/bin</em>
</p>
<p class="storytitle">root# . ./bash_profile</p>
<p class="storytitle">root# pecl install oci8</p>
<p class="storytitle">다음에 php engine이 module을 load 할 수 있도록 php.ini에 등록시켜준다.</p>
<p class="storytitle">$vi /etc/php.ini</p>
<p class="storytitle">extension=oci8.so ; php.ini 뒷부분에 삽입해 준다.</p>
<p class="storytitle">OCI8이 재대로 설치되었는지 확인해본다.</p>
<p class="storytitle">$php -i|grep -E -i &#8220;(oci8)&#8221;</p>
<address class="storytitle">OCI8  Support  =&gt;  enabled</address>
<address class="storytitle">oci8.connection_class  =&gt;  no</address>
<address class="storytitle">value  =&gt;  no  value</address>
<address class="storytitle">oci8.default_prefetch  =&gt;  100  =&gt;  100</address>
<address class="storytitle">oci8.events  =&gt;  Off  =&gt;  Off</address>
<address class="storytitle">oci8.max_persistent  =&gt;  -­1  =&gt;  -­1</address>
<address class="storytitle">oci8.old_oci_close_semantics  =&gt;  Off  =&gt;  Off</address>
<address class="storytitle">oci8.persistent_timeout  =&gt;  -­1  =&gt;  -­1</address>
<address class="storytitle">oci8.ping_interval  =&gt;  60  =&gt;  60</address>
<address class="storytitle">oci8.privileged_connect  =&gt;  Off  =&gt;  Off</address>
<address class="storytitle">oci8.statement_cache_size  =&gt;  20  =&gt;  20</address>
<p class="storytitle">여기까지 하고 일단 apache를 재 기동시키고 phpinfo()를 통해 확인해 보면 oci8관련 자료가 올라와 있는것을 확인할 수 있다.</p>
<p class="storytitle">이거외에도 몇가지 환경설정관련 작업을 해줘야 된다고 되어 있는데 이부분은 차후 정리해서 올리겠습니다.</p>
<p class="storytitle">
<p id="title">참고자료 :<a href="http://musarra.wordpress.com/2009/10/29/mac-os-x-snow-leopard-php-5-3-oci8/" target="_blank"> Antonio Musarra&#8217;s  Blog<br />
</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dinux.kr/?feed=rss2&amp;p=281</wfw:commentRss>
		</item>
		<item>
		<title>Mac OS X Snow Leopard 에서 Oracle 10.g 설치하기</title>
		<link>http://blog.dinux.kr/?p=278</link>
		<comments>http://blog.dinux.kr/?p=278#comments</comments>
		<pubDate>Wed, 07 Apr 2010 15:29:09 +0000</pubDate>
		<dc:creator>최 태현</dc:creator>
		
		<category><![CDATA[.Mac]]></category>

		<category><![CDATA[How to]]></category>

		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://blog.dinux.kr/?p=278</guid>
		<description><![CDATA[1996년인가  대전광역시 중소기업지원정보시스템 구축사업을 하면서 대전광역시에 오라클을 처음으로 도입했었습니다.
그당시 Ingres DB가 행정망용으로 사용되고 있었는데  Sun Enterprise 에 오라클 DB를 올렸던 기억이 납니다. 그 당시만해도
오라클사에서는 도입만해줘도 무슨 요구든지 들어줬는데 지금은 너무 배짱을 부리는것 같습니다. 유지보수비가 장난이 아니더군요. 그것도 유지보수계약 체결하기 전까지의 모든 비용을 요구하면서&#8230; 입맛이 씁쓸합니다.
물론 1998년인가 1999년도에 대전광역시에 시정도우미 라는 내부 인트라넷 서비스를 만들면서 Linux [...]]]></description>
			<content:encoded><![CDATA[<p>1996년인가  대전광역시 중소기업지원정보시스템 구축사업을 하면서 대전광역시에 오라클을 처음으로 도입했었습니다.</p>
<p>그당시 Ingres DB가 행정망용으로 사용되고 있었는데  Sun Enterprise 에 오라클 DB를 올렸던 기억이 납니다. 그 당시만해도</p>
<p>오라클사에서는 도입만해줘도 무슨 요구든지 들어줬는데 지금은 너무 배짱을 부리는것 같습니다. 유지보수비가 장난이 아니더군요. 그것도 유지보수계약 체결하기 전까지의 모든 비용을 요구하면서&#8230; 입맛이 씁쓸합니다.</p>
<p>물론 1998년인가 1999년도에 대전광역시에 시정도우미 라는 내부 인트라넷 서비스를 만들면서 Linux ( 당시 알짜 리눅스 였던것 같은데..)에 MySQL, PHP 를 386PC에 설치하면서 Free Software로 방향을 전환했습니다.</p>
<p>오째든 장난삼아 Oracle을 MacBook에 올려봤습니다.</p>
<p>( 원문 Site 입니다.     <a title="참조사이트" href="http://blog.rayapps.com/2009/04/12/how-to-install-oracle-database-10g-on-mac-os-x-intel/#comment-1164" target="_blank">ray_apps_blog</a> )</p>
<h3><span id="more-278"></span></h3>
<h3>Initial preparation</h3>
<p>If you are a developer then I suppose you already have Xcode tools  installed which are required also for Oracle installation. And I tried  these steps on Mac OS X latest version 10.5.6.</p>
<p>Then you need to create oracle user as well as increase default  kernel parameters. Open Terminal and switch to root user:</p>
<pre>sudo -i</pre>
<p>Create oinstall group and oracle user (I used group and user number  600 to ensure that they do not collide with existing groups and users):</p>
<pre>dscl . -create /groups/oinstall
dscl . -append /groups/oinstall gid 600
dscl . -append /groups/oinstall passwd "*"</pre>
<pre>dscl . -create /users/oracle
dscl . -append /users/oracle uid 600
dscl . -append /users/oracle gid 600
dscl . -append /users/oracle shell /bin/bash
dscl . -append /users/oracle home /Users/oracle
dscl . -append /users/oracle realname "Oracle software owner"
mkdir /Users/oracle
chown oracle:oinstall /Users/oracle</pre>
<p>Change password for oracle user:</p>
<pre>passwd oracle</pre>
<p>Change default kernel parameters:</p>
<pre>vi /etc/sysctl.conf</pre>
<p>and enter values recommended by Oracle:</p>
<pre>kern.sysv.semmsl=87381
kern.sysv.semmns=87381
kern.sysv.semmni=87381
kern.sysv.semmnu=87381
kern.sysv.semume=10
kern.sysv.shmall=2097152
kern.sysv.shmmax=2197815296
kern.sysv.shmmni=4096
kern.maxfiles=65536
kern.maxfilesperproc=65536
net.inet.ip.portrange.first=1024
net.inet.ip.portrange.last=65000
kern.corefile=core
kern.maxproc=2068
kern.maxprocperuid=2068</pre>
<p>After this reboot your computer so that these new kernel parameters  would be taken into effect. After reboot open again Terminal and now  login as oracle user:</p>
<pre>su - oracle</pre>
<p>Set shell settings in .bash_profile</p>
<pre>vi .bash_profile</pre>
<p>and enter</p>
<pre>export DISPLAY=:0.0
export ORACLE_BASE=$HOME
umask 022
ulimit -Hn 65536
ulimit -Sn 65536</pre>
<p>As you see I prefer to install all Oracle related files under home  directory of oracle user therefore I am setting ORACLE_BASE to home  directory. And also include ulimit settings – I forgot to do this  initially and got strange TNS service errors because of that.</p>
<p>Now execute this script so that these settings are applied to current  shell:</p>
<pre>. ./.bash_profile</pre>
<p>Now download <a href="http://www.oracle.com/technology/software/products/database/oracle10g/htdocs/10204macsoft_x86-64.html">db.zip  installation archive</a> and place it somewhere and unzip it:</p>
<pre>mkdir Install
cd Install
# download db.zip to this directory
unzip db.zip
cd db/Disk1</pre>
<p>Now you are ready to start installation:</p>
<pre>./runInstaller</pre>
<h3>Installation</h3>
<p>In installation wizard I selected the following options:</p>
<ul>
<li>Advanced Installation – so that I can change some default options</li>
<li>Standard Edition – as I don’t need additional features of Enterprise  Edition</li>
<li>Create Database / General Purpose</li>
<li>Global database name: orcl, SID: orcl</li>
<li>Character set: UTF-8 AL32UTF8</li>
<li>Create database with sample schemas</li>
<li>Selected “Use the same password for all the accounts” – do not  specify default “manager” password as it will not be allowed <img src='http://blog.dinux.kr/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li>Password Management – selected this to unlock necessary sample  accounts (e.g. HR schema account that I use as default test schema)</li>
</ul>
<p>At the end of installation you will be instructed to run one shell  script from root.<br />
Hopefully installation will complete successfully.</p>
<h3>Additional oracle user settings</h3>
<p>If you will use oracle user later then add the following lines to  .bash_profile of oracle user:</p>
<pre>export ORACLE_HOME=/Users/oracle/oracle/product/10.2.0/db_1
export DYLD_LIBRARY_PATH=$ORACLE_HOME/lib
export ORACLE_SID=ORCL
PATH=$PATH:$ORACLE_HOME/bin</pre>
<p>After this relogin as oracle user and verify listener status:</p>
<pre>lsnrctl status</pre>
<p>and if it is down then start it with</p>
<pre>lsnrctl start</pre>
<p>and verify if you can connect to Oracle database with sample user  (that I unlocked during installation)</p>
<pre>sqlplus hr/hr@orcl</pre>
<p>If it fails then do some investigation <img src='http://blog.dinux.kr/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>Change listener to listen on localhost</h3>
<p>As I need this Oracle database just as local development database on  my computer then I want to change the listener so that it would listen  just on localhost port 1521:</p>
<pre>vi $ORACLE_HOME/network/admin/listener.ora</pre>
<p>and change the contents of the file to:</p>
<pre>SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /Users/oracle/oracle/product/10.2.0/db_1)
      (PROGRAM = extproc)
    )
    (SID_DESC =
      (SID_NAME = orcl)
      (ORACLE_HOME = /Users/oracle/oracle/product/10.2.0/db_1)
    )
  )</pre>
<pre>LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    )
  )</pre>
<p>Then also change ORCL alias definition in  $ORACLE_HOME/network/admin/tnsnames.ora to:</p>
<pre>ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )</pre>
<p>After this change restart listener and try to connect with sqlplus to  verify that these changes are successful.</p>
<h3>Automatic startup of Oracle database</h3>
<p>If you want that Oracle database is started automatically when your  computer is booted then you need to create the following startup script.  Start terminal and switch to root.</p>
<p>At first edit /etc/oratab and change N to Y at the end of line for  ORCL database – this will be used by dbstart utility to find which  databases should be started automatically.</p>
<p>Then create startup script for Oracle database:</p>
<pre>mkdir /Library/StartupItems/Oracle
cd /Library/StartupItems/Oracle
vi Oracle</pre>
<p>and enter the following:</p>
<pre>#!/bin/sh</pre>
<pre># Suppress the annoying "$1: unbound variable" error when no option
# was given
if [ -z $1 ] ; then
  echo "Usage: $0 [start|stop|restart] "
  exit 1
fi</pre>
<pre># source the common startup script
. /etc/rc.common</pre>
<pre># Change the value of ORACLE_HOME to specify the correct Oracle home
# directory for the installation
ORACLE_HOME=/Users/oracle/oracle/product/10.2.0/db_1
DYLD_LIBRARY_PATH=$ORACLE_HOME/lib
export ORACLE_HOME DYLD_LIBRARY_PATH</pre>
<pre># change the value of ORACLE to the login name of the
# oracle owner at your site
ORACLE=oracle</pre>
<pre>PATH=$PATH:$ORACLE_HOME/bin</pre>
<pre># Set shell limits for the Oracle Database
ulimit -Hu 2068
ulimit -Su 2068
ulimit -Hn 65536
ulimit -Sn 65536</pre>
<pre>StartService()
{
  ConsoleMessage "Starting Oracle Databases"
  su $ORACLE -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
}</pre>
<pre>StopService()
{
  ConsoleMessage "Stopping Oracle Databases"
  su $ORACLE -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME"
}</pre>
<pre>RestartService()
{
  StopService
  StartService
}</pre>
<pre>RunService "$1"</pre>
<p>and then make this script executable</p>
<pre>chmod a+x Oracle</pre>
<p>and in addition create properties file:</p>
<pre>vi StartupParameters.plist</pre>
<p>with the following contents:</p>
<pre>{
  Description     = "Oracle Database Startup";
  Provides        = ("Oracle Database");
  Requires        = ("Disks");
  OrderPreference = "None";
}</pre>
<p>Now you can verify that these scripts are working. Open new terminal  and try</p>
<pre>sudo /Library/StartupItems/Oracle/Oracle stop</pre>
<p>to stop the database and</p>
<pre>sudo /Library/StartupItems/Oracle/Oracle start</pre>
<p>to start again the database. And later you can reboot your computer  also to verify that Oracle database will be started automatically.</p>
<h3>Hide oracle user from login window</h3>
<p>After computer reboot you probably noticed that now you got oracle  user in initial login window. To get rid of it execute this from  terminal:</p>
<pre>sudo defaults write /Library/Preferences/com.apple.loginwindow HiddenUsersList -array-add oracle</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.dinux.kr/?feed=rss2&amp;p=278</wfw:commentRss>
		</item>
		<item>
		<title>재미있는 ponebook</title>
		<link>http://blog.dinux.kr/?p=274</link>
		<comments>http://blog.dinux.kr/?p=274#comments</comments>
		<pubDate>Thu, 25 Mar 2010 23:21:20 +0000</pubDate>
		<dc:creator>최 태현</dc:creator>
		
		<category><![CDATA[Ubuntu]]></category>

		<category><![CDATA[Apple]]></category>

		<category><![CDATA[Book]]></category>

		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://blog.dinux.kr/?p=274</guid>
		<description><![CDATA[
아이디어 참 좋다&#8230;..
]]></description>
			<content:encoded><![CDATA[<p><object width="425" height="350" data="http://www.youtube.com/v/GnZTul_9fWc" type="application/x-shockwave-flash"><param name="src" value="http://www.youtube.com/v/GnZTul_9fWc" /></object></p>
<p>아이디어 참 좋다&#8230;..</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dinux.kr/?feed=rss2&amp;p=274</wfw:commentRss>
		</item>
		<item>
		<title>&#50504;&#46300;&#47196;&#51060;&#46300; &#44396;&#51077;</title>
		<link>http://blog.dinux.kr/?p=269</link>
		<comments>http://blog.dinux.kr/?p=269#comments</comments>
		<pubDate>Mon, 01 Mar 2010 04:25:45 +0000</pubDate>
		<dc:creator>최 태현</dc:creator>
		
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.dinux.kr/?p=269</guid>
		<description><![CDATA[
&#49884;&#54744;&#50868;&#50689;
]]></description>
			<content:encoded><![CDATA[<p><img style="display:block;margin-right:auto;margin-left:auto;" alt="image" src="http://blog.dinux.kr/wp-content/uploads/2010/03/wpid-2010-02-28-18-36-52-205.jpg" /></p>
<p>&#49884;&#54744;&#50868;&#50689;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dinux.kr/?feed=rss2&amp;p=269</wfw:commentRss>
		</item>
		<item>
		<title>WorkBench에서 Encoding 변환해서 보기</title>
		<link>http://blog.dinux.kr/?p=267</link>
		<comments>http://blog.dinux.kr/?p=267#comments</comments>
		<pubDate>Fri, 08 Jan 2010 15:21:35 +0000</pubDate>
		<dc:creator>최 태현</dc:creator>
		
		<category><![CDATA[Database]]></category>

		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://blog.dinux.kr/?p=267</guid>
		<description><![CDATA[SQL Editor에서 한글이 깨질경우 다음과 같이 화면 encoding을 변환해서 실행한다.
SET NAMES &#8216;euckr&#8217;;
]]></description>
			<content:encoded><![CDATA[<p>SQL Editor에서 한글이 깨질경우 다음과 같이 화면 encoding을 변환해서 실행한다.</p>
<p>SET NAMES &#8216;euckr&#8217;;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dinux.kr/?feed=rss2&amp;p=267</wfw:commentRss>
		</item>
		<item>
		<title>신성동 작은도서관 DB 분석</title>
		<link>http://blog.dinux.kr/?p=265</link>
		<comments>http://blog.dinux.kr/?p=265#comments</comments>
		<pubDate>Thu, 07 Jan 2010 15:47:23 +0000</pubDate>
		<dc:creator>최 태현</dc:creator>
		
		<category><![CDATA[Database]]></category>

		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://blog.dinux.kr/?p=265</guid>
		<description><![CDATA[책갈피 프로그램이 MySQL DB를 사용하고 있어서 Dump를 받아왔는데 latin-1으로 charset이 되어 있어서 utf-8로 전환하였다.
다른 방법도 있겠지만 Dump를 받아온것이라 vim 을 통해 간단히 전환했다.
일단 vim으로 euc-kr로 인코딩되어 있는 dump 파일을 Loading 하면  문자가 깨져 보일것이다. 이때 다음과 같이 인코딩을 바꾸면 제대로 보인다.
:e ++enc=euc-kr
이 상태에서 인코딩을 바꿔서 저장하려면
:set fileencoding=utf-8
이렇게 하면 간단히 문자 인코딩을 변경할 수 있다.
이상태에서 다음과 [...]]]></description>
			<content:encoded><![CDATA[<p>책갈피 프로그램이 MySQL DB를 사용하고 있어서 Dump를 받아왔는데 latin-1으로 charset이 되어 있어서 utf-8로 전환하였다.</p>
<p>다른 방법도 있겠지만 Dump를 받아온것이라 vim 을 통해 간단히 전환했다.</p>
<p>일단 vim으로 euc-kr로 인코딩되어 있는 dump 파일을 Loading 하면  문자가 깨져 보일것이다. 이때 다음과 같이 인코딩을 바꾸면 제대로 보인다.</p>
<p><span style="font-weight: bold;">:e ++enc=euc-kr</span></p>
<p>이 상태에서 인코딩을 바꿔서 저장하려면</p>
<p><span style="font-weight: bold;">:set fileencoding=utf-8</span></p>
<p>이렇게 하면 간단히 문자 인코딩을 변경할 수 있다.</p>
<p>이상태에서 다음과 같이 Dump File을 DB로 올려봤지만 &#8230;..</p>
<p>mysql -u root -p slibrary &lt; sinsung.sql</p>
<p>ERROR 1071 (42000): Specified key was too long; max key length is 1000 bytes.</p>
<p>위와 같은 메시지가 나오면서 설치가 중단되는데,  그 이유는 mysql 이 key 의 길이를 1000바이트로 제한하기 때문이다.</p>
<p>mysql 측에서는 이걸 버그라 보지 않고 &#8220;제한&#8221;이라고 봐서 당분간은 처리할 용의가 없답니다.</p>
<p>latin-1 에서는 1글자가 1바이트이지만 utf-8 에서는 한글자가 3바이트이기 때문에 크기 계산에 주의해야 한다.</p>
<p>latin1 = 1 byte  = 1 chararcter<br />
uft8     = 3 byte = 1 chararcter</p>
<p>즉, varchar(255)에서 255는 255 &#8220;바이트&#8221;가 아니라 &#8220;글자&#8221;이기 때문이다. utf-8일 경우 한글은 한 글자당 3바이트이므로 255 * 3 * 2 &gt; 1000 이다.</p>
<p>해결방법은</p>
<p>CREATE TABLE bookadd_tbl (<br />
S_ID varchar(20) NOT NULL default &#8221;,<br />
ADD_SEQ varchar(14) NOT NULL default &#8221;,<br />
ADD_NM1 varchar(200) default NULL,<br />
ADD_AUTH varchar(128) default NULL,<br />
ADD_CHUL varchar(128) default NULL,<br />
ADD_YEAR varchar(60) default NULL,<br />
ADD_TYPE varchar(100) default NULL,<br />
ADD_LENGTH varchar(100) default NULL,<br />
ADD_PAGE varchar(100) default NULL,<br />
ADD_ETC varchar(255) default NULL,<br />
ADD_DATE varchar(24) default NULL,<br />
ADD_MARC longtext,<br />
PRIMARY KEY  (S_ID,ADD_SEQ),<br />
KEY ADD_TYPE (ADD_TYPE),<br />
KEY ADD_NM1 (ADD_NM1,ADD_AUTH,ADD_CHUL)<br />
) TYPE=MyISAM;</p>
<p>에서 TYPE&#8230; 부분을 ENGINE=InnoDB DEFAULT CHARSET=utf8 로 하면 된다.</p>
<p>왜 되는지는 정확히 모르겠다.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dinux.kr/?feed=rss2&amp;p=265</wfw:commentRss>
		</item>
		<item>
		<title>MySQL Dump뜨는 방법 및 복구 방법</title>
		<link>http://blog.dinux.kr/?p=263</link>
		<comments>http://blog.dinux.kr/?p=263#comments</comments>
		<pubDate>Wed, 06 Jan 2010 16:00:14 +0000</pubDate>
		<dc:creator>최 태현</dc:creator>
		
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://blog.dinux.kr/?p=263</guid>
		<description><![CDATA[1. 덤프뜨기 

$&#62; mysqldump -u[사용자아이디] -p 데이터베이스명 [테이블명] &#62; 저장될 파일명
예) mysqldump -ukamkami -p mydatabase &#62; kamkami.pe.kr.sql
이렇게 하면 디비(mydatabase)를 몽땅 덤프를 뜨게된다.
테이블만 덤프를 뜨고 싶다면
예) mysqldump -ukamkami -p mydatabase member_table &#62; kamkami.pe.kr.member_table.sql
이렇게 하면 테이블만 덤프를 뜰 수 있다. 
2. 복구하기 

덤프 파일을 가지고 복구를 하는 방법도 간단하다.
$&#62; mysql -u[사용자아이디] -p [디비명] &#60; 덤프파일명
예) mysql -ukamkami [...]]]></description>
			<content:encoded><![CDATA[<h1><span id="writeContents" style="font-size: 12px;">1. 덤프뜨기 </span></h1>
<h2></h2>
<p style="padding-left: 30px;"><span id="writeContents" style="font-size: 12px;">$&gt; mysqldump -u[사용자아이디] -p 데이터베이스명 [테이블명] &gt; 저장될 파일명</span><span id="writeContents" style="font-size: 12px;"><br />
예) mysqldump -ukamkami -p mydatabase &gt; kamkami.pe.kr.sql</p>
<p>이렇게 하면 디비(mydatabase)를 몽땅 덤프를 뜨게된다.</p>
<p>테이블만 덤프를 뜨고 싶다면</p>
<p>예) mysqldump -ukamkami -p mydatabase member_table &gt; kamkami.pe.kr.member_table.sql</p>
<p>이렇게 하면 테이블만 덤프를 뜰 수 있다. </span></p>
<h1><span id="writeContents" style="font-size: 12px;">2. 복구하기 </span></h1>
<h1></h1>
<p><span id="writeContents" style="font-size: 12px;">덤프 파일을 가지고 복구를 하는 방법도 간단하다.<br />
$&gt; mysql -u[사용자아이디] -p [디비명] &lt; 덤프파일명</p>
<p>예) mysql -ukamkami -p &lt; kamkami.pe.kr.sql<br />
예) mysql -ukamkami -p mydatabase &lt; kamkami.pe.kr.member_table.sql</p>
<p>1.특정 db의 특정 table에서 원하는 값만 덤프받기</p>
<p>&gt;&gt; edu라는 디비에 a,b,c라는 테이블이 있다. 여기서 a라는 테이블에서 no가 7번이상이고 10번<br />
이하인 값만 덤프를 받고자 한다. 어떻게 하겠는가?<br />
여기서 사용되는 옵션은 -w 이다.그럼 위 질문의 sql문은 아래와 같다</p>
<p>mysqldump -u mysql_admin -p edu a -w&#8217;no=&gt;7 and no=&lt;10&#8242; &gt; edu_a_cond.sql</p>
<p>위와같이 하면 no가 7~10번까지가 덤프될것이다.<br />
위에서 조건문은 -w 다음에 싱글쿼테이션으로 묶어준다. sql에서 사용하는 조건문이 다 될듯싶</p>
<p>다. 모두 테스트를 해보진 않았다.</p>
<p>2.디비 스키마(Schema)만 백업받기</p>
<p>&gt;&gt;초기에 작성해 놓은 테이블 스키마가 없을때 어떻게 하겠는가?<br />
만약 하나의 테이블이라면 desc 해서 일일이 다 삽질을 하면 되것지만 만약 테이블이 100개라</p>
<p>면 ..크억&#8230;이럴때 사용하는 mysqldump옵션이 있습니다.<br />
-d 입니다.</p>
<p>!.edu라는 디비의 모든 테이블 스키마를 백업받으려면</p>
<p>mysqldump -u mysql_admin -p -d edu &gt; edu_db.sql</p>
<p>!.edu라는 디비의 a라는 테이블 스키마를 백업받으려면</p>
<p>mysqldump -u mysql_admin -p -d edu a&gt; edu_a_table.sql</span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dinux.kr/?feed=rss2&amp;p=263</wfw:commentRss>
		</item>
	</channel>
</rss>
