1. 程式人生 > >ORA-20200: Database/Instance / does not exist in DBA_HIST_DATABASE_INSTANCE

ORA-20200: Database/Instance / does not exist in DBA_HIST_DATABASE_INSTANCE

描述:

在執行awr報告收集時候報錯

 

SQL> @?/rdbms/admin/awrrpti.sql

Specify the Report Type
~~~~~~~~~~~~~~~~~~~~~~~
Would you like an HTML report, or a plain text report?
Enter 'html' for an HTML report, or 'text' for plain text
Defaults to 'html'
Enter value for report_type: 

Type Specified:  html


Instances in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   DB Id     Inst Num DB Name       Instance    Host
------------ -------- ------------ ------------ ------------
  3950953118        1 EHR       EHRDG    Hexindai-BJ-
                        XXY-80
* 2082231315        1 PROD1       PROD1    edbjr2p1
  2082231315        1 PROD1       PROD1    enmoedu1.exa
                        mple.com

Enter value for dbid: 3950953118
Using 3950953118 for database Id
Enter value for inst_num: 
Using  for instance number
  :inst_num  :=  ;
                 *
ERROR at line 3:
ORA-06550: line 3, column 18:
PLS-00103: Encountered the symbol ";" when expecting one of the following:
( - + case mod new not null <an identifier>
<a double-quoted delimited-identifier> <a bind variable>
continue avg count current exists max min prior sql stddev
sum variance execute forall merge time timestamp interval
date <a string literal with character set specification>
<a number> <a single-quoted SQL string> pipe
<an alternatively-quoted string literal with character set specification>
<an alternatively


declare
*
ERROR at line 1:
ORA-20200: Database/Instance / does not exist in DBA_HIST_DATABASE_INSTANCE
ORA-06512: at line 23

 

解決:

這是由於sqlplus環境變數配置導致輸入的dbid位數過長無法識別

SQL> show numformat
numformat "999,999,999,999"

 

 

將numformat設定為預設

SQL> set numformat ""
SQL> show numformat