在 ubuntu 上安装 oracle 10g xe。登录和创建数据库的问题
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/931441/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
oracle 10g xe install on ubuntu. problems logging in and creating database
提问by
objective: to install oracle 10g xe on ubuntu. method followed :www.oracle.com/technology/tech/linux/install/xe-on-kubuntu.html problem: The installation went fine and at 1 point it asked me for a password for the system account and I gave it lets say 'securepassword' that. Now, I have 2 problems:
目标:在 ubuntu 上安装 oracle 10g xe。方法如下:www.oracle.com/technology/tech/linux/install/xe-on-kubuntu.html 问题:安装进行得很好,在 1 点它要求我输入系统帐户的密码,我给了它让我们说'securepassword'那个。现在,我有两个问题:
- I want to create a database. There is a createdb script in the bin directory, but everytime I run it, it says :
- 我想创建一个数据库。bin 目录中有一个 createdb 脚本,但是每次我运行它时,它都会说:
ORACLE_HOME must be set and $ORACLE_HOME/dbs must be writable
必须设置 ORACLE_HOME 并且 $ORACLE_HOME/dbs 必须是可写的
So I set the ORACLE_HOME but i still get the problem. I figure that since all files in the dbs directory are owned by the 'oracle' user and the dba group, I'll su to oracle and run the command. Turns out 'securepassword' doesnt work for the oracle user. The Oracle installation created a user called 'oracle' but gave it some passwod I dont know about. Whats this password ?
所以我设置了 ORACLE_HOME 但我仍然遇到问题。我认为由于 dbs 目录中的所有文件都归“oracle”用户和 dba 组所有,因此我将 su 到 oracle 并运行该命令。结果证明'securepassword'对oracle用户不起作用。Oracle 安装创建了一个名为“oracle”的用户,但给了它一些我不知道的密码。这个密码是什么?
I also tried adding my current user to the dba group and trying it again. Didnt work either
我还尝试将我当前的用户添加到 dba 组并再次尝试。也没有用
- When I run ./sqlplus from the bin directory, I try to login as sys\'securepassword'. Didnt work! Tried system\'securepassword'. Didnt work either.
- 当我从 bin 目录运行 ./sqlplus 时,我尝试以 sys\'securepassword' 身份登录。没用!试过系统\'安全密码'。也没有用。
The only place system/'securepassword' worked was to get into the apex web interface. Can someone tel me the default password for the oracle user and how to login to sqlplus ?
system/'securepassword' 唯一起作用的地方是进入 apex Web 界面。有人可以告诉我 oracle 用户的默认密码以及如何登录 sqlplus 吗?
回答by Luke Woodward
I can think of three reasons why
我能想到三个原因
sqlplus sys\'securepassword'
wont' work:
不会'工作:
- You're using backslashes. Use forward slashes instead.
- Don't put quotes around the password.
- If connecting as
SYS
, you'll need to addas sysdba
as otherwise you get the following error message:
- 您正在使用反斜杠。请改用正斜杠。
- 不要在密码周围加上引号。
- 如果连接为
SYS
,则需要添加as sysdba
,否则会收到以下错误消息:
ERROR: ORA-28009: connection as SYS should be as SYSDBA or SYSOPER
So, assuming that securepassword
is the password for both SYS
and SYSTEM
, both of the following lines should work:
因此,假设securepassword
是两个密码SYS
和SYSTEM
,下面的两个行应该工作:
sqlplus sys/securepassword as sysdba
sqlplus system/securepassword
In Oracle, 'OS-based authentication' means that if your Ubuntu user account is a member of the dba
group, then you can log in as SYS
without a password by typing
在 Oracle 中,“基于操作系统的身份验证”意味着如果您的 Ubuntu 用户帐户是该dba
组的成员,那么您可以SYS
通过键入以下内容以无需密码的身份登录
sqlplus / as sysdba
in a shell window. This is handy if you forget your SYS
password and need to reset it.
在外壳窗口中。如果您忘记SYS
密码并需要重置密码,这会很方便。
Incidentally, I ran into a completely non-obvious issue installing Oracle 10g XE on my openSUSE box. I needed to run
顺便说一句,我在我的 openSUSE 机器上安装 Oracle 10g XE 时遇到了一个完全不明显的问题。我需要跑
chown oracle /var/tmp/.oracle
as root to clear up a permissions error which prevented the database from starting.
以 root 身份清除阻止数据库启动的权限错误。
回答by Obiora
In the linux terminal, type:
在 linux 终端中,键入:
/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/config/scripts/sqlplus.sh
It should bring you into the SQLPlus commandline. To connect, type:
它应该带您进入 SQLPlus 命令行。要连接,请键入:
connect sys as dba
Then fill in your password when prompted. Done!
然后在提示时填写您的密码。完毕!
回答by Plasmer
Can you log in as sys with os based authentication? Then you should be able to set passwords, etc. sqlplus / as sysdba ?
您可以使用基于 os 的身份验证以 sys 身份登录吗?那么你应该能够设置密码等 sqlplus / as sysdba 吗?
After re-reading the question, it sounds like you are trying to find the password for the OS user "oracle"? If you installed the software as root, you should be able to set a new password for the user "oracle" using the passwd utility.
重新阅读问题后,听起来您正在尝试查找操作系统用户“oracle”的密码?如果您以 root 用户身份安装该软件,您应该能够使用 passwd 实用程序为用户“oracle”设置新密码。