DBMS_FILE_TRANSFER package which provides an API for copying binary files between database servers
轉:
DBMS_FILE_TRANSFER Package in Oracle Database 10g
Oracle 10g has introduced theDBMS_FILE_TRANSFER
package which provides an API for copying binary files between database servers.[@more@]
Common Usage Notes
All of the the currently supported procedures have some common usage notes listed below:- The user must have read privilege on the source directory object and write privilege on the destination directory object.
- The procedure converts directory object names to uppercase unless they are surrounded by double quotes.
- Files to be copied must be multiples of 512 bytes in size.
- Files to be copied must be equal to or less than 2 terabytes in size.
- File transfers are not transactional.
- Files are copied as binary, so no character conversions are performed.
- File copies can be monitored using the
V$SESSION_LONGOPS
view.
COPY_FILE
TheCOPY_FILE
procedure allows you to copy binary files from one location to another on the same server.Checking the destination directory will reveal that the file has been copied successfully.-- Create the source and destination directory objects. CREATE OR REPLACE DIRECTORY db_files_dir1 AS '/u01/oradata/DB10G/'; CREATE OR REPLACE DIRECTORY db_files_dir2 AS '/u02/oradata/DB10G/'; -- Switch a tablespace into read only mode so we can -- use it for a test file transfer. ALTER TABLESPACE users READ ONLY; -- Copy the file. BEGIN DBMS_FILE_TRANSFER.COPY_FILE( source_directory_object => 'DB_FILES_DIR1', source_file_name => 'USERS01.DBF', destination_directory_object => 'DB_FILES_DIR2', destination_file_name => 'USERS01.DBF'); END; / -- Switch the tablespace back to read write mode. ALTER TABLESPACE users READ WRITE;
GET_FILE
TheGET_FILE
procedure allows you to copy binary files from a remote server to the local server.-- Login to the remote server. CONN system/password@remote -- Create the source directory object and switch mode of a tablespace. CREATE OR REPLACE DIRECTORY db_files_dir1 AS '/u01/oradata/DB10G/'; ALTER TABLESPACE users READ ONLY; -- Login to the local server. CONN system/password@local -- Create the destination directory object and a database link. CREATE OR REPLACE DIRECTORY db_files_dir2 AS '/u02/oradata/DB10G/'; CREATE DATABASE LINK remote CONNECT TO system IDENTIFIED BY password USING 'REMOTE'; -- Get the file. BEGIN DBMS_FILE_TRANSFER.GET_FILE( source_directory_object => 'DB_FILES_DIR1', source_file_name => 'USERS01.DBF', source_database => 'REMOTE', destination_directory_object => 'DB_FILES_DIR2', destination_file_name => 'USERS01.DBF'); END; / -- Login to the remote server. CONN system/password@remote -- Switch the tablespace back to read write mode. ALTER TABLESPACE users READ WRITE;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/197458/viewspace-1045201/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- DBMS_FILE_TRANSFER Package in Oracle Database 10gPackageOracleDatabase
- Database Servers (279)DatabaseServer
- C. Binary String Copying
- using dbms_file_transfer transportable tablespace between asmASM
- 轉淘寶流雲dbms_file_transfer package usagePackage
- Migrate database to Exadata with DBMS_FILE_TRANSFERDatabase
- 2.5 Overview of Tablespaces and Database Files in a CDBViewDatabase
- failed to establish dependency between database GERP and diskgroup resourceAIDatabase
- ERROR: failed to establish dependency between database db_name and diskgroupErrorAIDatabase
- 【OCP最新題庫解析(052)--題6】Which structure can span multiple data filesStruct
- How to move ASM database files from one diskgroup to anotherASMDatabase
- VMS: ALTER TABLESPACE/DATABASE TO RENAME FILES on VMS [ID 9560.1]Database
- by which, in which, from which 語法區別
- Nginx Parsing HTTP Package、header/post/files/args Sourcecode AnalysisNginxHTTPPackageHeader
- Specifying Oracle-Managed Files at Database Creation (76)OracleDatabase
- View and Data API Tips : Conversion between DbId and nodeViewAPI
- This page provides the following types of documentationIDE
- Jive筆記6 --Database Package下面的暗黑世界 (轉)筆記DatabasePackage
- How to copy files between sites using JavaScript REST in Office365 / SharePoint 2013JavaScriptREST
- Oracle 12C Database File Mapping for Oracle ASM FilesOracleDatabaseAPPASM
- xShared,a tool that share any files under same wi-fi. Convenience, Shortcut to transfer between iPho...
- Difference between Microsoft Dynamics 365 WEB API, Organization Service and Organization Data ServicROSWebAPI
- copying model and updating field of pydantic
- recover database using backup controlfile利用archivelog files.DatabaseHive
- ORA-16047: DGID mismatch between destination setting and target databaseDatabase
- parallel_max_serversParallelServer
- Application Servers (278)APPServer
- PL/SQL package SYS.DBMS_BACKUP_RESTORE version 19.16.00.00 in TARGET database isSQLPackageRESTDatabase
- 用匯入匯出誇平臺遷移所有資料( Move a Database Between Platforms)DatabasePlatform
- Error 945 Database cannot be opened due to inaccessible files or insufficient memory or disk spaceErrorDatabase
- List of currently operational QOTD serversServer
- MySql multiple servers on linuxMySqlServerLinux
- jQuery event.whichjQuery
- Dedicated and Shared Servers (104)Server
- Initialization Parameter Files and Server Parameter Files (287)Server
- Dagger 2 系列(三) -- 基礎篇:@Module 和 @ProvidesIDE
- not an rpm package (or package manifest):Package
- not an rpm package (or package manifest)Package