iis服务器助手广告广告
返回顶部
首页 > 资讯 > 数据库 >AWR跨库导出与导入的方法是什么
  • 128
分享到

AWR跨库导出与导入的方法是什么

2024-04-02 19:04:59 128人浏览 薄情痞子
摘要

这篇文章主要讲解了“AWR跨库导出与导入的方法是什么”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“AWR跨库导出与导入的方法是什么”吧!(1)导出SYS@h

这篇文章主要讲解了“AWR跨库导出与导入的方法是什么”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“AWR跨库导出与导入的方法是什么”吧!

(1)导出

SYS@honor1 > @?/rdbms/admin/awrextr.sql
~~~~~~~~~~~~~
AWR EXTRACT
~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~  This script will extract the AWR data for a range of snapshots  ~
~  into a dump file.  The script will prompt users for the         ~
~  following infORMation:                                          ~
~     (1) database id                                              ~
~     (2) snapshot range to extract                                ~
~     (3) name of directory object                                 ~
~     (4) name of dump file                                        ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Databases in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   DB Id     DB Name      Host
------------ ------------ ------------
* 353046371  HONOR        db-oracle-no
                          de1.cloud.la
                          b.eng.bos.re
                          dhat.com
* 353046371  HONOR        db-oracle-no
                          de2.cloud.la
                          b.eng.bos.re
                          dhat.com
The default database id is the local one: '                               353046371'.  To use this
database id, press <return> to continue, otherwise enter an alternative.
Enter value for dbid: 
Using                                353046371 for Database ID
Specify the number of days of snapshots to choose from
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Entering the number of days (n) will result in the most recent
(n) days of snapshots being listed.  Pressing <return> without
specifying a number lists all completed snapshots.
Enter value for num_days: 5
Listing the last 5 days of Completed Snapshots
DB Name        Snap Id    Snap Started
------------ --------- ------------------
HONOR             1207 05 Apr 2020 01:56
                  1208 05 Apr 2020 09:38
                  1209 05 Apr 2020 11:00
                  1210 05 Apr 2020 12:00
                  1211 05 Apr 2020 13:00
                  1212 05 Apr 2020 14:00
                  1213 05 Apr 2020 15:00
                  1214 05 Apr 2020 16:00
                  1215 05 Apr 2020 17:00
                  1216 05 Apr 2020 18:00
                  1217 05 Apr 2020 19:00
                  1218 05 Apr 2020 20:00
                  1219 05 Apr 2020 21:00
                  1220 05 Apr 2020 22:01
                  1221 05 Apr 2020 23:00
                  1222 06 Apr 2020 01:55
                  1223 06 Apr 2020 10:34
                  1224 06 Apr 2020 12:00
                  1225 06 Apr 2020 13:00
                  1226 06 Apr 2020 14:00
                  1227 06 Apr 2020 15:00
                  1228 06 Apr 2020 16:00
                  1229 06 Apr 2020 17:00
                  1230 06 Apr 2020 18:00
                  1231 06 Apr 2020 19:00
                  1232 06 Apr 2020 20:00
                  1233 06 Apr 2020 21:00
                  1234 07 Apr 2020 10:07
                  1235 07 Apr 2020 11:00
                  1236 07 Apr 2020 12:00
                  1237 07 Apr 2020 13:00
                  1238 07 Apr 2020 14:00
                  1239 09 Apr 2020 09:55
                  1240 09 Apr 2020 11:00
Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap: 1207
Begin Snapshot Id specified: 1207
Enter value for end_snap: 1217
End   Snapshot Id specified: 1217
Specify the Directory Name
~~~~~~~~~~~~~~~~~~~~~~~~~~
Directory Name                 Directory Path
------------------------------ -------------------------------------------------
DATA_FILE_DIR                  /u01/app/oracle/product/11.2/db_1/demo/schema/sal
                               es_history/
DATA_PUMP_DIR                  /u01/app/oracle/product/11.2/db_1/rdbms/log/
EXPDP                          /rman/expdp
LOG_FILE_DIR                   /u01/app/oracle/product/11.2/db_1/demo/schema/log
                               /
MEDIA_DIR                      /u01/app/oracle/product/11.2/db_1/demo/schema/pro
                               duct_media/
ORACLE_OCM_CONFIG_DIR          /u01/app/oracle/product/11.2/db_1/ccr/hosts/db-or
                               acle-node1.cloud.lab.eng.bos.redhat.com/state
ORACLE_OCM_CONFIG_DIR2         /u01/app/oracle/product/11.2/db_1/ccr/state
SS_OE_XMLDIR                   /u01/app/oracle/product/11.2/db_1/demo/schema/ord
                               er_entry/
SUBDIR                         /u01/app/oracle/product/11.2/db_1/demo/schema/ord
                               er_entry//2002/Sep
XMLDIR                         /u01/app/oracle/product/11.2/db_1/rdbms/xml
Choose a Directory Name from the above list (case-sensitive).
Enter value for directory_name: EXPDP      
Using the dump directory: EXPDP
Specify the Name of the Extract Dump File
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The prefix for the default dump file name is awrdat_1207_1217.
To use this name, press <return> to continue, otherwise enter
an alternative.
Enter value for file_name: 
Using the dump file prefix: awrdat_1207_1217
|
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|  The AWR extract dump file will be located
|  in the following directory/file:
|   /rman/expdp
|   awrdat_1207_1217.dmp
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|  *** AWR Extract Started ...
|
|  This operation will take a few moments. The
|  progress of the AWR extract operation can be
|  monitored in the following directory/file:
|   /rman/expdp
|   awrdat_1207_1217.log
|
End of AWR Extract
SYS@honor1 > exit

(2)导入

scp到目标数据库服务器

[oracle@db-oracle-node1 expdp]$ scp * 192.168.204.231:/rman/expdp
oracle@192.168.204.231's passWord: 
awrdat_1207_1217.dmp                                                                                                                   100%   12MB  11.8MB/s   00:00    
awrdat_1207_1217.log

导入

11:40:59 SYS@messay > @?/rdbms/admin/awrload.sql
~~~~~~~~~~
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
------------------------------ -------------------------------------------------
DATA_FILE_DIR                  /oracle/app/oracle/product/11.2/db_1/demo/schema/
                               sales_history/
DATA_PUMP_DIR                  /oracle/app/oracle/admin/messay/dpdump/
EXPDP                          /rman/expdp
LOG_FILE_DIR                   /oracle/app/oracle/product/11.2/db_1/demo/schema/
                               log/
MEDIA_DIR                      /oracle/app/oracle/product/11.2/db_1/demo/schema/
                               product_media/
ORACLE_OCM_CONFIG_DIR          /oracle/app/oracle/product/11.2/db_1/ccr/hosts/si
                               ngle/state
ORACLE_OCM_CONFIG_DIR2         /oracle/app/oracle/product/11.2/db_1/ccr/state
SS_OE_XMLDIR                   /oracle/app/oracle/product/11.2/db_1/demo/schema/
                               order_entry/
SUBDIR                         /oracle/app/oracle/product/11.2/db_1/demo/schema/
                               order_entry//2002/Sep
XMLDIR                         /oracle/app/oracle/product/11.2/db_1/rdbms/xml
Elapsed: 00:00:00.00
Choose a Directory Name from the list above (case-sensitive).
Enter value for directory_name: EXPDP
Using the dump directory: EXPDP
Elapsed: 00:00:00.00
Elapsed: 00:00:00.00
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_1207_1217
Loading from the file name: awrdat_1207_1217.dmp
Elapsed: 00:00:00.00
Elapsed: 00:00:00.00
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 <return> to continue, otherwise enter
an alternative.
Enter value for schema_name: 
Using the staging schema name: AWR_STAGE
Elapsed: 00:00:00.00
Elapsed: 00:00:00.00
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
--------------------------- ------------------
EXAMPLE
PERMANENT
SYSAUX
PERMANENT                   *
USERS
PERMANENT
Elapsed: 00:00:00.01
Pressing <return> 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
Elapsed: 00:00:00.00
Elapsed: 00:00:00.00
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                   *
Elapsed: 00:00:00.02
Pressing <return> 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
Elapsed: 00:00:00.00
Elapsed: 00:00:00.00
... Creating AWR_STAGE user
Elapsed: 00:00:00.16
Elapsed: 00:00:00.05
Elapsed: 00:00:00.00
|
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|  Loading the AWR data from the following
|  directory/file:
|   /rman/expdp
|   awrdat_1207_1217.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:
|   /rman/expdp
|   awrdat_1207_1217.log
|
Elapsed: 00:00:00.02
Elapsed: 00:00:56.84
Elapsed: 00:00:25.56
... Dropping AWR_STAGE user
Elapsed: 00:00:17.97
End of AWR Load

(3)生成awr

需要通过awrrpti.sql脚本生成快照:

11:46:21 SYS@messay > @?/rdbms/admin/awrrpti.sql

(4)删除导入awr

查询当前快照

select snap_id,dbid,instance_number from dba_hist_snapshot order by 2,1;

删除导入的快照:

12:07:52 SYS@messay > exec dbms_workload_repository.DROP_SNAPSHOT_RANGE(LOW_SNAP_ID=>1207,HIGH_SNAP_ID=>1217,DBID=>353046371);

再次查询:

select snap_id,dbid,instance_number from dba_hist_snapshot order by 2,1;

感谢各位的阅读,以上就是“AWR跨库导出与导入的方法是什么”的内容了,经过本文的学习后,相信大家对AWR跨库导出与导入的方法是什么这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是编程网,小编将为大家推送更多相关知识点的文章,欢迎关注!

您可能感兴趣的文档:

--结束END--

本文标题: AWR跨库导出与导入的方法是什么

本文链接: https://www.lsjlt.com/news/62961.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • AWR跨库导出与导入的方法是什么
    这篇文章主要讲解了“AWR跨库导出与导入的方法是什么”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“AWR跨库导出与导入的方法是什么”吧!(1)导出SYS@h...
    99+
    2024-04-02
  • sqlserver数据库导入导出的方法是什么
    SQL Server数据库可以通过多种方式进行导入导出操作,以下是一些常用的方法: 使用SQL Server Management...
    99+
    2024-04-09
    sqlserver
  • sql数据库表导入导出的方法是什么
    SQL数据库表导入导出的方法有多种,常用的方法有以下几种:1. 使用SQL命令行工具导入导出:可以使用命令行工具如MySQL的`my...
    99+
    2023-10-08
    sql数据库
  • plsql数据导出导入的方法是什么
    在PL/SQL中,可以使用以下方法导出和导入数据: 使用Oracle Data Pump工具进行导出和导入数据。Oracle D...
    99+
    2024-04-09
    plsql
  • Javascript模块导入导出的方法是什么
    这篇“Javascript模块导入导出的方法是什么”文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅读完这篇文章能有所收获,下面我们一起来看看这篇“Javascript模块导入...
    99+
    2023-07-04
  • plsql表结构导入导出的方法是什么
    PL/SQL表结构导入导出的方法有以下几种: 使用Oracle Data Pump导入导出:Oracle Data Pump提供...
    99+
    2023-10-23
    pgsql
  • oracle导入导出dmp文件的方法是什么
    要导入和导出Oracle数据库的dmp文件,可以使用exp和imp实用程序。以下是一些常用的步骤: 导出数据: 使用exp实用程序...
    99+
    2024-05-13
    oracle
  • python库的导入与管理方法是什么
    Python库的导入与管理方法有以下几种:1. 直接导入:使用`import`语句导入整个库。例如:`import math`2. ...
    99+
    2023-08-09
    python
  • mongodb数据表导入导出的方法是什么
    MongoDB提供了命令行工具mongodump和mongorestore来进行数据表的导入和导出。具体方法如下:1. 导出数据表:...
    99+
    2023-09-12
    mongodb
  • oracle数据泵导入导出的方法是什么
    Oracle数据泵是一种用于将数据导出和导入数据库的工具,它包含了expdp和impdp两个命令。以下是使用Oracle数据泵进行导...
    99+
    2024-04-15
    oracle
  • PL/SQL数据导入导出的方法是什么
    在PL/SQL中,数据导入导出的方法可以通过使用Oracle的数据导入导出工具实现,例如使用Oracle Data Pump工具或者...
    99+
    2024-05-08
    PL/SQL
  • Oracle中dmp文件导入导出的方法是什么
    在Oracle数据库中,可以使用exp和imp命令来导出和导入dmp文件。 导出数据:可以使用exp命令来导出数据库中的数据,语法...
    99+
    2024-04-09
    Oracle
  • oracle数据泵导入和导出的方法是什么
    通过使用Oracle数据泵工具,可以轻松地导出和导入数据库对象和数据。以下是导出和导入数据泵的方法: 导出数据: 使用expdp命...
    99+
    2024-04-11
    oracle
  • plsql全库导出的方法是什么
    在PL/SQL中,有几种不同的方法可以用于导出整个数据库。 使用Oracle Data Pump实用程序:Oracle Data...
    99+
    2024-02-29
    plsql
  • PostgreSQL数据库导入和导出的方法
    今天小编给大家分享一下PostgreSQL数据库导入和导出的方法的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获,下面我们一起来了解一下吧。Postgre...
    99+
    2023-06-27
  • MySQL表数据的导入与导出方法
    本篇内容介绍了“MySQL表数据的导入与导出方法”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成! LOAD...
    99+
    2024-04-02
  • sqlserver导出数据库的方法是什么
    在 SQL Server 中,可以使用 SQL Server Management Studio (SSMS) 工具或者使用 SQL...
    99+
    2024-04-09
    sqlserver 数据库
  • oracle导出数据库的方法是什么
    在Oracle数据库中,可以使用expdp命令来导出数据库。expdp是Oracle提供的数据泵工具,用于将数据库对象和数据导出到一...
    99+
    2024-04-02
  • Docker镜像与容器的导入导出方法
    这篇文章主要介绍“Docker镜像与容器的导入导出方法”,在日常操作中,相信很多人在Docker镜像与容器的导入导出方法问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”Docker镜像与容器的导入导出方法”的疑...
    99+
    2023-06-29
  • MySQL数据库导入导出数据的方法
    这篇文章主要介绍“MySQL数据库导入导出数据的方法”,在日常操作中,相信很多人在MySQL数据库导入导出数据的方法问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”MySQL数...
    99+
    2024-04-02
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作