急!!请问高手,我想把一个Oracle数据移到一个新服务器上,要怎么做?

luckyegg45 2004-11-06 08:38:04
我不知道原来的服务器上的设置和密码,这要怎么做。
更重要的是:我从没用过oracel啊。

服务器系统是winnt,数据库是oracel 7
请高手指示。
...全文
211 17 打赏 收藏 转发到动态 举报
写回复
用AI写文章
17 条回复
切换为时间正序
请发表友善的回复…
发表回复
luckyegg45 2004-11-12
  • 打赏
  • 举报
回复
谢谢楼上各位的帮忙,公司找人解决问题了,我想请问怎么把分数给你们。谢谢你们的帮忙:rdmarswu(磕睡虫) 、student7007(再向虎山行) 、 GerryYang(轻尘) 、snowy_howe(天下有雪)、soniczck(城市农作物)、 ssDOn(DonDon)共6个人,每人给3分行吗?
hardmarswu 2004-11-09
  • 打赏
  • 举报
回复
look carefully above documents,and wish to help you solved your problems.
hardmarswu 2004-11-08
  • 打赏
  • 举报
回复

5. remote_login_passwordfile = shared

我们看一下Oracle9i文档中的说明:

SHARED

More than one database can use a password file. However, the only user recognized by the password file is SYS.


意思是说多个数据库可以共享一个口令文件,但是只可以识别一个用户:SYS



SQL> select * from v$pwfile_users;

USERNAME SYSDB SYSOP
------------------------------ ----- -----
SYS TRUE TRUE

SQL> grant sysdba to eygle;
grant sysdba to eygle
*
ERROR at line 1:
ORA-01994: GRANT failed: cannot add users to public password file


SQL> show parameter password

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
remote_login_passwordfile string SHARED





我们看到,此时的口令文件中是不能添加用户的.

很多人的疑问在于:口令文件的缺省名称是orapw<sid>,怎么能够共享?

实际上是这样的: Oracle数据库在启动时,首先查找的是orapw<sid>的口令文件,如果该文件不存在,则开始查找,orapw的口令文件
如果口令文件命名为orapw,多个数据库就可以共享.

我们看一下测试:



[oracle@jumper dbs]$ sqlplus "/ as sysdba"

SQL*Plus: Release 9.2.0.3.0 - Production on Tue Jul 6 09:40:34 2004

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.3.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.3.0 - Production

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> !
[oracle@jumper dbs]$ ls
hsjf initdw.ora inithsjf.ora init.ora lkHSJF orapwhsjf spfilehsjf.ora
[oracle@jumper dbs]$ mv orapwhsjf orapwhsjf.bak
[oracle@jumper dbs]$ exit
exit

SQL> startup
ORACLE instance started.

Total System Global Area 235999908 bytes
Fixed Size 451236 bytes
Variable Size 201326592 bytes
Database Buffers 33554432 bytes
Redo Buffers 667648 bytes
ORA-01990: error opening password file '/opt/oracle/product/9.2.0/dbs/orapw'--这是最后查找的文件
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3





我们建立orapw口令文件,这时候可以打开数据库.

SQL> !
[oracle@jumper dbs]$ ls
hsjf initdw.ora inithsjf.ora init.ora lkHSJF orapwhsjf.bak spfilehsjf.ora
[oracle@jumper dbs]$ cp orapwhsjf.bak orapw
[oracle@jumper dbs]$ exit
exit

SQL> alter database open;

Database altered.

SQL> show parameter passw

NAME TYPE VALUE
------------------------------------ ----------- ---------
remote_login_passwordfile string SHARED
SQL>


那么你可能会有这样的疑问,多个Exclusive的数据库是否可以共享一个口令文件(orapw)呢?

我们继续这个实验:

SQL> show parameter passwordNAME TYPE VALUE
------------------------------------
remote_login_passwordfile string SHARED


[oracle@jumper dbs]$ strings orapw
]\[Z
ORACLE Remote Password file
INTERNAL
AB27B53EDC5FEF41
8A8F025737A9097A


注意这里仅记录着INTERNAL/SYS的口令

REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE 时

SQL> alter system set remote_login_passwordfile=exclusive scope=spfile;System altered.

SQL> startup force;
ORACLE instance started.

Total System Global Area 235999908 bytes
Fixed Size 451236 bytes
Variable Size 201326592 bytes
Database Buffers 33554432 bytes
Redo Buffers 667648 bytes
Database mounted.
Database opened.
SQL> !

[oracle@jumper bin]$ cd $ORACLE_HOME/dbs
[oracle@jumper dbs]$ strings orapw
]\[Z
ORACLE Remote Password file
HSJF
INTERNAL
AB27B53EDC5FEF41
8A8F025737A9097A
[oracle@jumper dbs]$ exit
exit


注意这里,以EXCLUSIVE 方式启动以后,实例名称信息被写入口令文件.

此时如果有其他实例以Exclusive模式启动仍然可以使用这个口令文件,口令文件中的实例名称同时被改写.

也就是说,数据库只在启动过程中才读取口令文件,数据库运行过程中并不锁定该文件,类似于pfile/spfile文件.


SQL> select * from v$pwfile_users;USERNAME SYSDB SYSOP
------------------------------ ----- -----
SYS TRUE TRUE

SQL> grant sysdba to eygle;

Grant succeeded.

SQL> select * from v$pwfile_users;

USERNAME SYSDB SYSOP
------------------------------
SYS TRUE TRUE
EYGLE TRUE FALSE

SQL> !
[oracle@jumper bin]$ cd $ORACLE_HOME/dbs
[oracle@jumper dbs]$ strings orapw
]\[Z
ORACLE Remote Password file
HSJF
INTERNAL
AB27B53EDC5FEF41
8A8F025737A9097A
>EYGLE
B726E09FE21F8E83



注意此时可以增加SYSDBA用户,并且这些信息可以被写入到口令文件.

一旦口令文件中增加了其他SYSDBA用户,此文件不再能够被其他Exclusive的实例共享.


实际上,口令文件对于其他用户来说就是启到了一个 sudo 的作用.

6.重建口令文件

如果口令文件丢失,可以使用orapwd可以重建口令文件,语法如下:


[oracle@jumper oracle]$ orapwdUsage: orapwd file=<fname> password=<password> entries=<users> where
file - name of password file (mand),
password - password for SYS (mand),
entries - maximum number of distinct DBA and OPERs (opt),
There are no spaces around the equal-to (=) character.

hardmarswu 2004-11-08
  • 打赏
  • 举报
回复
Oracle中password file的作用及说明

在数据库没有启动之前,数据库内建用户是无法通过数据库来验证身份的

口令文件中存放sysdba/sysoper用户的用户名及口令
允许用户通过口令文件验证,在数据库未启动之前登陆
从而启动数据库

如果没有口令文件,在数据库未启动之前就只能通过操作系统认证.

使用Rman,很多时候需要在nomount,mount等状态对数据库进行处理
所以通常要求sysdba权限如果属于本地DBA组,可以通过操作系统认证登陆
如果是远程sysdba登陆,需要通过passwordfile认证.

1.remote_login_passwordfile = NONE

此时停用口令文件验证,Oracle数据库不允许远程SYSDBA/SYSOPER身份登录
无法通过远程进行数据库起停等操作管理

local:

[oracle@jumper oracle]$ sqlplus "/ as sysdba"

SQL*Plus: Release 9.2.0.3.0 - Production on Thu Apr 15 09:58:45 2004

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.3.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.3.0 - Production

SQL> alter user sys identified by oracle;

User altered.

SQL> show parameter pass

NAME TYPE VALUE
--------------------- ----------- ------------------------------
remote_login_passwordfile string NONE

remote:

E:\Oracle\ora92\bin>sqlplus /nologSQL*Plus: Release 9.2.0.4.0 -
Production on 星期四 4月 15 09:39:22 2004Copyright (c) 1982, 2002, Oracle
Corporation. All rights reserved.SQL> connect sys/oracle@hsjf as
sysdbaERROR:ORA-01017: invalid username/password; logon denied

此处实际上是无法通过口令文件验证

2.remote_login_passwordfile = exclusive


SQL> alter system set remote_login_passwordfile=exclusive scope=spfile;

System altered.

SQL> startup force;
ORACLE instance started.

Total System Global Area 131142648 bytes
Fixed Size 451576 bytes
Variable Size 104857600 bytes
Database Buffers 25165824 bytes
Redo Buffers 667648 bytes
Database mounted.
Database opened.
SQL> show parameter pass

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
remote_login_passwordfile string EXCLUSIVE
SQL> alter user sys identified by oracle;

User altered.

remote:


E:\Oracle\ora92\bin>sqlplus /nologSQL*Plus: Release 9.2.0.4.0 -
Production on 星期四 4月 15 09:47:11 2004Copyright (c) 1982, 2002, Oracle
Corporation. All rights reserved.SQL> connect sys/oracle@hsjf as
sysdba已连接。SQL> show userUSER 为"SYS"SQL>


这实际上就是通过口令文件验证登录的

3.进一步测试

如果此时我们删除passwdfile,sysdba/sysoper将无法认证,也就无法登陆数据库

Server:

SQL> !
[oracle@jumper oracle]$ cd $ORACLE_HOME/dbs
[oracle@jumper dbs]$ ls orapwhsjf
orapwhsjf
[oracle@jumper dbs]$ mv orapwhsjf orapwhsjf.bak
[oracle@jumper dbs]$

Remote:

E:\Oracle\ora92\bin>sqlplus /nolog

SQL*Plus: Release 9.2.0.4.0 - Production on 星期四 4月 15 09:50:14 2004

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

SQL> connect sys/oracle@hsjf as sysdba
ERROR:
ORA-01031: insufficient privileges


SQL>



这实际上就是无法通过口令文件验证身份



4.如果丢失了passwdfile

如果使用passwdfile却意外丢失,此时将不能启动数据库


SQL> startup force;
ORACLE instance started.

Total System Global Area 131142648 bytes
Fixed Size 451576 bytes
Variable Size 104857600 bytes
Database Buffers 25165824 bytes
Redo Buffers 667648 bytes
ORA-01990: error opening password file '/opt/oracle/product/9.2.0/dbs/orapw'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3



此时可以通过orapwd重建口令文件来解决
此处我们恢复口令文件既可




SQL> !
[oracle@jumper oracle]$ mv $ORACLE_HOME/dbs/orapwhsjf.bak orapwhsjf
[oracle@jumper oracle]$ exit
exit

SQL> alter database open;

Database altered.

SQL>


大致就是如此.







GerryYang 2004-11-08
  • 打赏
  • 举报
回复
先在新的数据库建立和原数据库相同SID的instance,
然后将原数据库shutdown,
然后将原数据库的所有文件考到新数据库的相对应的目录,
就可以了。
student7007 2004-11-08
  • 打赏
  • 举报
回复
这样做一下,打开Enterprise manager consol(就在开始菜单中),选"独立启动",然后点其中的数据库名,这时会弹出对话框要求你输入用户名及口令,这时注意'连接身份'一栏,默认是normal, 你从中选择sysdba点确定就进入了,用户名口令不用写的.
进入后找到数据所属的用户名,即开发用户名,可以对它改口令,然后用它来 exp/imp.
luckyegg45 2004-11-07
  • 打赏
  • 举报
回复
不是吧,为了导这个还要我学习这个啊?俺可没时间学这个啊.晕死.
我先试着用上面的方法吧.不行再请教各位啦.
wzjcntlqs 2004-11-06
  • 打赏
  • 举报
回复
先学习吧
luckyegg45 2004-11-06
  • 打赏
  • 举报
回复
楼上的大哥。在哪看啊,麻烦说一下或给个看的地方行吗?
wupangzi 2004-11-06
  • 打赏
  • 举报
回复
你可以看看你的系统管理中的服务里,看看启动的地方是什么名字!这就是SID!当然其他地方也是可以看的!
密码的问题看看这里:
http://community.csdn.net/Expert/topic/3495/3495414.xml?temp=.9652521
luckyegg45 2004-11-06
  • 打赏
  • 举报
回复
原来机器上的SID在哪看?别笑话我,我真没用过oracel,还有数据库是怎么联接的?我记得我在看软件上的时候看到它的一个server项上写着:@cjyh。是不是就是这样联接的?
luckyegg45 2004-11-06
  • 打赏
  • 举报
回复
问题是用户名和密码我都不知道,对方也没有人知道,当初做这套系统的人现在在加拿大联系不上。
我只知道其中一个用户名和密码,是这个软件访问数据库的时候用的用户名和密码。

一楼说的EXP是不是可以用EXP72来访问的?这个我有个用户名和密码。

二楼说的我也知道把旧的覆盖到新的,可是我没有旧的设置,也就是说我不知道旧的数据库上要设置什么东西,用户名和密码之类的要设成相同的。可我就是没有原来的用户名和密码。
SID是哪个?我真不知道。

还有一个,这个可以装在2000的系统上吗?因为我装NT的时候系统总不行。
snowy_howe 2004-11-06
  • 打赏
  • 举报
回复
没有密码,怎么导入导出呢?开玩笑!
我觉得,
1、必须得知道数据库的SID
2、能够拷贝所有文件

在另一台机器上,新安装oracle7,注意其SID要设置为与上面一致。
将原来服务器上的所有oracle文件拷贝到新机器上覆盖新装的。
先试试,有问题再研究。
wupangzi 2004-11-06
  • 打赏
  • 举报
回复
导入导出!imp\exp
  • 打赏
  • 举报
回复
是,与其那么麻烦且没把握地导文件,不如写个穷举测试程序,还可以在所有类似情况反复使用。
ssDOn 2004-11-06
  • 打赏
  • 举报
回复
知道一个用户就行了。
先用sqlplus登录,然后执行 select * from all_users
列出所有用户名。
再看看这用户有没有权限防问数据库中的密码表,有的话不用再说了,把sys或system的密码改过来。
没有的话,老办法, crack it .
一般低下智力的人都会用这样的密码作为自己的密码:
用户名+几位数字(建议12,123,123456)
或直接用 12345678 就完了,如果全是数字的话分钟就可解出密码了。当然解密程序自己编, 很简单就是不断loop, connect 之类。
如果是高手的话, 8位全是e文。那么破解 connect internal 的密码。解了这个就好办了。
soniczck 2004-11-06
  • 打赏
  • 举报
回复
HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOME0\ORACLE_SID 的值就是SID名称;
$oracle(ORACLE安装目录)\admin\local\pfile 中的INIT.ORA文件中的db_name

17,380

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧