Linux中导入AWR报告时文件名后缀问题

导入AWR报告的过程中报错:

SQL> @?/rdbms/admin/awrload

 ~~~~~~~~~~
 AWR LOAD
 ~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~ This script will load the AWR data from a dump file. The ~
 ~ script will prompt users for the following information: ~
 ~ (1) name of directory object ~
 ~ (2) name of dump file ~
 ~ (3) staging schema name to load AWR data into ~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Specify the Directory Name
 ~~~~~~~~~~~~~~~~~~~~~~~~~~
Directory Name Directory Path
 ------------------------------ -------------------------------------------------
 ORA11G_DIR /home/ora11g
Choose a Directory Name from the list above (case-sensitive).
Enter value for directory_name: ORA11G_DIR
Using the dump directory: ORA11G_DIR
Specify the Name of the Dump File to Load
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Please specify the prefix of the dump file (.dmp) to load:
Enter value for file_name: AWRDAT_5318_5498
Loading from the file name: AWRDAT_5318_5498.dmp
Staging Schema to Load AWR Snapshot Data
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 The next step is to create the staging schema
 where the AWR snapshot data will be loaded.
 After loading the data into the staging schema,
 the data will be transferred into the AWR tables
 in the SYS schema.
The default staging schema name is AWR_STAGE.
 To use this name, press to continue, otherwise enter
 an alternative.
Enter value for schema_name:
Using the staging schema name: AWR_STAGE
Choose the Default tablespace for the AWR_STAGE user
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Choose the AWR_STAGE users's default tablespace. This is the
 tablespace in which the AWR data will be staged.
TABLESPACE_NAME CONTENTS DEFAULT TABLESPACE
 ------------------------------ --------- ------------------
 S PERMANENT
 SYSAUX PERMANENT *
 USERS PERMANENT
Pressing will result in the recommended default
 tablespace (identified by *) being used.
Enter value for default_tablespace:
Using tablespace SYSAUX as the default tablespace for the AWR_STAGE
Choose the Temporary tablespace for the AWR_STAGE user
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Choose the AWR_STAGE user's temporary tablespace.
TABLESPACE_NAME CONTENTS DEFAULT TEMP TABLESPACE
 ------------------------------ --------- -----------------------
 TEMP TEMPORARY *
Pressing will result in the database's default temporary
 tablespace (identified by *) being used.
Enter value for temporary_tablespace:
Using tablespace TEMP as the temporary tablespace for AWR_STAGE
... Creating AWR_STAGE user
|
 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | Loading the AWR data from the following
 | directory/file:
 | /home/ora11g
 | AWRDAT_5318_5498.dmp
 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 |
 | *** AWR Load Started ...
 |
 | This operation will take a few moments. The
 | progress of the AWR load operation can be
 | monitored in the following directory/file:
 | /home/ora11g
 | AWRDAT_5318_5498.log
 |
 DBMS_DATAPUMP.ADD_FILE(dump file)
 ORA-39001: invalid argument value
 Exception encountered in AWR_LOAD
 begin
 *
 ERROR at line 1:
 ORA-20115: datapump import encountered error:
 ORA-39001: invalid argument value
 ORA-39000: bad dump file specification
 ORA-31640: unable to open dump file "/home/ora11g/AWRDAT_5318_5498.dmp" for read
 ORA-27037: unable to obtain file status
 Linux-x86_64 Error: 2: No such file or directory
 Additional information: 3
 ORA-06512: at "SYS.DBMS_SWRF_INTERNAL", line 1717
 ORA-06512: at line 3
begin
 *
 ERROR at line 1:
 ORA-20106: AWR tables do not exist for the 'AWR_STAGE' user
 ORA-06512: at "SYS.DBMS_SWRF_INTERNAL", line 2920
 ORA-00942: table or view does not exist
 ORA-06512: at line 3
... Dropping AWR_STAGE user
End of AWR Load

仔细查看报错,发现找不到/home/ora11g/AWRDAT_5318_5498.dmp这个文件。

查看/home/ora11g下的文件,发现有这个文件,不过仔细查看,其后缀为DMP!

[[email protected] ora11g]# ls -lt *.dmp *.DMP
 -rw-r--r-- 1 ora11g oinstall 56430592 Feb 15 16:41 awrdat_929_976.dmp
 -rw-r--r-- 1 ora11g oinstall 77807616 Feb 15 10:41 AWRDAT_5318_5498.DMP

我们将其修改为dmp再次尝试导入

 

[[email protected] ora11g]# mv AWRDAT_5318_5498.DMP awrdat_5318_5498.dmp
SQL> @?/rdbms/admin/awrload
 ~~~~~~~~~~
 AWR LOAD
 ~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~ This script will load the AWR data from a dump file. The ~
 ~ script will prompt users for the following information: ~
 ~ (1) name of directory object ~
 ~ (2) name of dump file ~
 ~ (3) staging schema name to load AWR data into ~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Specify the Directory Name
 ~~~~~~~~~~~~~~~~~~~~~~~~~~
Directory Name Directory Path
 ------------------------------ -------------------------------------------------
 ORA11G_DIR /home/ora11g
Choose a Directory Name from the list above (case-sensitive).
Enter value for directory_name: ORA11G_DIR
Using the dump directory: ORA11G_DIR
Specify the Name of the Dump File to Load
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Please specify the prefix of the dump file (.dmp) to load:
Enter value for file_name: awrdat_5318_5498
Loading from the file name: awrdat_5318_5498.dmp
Staging Schema to Load AWR Snapshot Data
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 The next step is to create the staging schema
 where the AWR snapshot data will be loaded.
 After loading the data into the staging schema,
 the data will be transferred into the AWR tables
 in the SYS schema.
The default staging schema name is AWR_STAGE.
 To use this name, press to continue, otherwise enter
 an alternative.
Enter value for schema_name:
Using the staging schema name: AWR_STAGE
Choose the Default tablespace for the AWR_STAGE user
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Choose the AWR_STAGE users's default tablespace. This is the
 tablespace in which the AWR data will be staged.
TABLESPACE_NAME CONTENTS DEFAULT TABLESPACE
 ------------------------------ --------- ------------------
 ALAND PERMANENT
 MARSHALL PERMANENT
 MARVEN PERMANENT
 S PERMANENT
 SYSAUX PERMANENT *
 USERS PERMANENT
 XXX PERMANENT
Pressing will result in the recommended default
 tablespace (identified by *) being used.
Enter value for default_tablespace:
Using tablespace SYSAUX as the default tablespace for the AWR_STAGE
Choose the Temporary tablespace for the AWR_STAGE user
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Choose the AWR_STAGE user's temporary tablespace.
TABLESPACE_NAME CONTENTS DEFAULT TEMP TABLESPACE
 ------------------------------ --------- -----------------------
 TEMP TEMPORARY *
Pressing will result in the database's default temporary
 tablespace (identified by *) being used.
Enter value for temporary_tablespace:
Using tablespace TEMP as the temporary tablespace for AWR_STAGE
... Creating AWR_STAGE user
|
 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | Loading the AWR data from the following
 | directory/file:
 | /home/ora11g
 | awrdat_5318_5498.dmp
 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 |
 | *** AWR Load Started ...
 |
 | This operation will take a few moments. The
 | progress of the AWR load operation can be
 | monitored in the following directory/file:
 | /home/ora11g
 | awrdat_5318_5498.log
 |
... Dropping AWR_STAGE user
End of AWR Load


导入成功!

注意:在导入dmp文件时,一定要注意以下几点:
1.Directory Name输入一定为大写。
2.注意此Directory Name的权限及dmp文件权限。
3.在linux中,dmp文件的后缀名一定要为小写的dmp,如果是大写的DMP,会导致无法导入。
4.细心就好,load不是关键的操作,不会导致什么过分严重的问题,往死里整就行。

普人特福的博客cnzz&51la for wordpress,cnzz for wordpress,51la for wordpress