conn username/password@servicename

conn username/password 方式连接的时候,会碰到这样的错误问题


oracle@prd:/home/oracle/impdir$sqlplus /nolog
SQL*Plus: Release 11.2.0.4.0 Production on Mon Mar 21 00:14:52 2022
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
SQL> conn myuser/abc123456   
ERROR:
ORA-00942: table or view does not exist
Error accessing PRODUCT_USER_PROFILE
Warning: Product user profile information not loaded!
You may need to run PUPBLD.SQL as SYSTEM
//提示错误,这种提示有的话,你导入,导出也会发生错误。 impdp myuser/abc123456 ......... 

 

解决方法: 需要使用system用户登陆,并执行pupbld.sql脚本,不能用sysdba。
每个人安装目录不同,可能pupbld.sql位置不确定,你可以locate pupbld.sql 查找一下他的位置。
[oracle@prd:/home/oracle/impdir$sqlplus /nolog
SQL*Plus: Release 11.2.0.4.0 Production on Mon Mar 21 00:14:52 2022
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
SQL> conn system/abc123456
Connected.
SQL>@/u01/oracle/product/11.2.0/sqlplus/admin/pupbld.sql
.....
.....
//执行过程省略,执行完之后你再重新登录
oracle@prd:/home/oracle/impdir$sqlplus /nolog
SQL*Plus: Release 11.2.0.4.0 Production on Mon Mar 21 00:14:52 2022
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
SQL> conn myuser/abc123456   
Connected. //就会ok

1、conn username/password@servicename   //连接某实例

oracle@prd:/home/oracle/impdir$sqlplus /nolog
SQL*Plus: Release 11.2.0.4.0 Production on Mon Mar 21 00:14:52 2022
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
SQL> conn sh3/ab123@fp
Connected.
//这里fp是servicename

  SQL> conn sh3/abc123@fp3  //我故意把fp写错,注意fp就是在tnsnames.ora里面设置的
  ERROR:
  ORA-12154: TNS:could not resolve the connect identifier specified

  Warning: You are no longer connected to ORACLE.

2、conn system/Shfpbi    //连接某账户

oracle@prd:/home/oracle/impdir$sqlplus /nolog
SQL*Plus: Release 11.2.0.4.0 Production on Mon Mar 21 00:14:52 2022
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
SQL> conn shfpfpmai/Shfpbi12@fpmai
Connected.
SQL> conn sh3/abc123@fpmai2
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified
Warning: You are no longer connected to ORACLE.

3、导入导出

 expdp sh3/abc123  dumpfile=SH3.dmp directory=EXPDIR logfile=sh3export.log
 impdp sh3/abc123  dumpfile=SH3.dmp directory=IMPDIR logfile=sh3import.log
posted @ 2022-03-21 00:49  jinzi  阅读(276)  评论(0编辑  收藏  举报