SlideShare una empresa de Scribd logo
1 de 5
Testing : BULK DATA LOAD on Database Machine of Exadata.
NOTE: This is only for testing environment. For bulk data loading, Oracle recommends
to create a separate dedicated database instance for DBFS on Database Machine
Step 1: Configure a database file system (DBFS) and use it to stage a CSV formatted
file.
Step 2 : Create external table to reference the CSV file.
Step 3: CREATE TABLE to copy the CSV file data into a table in your database
Step 1: Configure a database file system (DBFS) and use it to stage a CSV
formatted file.
i. Create a tablespace for database file system (DBFS) and a new database user to
support DBFS.
create bigfile tablespace dbfs datafile '+DBFS_DG' size 130M;
create user dbfs identified by dbfs quota unlimited on dbfs;
grant create session, create table, create procedure, dbfs_role to dbfs;
ii. create a new directory named DBFS which will act as the anchor for your database
file system mount point.
$mkdir DBFS
iii. Create the database objects for your DBFS store
dbfs_create_filesystem_advanced.sql script under
$ORACLE_HOME/ rtstxdbs/admin).
sqlplus dbfs/dbfs
@?/rtstxdbs/admin/dbfs_create_filesystem_advanced.sql dbfs mydbfs
nocompress nodeduplicate noencrypt non-partition
dbfs --> specifies the tablespace where the DBFS store is created.
mydbfs --> specifies the name of the DBFS store.
The final four parameters specify whether or not to enable various features inside the
DBFS store.
Typically, it is recommended to leave the advanced features disabled for a DBFS store
that is used to stage data files for bulk data loading.
OutPut:
--------
CREATE STORE:
begin tstxdbs_dbfs_sfs.createFilesystem(store_name => 'FS_MYDBFS', tbl_name
=>
'T_MYDBFS', tbl_tbs => 'dbfs', lob_tbs => 'dbfs', do_partition => false,
partition_key => 1, do_compress => false, compression => '', do_dedup => false,
do_encrypt => false); end;
--------
REGISTER STORE:
begin tstxdbs_dbfs_content.registerStore(store_name=> 'FS_MYDBFS',
provider_name =>
'sample1', provider_package => 'tstxdbs_dbfs_sfs'); end;
--------
MOUNT STORE:
begin tstxdbs_dbfs_content.mountStore(store_name=>'FS_MYDBFS',
store_mount=>'mydbfs'); end;
--------
CHMOD STORE:
declare m integer; begin m := tstxdbs_fuse.fs_chmod('/mydbfs', 16895); end;
No errors.
iv. For DBFS database user create a file named passwd.txt, which contains the
password
[oracle@XXXXXX ~]$ echo dbfs >passwd.txt
[oracle@XXXXXX ~]$ ls
datagenerator DBFS labs oradiag_oracle passwd.txt setup sql1.sh
[oracle@XXXXXX ~]$ vi passwd.txt
v. Mounts database file system by running DBFS client (dbfs_client)
-----------------------------------------------------------------------------------------------
[oracle@XXXXXX ~]$ nohup $ORACLE_HOME/bin/dbfs_client 
> dbfs@tstxdb -o allow_other,direct_io /home/oracle/DBFS < passwd.txt &
[1] 28161
[oracle@XXXXXX ~]$ nohup: appending output to `nohup.out'
vi. Check the dbfs_client process and database file system
---------------------------------------------------------------------------------
[oracle@XXXXXX ~]$ ps -ef | grep dbfs_client
oracle 28161 25684 0 02:30 pts/0 00:00:00
/u01/app/oracle/product/11.2.0/dbhome_1/bin/dbfs_client dbfs@tstxdb -o
allow_other,direct_io /home/oracle/DBFS
oracle 28238 25684 0 02:31 pts/0 00:00:00 grep dbfs_client
[oracle@XXXXXX ~]$ df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/xvda2 8022104 4008292 3599740 53% /
/dev/xvda1 101086 13048 82819 14% /boot
tmpfs 1331200 797316 533884 60% /dev/shm
/dev/xvdb1 15480800 11955632 2738788 82% /u01
dbfs-dbfs@tstxdb:/ 101080 152 100928 1% /home/oracle/DBFS
vi. Transfer file the CSV file to stage inside DBFS
-------------------------------------------------------------
[oracle@XXXXXX ~]$ cp /Test/CSV/customers_tsdbfs.csv DBFS/mydbfs/
[oracle@XXXXXX ~]$ cd DBFS/mydbfs/
[oracle@XXXXXX mydbfs]$ ls -l *.csv
-rw-r--r-- 1 oracle oinstall 7552705 Sep 30 02:33 customers_tsdbfs.csv
So CSV data file is now staged inside DBFS.
vii. SQL> create directory staging as '/home/oracle/DBFS/mydbfs';
grant read, write on directory staging to sh;
Directory created.
SQL>
Grant succeeded.
Step 2: Create the external table to reference the CSV file.
i. Create an external table that references the data in your DBFS-staged CSV data file.
SQL> create table ext_customers
2 (
3 customer_id number(12),
4 cust_first_name varchar2(30),
5 cust_last_name varchar2(30),
6 nls_language varchar2(3),
7 nls_territory varchar2(30),
8 credit_limit number(9,2),
9 cust_email varchar2(100),
10 account_mgr_id number(6)
11 )
12 organization external
13 (
14 type oracle_loader
15 default directory staging
16 access parameters
17 (
18 records delimited by newline
19 badfile staging:'custxt%a_%p.bad'
20 logfile staging:'custxt%a_%p.log'
21 fields terminated by ',' optionally enclosed by '"'
22 missing field values are null
23 (
24 customer_id, cust_first_name, cust_last_name, nls_language,
25 nls_territory, credit_limit, cust_email, account_mgr_id
26 )
27 )
28 location (' customers_tsdbfs.csv)
29 )
30 parallel
31 reject limit unlimited;
Table created.
ii. Check query execution plans
-----------------------------
SQL>
SQL> set autotrace on explain
SQL> select count (*) from ext_customers;
COUNT(*)
----------
100000
Execution Plan
----------------------------------------------------------
Plan hash value: 3054877561
--------------------------------------------------------------------------------
--------------------------------------
| Id | Operation | Name | Rows | Cost (%CPU)| T
ime | TQ |IN-OUT| PQ Distrib |
--------------------------------------------------------------------------------
--------------------------------------
| 0 | SELECT STATEMENT | | 1 | 16 (0)| 0
0:00:01 | | | |
| 1 | SORT AGGREGATE | | 1 | |
| | | |
| 2 | PX COORDINATOR | | | |
| | | |
| 3 | PX SEND QC (RANDOM) | :TQ10000 | 1 | |
| Q1,00 | P->S | QC (RAND) |
| 4 | SORT AGGREGATE | | 1 | |
| Q1,00 | PCWP | |
| 5 | PX BLOCK ITERATOR | | 8168 | 16 (0)| 0
0:00:01 | Q1,00 | PCWC | |
| 6 | EXTERNAL TABLE ACCESS FULL| EXT_CUSTOMERS | 8168 | 16 (0)| 0
0:00:01 | Q1,00 | PCWP | |
--------------------------------------------------------------------------------
--------------------------------------
Note : The full table scan of the external table is executed in parallel.
SQL> set autotrace off;
STEP 3: Load the external table data from CSV file into a new table
SQL>
create table loaded_customers
as select * from ext_customers;SQL> 2
Table created.
SQL> select count(*) from loaded_customers;
COUNT(*)
----------
100000
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 -
64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage
Management, OLAP,
Data Mining and Real Application Testing options
[oracle@XXXXXX mydbfs]$ ls -l
total 7382
-rw-r--r-- 1 oracle oinstall 7552705 Sep 30 02:33 customers.csv
-rw-r--r-- 1 oracle dba 2752 Sep 30 02:43 custxt000_28630.log
-rw-r--r-- 1 oracle dba 2752 Sep 30 02:43 custxt000_3259.log
Unmount database file system
-------------------------------------
[oracle@XXXXXX mydbfs]$ cd
[oracle@XXXXXX ~]$ fusermount -u /home/oracle/DBFS/
[oracle@XXXXXX ~]$ df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/xvda2 8022104 4008292 3599740 53% /
/dev/xvda1 101086 13048 82819 14% /boot
tmpfs 1331200 797316 533884 60% /dev/shm
/dev/xvdb1 15480800 11957216 2737204 82% /u01
[1]+ Done nohup $ORACLE_HOME/bin/dbfs_client dbfs@tstxdb -
o allow_other,direct_io /home/oracle/DBFS < passwd.txt
[oracle@XXXXXX ~]$ ps -ef | grep dbfs_client
oracle 29077 25684 0 02:47 pts/0 00:00:00 grep dbfs_client

Más contenido relacionado

La actualidad más candente

FIXING BLOCK CORRUPTION (RMAN) on 11G
FIXING BLOCK CORRUPTION (RMAN) on 11GFIXING BLOCK CORRUPTION (RMAN) on 11G
FIXING BLOCK CORRUPTION (RMAN) on 11G
N/A
 
Basic - Oracle Edition Based Redefinition Presentation
Basic - Oracle Edition Based Redefinition PresentationBasic - Oracle Edition Based Redefinition Presentation
Basic - Oracle Edition Based Redefinition Presentation
N/A
 
Reduce Resource Consumption & Clone in Seconds your Oracle Virtual Environmen...
Reduce Resource Consumption & Clone in Seconds your Oracle Virtual Environmen...Reduce Resource Consumption & Clone in Seconds your Oracle Virtual Environmen...
Reduce Resource Consumption & Clone in Seconds your Oracle Virtual Environmen...
BertrandDrouvot
 

La actualidad más candente (19)

Postgresql Database Administration Basic - Day2
Postgresql  Database Administration Basic  - Day2Postgresql  Database Administration Basic  - Day2
Postgresql Database Administration Basic - Day2
 
Scripts related to temp tablespace
Scripts related to temp tablespaceScripts related to temp tablespace
Scripts related to temp tablespace
 
Mysql database basic user guide
Mysql database basic user guideMysql database basic user guide
Mysql database basic user guide
 
FIXING BLOCK CORRUPTION (RMAN) on 11G
FIXING BLOCK CORRUPTION (RMAN) on 11GFIXING BLOCK CORRUPTION (RMAN) on 11G
FIXING BLOCK CORRUPTION (RMAN) on 11G
 
Basic - Oracle Edition Based Redefinition Presentation
Basic - Oracle Edition Based Redefinition PresentationBasic - Oracle Edition Based Redefinition Presentation
Basic - Oracle Edition Based Redefinition Presentation
 
Mongodb replication
Mongodb replicationMongodb replication
Mongodb replication
 
Postgresql Database Administration Basic - Day1
Postgresql  Database Administration Basic  - Day1Postgresql  Database Administration Basic  - Day1
Postgresql Database Administration Basic - Day1
 
Postgresql Database Administration- Day3
Postgresql Database Administration- Day3Postgresql Database Administration- Day3
Postgresql Database Administration- Day3
 
Hive data migration (export/import)
Hive data migration (export/import)Hive data migration (export/import)
Hive data migration (export/import)
 
TP2 Big Data HBase
TP2 Big Data HBaseTP2 Big Data HBase
TP2 Big Data HBase
 
The first bug on Oracle Database 12c: how to create a pdb by cloning a remote...
The first bug on Oracle Database 12c: how to create a pdb by cloning a remote...The first bug on Oracle Database 12c: how to create a pdb by cloning a remote...
The first bug on Oracle Database 12c: how to create a pdb by cloning a remote...
 
Creating a physical standby database 11g on windows
Creating a physical standby database 11g on windowsCreating a physical standby database 11g on windows
Creating a physical standby database 11g on windows
 
Hive commands
Hive commandsHive commands
Hive commands
 
MySQL database replication
MySQL database replicationMySQL database replication
MySQL database replication
 
Gg steps
Gg stepsGg steps
Gg steps
 
Plmce 14 be a_hero_16x9_final
Plmce 14 be a_hero_16x9_finalPlmce 14 be a_hero_16x9_final
Plmce 14 be a_hero_16x9_final
 
Writing A Foreign Data Wrapper
Writing A Foreign Data WrapperWriting A Foreign Data Wrapper
Writing A Foreign Data Wrapper
 
Reduce Resource Consumption & Clone in Seconds your Oracle Virtual Environmen...
Reduce Resource Consumption & Clone in Seconds your Oracle Virtual Environmen...Reduce Resource Consumption & Clone in Seconds your Oracle Virtual Environmen...
Reduce Resource Consumption & Clone in Seconds your Oracle Virtual Environmen...
 
Postgresql Database Administration- Day4
Postgresql Database Administration- Day4Postgresql Database Administration- Day4
Postgresql Database Administration- Day4
 

Destacado

Oracle 12c RAC (Advanced installation - Flex ASM)
Oracle 12c RAC (Advanced installation - Flex ASM)Oracle 12c RAC (Advanced installation - Flex ASM)
Oracle 12c RAC (Advanced installation - Flex ASM)
Monowar Mukul
 
Exadata - Smart Scan Testing
Exadata - Smart Scan TestingExadata - Smart Scan Testing
Exadata - Smart Scan Testing
Monowar Mukul
 
Oracle 12c far sync standby instance
Oracle 12c far sync standby instanceOracle 12c far sync standby instance
Oracle 12c far sync standby instance
Monowar Mukul
 
Copyright Crash Course 1st revised ppt 6340.64 Sonia Aldape
Copyright Crash Course 1st revised ppt 6340.64 Sonia AldapeCopyright Crash Course 1st revised ppt 6340.64 Sonia Aldape
Copyright Crash Course 1st revised ppt 6340.64 Sonia Aldape
soniaaldape
 
Advanced installation 12c rac
Advanced installation 12c racAdvanced installation 12c rac
Advanced installation 12c rac
Monowar Mukul
 
12c: Testing audit features for Data Pump (Export & Import) and RMAN jobs
12c: Testing audit features for Data Pump (Export & Import) and RMAN jobs12c: Testing audit features for Data Pump (Export & Import) and RMAN jobs
12c: Testing audit features for Data Pump (Export & Import) and RMAN jobs
Monowar Mukul
 
Edtc6341 63 esther_sauceda_practice_test5
Edtc6341 63 esther_sauceda_practice_test5Edtc6341 63 esther_sauceda_practice_test5
Edtc6341 63 esther_sauceda_practice_test5
esauceda12
 

Destacado (20)

12c database migration from ASM storage to NON-ASM storage
12c database migration from ASM storage to NON-ASM storage12c database migration from ASM storage to NON-ASM storage
12c database migration from ASM storage to NON-ASM storage
 
Oracle 12c RAC (Advanced installation - Flex ASM)
Oracle 12c RAC (Advanced installation - Flex ASM)Oracle 12c RAC (Advanced installation - Flex ASM)
Oracle 12c RAC (Advanced installation - Flex ASM)
 
Exadata - Smart Scan Testing
Exadata - Smart Scan TestingExadata - Smart Scan Testing
Exadata - Smart Scan Testing
 
TimesTen in memory database Creation
TimesTen in memory database Creation TimesTen in memory database Creation
TimesTen in memory database Creation
 
Moving 12c database from NON-ASM to ASM
Moving 12c database from NON-ASM to ASMMoving 12c database from NON-ASM to ASM
Moving 12c database from NON-ASM to ASM
 
Exadata Cell metrics
Exadata Cell metricsExadata Cell metrics
Exadata Cell metrics
 
Oracle 12c far sync standby instance
Oracle 12c far sync standby instanceOracle 12c far sync standby instance
Oracle 12c far sync standby instance
 
SOA Fusion Middleware installation
SOA Fusion Middleware installationSOA Fusion Middleware installation
SOA Fusion Middleware installation
 
Exadata I/O Resource Manager (Exadata IORM)
Exadata I/O Resource Manager (Exadata IORM)Exadata I/O Resource Manager (Exadata IORM)
Exadata I/O Resource Manager (Exadata IORM)
 
1247g3hg1238 2011
1247g3hg1238 20111247g3hg1238 2011
1247g3hg1238 2011
 
Copyright Crash Course 1st revised ppt 6340.64 Sonia Aldape
Copyright Crash Course 1st revised ppt 6340.64 Sonia AldapeCopyright Crash Course 1st revised ppt 6340.64 Sonia Aldape
Copyright Crash Course 1st revised ppt 6340.64 Sonia Aldape
 
Advanced installation 12c rac
Advanced installation 12c racAdvanced installation 12c rac
Advanced installation 12c rac
 
12c: Testing audit features for Data Pump (Export & Import) and RMAN jobs
12c: Testing audit features for Data Pump (Export & Import) and RMAN jobs12c: Testing audit features for Data Pump (Export & Import) and RMAN jobs
12c: Testing audit features for Data Pump (Export & Import) and RMAN jobs
 
Upgrade database using cloud_control Provisioning
Upgrade database using cloud_control Provisioning Upgrade database using cloud_control Provisioning
Upgrade database using cloud_control Provisioning
 
Edtc6341 63 esther_sauceda_practice_test5
Edtc6341 63 esther_sauceda_practice_test5Edtc6341 63 esther_sauceda_practice_test5
Edtc6341 63 esther_sauceda_practice_test5
 
12c Flex ASM: Moving to Flex ASM
12c Flex ASM: Moving to Flex ASM12c Flex ASM: Moving to Flex ASM
12c Flex ASM: Moving to Flex ASM
 
Migration Database from SQL SERVER 2012 to Oracle12c with Pluggable Database
Migration Database from SQL SERVER 2012 to Oracle12c with Pluggable Database  Migration Database from SQL SERVER 2012 to Oracle12c with Pluggable Database
Migration Database from SQL SERVER 2012 to Oracle12c with Pluggable Database
 
4. java intro class
4. java intro class4. java intro class
4. java intro class
 
EM12c Configuration Setup - Step by Step
EM12c Configuration Setup - Step by StepEM12c Configuration Setup - Step by Step
EM12c Configuration Setup - Step by Step
 
Oracle AWR baseline - Basic
Oracle AWR baseline - BasicOracle AWR baseline - Basic
Oracle AWR baseline - Basic
 

Similar a Exadata - BULK DATA LOAD Testing on Database Machine

Discard inport exchange table & tablespace
Discard inport exchange table & tablespaceDiscard inport exchange table & tablespace
Discard inport exchange table & tablespace
Marco Tusa
 
Get started with Microsoft SQL Polybase
Get started with Microsoft SQL PolybaseGet started with Microsoft SQL Polybase
Get started with Microsoft SQL Polybase
Henk van der Valk
 
Create manula and automaticly database
Create manula and automaticly databaseCreate manula and automaticly database
Create manula and automaticly database
Anar Godjaev
 
database-querry-student-note
database-querry-student-notedatabase-querry-student-note
database-querry-student-note
Leerpiny Makouach
 
Steps for upgrading the database to 10g release 2
Steps for upgrading the database to 10g release 2Steps for upgrading the database to 10g release 2
Steps for upgrading the database to 10g release 2
nesmaddy
 

Similar a Exadata - BULK DATA LOAD Testing on Database Machine (20)

Discard inport exchange table & tablespace
Discard inport exchange table & tablespaceDiscard inport exchange table & tablespace
Discard inport exchange table & tablespace
 
Get started with Microsoft SQL Polybase
Get started with Microsoft SQL PolybaseGet started with Microsoft SQL Polybase
Get started with Microsoft SQL Polybase
 
Csql Cache Presentation
Csql Cache PresentationCsql Cache Presentation
Csql Cache Presentation
 
Presentation day4 oracle12c
Presentation day4 oracle12cPresentation day4 oracle12c
Presentation day4 oracle12c
 
Create manula and automaticly database
Create manula and automaticly databaseCreate manula and automaticly database
Create manula and automaticly database
 
Vikas 500 BIG DATA TECHNOLOGIES LAB.pdf
Vikas 500 BIG DATA TECHNOLOGIES LAB.pdfVikas 500 BIG DATA TECHNOLOGIES LAB.pdf
Vikas 500 BIG DATA TECHNOLOGIES LAB.pdf
 
15 MySQL Basics #burningkeyboards
15 MySQL Basics #burningkeyboards15 MySQL Basics #burningkeyboards
15 MySQL Basics #burningkeyboards
 
Hive
HiveHive
Hive
 
An overview of snowflake
An overview of snowflakeAn overview of snowflake
An overview of snowflake
 
MySql slides (ppt)
MySql slides (ppt)MySql slides (ppt)
MySql slides (ppt)
 
Rmoug ashmaster
Rmoug ashmasterRmoug ashmaster
Rmoug ashmaster
 
database-querry-student-note
database-querry-student-notedatabase-querry-student-note
database-querry-student-note
 
Playing with the CONNECT storage engine
Playing with the CONNECT storage enginePlaying with the CONNECT storage engine
Playing with the CONNECT storage engine
 
Guide to compile your own 4.3.4 cataclysm server
Guide to compile your own 4.3.4 cataclysm serverGuide to compile your own 4.3.4 cataclysm server
Guide to compile your own 4.3.4 cataclysm server
 
20201106 hk-py con-mysql-shell
20201106 hk-py con-mysql-shell20201106 hk-py con-mysql-shell
20201106 hk-py con-mysql-shell
 
TrinityCore server install guide
TrinityCore server install guideTrinityCore server install guide
TrinityCore server install guide
 
MySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELKMySQL Audit using Percona audit plugin and ELK
MySQL Audit using Percona audit plugin and ELK
 
MySQL Presentation
MySQL PresentationMySQL Presentation
MySQL Presentation
 
My SYSAUX tablespace is full - please help
My SYSAUX tablespace is full - please helpMy SYSAUX tablespace is full - please help
My SYSAUX tablespace is full - please help
 
Steps for upgrading the database to 10g release 2
Steps for upgrading the database to 10g release 2Steps for upgrading the database to 10g release 2
Steps for upgrading the database to 10g release 2
 

Último

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
SanaAli374401
 

Último (20)

APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 

Exadata - BULK DATA LOAD Testing on Database Machine

  • 1. Testing : BULK DATA LOAD on Database Machine of Exadata. NOTE: This is only for testing environment. For bulk data loading, Oracle recommends to create a separate dedicated database instance for DBFS on Database Machine Step 1: Configure a database file system (DBFS) and use it to stage a CSV formatted file. Step 2 : Create external table to reference the CSV file. Step 3: CREATE TABLE to copy the CSV file data into a table in your database Step 1: Configure a database file system (DBFS) and use it to stage a CSV formatted file. i. Create a tablespace for database file system (DBFS) and a new database user to support DBFS. create bigfile tablespace dbfs datafile '+DBFS_DG' size 130M; create user dbfs identified by dbfs quota unlimited on dbfs; grant create session, create table, create procedure, dbfs_role to dbfs; ii. create a new directory named DBFS which will act as the anchor for your database file system mount point. $mkdir DBFS iii. Create the database objects for your DBFS store dbfs_create_filesystem_advanced.sql script under $ORACLE_HOME/ rtstxdbs/admin). sqlplus dbfs/dbfs @?/rtstxdbs/admin/dbfs_create_filesystem_advanced.sql dbfs mydbfs nocompress nodeduplicate noencrypt non-partition dbfs --> specifies the tablespace where the DBFS store is created. mydbfs --> specifies the name of the DBFS store. The final four parameters specify whether or not to enable various features inside the DBFS store. Typically, it is recommended to leave the advanced features disabled for a DBFS store that is used to stage data files for bulk data loading. OutPut: -------- CREATE STORE: begin tstxdbs_dbfs_sfs.createFilesystem(store_name => 'FS_MYDBFS', tbl_name => 'T_MYDBFS', tbl_tbs => 'dbfs', lob_tbs => 'dbfs', do_partition => false,
  • 2. partition_key => 1, do_compress => false, compression => '', do_dedup => false, do_encrypt => false); end; -------- REGISTER STORE: begin tstxdbs_dbfs_content.registerStore(store_name=> 'FS_MYDBFS', provider_name => 'sample1', provider_package => 'tstxdbs_dbfs_sfs'); end; -------- MOUNT STORE: begin tstxdbs_dbfs_content.mountStore(store_name=>'FS_MYDBFS', store_mount=>'mydbfs'); end; -------- CHMOD STORE: declare m integer; begin m := tstxdbs_fuse.fs_chmod('/mydbfs', 16895); end; No errors. iv. For DBFS database user create a file named passwd.txt, which contains the password [oracle@XXXXXX ~]$ echo dbfs >passwd.txt [oracle@XXXXXX ~]$ ls datagenerator DBFS labs oradiag_oracle passwd.txt setup sql1.sh [oracle@XXXXXX ~]$ vi passwd.txt v. Mounts database file system by running DBFS client (dbfs_client) ----------------------------------------------------------------------------------------------- [oracle@XXXXXX ~]$ nohup $ORACLE_HOME/bin/dbfs_client > dbfs@tstxdb -o allow_other,direct_io /home/oracle/DBFS < passwd.txt & [1] 28161 [oracle@XXXXXX ~]$ nohup: appending output to `nohup.out' vi. Check the dbfs_client process and database file system --------------------------------------------------------------------------------- [oracle@XXXXXX ~]$ ps -ef | grep dbfs_client oracle 28161 25684 0 02:30 pts/0 00:00:00 /u01/app/oracle/product/11.2.0/dbhome_1/bin/dbfs_client dbfs@tstxdb -o allow_other,direct_io /home/oracle/DBFS oracle 28238 25684 0 02:31 pts/0 00:00:00 grep dbfs_client [oracle@XXXXXX ~]$ df Filesystem 1K-blocks Used Available Use% Mounted on /dev/xvda2 8022104 4008292 3599740 53% / /dev/xvda1 101086 13048 82819 14% /boot tmpfs 1331200 797316 533884 60% /dev/shm /dev/xvdb1 15480800 11955632 2738788 82% /u01 dbfs-dbfs@tstxdb:/ 101080 152 100928 1% /home/oracle/DBFS
  • 3. vi. Transfer file the CSV file to stage inside DBFS ------------------------------------------------------------- [oracle@XXXXXX ~]$ cp /Test/CSV/customers_tsdbfs.csv DBFS/mydbfs/ [oracle@XXXXXX ~]$ cd DBFS/mydbfs/ [oracle@XXXXXX mydbfs]$ ls -l *.csv -rw-r--r-- 1 oracle oinstall 7552705 Sep 30 02:33 customers_tsdbfs.csv So CSV data file is now staged inside DBFS. vii. SQL> create directory staging as '/home/oracle/DBFS/mydbfs'; grant read, write on directory staging to sh; Directory created. SQL> Grant succeeded. Step 2: Create the external table to reference the CSV file. i. Create an external table that references the data in your DBFS-staged CSV data file. SQL> create table ext_customers 2 ( 3 customer_id number(12), 4 cust_first_name varchar2(30), 5 cust_last_name varchar2(30), 6 nls_language varchar2(3), 7 nls_territory varchar2(30), 8 credit_limit number(9,2), 9 cust_email varchar2(100), 10 account_mgr_id number(6) 11 ) 12 organization external 13 ( 14 type oracle_loader 15 default directory staging 16 access parameters 17 ( 18 records delimited by newline 19 badfile staging:'custxt%a_%p.bad' 20 logfile staging:'custxt%a_%p.log' 21 fields terminated by ',' optionally enclosed by '"' 22 missing field values are null 23 ( 24 customer_id, cust_first_name, cust_last_name, nls_language, 25 nls_territory, credit_limit, cust_email, account_mgr_id 26 )
  • 4. 27 ) 28 location (' customers_tsdbfs.csv) 29 ) 30 parallel 31 reject limit unlimited; Table created. ii. Check query execution plans ----------------------------- SQL> SQL> set autotrace on explain SQL> select count (*) from ext_customers; COUNT(*) ---------- 100000 Execution Plan ---------------------------------------------------------- Plan hash value: 3054877561 -------------------------------------------------------------------------------- -------------------------------------- | Id | Operation | Name | Rows | Cost (%CPU)| T ime | TQ |IN-OUT| PQ Distrib | -------------------------------------------------------------------------------- -------------------------------------- | 0 | SELECT STATEMENT | | 1 | 16 (0)| 0 0:00:01 | | | | | 1 | SORT AGGREGATE | | 1 | | | | | | | 2 | PX COORDINATOR | | | | | | | | | 3 | PX SEND QC (RANDOM) | :TQ10000 | 1 | | | Q1,00 | P->S | QC (RAND) | | 4 | SORT AGGREGATE | | 1 | | | Q1,00 | PCWP | | | 5 | PX BLOCK ITERATOR | | 8168 | 16 (0)| 0 0:00:01 | Q1,00 | PCWC | | | 6 | EXTERNAL TABLE ACCESS FULL| EXT_CUSTOMERS | 8168 | 16 (0)| 0 0:00:01 | Q1,00 | PCWP | | -------------------------------------------------------------------------------- -------------------------------------- Note : The full table scan of the external table is executed in parallel. SQL> set autotrace off;
  • 5. STEP 3: Load the external table data from CSV file into a new table SQL> create table loaded_customers as select * from ext_customers;SQL> 2 Table created. SQL> select count(*) from loaded_customers; COUNT(*) ---------- 100000 SQL> exit Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options [oracle@XXXXXX mydbfs]$ ls -l total 7382 -rw-r--r-- 1 oracle oinstall 7552705 Sep 30 02:33 customers.csv -rw-r--r-- 1 oracle dba 2752 Sep 30 02:43 custxt000_28630.log -rw-r--r-- 1 oracle dba 2752 Sep 30 02:43 custxt000_3259.log Unmount database file system ------------------------------------- [oracle@XXXXXX mydbfs]$ cd [oracle@XXXXXX ~]$ fusermount -u /home/oracle/DBFS/ [oracle@XXXXXX ~]$ df Filesystem 1K-blocks Used Available Use% Mounted on /dev/xvda2 8022104 4008292 3599740 53% / /dev/xvda1 101086 13048 82819 14% /boot tmpfs 1331200 797316 533884 60% /dev/shm /dev/xvdb1 15480800 11957216 2737204 82% /u01 [1]+ Done nohup $ORACLE_HOME/bin/dbfs_client dbfs@tstxdb - o allow_other,direct_io /home/oracle/DBFS < passwd.txt [oracle@XXXXXX ~]$ ps -ef | grep dbfs_client oracle 29077 25684 0 02:47 pts/0 00:00:00 grep dbfs_client