oracel11gr2安装,起图形界面时中文乱码
http://bbs.chinaunix.net/thread-3569238-1-1.html
字体原因,去下载一个中易字体,
把中文字体增加到oracle安装文件,解决安装时中文是"囗囗囗囗囗囗囗囗"
进入刚解压的database/stage/Components/oracle.jdk/1.5.0.17.0/1/DataFiles/all.jar就是JDK喽.在桌面新建一个文件夹命名为fallback/找一个zysong.ttf中文字体放入里面去。再用归档管理器打开它进入/jdk/jre/lib/fonts/(all.jar包的目录)把在桌面建好的fallback文件夹拖放进来,完成后的目录结构应该是/jdk/jre/lib/fonts/fallback/zysong.ttf。
---------------
LANG=en_US ./runInstaller
|
export LC_ALL=en_US.UTF-8
====================
Java
Java 有 2 个,一个是openjava,一个是oracle的java,默认系统安装的是openjava,如果你只是普通用户,运行java程序而已,openjava足矣,如果你是搞java开发的,老老实实用sun-java,别跟自己的工作过不去。
目录[隐藏] |
[编辑]Open-Java
sudo apt-get install openjdk-6-jdk
[编辑]Sun-java6
参考 Sun-java6
[编辑]Tomcat
JSP 开发,参照Tomcat。
[编辑]JBoss
[编辑]中文
[编辑]安装中文字体
在本文中假设你已经安装了ttf-wqy-zenhei字体包,如果你还没有安装的话,请下载 ttf-wqy-zenhei 字体包,使用下面的命令安装:
sudo apt-get install ttf-wqy-zenhei
其实只要是有中文字体就可以,只需要把后面相应的字体(具体有说明)在改成你所要的字体即可,这里为了方便还是用 ttf-wqy-zenhei 字体。
[编辑]设置中文字体 (有两种方案)
方案一
- 进入J2SDK的库目录中的字体目录,位于/usr/lib/jvm 中的某个目录 可能为 java-6-sun 可能为 java-6-openjdk,进入其子目录 jre/lib/
- 建立fonts文件夹,然后新建fallback目录,并创建一个ttf-中文的 TTF 字体的软链接
sudo mkdir fonts/fallback sudo ln -s /usr/share/fonts/truetype/wqy/wqy-zenhei.ttc fallback/wqy-zenhei.ttf
方案二
- 用你使用的编辑器打开/usr/lib/jvm/java-6-sun/jre/lib/fontconfig.properties或者/usr/lib/jvm/java-6-openjdk/jre/lib/fontconfig.properties
进行改动找到
filename.-arphic-ar_pl_shanheisun_uni-medium-r-normal--*-*-*-*-p-*-iso10646-1=/usr/share/fonts/truetype/arphic/uming.ttf filename.-arphic-ar_pl_uming_uni-medium-r-normal--*-*-*-*-p-*-iso10646-1=/usr/share/fonts/truetype/arphic/uming.ttf
- 把这两句后的uming.ttf改为uming.ttc即可
[编辑]测试改动
/usr/lib/jvm/java-6-sun/bin/java -jar /usr/lib/jvm/java-6-sun/demo/jfc/FileChooserDemo/FileChooserDemo.jar
如果点击浏览可以看到中文而不是方框的话,那么恭喜你,你成功了!
[编辑]中文字体模糊
echo "export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on' ">> ~/.bashrc
[编辑]参考
++++++++++++++++++++++++++++++++++++++++++++++
http://wiki.ubuntu.org.cn/index.php?title=Oracle_11g_for_Ubuntu_8.04
Oracle 11g for Ubuntu 8.04
本文大部分内容来自wiki.ubuntu.org.cn上的孙高勇先生所著的Oracle 10g for ubuntu安装指南, 只是根据ubuntu8.04上安装oracle 11g的实际情况作了修改.
首先安装必须的包:
apt-get install build-essential libaio1 gawk ksh libmotif3 alien libtool lsb-rpm
而JAVA环境可以直接通过 apt-get install java 来得到, 这儿得到的是java6的运行环境.
现在开始创建用户和组, oracle 安装需要两个 unix 用户组和一个运行时的 oracle 用户。
- addgroup oinstall
#addgroup dba
#addgroup nobody
#useradd -g oinstall -G dba -p passwd -d /home/oracle -s /bin/bash oracle
#usermod -g nobody nobody
#mkdir /home/oracle
#chown -R oracle:oinstall /home/oracle
#chmod 775 /home/oracle
创建oracle安装目录, 有很多文档,建议您将 oracle 安装到一个独立的分区上面。比如:/opt。请您根据您的需要
选择合适自己的安装目录。在本文档中,我们假设 Oracle 的安装目录为/opt/ora10。确保有至少 3.0G 的可用空间。
- mkdir -p /opt/oraInventory
#mkdir -p /opt/ora
#chown -R oracle:oinstall /opt/ora*
#chmod -R 775 /opt/ora*
设置内核参数, 在ubuntu7.10上,我的内核参数都是够的,但在ubuntu8.04上,内核参数是不够了, 所以这步,希望大家还
是要作一下为好.
添加如下的行到/etc/sysctl.conf中,如果有些行存在的话,请把原来的行去除.
fs.file-max = 6553600
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 1024 65535
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 262144
修改limits.conf, 添加下面的行到/etc/security/limits.conf 以修改你的资源限制:
oracle soft nofile 65536
oracle hard nofile 65536
oracle soft nproc 16384
oracle hard nproc 16384
让修改生效:
- sysctl -p
创建程序链接
- ln -s /usr/bin/awk /bin/awk
#ln -s /usr/bin/rpm /bin/rpm
#ln -s /usr/bin/basename /bin/basename
设置 Oracle 用户环境:
以 oracle 用户登录:
~$su oracle
修改~/.bash_profile 文件,去掉下列三行的注释符,使.bashrc 文件生效:
- if [ -f ~/.bashrc ]; then
# . ~/.bashrc
#fi
ununtu 默认是没有注释的,debian 用户需要取消掉这个。
添加下列行到~/.bashrc:
export GST_ID3_TAG_ENCODING=[GBK,GB13000,UTF-8]
export JAVA_HOME=/usr/lib/jvm/java-6-sun
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export ORACLE_BASE=/opt/ora
export ORACLE_HOME=/opt/ora/11g
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/Apache/bin:$PATH
export ORACEL_OWNER=oracle
export ORACLE_SID=orcl
export ORACLE_TERM=gnome-terminal
export LC_ALL=zh_CN.UTF-8
export LANG=zh_CN.UTF-8
export LANGUAGE=zh_CN:zh:en_CN:en
export NLS_LANG="SIMPLIFIED CHINESE"_CHINA.UTF8
执行安装, 在root权限下运行 xhost + ,这样就可以不用用oracle用户登录x也可以直接以 su oracle的方法来运行图形界面了.
在很多的安装文档中都说要建立一个/etc/redhat-release文件,但在8.04下,如果你这样子作了,会发现安装时的系统配置检查
过不去, 所以这步不要作. 如果你直接以./runInstall的话, 会发现界面上都是框框框, 这是因为没有配置redhat-release, 所以
oracle自带的jre找不到字体. 所以要以 ./runInstall -jreLoc $JRE_HOME 的形式来运行, 就会发现框框变成了实际的中文.
在安装时,请注意一下, 只安装oracle软件就好了, 不要安装数据库, 我们在安装软件完后, 再来安装数据库,要不然,你会发
现, 在安装软件时一切OK, 而到了数据库阶段, 又会变成框框框了, 这是因为在配置数据库时,所用的JRE还是oracle自带的,,
字体问题还没解决.
在安装完软件后. 我们来安装数据库. 首先,
#mkdir /usr/share/fonts/zh_CN
#mkdir /usr/share/fonts/zh_CN/TrueType
#ln -s /usr/share/fonts/truetype/wqy/wqy-zenhei.ttf /usr/share/fonts/zh_CN/TrueType/zysong.ttf
来建立所需的字体. 然后以oracle的身份
$mv /opt/ora/11g/jdk/jre/lib/fontconfig.RedHat.properties.src /opt/ora/11g/jdk/jre/lib/fontconfig.properties.src
$mv /opt/ora/11g/jdk/jre/lib/fontconfig.RedHat.bfc /opt/ora/11g/jdk/jre/lib/fontconfig.bfc
这样, 字体问题就解决了.
现在来运行 netca 来建立 listener. 然后用 dbca 来建立数据库, 在建立数据库时, 要注意选择字符集时, 用
AL16UTF8, 而本地字符集用AL32UTF16好像是这两个, 大家自己看一下, 就可以正确的显示与保存中文了.
下面就与10g上的一样了.大家自己看吧.
- 启动数据库
o 启动
$ sqlplus " scott/tiger as sysdba"
将出现如下连接数据库信息:
SQL*Plus: Release 10.1.0.2.0 - Production on 星期三 3 月 24 16:23:27 2004
Copyright (c) 1982, 2004, Oracle. All rights reserved.
连接到:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL>
表明登录数据库系统成功,运行 startup 命令启动数据库。
SQL> startup
ORACLE instance started.
Total System Global Area 336356520 bytes
Fixed Size 279720 bytes
Variable Size 268435456 bytes
Database Buffers 67108864 bytes
Redo Buffers 532480 bytes
Database mounted.
Database opened.
SQL>
表示数据库正常启动。
o 关闭 Oracle10g 数据库
$ sqlplus "scott/tiger as sysdba" //以 sysdba 用户登录数据库
成功登录数据库系统后,运行 shudown 命令关闭数据库。
SQL> shutdown
o 启动 Oracle10g 监听程序
Oracle 的监听程序主要是为客户端的连接提供接口,在控制台窗口键入如下命令:
$ lsnrctl
将出现如下监听程序信息:
LSNRCTL for 32-bit Windows: Version 10.1.0.2.0 - Production on 24-3 月 -2004 16:59:51
Copyright (c) 1991, 2004, Oracle. All rights reserved.
欢迎来到 LSNRCTL, 请键入"help"以获得信息。
LSNRCTL>
表明登录监听程序控制台成功,运行 start 命令启动监听程序。
LSNRCTL> start
将出现监听程序的一系列启动和配置情况信息列表。信息行的最后一行是“The command completed successfully”字样时,监听程序启动成功。
o 关闭 Oracle10g 监听程序
运行 stop 命令关闭监听程序。
LSNRCTL> stop
- 创建自启动脚本
创建 oracledb 脚本到/etc/init.d/oracledb,内容如下
- !/bin/bash
#
# /etc/init.d/oracledb
#
# Run-level Startup script for the Oracle Instance, Listener, and
# Web Interface
export ORACLE_HOME=/opt/ora/11g
export ORACLE_SID=orcl
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
设置权限,放到启动脚本中去
- chmod 755 /etc/init.d/oracledb
#update-rc.d oracledb defaults 99
- 使用企业管理器
启动控制台
- emctl start dbconsole
访问数据库控制器http://localhost.localdomain:1158/em/ 要提供 sys/passwd as sysdba; 你要从一个客户端浏览器访问 em 数据库控制器,必须要运行 dbconsole 进程.安装之后,dbconsole 进程是自动会启动的.然后,如果这个集成没有启动,你可以向下面的命令行手工的启动它:
- cd $ORACLE_HOME/bin
#emctl start dbconsole
这样你就可以打开 web 浏览器,输入下面的 http://hostnameortnumber/em 来访问 em db control. host 那么是你的计算机的名字或地址.portnumber 是 em db control http 的端口号,这是在安装的时候指定的.默认的是 1158 ,你可以在$ORACLE_HOME/install/portlist.ini 文件中找到这个值.
如果实例启动了,EM 就会显示 db control 登录页.你必须使用授权访问 db control 的用户登录到数据库.一开始是 sys 用户,使用在安装的时候你确定的 sys 用户的密码.从 connect as 下拉框选 sysdba,然后点登录.这样就会出现 dbcontrol 的主页.这是同 Oracle 9i 的不同的。其它的大家共同学习吧!
===============================
http://forum.ubuntu.org.cn/viewtopic.php?f=44&t=136860
在ubuntu 8.04下安装Oracle 11g
本文是参考了:http://hi.baidu.com/wuxicn/blog/item/0cfdc24ac5ae372609f7ef94.html"文章,是翻译下面的这篇文章的。我主要参考的是中文的,我只是在实际操作中做了一点小小的修改,在此表示感谢!紫色为我的注释。
原文是英文,地址是:
http://www.pythian.com/blogs/968/instal ... ardy-heron,(转载注明出处,谢谢!! )
共9步:
Step 1
下载和安装 Ubuntu 8.04 Hardy Heron (x86-32位) 版。略。
Step 2
下载Oracle 11g: Download Oracle 11g for Linux (x86, 32-bit).
现不要急着解压,一会我会告诉你解压在哪的。
Step 3
修改X server 的默认设置,点菜单的System -> Administration -> Login Window(系统->管理->登录窗口),选择“Security(安全)”选项卡,取消“Deny TCP connections to the Xserver(拒绝TCP连接到X服务器)”的勾,重启Xserver(或者重启系统)。然后在终端输入:
user@hardy:~$ xhost +127.0.0.1
127.0.0.1 being added to access control list
Step 4
打开终端,转换为超级用户:(注意,这里用sudo su -而不是sudo -s是有原因的:sudo su - 将用户转换为超级用户,并新起一个会话(空的会话),而不是像sudo -s那样将当前会话传递个新的超级用户,减少环境变量可能造成的影响和危害。
user@hardy:~$ sudo su -
[sudo] password for user:
root@hardy:~# apt-get update
...
root@hardy:~# apt-get dist-upgrade
...
root@hardy:~# reboot
Step 5
用apt安装一些必要的工具:
user@hardy:~$ sudo su -
[sudo] password for user:
root@hardy:~# apt-get install build-essential libaio1 gawk ksh libmotif3 alien libtool lsb-rpm
...
root@hardy:~#
Step 6
在装完那些工具以后,我们需要做的就是修改一些Ubuntu的/bin/sh的默认连接,千万不要略过这一步,否则安装的时候会出现很多错误。
root@hardy:~# cd /bin
root@hardy:/bin# ls -l /bin/sh
lrwxrwxrwx 1 root root 4 2008-04-28 19:59 /bin/sh -> dash
root@hardy:/bin# ln -sf bash /bin/sh
root@hardy:/bin# ls -l /bin/sh
lrwxrwxrwx 1 root root 4 2008-05-01 22:51 /bin/sh -> bash
如果你想知道为什么Ubuntu用dash作为默认的shell,看这个:a detailed explanation of why dash is the default system shell 。
Step 7
增加用户和组,并修改一些配置。这一步很重要!如果不是很有把握,不要随便改。(为了便于解释,增加了行号):
01 root@hardy:/bin# cd
02 root@hardy:~# pwd
/root
04 root@hardy:~# addgroup oinstall
Adding group `oinstall' (GID 1001) ...
Done.
07 root@hardy:~# addgroup dba
Adding group `dba' (GID 1002) ...
Done.
10 root@hardy:~# addgroup nobody
Adding group `nobody' (GID 1003) ...
Done.
13 root@hardy:~# usermod -g nobody nobody
14 root@hardy:~# useradd -g oinstall -G dba -p password -d /home/oracle -s /bin/bash oracle
15 root@hardy:~# mkdir /home/oracle
16 root@hardy:~# chown -R oracle:dba /home/oracle
17 root@hardy:~# ln -s /usr/bin/awk /bin/awk
18 root@hardy:~# ln -s /usr/bin/rpm /bin/rpm
19 root@hardy:~# ln -s /usr/bin/basename /bin/basename
20 root@hardy:~# mkdir /etc/rc.d
21 root@hardy:~# for i in 0 1 2 3 4 5 6 S ; do ln -s /etc/rc$i.d /etc/rc.d/rc$i.d ; done
22 root@hardy:~# mkdir -p /u01/app/oracle
23 root@hardy:~# chown -R oracle:dba /u01
24 root@hardy:~#
Lines 04-12: 增加我们需要的用户和组
Line 13: 让nobody用户的组变为nobody,这样Oracle的安装程序不会出问题。Ubuntu默认nobody的组是nogroup。
Lines 14-18: 创建一个oracle用户。注意,oracle用户的HOME目录不要与ORACLE_HOME相同。
Lines 19-23: 创建一些Oracle安装程序需要的工具的连接。因为Oracle安装程序是为Red Hat准备的,所以有些工具的位置和Ubuntu不一样。
Finally, on lines 24-25 创建ORACLE_BASE目录。
Step 8
修改一些系统默认值。这些修改将会增加系统文件描述符的数量、增加共享内存大小和修改一些网络子系统参数。这些修改是否会对你的系统带来影响我就不得而知了。将下面这些增加到/etc/sysctl.conf文件的末尾:
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 65535
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144
再增加下面这些到/etc/security/limits.conf文件末尾:
oracle soft nproc 2047
oracle hard nproc 16383
oracle soft nofile 1023
oracle hard nofile 65535
为了强制使用刚才我们增加的东西,我们再增加下面这些到/etc/pam.d/login文件末尾:
session required /lib/security/pam_limits.so
session required pam_limits.so
然后通过命令:sysctl -p 让刚才增加的东西生效:
root@hardy:~# sysctl -p
kernel.printk = 4 4 1 7
kernel.maps_protect = 1
fs.inotify.max_user_watches = 524288
vm.mmap_min_addr = 65536
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.all.rp_filter = 1
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 65535
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144
root@hardy:~#
Step 9
现在我们将刚才下载的oracle11g的安装包解压到/home/oracle/install/目录下。然后进入目录,设置DISPLAY参数,开始安装:
root@hardy:~# cd /home/oracle
root@hardy:/home/oracle# chown -R oracle:dba install
用oracle用户登陆,(不然会出安装界面出不来)
oracle@hardy:~$ export DISPLAY=127.0.0.1:0.0
oracle@hardy:~$ pwd
/home/oracle
oracle@hardy:~$ ls -l
total 4
drwxr-xr-x 6 oracle dba 4096 2007-09-18 18:50 install
oracle@hardy:~$ cd install
oracle@hardy:~/install$ ls -l
total 28
drwxr-xr-x 11 oracle dba 4096 2007-08-06 16:02 doc
drwxr-xr-x 5 oracle dba 4096 2007-08-03 13:28 install
drwxr-xr-x 2 oracle dba 4096 2007-09-18 18:52 response
-rwxr-xr-x 1 oracle dba 2911 2007-08-03 13:28 runInstaller
drwxr-xr-x 14 oracle dba 4096 2007-08-03 13:27 stage
-rw-r--r-- 1 oracle dba 4835 2007-08-06 18:19 welcome.html
oracle@hardy:~/install$ ./runInstaller -ignoreSysPrereqs
输入完上面命令后,就进入了Oracle 的同一安装程序了(OUI),不要急,继续按照本文一步一步的通过安装:
注意:OUI安装完后,并不是真正完全安装完成,还需要就行最后的收尾工作(在最后有),而且这是必须做的工作!
点(Next)下一步。
修改“Specify Operating System group name:”为:"dba",然后点"Next".
按照上图设置,点下一步。
选择"Enterprise Edition",然后下一步。
安图设置,下一步。
继续下一步。
等待系统检查,不要担心有错误和警告。
将检查到的所有非“Succeeded”的都打上勾,下一步。
,下一步。在这一步选"Create a Database"来安装数据库。([color=red]原文是通过netca建立监听,dbca建库,我第一次也是这样做的,dbca建库时会报错,因为ubutunbu 不支持RPM包)。[/color]
将所有组都设为:dba,下一步。
现在可以点“Install”了:)时间比较长。
到了这一步不要记着点“OK”,需要做下面操作:(另起一个终端,用sudo su - 转为超级用户)
root@hardy:~# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory to 770.
Changing groupname of /u01/app/oraInventory to dba.
The execution of the script is complete
root@hardy:~# /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
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.sh script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
root@hardy:~#
好了,这个完成后可以点“OK”了。
安后点“Exit”退出OUI,现在可以祝贺你,OUI安装完成了:)但是还是不要急,记住咱们还有收尾工作需要做。
在/etc/profile文件中加入下面几句:
export ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_1
export PATH=$PATH:/u01/app/oracle/product/11.1.0/db_1/bin
创建一个Oracle 11g数据库的启动脚本,名字可以叫做:oracledb,在/u01/app/oracle/product/11.1.0/db_1/bin下建立文件:oracledb,内容:
#!/bin/bash
#
# /etc/init.d/oracledb
#
# Run-level Startup script for the Oracle Listener and Instances
# It relies on the information on /etc/oratab
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_1
export ORACLE_OWNR=oracle
export PATH=$PATH:$ORACLE_HOME/bin
if [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]
then
echo "Oracle startup: cannot start"
exit 1
fi
case "$1" in
start)
# Oracle listener and instance startup
echo -n "Starting Oracle: "
su $ORACLE_OWNR -c "$ORACLE_HOME/bin/lsnrctl start"
su $ORACLE_OWNR -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
touch /var/lock/oracle
echo "OK"
;;
stop)
# Oracle listener and instance shutdown
echo -n "Shutdown Oracle: "
su $ORACLE_OWNR -c "$ORACLE_HOME/bin/lsnrctl stop"
su $ORACLE_OWNR -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME"
rm -f /var/lock/oracle
echo "OK"
;;
reload|restart)
$0 stop
$0 start
;;
*)
echo "Usage: `basename $0` start|stop|restart|reload"
exit 1
esac
exit 0
修改脚本为可执行的:
root@hardy:~# chmod a+x /u01/app/oracle/product/11.1.0/db_1/bin/oracledb
如果你希望开机自动启动Oracle 11g数据库,那么就作下面的工作:
root@hardy:~# ln -s /u01/app/oracle/product/11.1.0/db_1/bin/oracledb /etc/init.d/oracledb
root@hardy:~# sudo sysv-rc-conf --level 2345 oracledb on
如果没有sysv-rc-conf命令,就apt-get一个。
最后,增加你自己的用户名到dba组:
root@hardy:~# usermod -G dba -a user
好了,至此,Oracle 11g就安装完了。重新登录后,你就可以使用oracle的命令了。
(ORACLE_SID=orcl 是你安装时候设置的值)
oracle@hardy:~$ export ORACLE_SID=orcl
oracle@hardy:~$ sqlplus '/as sysdba'
SQL*Plus: Release 11.1.0.6.0 - Production on Mon May 5 02:39:27 2008
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>connect /as sysdba
Connected to an idle instance.
SQL>startup 启动数据库命令。
.
ORACLE instance started.
Total System Global Area 418484224 bytes
Fixed Size 1300324 bytes
Variable Size 281020572 bytes
Database Buffers 130023424 bytes
Redo Buffers 6139904 bytes
Database mounted.
Database opened.
oracle@hardy:~$ export ORACLE_SID=orcl
oracle@hardy:~$ emctl start dbconsole 启动EM,地址为https://yourip:1158/em/console.这样你就可以通过IE登陆了。不过界面为乱码。呵呵!!解决方法自己在网上找吧!!
如果你看到了上面的结果,证明你的oracle安装成功了。
最后由 zm508_china 编辑于 2008-08-11 16:06,总共编辑了 3 次