<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    狼愛上貍

    我胡漢三又回來了

    #

    Installing Oracle 11g on Ubuntu Linux 7.04

    I come from a MySQL background, and I have been given the challenge of learning Oracle. I can’t just play around with our customers’ databases, but I remembered that Paul Vallée said that there is nothing wrong with learning on company time. So I decided to install my own Oracle database, which I’ll be free to destroy in every way I can think of… and of course, free to bring it back to life. Recovering from crashes will probably be the most difficult part of my adventures in the Oracle world, but let’s take one step at a time, shall we?

    Now, onto Oracle 11g (beta 5) on Ubuntu 7.04 (Feisty Fawn). One little issue is that Ubuntu is unsupported by Oracle. So, through this text, we will trick the Oracle installer into thinking it’s actually running on a Red Hat box.

    Step Zero

    This tutorial was based on a document which can be found here. I have adapted it for Oracle 11g.

    Get a copy of Ubuntu 7.04 and install on a machine. I’m using the 32-bit version here (as well as for Oracle). Next, make sure your system is up-to-date. A simple apt-get update followed by a apt-get upgrade will do the trick, although you may prefer using the GUI Synaptic Package Manager — it’s entirely up to you what method you choose. However, I much prefer to use the command line.

    As you go through updates, sometimes a reboot will be needed (usually to boot from a newer, recently-updated kernel). Sometimes it’ll just ask you to restart your web browser or some other program as a new version is installed.

    It’s important to have a few gigabytes of free disk space and a total of 1 GB of memory before starting this. This 1 GB of memory can be RAM alone or the combination of RAM and swap space. Of course, since everything runs faster when in RAM, the more of it, the better.

    Very important: get Java running before trying to move on. My guess is that almost any JRE (java runtime) or JDK (java development kit) will work. I’m not sure which is the minimum version required: I used Sun JDK 1.5.

    Step One

    Install some system requirements. There are a few packages that I had to install on this box (it was a recently installed system which didn’t have all these packages). After several attempts of installing Oracle, the equivalent command-line for installing all the necessary packages at once was something like this:

    # apt-get install gcc make binutils lesstif2 libc6 libc6-dev rpm libmotif3 libaio libstdc++5 gawk alien libg++2.8.1.3-glibc2.2 ksh gcc-3.3 g++-3.3 libstdc++5

    It’s possible that when installing the packages mentioned above, the installer will install some other prerequisites as well, as these packages themselves may have prerequisites.

    Step Two

    Choose where you are going to install your Oracle 11g server and create the ORACLE_BASE directory. This is the place where Oracle will be installed. Make sure there is at least 3 GB on the partition/mount point before moving to the next step. After installed, my basic installation took about 3.4 GB on disk (without the starter database!). As your database grows, it will need more space. Reserve a total of at least 6 GB for the unpacked installer and the basic installation. You can get rid of the installer files afterwards.

    # mkdir -p /u01/app/oracle

    Step Three

    Add a few users and change groups to make the installer more comfortable. Remember, we are tricking the installer to think it’s installing on a Red Hat box.

    # addgroup oinstall
    # addgroup dba
    # addgroup nobody
    # useradd -g oinstall -G dba -p password -d /home/oracle -s /bin/bash oracle
    # usermod -g nobody nobody

    The usermod command is needed since because when running, the installer looks for a user called nobody which is part of a group named nobody (in Ubuntu, the user nobody it’s assigned to nogroup by default).

    Step Four

    Make some symlinks. Apparently, the installer uses absolute paths, so it must find the binaries in the right places.

    # ln -s /usr/bin/awk /bin/awk
    # ln -s /usr/bin/rpm /bin/rpm
    # ln -s /usr/bin/basename /bin/basename

    Step Five

    We need to mimic the /etc/rc.d directory structure of a Red Hat box. We do this with more symlinks:

    # mkdir /etc/rc.d
    # ln -s /etc/rc0.d /etc/rc.d/rc0.d
    # ln -s /etc/rc2.d /etc/rc.d/rc2.d
    # ln -s /etc/rc3.d /etc/rc.d/rc3.d
    # ln -s /etc/rc4.d /etc/rc.d/rc4.d
    # ln -s /etc/rc5.d /etc/rc.d/rc5.d
    # ln -s /etc/rc6.d /etc/rc.d/rc6.d
    # ln -s /etc/init.d /etc/rc.d/init.d

    Step Six

    I’ve created a file called /etc/redhat-release and put only one line on it. The same can be achieved by issuing the following as root:

    echo "Red Hat Linux release 4" > /etc/redhat-release

    Step Seven

    We tweak the system default limits on a few items. The shared-memory are specially important, since Oracle relies on shared memory for process communications. There is a file called /etc/sysctl.conf and it should have these lines on it:

    fs.file-max = 65535
    kernel.shmall = 2097152
    kernel.shmmax = 2147483648
    kernel.shmmni = 4096
    kernel.sem = 250 32000 100 128
    net.ipv4.ip_local_port_range = 1024 65000
    net.core.rmem_default = 1048576
    net.core.rmem_max = 1048576
    net.core.wmem_default = 262144
    net.core.wmem_max = 262144

    Now that they are in a config file, these limits will be issued automatically at the next boot sequence. For now, we need to make the system re-read the config file:

    # sysctl -p

    Now, what do those parameters and values actually mean?

    • fs.file-max sets the maximum number of open files that can be handled by the Linux kernel.
    • kernel.shmall determines the total amount of shared memory to be allocated in pages. In this example, I’ve set it to 8GB, which is way above the amount of memory I can handle in my box, even with swap.
    • kernel.shmmax controls the maximum amount of memory to be allocated for shared memory which in this example is 2GB.
    • kernel.shmmni defines the maximum number of segments system-wide.
    • net.core.rmem_default and net.core.rmem_max define the default and maximum read buffer queue for network operations (1 MB in this example)
    • net.core.wmem_default and net.core.wmem_max define the default and maximum write buffer queue for network operations (256 KB in this example)
    • net.ipv4.ip_local_port_range tells the kernel the port ranges that will be used for outbound connections.
    • kernel.sem has four parameters:
      1. SEMMSL - semaphores per array
      2. SEMMNS - max semaphores system-wide (SEMMNI*SEMMSL)
      3. SEMOPM - max operations per semop call
      4. SEMMNI - max number of semaphore arrays

    To check your current semaphores configuration, you can run cat /proc/sys/kernel/sem or ipcs -ls. On my machine, after the modifications on sysctl.conf, these commands output:

    # cat /proc/sys/kernel/sem
    250 32000 100 128

    # ipcs -ls

    ------ Semaphore Limits --------
    max number of arrays = 128
    max semaphores per array = 250
    max semaphores system wide = 32000
    max ops per semop call = 100
    semaphore max value = 32767

    (I really don’t know if these are enough or too much, but I’ll keep you posted.)

    For a better understanding of these kernel-tweaking settings, I’d recommend these resources:

    Step Eight

    Add these lines to /etc/security/limits.conf, letting the oracle user use more resources than the defaults allowed. You may notice that all these values are a power of 2 minus one. When soft limits are exceeded, you’ll get a warning; the hard limits can’t be exceeded in any situation: you’ll get an error. I’m not completely sure, but I think these limits apply to each session/login (and since Oracle doesn’t exactly log in to the machine, my best guess is these limits apply per instance running).

    oracle soft nproc 2047
    oracle hard nproc 16383
    oracle soft nofile 1023
    oracle hard nofile 65535

    Step Nine

    Make sure the limits.conf is being interpreted as the oracle user logs in by adding these lines to /etc/pam.d/login. You will want to make sure that is actually happening, since the defaults are way lower and you may get all sorts of problems.

    session required /lib/security/pam_limits.so
    session required pam_limits.so

    Step Ten

    Unpack and prepare the installation.

    # cd /path/to/zipfile
    # unzip linux_11gR1b5_database.zip

    (And wait… wait a bit more… go get a cup of coffee…)

    After your second cup of coffee, you should have a multi-gigabyte set of files; this is our installer.

    # chown -R oracle:oinstall database
    # chown -R oracle:oinstall /u01/app/oracle

    Step Eleven

    Fire up the installer as the oracle user itself. This is what you will probably see on the output window:

    # su - oracle
    $ cd /path/to/extracted/zip/file
    $ ./runInstaller
    Starting Oracle Universal Installer...

    Checking Temp space: must be greater than 80 MB. Actual 58633 MB Passed
    Checking swap space: must be greater than 150 MB. Actual 2900 MB Passed
    Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed
    Preparing to launch Oracle Universal Installer from /tmp/OraInstall2007-07-11_04-38-56PM. Please wait ...
    Oracle Universal Installer, Version 11.1.0.2.0 Production
    Copyright (C) 1999, 2007, Oracle. All rights reserved.

    ulimit: 1: Illegal option -u
    ulimit: 1: Illegal option -u
    rpm: To install rpm packages on Debian systems, use alien. See README.Debian.
    error: cannot open Packages index using db3 - No such file or directory (2)
    error: cannot open Packages database in /var/lib/rpm
    rpm: To install rpm packages on Debian systems, use alien. See README.Debian.
    error: cannot open Packages index using db3 - No such file or directory (2)
    error: cannot open Packages database in /var/lib/rpm

    There are a few errors that can be safely ignored: the ulimit and the RPM-related errors, since the limits don’t restrict the installer and since we actually don’t have a RPM database on the machine — we are running on Ubuntu, remember?

    After a few moments, you will be prompted to choose where to install the Oracle server. You’ll notice that I asked the installer to not create a starter database — I did that later. Choose the Oracle Base and correct the group if needed. I personally recommend sticking with the defaults if you are a newbie like me.

    sm_o11g_011.png

    As you press the Next button, you will be prompted where to install the Inventory — leave it that way unless you know what you are doing (if this were the case, you wouldn’t be reading this text anyways). Also correct the OS group name if needed and hit Next.

    sm_o11g_021.png

    Since I’ve chosen to install the server in the same directory as the oracle user’s HOME directory, the installer will issue a warning. I simply ignored it and continued with the installation.

    sm_o11g_03.png

    After that warning, I tried to perform some prerequisite tests, and yes — some will fail. Just mark the failed boxes and hit Next (after trying a few times to fix those issues, I’ve decided to call the installer’s bluff and… it worked!)

    sm_o11g_04.png

    After all this warning stuff, it’ll ask you to check the list of products to be installed. I was amazed when I read that 122 different products would be installed on my box. Hit Next.

    Go get some coffee.

    sm_o11g_06.png

    And some more coffee.

    sm_o11g_07.png

    And even more coffee.

    sm_o11g_08.png

    You may like to go to the washroom after so much time drinking coffee. Remember: I was installing on a 3 GHz machine with 1 GiB of RAM with SATA2 disks — this box is supposed be blazing fast.

    sm_o11g_09.png

    At some point, it will ask you to run some commands as root. Do that when it asks, since the install depends on a few modifications on the base system (like creating the /etc/oratab file).

    $ sudo -s
    Password:

    # /u01/app/oracle/oraInventory/orainstRoot.sh
    Changing permissions of /u01/app/oracle/oraInventory to 770.
    Changing groupname of /u01/app/oracle/oraInventory to oinstall.
    The execution of the script is complete

    # /u01/app/oracle/product/11.1.0/db_1/root.sh
    Running Oracle 11g root.sh script...

    The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME= /u01/app/oracle/product/11.1.0/db_1
    [: 185: ==: unexpected operator
    [: 189: ==: unexpected operator
    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.sh script.
    Now product-specific root actions will be performed.
    Finished product-specific root actions.

    After these scripts finish their execution (the errors seem to be ignorable), hit the OK button and you’ll have a window that (probably) will look like this one:

    sm_o11g_10.png

    Just hit OK to get out the installer. The basic installation is… not over yet.

    sm_o11g_11.png

    To allow Oracle start on boot-up, create a file called oracledb (or whatever name you want to call it) and put it in /etc/init.d with the contents below. This script was copied and pasted from a tutorial by Graham Williams. It will read the /etc/oratab and fire up any instances it finds.

    #!/bin/bash
    #
    # /etc/init.d/oracledb
    #
    # Run-level Startup script for the Oracle Instance, Listener, and Web Interface

    export ORACLE_HOME=/u01/app/oracle
    export PATH=$PATH:$ORACLE_HOME/bin

    ORA_OWNR="oracle"

    # if the executables do not exist -- display error

    if [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]
    then
    echo "Oracle startup: cannot start"
    exit 1
    fi

    # depending on parameter -- startup, shutdown, restart
    # of the instance and listener or usage display

    case "$1" in
    start)
    # Oracle listener and instance startup
    echo -n "Starting Oracle: "
    su $ORA_OWNR -c "$ORACLE_HOME/bin/lsnrctl start"
    su $ORA_OWNR -c $ORACLE_HOME/bin/dbstart
    touch /var/lock/oracle

    su $ORA_OWNR -c "$ORACLE_HOME/bin/emctl start dbconsole"
    echo "OK"
    ;;
    stop)
    # Oracle listener and instance shutdown
    echo -n "Shutdown Oracle: "
    su $ORA_OWNR -c "$ORACLE_HOME/bin/lsnrctl stop"
    su $ORA_OWNR -c $ORACLE_HOME/bin/dbshut
    rm -f /var/lock/oracle

    su $ORA_OWNR -c "$ORACLE_HOME/bin/emctl stop dbconsole"
    echo "OK"
    ;;
    reload|restart)
    $0 stop
    $0 start
    ;;
    *)
    echo "Usage: `basename $0` start|stop|restart|reload"
    exit 1
    esac

    exit 0

    After saving the file, make it executable

    # chmod a+x /etc/init.d/oracledb

    and if you want, make it run at every boot:

    # update-rc.d oracledb defaults 99
    Adding system startup for /etc/init.d/oracledb ...
    /etc/rc0.d/K99oracledb -> ../init.d/oracledb
    /etc/rc1.d/K99oracledb -> ../init.d/oracledb
    /etc/rc6.d/K99oracledb -> ../init.d/oracledb
    /etc/rc2.d/S99oracledb -> ../init.d/oracledb
    /etc/rc3.d/S99oracledb -> ../init.d/oracledb
    /etc/rc4.d/S99oracledb -> ../init.d/oracledb
    /etc/rc5.d/S99oracledb -> ../init.d/oracledb

    Before finishing, add the following lines to your /etc/profile . Be careful, since these values are valid system-wide. So make sure the paths are set according to your particular setup (if you have been doing everything according to this text, you should be fine).

    export ORACLE_BASE=/u01/app/oracle
    export ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_1
    export ORACLE_SID=ORCL
    export PATH=$PATH:/u01/app/oracle/product/11.1.0/db_1/bin

    Last operation: add yourself to the dba group. You can use usermod or just edit the /etc/groups file and add your username at the end of the line that starts with dba (my username is ‘bott’):

    dba:x:1002:oracle,bott

    If you chose to not create a starter database during your install, you’ll have to do two extra steps. You should create a listener (with netca) and after that, create the starter database (also with netca). If you chose to have the installer create a database for you, then you should be fine, since when doing that, it asks for a password for the default accounts (SYS, SYSTEM, and DBSNMP, SYSMAN if you choose to install it with the enterprise manager option selected).

    If everything has gone well, open a terminal window and, as the oracle user, type:

    $ sqlplus 

    SQL*Plus: Release 11.1.0.5.0 - Beta on Wed Jul 11 17:11:53 2007

    Copyright (c) 1982, 2007, Oracle. All rights reserved.

    Enter user-name:

    If you see these messages (and I sincerely hope you do) you’re all set! That means that you have finished a quite long install of Oracle 11g and you are ready to begin destroying it, just as I plan to as I take my first steps with Oracle. Some might say that going from Oracle to MySQL would make for an easier transition — I really don’t know, but I will post further entries on my experiences as I go.

    Anyway, I would greatly appreciate your feedback, especially if we can improve this tutorial so that more people can benefit from it.

    Augusto Bott.


    comefrom:http://www.phpchina.com/batch.viewlink.php?itemid=14789

    posted @ 2008-04-27 20:55 狼愛上貍 閱讀(1754) | 評論 (0)編輯 收藏

    Ubuntu使用ROOT登陸后,系統是英文的,而且無法使用中文輸入法

    1.apt-get install scim scim-modules-socket scim-modules-table scim-pinyin scim-tables-zh scim-gtk2-immodule scim-qtimm

    2 im-switch -s scim

    3.修改/etc/environment配置文件了.使用vi編輯器打開environment文件,在里面加入這么一行LC_CTYPE=zh_CN.UTF-8,然后保存退出,重新啟動系統,使用英文登陸,按下Ctrl+Space,看到輸入法圖標了吧?


    4. reboot

    系統就可以使用使用輸入法了。

    comefrom:http://www.linuxdiyf.com/viewarticle.php?id=59990

    posted @ 2008-04-27 13:44 狼愛上貍 閱讀(2505) | 評論 (0)編輯 收藏

    Ubuntu 8.04 Eclipse MyEclipse 出現的問題小記

    NND,郁悶的事情總是一件接著一件, 今天升級到 Hardy RC,結果,eclipse每次啟動的時候,要出錯,說:
    Could not initialize the application's security component.
    The most likely cause is problems with files in your application's profile directory.
    Please check that this directory has no read/write restrictions and your hard disk is not full or close to full.
    It is recommended that you exit the application and fix the problem.
    If you continue to use this session, you might see incorrect application behaviour when accessing security features. 


    把整個eclipse目錄和workspace都給了 777的權限,還是報錯。 

    幾經Google,終于找到一個處理方法: mkdir ~/.mozilla/eclipse


    不知何解~~~




    安 裝MyEclipse插件后,打開JSP文件時,出現:"processing dirty regions" 的錯誤, 解決辦法是:刪除原eclipse目錄下,plugins/org.eclipse.wst.sse.ui_1.××××××.jar  , 或者是禁用掉原eclipse的WST插件。



    同樣,MyEclipse提示說:
    “The Linux WYSIWYG design panel is still under development. To access an experimental version of this design panel restart with the commandline argument -Dlinux.experimental=true”
    這個參數,是要加到eclipse.ini文件里面的,而不是在執行eclipse的添加。~~~

    comefrom:http://m.tkk7.com/xiaosilent/archive/2008/04/21/194559.html

    posted @ 2008-04-27 09:03 狼愛上貍 閱讀(747) | 評論 (0)編輯 收藏

    Ubuntu配置Java+Eclipse+MyEclipse環境

    作者:小兵

        一、給Ubuntu配置JAVA環境

    操作系統版本:Ubuntu 7.10 Gutsy

    JAVA版本:JAVA 6

    在Ubuntu下安裝JAVA虛擬機和SDK(開發包)是非常輕松容易的:

    聯網的情況下在終端下輸入命令

    $sudo apt-get install sun-java6-jre sun-java6-sdk

    這條命令就可以幫助下載并安裝JAVA6了,順便再給瀏覽器安裝JAVA支持:

    $sudo apt-get install sun-java6-plugin

    安裝完這三個之后還需要寫入系統變量:

    $sudo gedit /etc/environment

    在文本編輯器里寫入下面兩行內容:

    CLASSPATH=.:/usr/lib/jvm/java-6-sun/lib

    JAVA_HOME=/usr/lib/jvm/java-6-sun

    還要將系統虛擬機的優先順序也調整一下:

    $sudo gedit /etc/jvm

    在文本編輯器里將下面一句寫在最頂部:

    /usr/lib/jvm/java-6-sun

    接下來在終端中輸入命令:

    $java -version

    終端應該返回如下字樣:

    java version "1.6.0_03"

    Java(TM) SE Runtime Environment (build 1.6.0_03-b05)

    Java HotSpot(TM) Server VM (build 1.6.0_03-b05, mixed mode)

    這就說明JAVA環境已經建立好了,你可以用文本編輯器寫一個JAVA HelloWorld!程序執行一下javac編譯并java來解釋執行看看效果。

    二、安裝配置Eclipse+MyEclipse

    Eclipse是一個開源免費的軟件開發工具(IDE),是一個基于JAVA的可擴 展的開發平臺,準確來說Eclipse提供的是一個框架和一組服務, Eclipse的開放可擴展性使得Eclipse擁有大量的插件可以擴展Eclipse的開發能力和功能,不僅僅局限于JAVA開發。所以雖然 Eclipse是使用JAVA編寫的,但不僅僅可以用來進行JAVA開發,還可以用于C/C++等語言的開發,只要你安裝相應的插件來擴展。 Eclipse最初是由IBM向開源社區捐贈的開發框架,IBM開發技術網站上有Eclipse的大量技術資料:

    http://www.ibm.com/developerworks/cn/eclipse/

    MyEclipse是用來擴展Eclipse的J2EE的開發功能的,所以基本上很多人使用Eclipse都會隨之安裝MyEclipse,MyEclipse也是Eclipse的插件。

    對Eclipse和MyEclipse的介紹就到此了,正文開始:

    首先在你的主文件夾(/home/[your name])下建立一個目錄用于存放Eclipse,在shixinyu我的機子上是建立了一個JAVA目錄在/home/shixinyu下。

    先去Eclipse官方網站上下載Eclipse,目前最新版本是3.3.1.1:

    http://www.eclipse.org/downloads/

    shixinyu我下載的是Eclipse Classic 3.3.1.1這個版本

    下載完后將下載到的壓縮文件可直接解壓縮其文件夾eclipse到/home/[your name]/JAVA下,可直接雙擊執行eclipse

    接下來下載MyEclipse:

    http://www.myeclipseide.com/module-htmlpages-display-pid-4.html

    需 要下載與Eclipse 3.3相匹配的MyEclipse 6.0 GA這個版本,下載前需要注意一點,MyEclipse是一個商業軟件,只能免費試用30天,30天之后必須提交訂閱碼才能繼續使用。授權費用為標準版是 32美元,專業版是53美元。如果你有興趣并且也愿意為此掏錢,那么請購買授權,否則想要繼續使用,請自行處理。

    下載完MyEclipse之后,得到的是一個.bin的文件,打開終端,使用cd命令進入MyEclipse安裝文件所在目錄,如shixinyu的是存放在/home/shixinyu/Downlads下的,那么就是輸入命令:

    $cd /home/shixinyu/Downloads

    然后鍵入命令:

    $sudo sh MyEclipse_6_0_1GA_E3_3_1_Installer.bin

    隨后就會啟動一個GUI的安裝程序。

    單擊“Next“按鈕繼續,選擇“I accept...“:

    在這里選擇Eclipse所在目錄,單擊“Choose“按鈕來選擇,shixinyu的就是選擇“/home/shixinyu/JAVA/eclipse“:

    接下來選擇MyEclipse的安裝位置,我選擇在"/home/shixinyu/JAVA/MyEclipse"這里(事先已經建立了MyEclipse這個目錄):

    接下來選擇Link Folder,可以保持默認選擇繼續:

    接下來就可以安裝了,單擊“Install“按鈕:

    安裝好后進入/home/shixinyu/JAVA/eclipse直接雙擊執行eclipse即可自動識別出MyEclipse,想要在“應用程序“里建立菜單?

    那么在終端下執行命令:

    $sudo gedit /usr/share/applications/Eclipse.desktop

    在文本編輯器里復制粘貼下面內容

    [Desktop Entry]
    Name=Eclipse
    Comment=Eclipse IDE
    Exec=/home/shixinyu/JAVA/eclipse/eclipse
    Icon=/home/shixinyu/JAVA/eclipse/icon.xpm
    Terminal=false
    Type=Application
    Categories=Application;Development;

    保存這個文件后,就會在“應用程序”下的“編程”中出現Eclipse的快捷方式。

    你可以在Eclipse里新建一個Projects后新建一個Class來寫一個HelloWorld!程序測試一下。


    http://tech.sina.com.cn/s/2008-01-18/08171981706.shtml

    posted @ 2008-04-27 08:38 狼愛上貍 閱讀(416) | 評論 (0)編輯 收藏

    Ubuntu安裝eclipse-SDK-3.3小結

    裝eclipse之前,清確定你安裝了jdk。

    1、首先下載eclipse-SDK-3.3,這是目前最新版本的eclipse
    官方下載:http://www.eclipse.org/downloads/

    2、安裝eclipse
    (1)把eclipse-SDK-3.3解壓到某個目錄中,俺解壓到的是/opt下,得到/opt/eclipse目錄
    如果想把eclipse目錄的更改為root擁有,可以執行下面的命令
    sudo chown -R root:root /opt/eclipse
    當然也可以不用。

    (2)在/usr/bin目錄下創建一個啟動腳本eclipse,執行下面的命令來創建:

    sudo vi /usr/bin/eclipse

    如果不熟悉vi命令的可以用Ubuntu自帶的簡單文本編輯器gedit,用下面的命令來創建:

    sudo gedit /usr/bin/eclipse

    然后在該文件中添加以下內容:

    #!/bin/sh
    export MOZILLA_FIVE_HOME=”/usr/lib/mozilla/”
    export ECLIPSE_HOME=”/opt/eclipse”

    $ECLIPSE_HOME/eclipse $*


    (3)讓修改該腳本的權限,讓它變成可執行,執行下面的命令:

    sudo chmod +x /usr/bin/eclipse

    3、在桌面或者gnome菜單中添加eclipse啟動圖標
    (1)在桌面或者啟動面板上添加圖標:
    在桌面(右鍵單擊桌面->創建啟動器)或面板(右鍵單擊面板->添加到面板 ->定制應用程序啟動器)上創建一個新的啟動器,然后添加下列數據:
    名稱:Eclipse Platform
    命令:eclipse
    圖標: /opt/eclipse/icon.xpm

    (2)在Applications(應用程序)菜單上添加一個圖標
    用文本編輯器在/usr/share/applications目錄里新建一個名為eclipse.desktop的啟動器,如下面的命令:

    sudo vi /usr/share/applications/eclipse.desktop
    或者
    sudo gedit /usr/share/applications/eclipse.desktop

    然后在文件中添加下列內容:

    [Desktop Entry]
    Encoding=UTF-8
    Name=Eclipse Platform
    Comment=Eclipse IDE
    Exec=eclipse
    Icon=/opt/eclipse/icon.xpm
    Terminal=false
    StartupNotify=true
    Type=Application
    Categories=Application;Development;

    保存文件。完成整個安裝過程??梢噪p擊桌面eclipse的圖標來運行eclipse

    linkfrom:http://linux.e800.com.cn/articles/2007/827/1188149563706378065_1.html

    posted @ 2008-04-27 08:33 狼愛上貍 閱讀(825) | 評論 (0)編輯 收藏

    ubuntu下更改mysql默認編碼(字符集)

    sudo apt-get install mysql-server #直接自動獲得可用版本
    也可以這樣寫
    sudo apt-get install mysql-server-5.0 #安裝mysql服務器5.0版本

    安裝后

    /etc/init.d/mysql start (stop) 為啟動和停止服務器
    /etc/mysql/ 主要配置文件所在位置 my.cnf
    /var/lib/mysql/ 放置的是數據庫表文件夾,這里的mysql相當于windows下mysql的date文件夾

    啟動mysql后,以root登錄mysql
    isher@isher-ubuntu:~$ mysql -u root
    >show variables like 'character%'; #執行編碼顯示
    +--------------------------+----------------------------+
    | Variable_name | Value |
    +--------------------------+----------------------------+
    | character_set_client | latin1 |
    | character_set_connection | latin1 |
    | character_set_database | latin1 |
    | character_set_filesystem | binary |
    | character_set_results | latin1 |
    | character_set_server | latin1 |
    | character_set_system | utf8 |
    | character_sets_dir | /usr/share/mysql/charsets/ |
    +--------------------------+----------------------------+

    在某些時候,我們續要修改mysql默認數據庫的編碼,以保證某些遷移的程序可以正常顯示,編輯my.cnf文件進行編碼修改,windows可以直接用Mysql Server Instance Config Wizard 進行設置

    在linux下修改3個my.cnf的1個/etc/mysql/my.cnf文件

    找到客戶端配置[client] 在下面添加
    default-character-set=utf8 默認字符集為utf8
    在找到[mysqld] 添加
    default-character-set=utf8 默認字符集為utf8
    init_connect='SET NAMES utf8' (設定連接mysql數據庫時使用utf8編碼,以讓mysql數據庫為utf8運行)

    修改好后,重新啟動mysql 即可,查詢一下show variables like 'character%';
    +--------------------------+----------------------------+
    | Variable_name | Value |
    +--------------------------+----------------------------+
    | character_set_client | utf8 |
    | character_set_connection | utf8 |
    | character_set_database | utf8 |
    | character_set_filesystem | binary |
    | character_set_results | utf8 |
    | character_set_server | utf8 |
    | character_set_system | utf8 |
    | character_sets_dir | /usr/share/mysql/charsets/ |
    +--------------------------+----------------------------+

    此方法用于標準mysql版本同樣有效,對于/etc/my.cnf文件,需要從mysql/support-files的文件夾cp my-large.cnf一份到/etc/my.cnf

    linkfrom:http://hi.baidu.com/alman/blog/item/c572c9019da099d2277fb5fa.html


    posted @ 2008-04-27 08:23 狼愛上貍 閱讀(582) | 評論 (0)編輯 收藏

    ubuntu mysql遠程訪問

    在ubuntu7.10中mysql安裝,默認是只能本機訪問的,需要打開用戶權限和mysql的本機綁定
    1、在命令行底下打開用戶權限:grant all privileges on drupal.* to user@192.168.1.80 identified by 'user-password';
       在管理員界面可以通過用戶管理add host->any host來添加訪問權限(root用戶默認只能訪問本機,新添加的用戶可遠程)
    2、取消mysql本機綁定:
    編輯/etc/mysql/my.cnf
    # Instead of skip-networking the default is now to listen only on
    # localhost which is more compatible and is not less secure.
    bind-address = 127.0.0.1
    將”bind-address = 127.0.0.1“注釋
    sudo /etc/init.d/mysql restart重啟即可遠程訪問

    linkfrom:http://hi.baidu.com/iminger/blog/item/19e0c9139a052bd4f7039e50.html

    posted @ 2008-04-27 08:01 狼愛上貍 閱讀(3326) | 評論 (1)編輯 收藏

    MySQL show的用法

       a. show tables或show tables from database_name; // 顯示當前數據庫中所有表的名稱

       b. show databases; // 顯示mysql中所有數據庫的名稱

       c. show columns from table_name from database_name; 或show columns from database_name.table_name;   // 顯示表中列名稱

       d. show grants for user_name@localhost;   //   顯示一個用戶的權限,顯示結果類似于grant 命令

       e. show index from table_name;   // 顯示表的索引

       f. show status;   // 顯示一些系統特定資源的信息,例如,正在運行的線程數量

       g. show variables; // 顯示系統變量的名稱和值
      
       h. show   processlist; // 顯示系統中正在運行的所有進程,也就是當前正在執行的查詢。大多數用戶可以查看
             他們自己的進程,但是如果他們擁有process權限,就可以查看所有人的進程,包括密碼。

       i. show table status; // 顯示當前使用或者指定的database中的每個表的信息。信息包括表類型和表的最新更新時間

       j. show privileges;   // 顯示服務器所支持的不同權限

       k. show create database database_name; // 顯示create database 語句是否能夠創建指定的數據庫

       l. show create table table_name; // 顯示create database 語句是否能夠創建指定的數據庫

       m. show engies;   // 顯示安裝以后可用的存儲引擎和默認引擎。

       n. show innodb status; // 顯示innoDB存儲引擎的狀態

       o. show logs; // 顯示BDB存儲引擎的日志

       p. show warnings; // 顯示最后一個執行的語句所產生的錯誤、警告和通知

       q. show errors; // 只顯示最后一個執行語句所產生的錯誤


    linkfrom: http://hi.baidu.com/linuxgg/blog/item/95c0e0fe468db0305c6008bb.html

    posted @ 2008-04-26 23:22 狼愛上貍 閱讀(246) | 評論 (0)編輯 收藏

    spring+hibernate+struts中MYSQL亂碼問題

    一般如果把程序、配置文件和數據庫字符格式都設置成utf8字符的話是不會出現亂碼的。

    可以通過命令
    SHOW VARIABLES LIKE '%character_set_%'
    察看Mysql的編碼設置

    character_set_client, utf8
    character_set_connection
    , utf8
    character_set_database
    , utf8
    character_set_filesystem
    , binary
    character_set_results
    , utf8
    character_set_server
    , utf8
    character_set_system
    , utf8
    character_sets_dir
    , E:softProgrammysqlmysql-5.0.22-win32sharecharsets

    posted @ 2008-04-26 08:20 狼愛上貍 閱讀(378) | 評論 (0)編輯 收藏

    Java簡單的術語


    1.什么是DAO?
    DAO是Data Access Object數據訪問接口,數據訪問:故名思義就是與數據庫打交道。夾在業務邏輯與數據庫資源中間。

    在核心J2EE模式中是這樣介紹DAO模式的:為了建立一個健壯的J2EE應用,應該將所有對數據源的訪問操作抽象封裝在一個公共API中。用程序設計的語言來說,就是建立一個接口,接口中定義了此應用程序中將會用到的所有事務方法。在這個應用程序中,當需要和數據源進行交互的時候則使用這個接口,并且編寫一個單獨的類來實現這個接口在邏輯上對應這個特定的數據存儲。

        DAO(數據訪問對象)是一種應用程序編程接口(API),存在于微軟的Visual Basic中,它允許程序員請求對微軟的Access數據庫的訪問。DAO是微軟的第一個面向對象的數據庫接口。DAO對象封閉了Access的Jet函數。通過Jet函數,它還可以訪問其他的結構化查詢語言(SQL)數據庫。

    2.什么是POJO?
    簡單的Java對象(Plain Old Java Objects)實際就是普通JavaBeans,使用POJO名稱是為了避免和EJB混淆起來, 而且簡稱比較直接. 其中有一些屬性及其getter setter方法的類,有時可以作為value object或dto(Data Transform Object)來使用.當然,如果你有一個簡單的運算屬性也是可以的,但不允許有業務方法,也不能攜帶有connection之類的方法。  

    POJO有一些private的參數作為對象的屬性。然后針對每個參數定義了get和set方法作為訪問的接口。例如:
    public class User {
      private long id;
      private String name;
      public void setId(long id) {
    this.id = id;
    }  
    public void setName(String name) {
    this.name=name;
    }
    public long getId() {
    return id;
    }  
    public String getName() {
    return name;
    }
    }
    POJO對象有時也被稱為Data對象,大量應用于表現現實中的對象。

    3.什么是IMPL?

    尚未查到。

    posted @ 2008-04-25 20:17 狼愛上貍 閱讀(290) | 評論 (0)編輯 收藏

    僅列出標題
    共38頁: First 上一頁 20 21 22 23 24 25 26 27 28 下一頁 Last 
    主站蜘蛛池模板: 亚洲国产精品特色大片观看完整版| 亚洲第一永久AV网站久久精品男人的天堂AV| 亚洲日韩aⅴ在线视频| 免费国产va视频永久在线观看| 日本xxwwxxww在线视频免费| 亚洲AV无码一区二区三区牲色| 免费视频中文字幕| 久久亚洲AV成人无码国产最大| 国产午夜影视大全免费观看| 亚洲国产精品网站在线播放| 亚洲av无码成人精品区在线播放| 十八禁的黄污污免费网站| 日韩精品亚洲aⅴ在线影院| 日本免费污片中国特一级| 亚洲黄色片在线观看| 成年免费大片黄在线观看岛国| 在线观看亚洲AV日韩AV| 免费一级国产生活片| 99热在线日韩精品免费| 亚洲毛片在线观看| 国产va精品免费观看| 国产成人亚洲精品无码AV大片| 亚洲最大av无码网址| 91青青国产在线观看免费| 亚洲不卡影院午夜在线观看| 免费一区二区三区四区五区| 中文字幕免费播放| 亚洲最大黄色网站| 亚洲国产精品专区在线观看| 久草福利资源网站免费| 亚洲中文精品久久久久久不卡| 四虎永久免费观看| 国内精品一级毛片免费看| 亚洲综合在线一区二区三区| 久久久久亚洲av成人无码电影| 免费视频爱爱太爽了| 国产无遮挡色视频免费观看性色| 亚洲理论片在线观看| 亚洲美女在线国产| 青娱乐免费在线视频| 成人av片无码免费天天看|