How To Create Oracle Database Dump File
The easiest way to create a dump from the codeBeamer schema is the Oracle Data Pump If the admin user is a sysdba then you will get a prompt to type username which should be: sys as sysdba Run the following command from command line: By default, the value of the directory is data_pump_dir. Users can check the available directories by running the following command: To create a directory, run the following command: The dump files can be found in the <data_pump_dir>. The oracle dump contains not only the data but the structure and storage place of the data. Oracle dump contains tablespace information of objects. It is necessary to remap to an existing or a new tablespace. Sample SQL: It creates a tablespace with initial size of 100 megabytes and wiith a maximum size is 31000 megabytes. Oracle dump contains schema information of objects. It is necessary to remap to an existing or a new schema. To create a new database schema, run the following command: To import a database dump, run the following command: It is necessary to refresh index information of the schema. To gather statistical information about the database schema, run the following command: THE FOLLOWING PROCESS WILL MODIFY THE DATA IN THE DATABASE AND IT IS NOT POSSIBLE TO REVERT MODIFICATIONS. DO NOT USE IT ON PRODUCTION ENVIRONMENT! After executing the script, it is not possible to login to codeBeamer because all user credentials (usernames, passwords) are removed. To set '007' as password for all users run the following script: If autocommit is not active in sqlplus, commit may be needed after user password update: Now you can login to codeBeamer with user-<user-id>/007. For example: user-1/007 LDAP/AD authentication must be disabled even if Fallback option is activated.Import and Export codeBeamer database with Oracle
tool. Create Dump
expdp <adminUserName>/<adminPassword> schemas=<schemaName> parallel=<numberOfCPUCores-1> directory=<data_pump_dir> dumpfile=CB_DUMP_%U.dmp logfile=DB_DUMP_exp.log
SELECT owner, directory_name, directory_path FROM all_directories
CREATE DIRECTORY <directory_name> AS 'absolute_path';
Import Dump
Tablespace
Create a new tablespace
CREATE TABLESPACE <name of new tablespace> DATAFILE '<absolute path of data directory>' SIZE 100M AUTOEXTEND ON NEXT 100M MAXSIZE 31000M;
Schema
Create a new schema
CREATE USER C##CBROOT IDENTIFIED BY CBROOT DEFAULT TABLESPACE <name of tablespace for the schema> QUOTA UNLIMITED ON <name of tablespace for the schema>; GRANT CREATE SESSION TO C##CBROOT; GRANT CREATE TYPE TO C##CBROOT ; GRANT CREATE TABLE TO C##CBROOT ; GRANT CREATE CLUSTER TO C##CBROOT ; GRANT CREATE TRIGGER TO C##CBROOT ; GRANT CREATE OPERATOR TO C##CBROOT ; GRANT CREATE SEQUENCE TO C##CBROOT ; GRANT CREATE INDEXTYPE TO C##CBROOT ; GRANT CREATE PROCEDURE TO C##CBROOT ; GRANT CREATE VIEW TO C##CBROOT ; GRANT EXECUTE ON CTXSYS.CTX_DDL TO C##CBROOT ; GRANT EXECUTE ON DBMS_LOB TO C##CBROOT ; /*The following permissions is necessary to import the dump but it is not necessary to use codeBeamer. If there is an admin user who can import the dump then it is not necessary to execute the following permissions*/ GRANT IMPORT FULL DATABASE TO C##CBROOT; GRANT READ, WRITE ON DIRECTORY data_pump_dir TO C##CBROOT;
Import dump
impdp <adminUserName>/<adminPassword> directory=<data_pump_dir> schemas=<schemaName> dumpfile=<dump file name>_%U.dmp logfile=DB_DUMP_imp.log job_name=job1 PARALLEL=<numberOfCPUCores-1> Optional parameters: REMAP_SCHEMA=<schema name in dump>:<schema name in database> REMAP_TABLESPACE=<table space name in dump>:<table space name in database>
Gather schema statistics
BEGIN DBMS_STATS.GATHER_SCHEMA_STATS ( ownname => '<schema name>', estimate_percent => 100, method_opt => 'FOR ALL COLUMNS SIZE AUTO', degree => 1, granularity => 'ALL', cascade => TRUE, options => 'GATHER' ) ; END ;
Obfuscate sensitive data
UPDATE users SET registrydate = null, passwd = LOWER(rawtohex(sys.dbms_crypto.hash(UTL_I18N.STRING_TO_RAW ('007'|| id ||'700101010000','AL32UTF8'), 6))); commit;
How To Create Oracle Database Dump File
Source: https://codebeamer.com/cb/wiki/2732806
Posted by: stormplacrour.blogspot.com

0 Response to "How To Create Oracle Database Dump File"
Post a Comment