0% found this document useful (0 votes)
9 views47 pages

DBA Class Notes

The document contains class notes on Linux commands, Oracle database installation, and SQL Developer setup. It covers essential commands for file management, database operations, and internal database structures, including datafiles, control files, and redo log files. Additionally, it explains the differences between ARCHIVELOG and NOARCHIVELOG modes, along with recovery procedures for corrupted datafiles and control files.

Uploaded by

Nagesh Giri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views47 pages

DBA Class Notes

The document contains class notes on Linux commands, Oracle database installation, and SQL Developer setup. It covers essential commands for file management, database operations, and internal database structures, including datafiles, control files, and redo log files. Additionally, it explains the differences between ARCHIVELOG and NOARCHIVELOG modes, along with recovery procedures for corrupted datafiles and control files.

Uploaded by

Nagesh Giri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 47

DBA Class Notes

Linux Commands
1. pwd
2. mkdir
3. open
4. cd
5. ls -ltr
6. mv
7. clear
8. rm
9. ls
10. ls -l
11. >
12. sort
13. exit
14. vi
15. wq
16. cat
17. chmod -w <filename>
18. chmod +x <filename>
19. sh <filename>
20. ./<filename>&
21. hostname
22. top
23. kill

1. PWD (Printable working directory)


2. MKDIR <filename>
Using mkdir <filename>
command you can
create a directory/file.
HERE I given file name
as NAGESH

GIRI
3. Cd (change directory)

Using CD <filename>
change the current
working directory

Created 2 files
(giri1 , giri2)

4. Open <filename>
Changed directory to
Using OPEN <filename> giri1 , initially it was
a giri directory
You can able to open the
directory which you
want.

5. CP

Using CP <source file> <destination file>


You can copy text file

CP <source file> <destination file>


(Using this command you can copy text CREATING DIRECTORIES

files into a directory)


COPYING DIRECTORIES

Note : cp -r <source dir> <destination dir> COPYING TEXT FILES


INTO DIRECTORIES
(It copy directory into another directory)

This is because typing mistake in


command used mkdie instead mkdir

6. Vi used for edit mode


7. Cat <filename>

Cat command print the


content of a file.

GIRI
To edit any text file we have to remember these things;

Vi Edit mode
Cat Read text file
Esc + dd Delete the text
Ecs + shift + ; To come out from edit mode
Wq Saving purpose, write and quite the file
STEPS TO CREATE A TEXT FILE:

1. In command prompt type vi abc.txt


2. Click on i keybord
3. Then now start writing something
4. Then click esc + shift + ;
5. Now give wq command
Now text file edited

8. LS

LS command used to lists


the names of files in a
particular unix directory.

Note: Carefully observe


how we changed
directories.

Task: check some other


lists command.
Ex: ls -l, ls -lrt etc.,

9. rm

It remove/delete entire
from system.
rm abc.txt

GIRI
10. MV (Move command. It used to move a file/directory into another destination file.) try…
11. Chmod -w <filename>

12. TOP

13.KILL
KILL USING PID

GIRI
1.ORACLE DATABASE INSTALLATION GUIDE

. 1 2

3 3

GIRI
NOW

1. Open V38894-01_2of2. Follow this path: database → stage → components → copy all those files.
2. Now Open V38894-01_1of2. Follow this path: database → stage → components → past all copied files here.

Now run V38894-01_1of2 extension file..

Procedure to setup:

1. Click on NEXT
2. A pop up come Click on YES
3. Click on NEXT
4. Check box: create and configure a database
5. Select : Desktop class
6. Try to create with a new user.
7. Provide administrative password and confirm
8. Some loads and click on INSTALL.

SQL DEVELOPER SETUP

1
Search for ORACLE
SQL DEVELOPER

GIRI
You need to download : java sdk 8

Now browse java file and provide path…like: C:\Program Files\Java\jdk1.8.0_202\bin\java.exe

Technical terms:
• Net Listener
• SID
• Service name
• Container database
• Pluggable database
• Sql Plus
• Sql Developer

1. Net listener : A listener is configured with one or more listening protocol addresses, information about
supported services, and parameters that control its run-time behavior. The listener configuration is stored in a
configuration file named listener.ora.
Because all of the configuration parameters have default values, it is possible to start and use a listener with no
configuration. This default listener has a name of LISTENER, supports no services on startup, and listens on the
following TCP/IP protocol address:
(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))

2. SID VS SERVICE NAME:

An SID is specific to a database, it is unique in an environment and 'points' to one, and only one,
database in that environment. A service name can be associated with one or more SIDs; think about a
RAC environment where each instance is uniquely named yet all can be accessed through the
SERVICE_NAME:
SID SERVICE_NAME
bob1 bob
bob2 bob
bob3 bob

GIRI
Through the 'magic' of the tnsnames.ora file all four of those SIDs can be associated with the
SERVICE_NAME bob, and if load balancing is configured, the listener will 'balance' the workload across
all four SIDs. This doesn't stop you from connecting to bob1 all of the time if you want to, you just
need to NOT use the SERVICE_NAME and use the SID.

Think of the SERVICE_NAME as a town and each SID as a house in that town; you can choose to drive
to town and see who's home (using the SERVICE_NAME) or you can make a direct trip to one of those
houses (using the SID).
SERVICE_NAME is a much more flexible choice. Dynamic registration uses the SERVICE_NAME and
allows one or more SIDs to be serviced by that SERVICE_NAME (no pun intended).
If you run ''lsnrctl services' you'll see how the SERVICE_NAME and SID relate:
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))

3. CONTAINER DATABASE VS PLUGGABLE DATA

Refer : https://www.databasestar.com/oracle-pdb/

4. SQL PLUS

SQLPlus is an interactive and batch query tool that is installed with every Oracle Database Server or Client
installation. It has a command-line user interface, a Windows Graphical User Interface (GUI) and the I sql
Plus web-based user interface.

SQL*Plus has its own commands and environment, and it provides access to the Oracle Database. It
enables you to enter and execute SQL, PL/SQL, SQL*Plus and operating system commands to perform the
following:

• Format, perform calculations on, store, and print from query results
• Examine table and object definitions
• Develop and run batch scripts
• Perform database administration

Refer : https://docs.oracle.com/cd/B14117_01/server.101/b12170/ch1.htm

GIRI
5. SQL DEVELOPER
Oracle SQL Developer is a free, integrated development environment that simplifies the development and
management of Oracle Database. Java powered application for Windows, OS X, and Linux with + 5 Million
users.
• Full featured PL/SQL IDE
• Database administration
• Complete Data Modelling Solution
• 3rd party DBMS migrations to Oracle
• Migrate Oracle On-Premises to Oracle Cloud

2.CONNECTING WITH DATABASE

Procedure for connecting connection


1. Click on +
2. Give connection name any..
3. Provide username and password
4. Check your host , port and service name in tnsnames.ora
5. Test and connect

GIRI
tnsnames.ora file looks like this…

3.CREATE A TABLE

Query for creating a sample table:


CREATE TABLE Persons (
PersonID int, Create a table
LastName varchar(10),
FirstName varchar(10)
);
Insert values
Insert into persons values (10,‘nagesh’,‘giri’) into a table

Select * from persons Access table

You can check this created table in sql plus promt:


1. You need to commit (It is run in the sql developer)
2. Then run Select * from persons in sql plus promt
3. Rollback command : Delete rows which are not committed.

GIRI
4. COMMANDS TO KNOW

1. Shutdown;
2. Startup;
3. Startup mount;
4. Shutdown immediate;
5. Shutdown abort;
6. Show con_name;
7. Show pdbs;
8. tnsping <service name>
9. lsnrctl
10. lsnrctl start
11. lsnrctl status
12. show user;
13. alter database open;
14. alter database mount;
15. alter pluggable database <pdb_name> open;
16. alter session set container = <pdb_name>

Shutdown [Normal]: Normal database shutdown proceeds with the following conditions:
• No new connections are allowed after the statement is issued.
• Before the database is shut down, the database waits for all currently connected users to
disconnect from the database.

Shutdown Immediate:

Use immediate database shutdown only in the following situations:

• To initiate an automated and unattended backup


• When a power shutdown is going to occur soon
• When the database or one of its applications is functioning irregularly and you cannot contact
users to ask them to log off or they are unable to log off

Immediate database shutdown proceeds with the following conditions:

• No new connections are allowed, nor are new transactions allowed to be started, after the
statement is issued.
• Any uncommitted transactions are rolled back. (If long uncommitted transactions exist, this
method of shutdown might not complete quickly, despite its name.)
• Oracle Database does not wait for users currently connected to the database to disconnect. The
database implicitly rolls back active transactions and disconnects all connected users.

The next startup of the database will not require any instance recovery procedures.

GIRI
Shutdown transactional:

Transactional database shutdown proceeds with the following conditions:


• No new connections are allowed, nor are new transactions allowed to be started, after the
statement is issued.
• After all transactions have completed, any client still connected to the instance is disconnected.
• At this point, the instance shuts down just as it would when a SHUTDOWN
IMMEDIATE statement is submitted.
The next startup of the database will not require any instance recovery procedures.
A transactional shutdown prevents clients from losing work, and at the same time, does not
require all users to log off.

Shutdown abort:
You can shut down a database instantaneously by aborting the database instance. If possible, perform
this type of shutdown only in the following situations:
The database or one of its applications is functioning irregularly and none of the other types of shutdown
works.
• You need to shut down the database instantaneously (for example, if you know a power shutdown is
going to occur in one minute).
• You experience problems when starting a database instance.
When you must do a database shutdown by aborting transactions and user connections, use one of the
following commands:
An aborted database shutdown proceeds with the following conditions:
• No new connections are allowed, nor are new transactions allowed to be started, after the statement
is issued.
• Current client SQL statements being processed by Oracle Database are immediately terminated.
• Uncommitted transactions are not rolled back.
• Oracle Database does not wait for users currently connected to the database to disconnect. The
database implicitly disconnects all connected users.
The next startup of the database will require automatic instance recovery procedures.

Startup:

show con_name; & show pdbs;

GIRI
tnsping <service_name>:

Lsnrctl & lsnrctl status & snrctl start

Alter pluggable database <pdname> open;

Try some commands your self….

GIRI
5.INTERNAL DB STRUCTURE

Datafiles: Data files are the operating system files that store the data within the database. The data is
written to these files in an Oracle proprietary format that cannot be read by other programs.

Refer: datafiles..

Control files: The control file must be available for writing by the Oracle database server whenever the
database is open. Without the control file, the database cannot be mounted and recovery is difficult.

The control file of an Oracle database is created at the same time as the database. By default, at least one
copy of the control file is created during database creation. On some operating systems the default is to
create multiple copies. You should create two or more copies of the control file during database creation.
You might also need to create control files later, if you lose control files or want to change particular
settings in the control files.

Refer: controlfiles..

Redo log files: The most crucial structure for recovery operations is the redo log, which consists of two or
more preallocated files that store all changes made to the database as they occur. Every instance of an Oracle
Database has an associated redo log to protect the database in case of an instance failure.
Refer: redologfiles..

ARCHIVELOG mode vs NOARCHIVELOG mode:

Article Body
ARCHIVELOG mode is a mode that you can put the database in for creating a backup of all transactions that
have occurred in the database so that you can recover to any point in time.
NOARCHIVELOG mode is basically the absence of ARCHIVELOG mode and has the disadvantage of not being
able to recover to any point in time. NOARCHIVELOG mode does have the advantage of not having to write
transactions to an archive log and thus increases the performance of the database slightly.
ARCHIVELOG MODE
Advantages
1. You can perform hot backups (backups when the database is online).
2. The archive logs and the last full backup (offline or online) or an older backup can completely recover the
database without losing any data because all changes made in the database are stored in the log file.

GIRI
Disadvantages
1. It requires additional disk space to store archived log files. However, the agent offers the option to purge the
logs after they have been backed up, giving you the opportunity to free disk space if you need it.
NO-ARCHIVELOG MODE
Advantages
1. It requires no additional disk space to store archived log files.
Disadvantages
1. If you must recover a database, you can only restore the last full offline backup. As a result, any changes made
to the database after the last full offline backup are lost.
2. Database downtime is significant because you cannot back up the database online. This limitation becomes a
very serious consideration for large databases.
Note: Because NOARCHIVELOG mode does not guarantee Oracle database recovery if there is a disaster, the
Agent for Oracle does not support this mode. If you need to maintain Oracle Server in NOARCHIVELOG mode,
then you must backup full Oracle database files without the agent using CA ARCserve Backup while the database
is offline to ensure disaster recovery.

6. DATAFILES RECOVERY

Scenario:

Issue: Datafile corrupted…(SYSTEM01.DBF)


1. Shutdown immediate;
2. Here we corrupted 2 files : a) STSTEM01.DBF
b) SYSAUX01.DBF
3. Backup these files before corrupting. And save in different file
4. Replace the 2 files manually.
5. Close the sqlplus and start again
6. login
7. startup;
8. alter database open;

GIRI
7.CONTROLFILE RECOVERY

1. shutdown immediate;
2. Copy CONTROLO2 file from FAST_RECOVERY_AREA
3. Past this file in oradata folder
4. Rename as CONTROL01
5. Open SQL plus
6. Login
7. Alter database mount;
8. Alter database open;

8.USER CREATION

1. Login
2. Try to create user : you will get error- ora:65096
3. Run: alter session set “_oracle_script” = true ;
4. create user GIRI identified by GIRI123 ;
5. grant dba to GIRI;
6. CONNECT GIRI
7. SHOW USER;
8. For dropping a database user: DROP USER GIRI;

GIRI
9. RMAN
RECOVERY MANAGER

RMAN

CONNECT TARGET /
LIST BACKUP;

BACKUP DATA

RMAN Database Recovery done only when your database ARCHIVELOG MODE is ON

Steps:
Shutdown immediate;

Startup mount;

ALTER DATABASE ARCHIVELOG;

ALTER DATABASE OPEN;

GIRI
Now shift to cmd for backup files:

RMAN

CONNECT TARGET /
BACKUP DATABASE;

STARTUP MOUNT;

BACKUP DATABASE;

BACKUP DATA

Steps to Recovery Database:


RMAN

CONNECT TARGET /

STARTUP MOUNT;

RESTORE DATABASE;

After this open sql plus:

login

Startup;

Select * from dba_data_files;

GIRI
There is chance of getting an error : database note open
Try this.
alter database open;

If any file missing :

RECOVER DATAFILE 1;

if you getting this type error :

You need to do incomplete recover

RECOVER DATABASE UNTIL CANCEL;

TYPE : AUTO OR CANCEL In cmd

ALTER DATABASE OPEN RESETLOG;

Shutdown;

Login In SQL PLUS

Select * from v$database;

NOTE

GIRI
10. MEMORY MANAGEMENT

SQL*Plus: Release 12.1.0.1.0 Production on Mon Mar 13 19:29:24 2023


Copyright (c) 1982, 2013, Oracle. All rights reserved.

Enter user-name: SYS AS SYSDBA


Enter password: XXXXXXX

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> show parameter target;

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
archive_lag_target integer 0
db_big_table_cache_percent_target string 0
db_flashback_retention_target integer 1440
fast_start_io_target integer 0
fast_start_mttr_target integer 0
memory_max_target big integer 3216M
memory_target big integer 0
parallel_servers_target integer 128
pga_aggregate_target big integer 793M
sga_target big integer 2384M

SQL> show parameters memory_max_target;

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
memory_max_target big integer 3216M

SQL> alter system set memory_max_target = 3250 scope = spfile;

System altered.

SQL> shutdown immediate;


Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup;
ORACLE instance started.

Total System Global Area 3315400704 bytes


Fixed Size 2436752 bytes
Variable Size 1509949808 bytes
Database Buffers 1795162112 bytes
Redo Buffers 7852032 bytes
Database mounted.
Database opened.
GIRI
SQL> show parameters memory_max_target;

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
memory_max_target big integer 3176M

SQL> alter system set memory_max_target = 3250 M scope = spfile;

System altered.

SQL> SHUTDOWN IMMEDIATE;


Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> STARTUP;
ORACLE instance started.

Total System Global Area 3407261696 bytes


Fixed Size 2801576 bytes
Variable Size 1644167256 bytes
Database Buffers 1744830464 bytes
Redo Buffers 15462400 bytes
Database mounted.
Database opened.
SQL> show parameters memory_max_target;

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
memory_max_target big integer 3264M

GIRI
11.TELNET
Telnet, developed in 1969, is a protocol that provides a command line interface for communication with a
remote device or server, sometimes employed for remote management but also for initial device setup like
network hardware. Telnet stands for Teletype Network, but it can also be used as a verb; 'to telnet' is to
establish a connection using the Telnet protocol.

Telnet provides users with a bidirectional interactive text-oriented communication system utilizing a virtual
terminal connection over 8 byte. User data is interspersed in-band with telnet control information over
the transmission control protocol (TCP). Often, Telnet was used on a terminal to execute functions remotely.

The user connects to the server by using the Telnet protocol, which means entering Telnet into a command
prompt by following this syntax: telnet hostname port. The user then executes commands on the server by
using specific Telnet commands into the Telnet prompt. To end a session and log off, the user ends a Telnet
command with Telnet.

Telnet can be used to test or troubleshoot remote web or mail servers, as well as for remote access to MUDs
(multi-user dungeon games) and trusted internal networks.

NOTE: NOT RECOGNIZED

GIRI
GIRI
12.pfile vs spfile

Spfile refers to Server Parameter file(spfile$ORACLE_SID.ora). Server parameter files are binary files that
exist only on the server and are called from client locations to start up the database. Since spfile is a
binary file we cannot edit the file directly rather we need to use ALTER SYSTEM SET parameter
to modify/update the parameters.

You must have the SYSDBA or the SYSOPER system privilege to create spfile. You can execute this
statement before or after instance startup. However, if you have already started an instance using
spfile_name, you cannot specify the same spfile_name in this statement.

Pfile refers to Parameter file(init$ORACLE_SID.ora). Pfile is a text file created from spfile, used to get a
list of the current parameter setting being used by the database. We can easily edit the pfile using editor
like vi and applied to the database by creating spfile from the pfile.

You must have the SYSDBA or the SYSOPER system privilege to create pfile. We can execute this
statement either before or after instance startup.

PFILE PATH: D:\app\girinagesh5\admin\nagesh\pfile\init.ora


SPFILE PATH: D:\app\girinagesh5\product\12.1.0\dbhome_1\database\spfilenagesh

PROVIDING MEMORY SIZE AS 200MB

SQL*Plus: Release 12.1.0.1.0 Production on Tue Mar 14 20:17:26 2023


Copyright (c) 1982, 2013, Oracle. All rights reserved.

Enter user-name: sys as sysdba


Enter password:

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> ALTER SYSTEM SET SGA_MAX_SIZE = 200M SCOPE = SPFILE;


System altered.
(OR) ALTER SYSTEM SET SGA_TARGET = 20M SCOPE = SPFILE;

GIRI
SQL> SHUTDOWN IMMEDIATE;
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> STARTUP;
ORA-00823: Specified value of sga_target greater than sga_max_size

SQL> STARTUP PFILE= 'D:\app\girinagesh5\admin\nagesh\pfile\init.ora';


LRM-00109:could not open parameter file 'D:\app\girinagesh5\admin\nagesh\pfile\
init.ora'
ORA-01078: failure in processing system parameters

init.ora.23202371229

SQL> STARTUP PFILE = 'D:\app\girinagesh5\admin\nagesh\pfile\


init.ora.23202371229';

ORACLE instance started.

Total System Global Area 2484457472 bytes


Fixed Size 2820392 bytes
Variable Size 683673304 bytes
Database Buffers 1790967808 bytes
Redo Buffers 6995968 bytes
Database mounted.
Database opened.

SQL> create spfile from pfile =


"D:\app\girinagesh5\admin\nagesh\pfile\init.ora.23202371229";

create spfile from pfile = "D:\app\girinagesh5\admin\nagesh\pfile\init.ora.23202371229"


*
ERROR at line 1:
ORA-00972: identifier is too long

SQL> create spfile from pfile = 'D:\app\girinagesh5\admin\nagesh\pfile\


init.ora.23202371229';

File created.

SQL> shutdown immediate;


GIRI
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup;
ORACLE instance started.

Total System Global Area 2488635392 bytes


Fixed Size 2798928 bytes
Variable Size 721423024 bytes
Database Buffers 1744830464 bytes
Redo Buffers 19582976 bytes
Database mounted.
Database opened.
SQL>

GIRI
13. CREATE TABLESPACE

SQL> startup;
ORACLE instance started.

Total System Global Area 2488635392 bytes


Fixed Size 2798928 bytes
Variable Size 721423024 bytes
Database Buffers 1744830464 bytes
Redo Buffers 19582976 bytes
Database mounted.
Database opened.
Here for permanent tabslespace we have to use datafile clausess

SQL> ALTER SESSION SET "_ORACLE_SCRIPT" = TRUE;


Session altered.

SQL> CREATE USER TRNUSR IDENTIFIED BY TRNUSR;


User created.

SQL> GRANT DBA TO TRNUSR;


Grant succeeded.

SQL> CREATE TABLESPACE TRN1 DATAFILE 'TRN1DBFILE1.dbf' SIZE 5M ;


Tablespace created.

SQL> ALTER TABLESPACE TRN1 ADD DATAFILE 'TRN1DBFILE2.dbf' SIZE 5M ;

Tablespace altered.

SQL> ALTER USER trnusr DEFAULT TABLESPACE trn1;

User altered.

SQL> set lines 4000;

SQL> SELECT TABLESPACE_NAME, FILE_NAME, BYTES/1024/1024 MB FROM


DBA_DATA_FILES;

GIRI
SQL> CONNECT trnusr
Enter password: trnusr
Connected.
SQL> CREATE TABLE EMPLOYEE (ID INT, NAME VARCHAR(20));
Table created.

SQL> INSERT INTO EMPLOYEE VALUES (100,'giri');


1 row created.

SQL> COMMIT;
Commit complete.

SQL> INSERT INTO EMPLOYEE VALUES (200,'nag');


1 row created.

SQL> SELECT * FROM EMPLOYEE;


ID NAME
---------- --------------------
100 giri
200 nag

SQL> ROLLBACK;
Rollback complete.

SQL> SELECT * FROM EMPLOYEE;


ID NAME
---------- --------------------
100 giri

GIRI
14.SHOW PARAMETER

SQL> show parameter pfile;

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
spfile string
SQL> show parameter spfile;

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
spfile string

SQL> create spfile from pfile;

File created.

SQL> shutdown immediate;


Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup;
ORACLE instance started.

Total System Global Area 2488635392 bytes


Fixed Size 2798928 bytes
Variable Size 721423024 bytes
Database Buffers 1744830464 bytes
Redo Buffers 19582976 bytes
Database mounted.
Database opened.

SQL> show parameter pfile;

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
spfile string D:\APP\GIRINAGESH5\PRODUCT\12.
1.0\DBHOME_1\DATABASE\SPFILENA
GESH.ORA

SQL> show parameter spfile;

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
spfile string D:\APP\GIRINAGESH5\PRODUCT\12.
1.0\DBHOME_1\DATABASE\SPFILENA
GESH.ORA

GIRI
15.CONTROLFILE BACKUP USING RMAN

SQL*Plus: Release 12.1.0.1.0 Production on Wed Mar 22 15:59:47 2023

Copyright (c) 1982, 2013, Oracle. All rights reserved.

Enter user-name: SYS AS SYSDBA


Enter password:

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> shutdown immediate;


Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 2488635392 bytes


Fixed Size 2798928 bytes
Variable Size 721423024 bytes
Database Buffers 1744830464 bytes
Redo Buffers 19582976 bytes
ORA-00205: error in identifying control file, check alert log for more info

Cmd:
Microsoft Windows [Version 10.0.22000.1696]
(c) Microsoft Corporation. All rights reserved.

C:\Users\girin>rman

Recovery Manager: Release 12.1.0.1.0 - Production on Wed Mar 22 16:06:27 2023

Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved.

RMAN> connect target /

connected to target database: NAGESH (not mounted)

RMAN> restore controlfile from autobackup;

Starting restore at 22-MAR-23


using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=62 device type=DISK

recovery area destination: D:\app\girinagesh5\fast_recovery_area


database name (or database unique name) used for search: NAGESH
GIRI
channel ORA_DISK_1: AUTOBACKUP
D:\APP\GIRINAGESH5\FAST_RECOVERY_AREA\NAGESH\AUTOBACKUP\2023_03_20\O1_M
F_S_1131992890_L1JP325B_.BKP found in the recovery area
AUTOBACKUP search with format "%F" not attempted because DBID was not set
channel ORA_DISK_1: restoring control file from AUTOBACKUP
D:\APP\GIRINAGESH5\FAST_RECOVERY_AREA\NAGESH\AUTOBACKUP\2023_03_20\O1_M
F_S_1131992890_L1JP325B_.BKP
channel ORA_DISK_1: control file restore from AUTOBACKUP complete
output file name=D:\APP\GIRINAGESH5\ORADATA\NAGESH\CONTROL01.CTL
output file name=D:\APP\GIRINAGESH5\FAST_RECOVERY_AREA\NAGESH\CONTROL02.CTL
Finished restore at 22-MAR-23

RMAN> alter database mount;

Statement processed
released channel: ORA_DISK_1

RMAN> recover database;

Starting recover at 22-MAR-23


Starting implicit crosscheck backup at 22-MAR-23
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=62 device type=DISK
Crosschecked 7 objects
Finished implicit crosscheck backup at 22-MAR-23

Starting implicit crosscheck copy at 22-MAR-23


using channel ORA_DISK_1
Finished implicit crosscheck copy at 22-MAR-23

searching for all files in the recovery area


cataloging files...
cataloging done

List of Cataloged Files


=======================
File Name:
D:\APP\GIRINAGESH5\FAST_RECOVERY_AREA\NAGESH\ARCHIVELOG\2023_03_20\O1_MF
_1_10_L1K2JW6N_.ARC
File Name:
D:\APP\GIRINAGESH5\FAST_RECOVERY_AREA\NAGESH\ARCHIVELOG\2023_03_20\O1_MF
_1_11_L1K2KG7Q_.ARC
……………………………..
……………………………..
File Name:
D:\APP\GIRINAGESH5\FAST_RECOVERY_AREA\NAGESH\ARCHIVELOG\2023_03_22\O1_MF
_1_18_L1N5NVNP_.ARC
File Name:
D:\APP\GIRINAGESH5\FAST_RECOVERY_AREA\NAGESH\ARCHIVELOG\2023_03_22\O1_MF
_1_19_L1ONOTFC_.ARC

GIRI
File Name:
D:\APP\GIRINAGESH5\FAST_RECOVERY_AREA\NAGESH\AUTOBACKUP\2023_03_20\O1_M
F_S_1131992890_L1JP325B_.BKP

using channel ORA_DISK_1

starting media recovery

archived log for thread 1 with sequence 5 is already on disk as file


D:\APP\GIRINAGESH5\FAST_RECOVERY_AREA\NAGESH\ARCHIVELOG\2023_03_20\O1_MF
_1_5_L1HJ9YJJ_.ARC
archived log for thread 1 with sequence 6 is already on disk as file
D:\APP\GIRINAGESH5\FAST_RECOVERY_AREA\NAGESH\ARCHIVELOG\2023_03_20\O1_MF
_1_6_L1HQV083_.ARC
archived log for thread 1 with sequence 7 is already on disk as file
D:\APP\GIRINAGESH5\FAST_RECOVERY_AREA\NAGESH\ARCHIVELOG\2023_03_20\O1_MF
_1_7_L1JC7PQJ_.ARC
archived log for thread 1 with sequence 8 is already on disk as file
D:\APP\GIRINAGESH5\FAST_RECOVERY_AREA\NAGESH\ARCHIVELOG\2023_03_20\O1_MF
_1_8_L1JH72QV_.ARC
archived log for thread 1 with sequence 9 is already on disk as file
D:\APP\GIRINAGESH5\FAST_RECOVERY_AREA\NAGESH\ARCHIVELOG\2023_03_20\O1_MF
_1_9_L1JW879R_.ARC
archived log for thread 1 with sequence 10 is already on disk as file
D:\APP\GIRINAGESH5\FAST_RECOVERY_AREA\NAGESH\ARCHIVELOG\2023_03_20\O1_MF
_1_10_L1K2JW6N_.ARC
archived log for thread 1 with sequence 11 is already on disk as file
D:\APP\GIRINAGESH5\FAST_RECOVERY_AREA\NAGESH\ARCHIVELOG\2023_03_20\O1_MF
_1_11_L1K2KG7Q_.ARC
archived log for thread 1 with sequence 12 is already on disk as file
archived log file name=D:\APP\GIRINAGESH5\ORADATA\NAGESH\REDO02.LOG thread=1
sequence=20…………..
……………………….
…………………………
media recovery complete, elapsed time: 00:00:04
Finished recover at 22-MAR-23

RMAN>

Sql side
SQL> startup;
ORACLE instance started.

Total System Global Area 2488635392 bytes


Fixed Size 2798928 bytes
Variable Size 721423024 bytes
Database Buffers 1744830464 bytes
Redo Buffers 19582976 bytes
Database mounted.
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

SQL>
GIRI
Cmd side
C:\Users\girin>rman

Recovery Manager: Release 12.1.0.1.0 - Production on Wed Mar 22 16:15:45 2023


Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved.

RMAN> connect target/

connected to target database: NAGESH (DBID=2745756737, not open)

RMAN> alter database open resetlogs;

using target database control file instead of recovery catalog


Statement processed

Sql side:
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 2488635392 bytes


Fixed Size 2798928 bytes
Variable Size 721423024 bytes
Database Buffers 1744830464 bytes
Redo Buffers 19582976 bytes
Database mounted.
Database opened.
SQL>
ORA-03113 END-0F-FILE ON COMMUNICATION
CHANNEL

SQL> sys as sysdba


……..
Connected to an idle instance
SQL> startup nomount

ORACLE instance started.

GIRI
Total System Global Area 2147483648 bytes
Fixed Size 2926472 bytes
Variable Size 1224738936 bytes
Database Buffers 905969664 bytes
Redo Buffers 13848576 bytes
SQL> alter database mount;
Database altered.
SQL> alter database clear unarchived logfile group 1;
Database altered.
SQL> alter database clear unarchived logfile group 2;
Database altered.
SQL> alter database clear unarchived logfile group 3;
Database altered.
SQL> shutdown immediate
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup

ORACLE instance started.


Total System Global Area 2147483648 bytes
Fixed Size 2926472 bytes
Variable Size 1224738936 bytes
Database Buffers 905969664 bytes
Redo Buffers 13848576 bytes
Database mounted.
Database opened.
SQL>

GIRI
16.EXPORT AND IMPORT SCHEMAS

Microsoft Windows [Version 10.0.22000.1696]


(c) Microsoft Corporation. All rights reserved.

C:\Users\girin>expdp directory=dp dumpfile=rajesh.dmp schemas=c##rajesh


Export: Release 12.1.0.1.0 - Production on Mon Mar 20 22:34:01 2023
Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved.

Username: sys as sysdba


Password:

Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

WARNING: Oracle Data Pump operations are not typically needed when connected to the root or seed of a container
database.

Starting "SYS"."SYS_EXPORT_SCHEMA_01": sys/******** AS SYSDBA directory=dp dumpfile=rajesh.dmp


schemas=c##rajesh
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 64 KB
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type SCHEMA_EXPORT/STATISTICS/MARKER
. . exported "C##RAJESH"."EMP" 5.492 KB 2 rows
Master table "SYS"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYS.SYS_EXPORT_SCHEMA_01 is:
D:\DATAPUMP\RAJESH.DMP
Job "SYS"."SYS_EXPORT_SCHEMA_01" successfully completed at Mon Mar 20 22:34:29 2023 elapsed 0 00:00:16

C:\Users\girin>impdp directory=dp dumpfile=rajesh.dmp


Import: Release 12.1.0.1.0 - Production on Mon Mar 20 22:44:16 2023
Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved.

Username: sys as sysdba


Password:

Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

GIRI
WARNING: Oracle Data Pump operations are not typically needed when connected to the root or seed of a container
database.

Master table "SYS"."SYS_IMPORT_FULL_01" successfully loaded/unloaded


Starting "SYS"."SYS_IMPORT_FULL_01": sys/******** AS SYSDBA directory=dp dumpfile=rajesh.dmp
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
. . imported "C##RAJESH"."EMP" 5.492 KB 2 rows
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type SCHEMA_EXPORT/STATISTICS/MARKER
Job "SYS"."SYS_IMPORT_FULL_01" successfully completed at Mon Mar 20 22:44:34 2023 elapsed 0 00:00:07

C:\Users\girin>

SQL PLUS SIDE

SQL*Plus: Release 12.1.0.1.0 Production on Mon Mar 20 22:35:53 2023


Copyright (c) 1982, 2013, Oracle. All rights reserved.

Enter user-name: sys as sysdba


Enter password:

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> connect
Enter user-name: c##rajesh
Enter password:
Connected.
SQL> select * from emp;

ID NAME
---------- ----------
10 nagesh
13 giri

SQL> connect as sysdba


Enter user-name: Girinagesh123
Enter password:
Connected.
SQL> connect
Enter user-name: sys as sysdba
Enter password:
Connected.

GIRI
SQL> drop user c##rajesh cascade; AFTER EXPORT USER SCHEMA.
WE DROPED USER
User dropped.

SQL> connect
Enter user-name: c##rajesh
Enter password:
ERROR:
ORA-01017: invalid username/password; logon denied

Warning: You are no longer connected to ORACLE.

SQL> connect
Enter user-name: c##rajesh
Enter password:
After importing the dumpfile,
Connected.
Now I am able to get back the user
SQL> select * from emp;

ID NAME
---------- ----------
10 nagesh
13 giri

SQL>

IMPORT A TABLE TO ANOTHER USER

TASK: GET ACCESS OF EMP TABLE FROM C##RAJESH USER TO C##SURESH USER

C:\Users\girin>impdp directory=dp dumpfile=rajesh.dmp tables='emp' remap_schema='c##rajesh:c##rajesh'


Import: Release 12.1.0.1.0 - Production on Mon Mar 20 23:08:07 2023
Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved.

Username: sys as sysdba


Password:

Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
ORA-39002: invalid operation
ORA-39166: Object SYS.EMP was not found. UNDERSTAND EMP TABLE NOT
RELATED TO SYS USER/SCHEMA

GIRI
C:\Users\girin>impdp directory=dp dumpfile=rajesh.dmp tables='emp' remap_schema='c##rajesh:c##rajesh'
Import: Release 12.1.0.1.0 - Production on Mon Mar 20 23:08:54 2023

Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved.

Username: c##rajesh PROPER USER / PASSWORD


Password: GIVEN HERE

Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

WARNING: Oracle Data Pump operations are not typically needed when connected to the root or seed of a container
database.

Master table "C##RAJESH"."SYS_IMPORT_TABLE_01" successfully loaded/unloaded


Starting "C##RAJESH"."SYS_IMPORT_TABLE_01": c##rajesh/******** directory=dp dumpfile=rajesh.dmp
tables='emp' remap_schema='c##rajesh:c##rajesh'
Processing object type SCHEMA_EXPORT/TABLE/TABLE
ORA-39151: Table "C##RAJESH"."EMP" exists. All dependent metadata and data will be skipped due to
table_exists_action of skip
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type SCHEMA_EXPORT/STATISTICS/MARKER
Job "C##RAJESH"."SYS_IMPORT_TABLE_01" completed with 1 error(s) at Mon Mar 20 23:09:09 2023 elapsed 0
00:00:01

C:\Users\girin>impdp directory=dp dumpfile=rajesh.dmp tables='emp'


remap_schema='c##rajesh:c##suresh'

Import: Release 12.1.0.1.0 - Production on Mon Mar 20 23:09:44 2023


Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved.

Username: c##rajesh
Password:
Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

WARNING: Oracle Data Pump operations are not typically needed when connected to the root or seed of a container
database.
Master table "C##RAJESH"."SYS_IMPORT_TABLE_01" successfully loaded/unloaded
Starting "C##RAJESH"."SYS_IMPORT_TABLE_01": c##rajesh/******** directory=dp dumpfile=rajesh.dmp
tables='emp' remap_schema='c##rajesh:c##suresh'
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
. . imported "C##SURESH"."EMP" 5.492 KB 2 rows
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type SCHEMA_EXPORT/STATISTICS/MARKER
Job "C##RAJESH"."SYS_IMPORT_TABLE_01" successfully completed at Mon Mar 20 23:10:03 2023 elapsed 0 00:00:02

C:\Users\girin

GIRI
SQLPLUS SIDE

SQL> create user c##suresh identified by suresh123;

User created.

SQL> grant dba to c##suresh;

Grant succeeded.

SQL> grant create session to c##suresh;

Grant succeeded.

SQL> connect
Enter user-name: c##suresh
Enter password:
Connected.
SQL> connect
Enter user-name: sys as sysdba
Enter password:
Connected.
SQL> connect
Enter user-name: c##suresh
Enter password:
Connected.
SQL> select * from emp;
EMP TABLE IS CREATED BY C##RAJESH
ID NAME NOW YOU CAN ACCESS THAT SAME TABLE
---------- ---------- IN C##SURESH USER
10 nagesh
13 giri

SQL>

TASKS :
1) EXPORT TABLESPACE DATA INTO DUMPFILE…
2) IMPORT TABLES INTO ANOTHER TABLESPACE….
3) REMAP TABLE…..

GIRI
17.IMPORT A DUMPFILE REMOTE SYSTEM

SQL*Plus: Release 12.1.0.1.0 Production on Wed Mar 22 15:06:47 2023


Copyright (c) 1982, 2013, Oracle. All rights reserved.

Enter user-name: sys as sysdba


Enter password:

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> alter session set "_oracle_script" = true;


Session altered.

SQL> create user HARI identified by hari;


User created.

SQL> grant all privileges to hari;


Grant succeeded.

SQL> create directory giri as 'D:\data';


Directory created.

SQL> grant all privileges on directory giri to hari;


Grant succeeded.

Connected to HARI

SQL> create table HYD (name varchar(10),fname varchar(10));


Table created.

SQL> create table BANGALORE (name varchar(10),fname varchar(10));


Table created.

SQL> insert into hyd values ('adam','smith');


1 row created.

5 times inserted

SQL> insert into bangalore values ('smith','adam');


1 row created.

5 times inserted

SQL> select * from hyd;

GIRI
NAME FNAME
---------- ----------
adam smith
adam smith
adam smith
adam smith
adam smith
adam smith

6 rows selected.

SQL> select * from bangalore;

NAME FNAME
---------- ----------
smith adam
smith adam
smith adam
smith adam
smith adam
smith adam

6 rows selected.

SQL>

CMD SIDE

Microsoft Windows [Version 10.0.22000.1696]


(c) Microsoft Corporation. All rights reserved.

C:\Users\girin>expdp directory=giri dumpfile=harischema.dmp logfile=harilog.log


schemas=hari

Export: Release 12.1.0.1.0 - Production on Wed Mar 22 15:34:24 2023


Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved.

Username: sys as sysdba


Password:

Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit
Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

WARNING: Oracle Data Pump operations are not typically needed when connected to the
root or seed of a container database.

Starting "SYS"."SYS_EXPORT_SCHEMA_01": sys/******** AS SYSDBA directory=giri


dumpfile=harischema.dmp logfile=harilog.log schemas=hari

GIRI
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 128 KB
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type SCHEMA_EXPORT/STATISTICS/MARKER
. . exported "HARI"."BANGALORE" 5.531 KB 5 rows
. . exported "HARI"."HYD" 5.523 KB 5 rows
Master table "SYS"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYS.SYS_EXPORT_SCHEMA_01 is:
D:\DATA\HARISCHEMA.DMP
Job "SYS"."SYS_EXPORT_SCHEMA_01" successfully completed at Wed Mar 22 15:34:47
2023 elapsed 0 00:00:12

C:\Users\girin>

IMPORT

1. Create directory giri as "C:\Users\girin\Downloads\DATAPUMP"; (You can


create your own path..)
2. SAVE EXPORTED FILES IN DATAPUMP FOLDER
3. In cmd write:
IMPDP DIRECTORY=giri DUMPFILE=HARISCHEMA.DMP
LOGFILE=harilog.LOG REMAP_SCHEMA=HARI:SYS
4. Then check in sqlplus as: select * from hyd;
5. Select * from banga lore;

GIRI
18.SQL*LOADER

C:\Users\girin>sqlldr

SQL*Loader: Release 12.1.0.1.0 - Production on Thu Mar 23 12:22:44 2023


Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved.

Usage: SQLLDR keyword=value [,keyword=value,...]

Valid Keywords:

userid -- ORACLE username/password


control -- control file name
log -- log file name
bad -- bad file name
data -- data file name
discard -- discard file name
discardmax -- number of discards to allow (Default all)
skip -- number of logical records to skip (Default 0)
load -- number of logical records to load (Default all)
errors -- number of errors to allow (Default 50)
rows -- number of rows in conventional path bind array or between direct path data saves
(Default: Conventional path 64, Direct path all)
bindsize -- size of conventional path bind array in bytes (Default 256000)
silent -- suppress messages during run (header,feedback,errors,discards,partitions)
direct -- use direct path (Default FALSE)
parfile -- parameter file: name of file that contains parameter specifications
parallel -- do parallel load (Default FALSE)
file -- file to allocate extents from
skip_unusable_indexes -- disallow/allow unusable indexes or index partitions (Default FALSE)
skip_index_maintenance -- do not maintain indexes, mark affected indexes as unusable (Default
FALSE)
GIRI
commit_discontinued -- commit loaded rows when load is discontinued (Default FALSE)
readsize -- size of read buffer (Default 1048576)
external_table -- use external table for load; NOT_USED, GENERATE_ONLY, EXECUTE
columnarrayrows -- number of rows for direct path column array (Default 5000)
streamsize -- size of direct path stream buffer in bytes (Default 256000)
multithreading -- use multithreading in direct path
resumable -- enable or disable resumable for current session (Default FALSE)
resumable_name -- text string to help identify resumable statement
resumable_timeout -- wait time (in seconds) for RESUMABLE (Default 7200)
date_cache -- size (in entries) of date conversion cache (Default 1000)
no_index_errors -- abort load on any index errors (Default FALSE)
table -- Table for express mode load
date_format -- Date format for express mode load
timestamp_format -- Timestamp format for express mode load
terminated_by -- terminated by character for express mode load
enclosed_by -- enclosed by character for express mode load
optionally_enclosed_by -- optionally enclosed by character for express mode load
characterset -- characterset for express mode load
degree_of_parallelism -- degree of parallelism for express mode load and external table load
trim -- trim type for express mode load and external table load
csv -- csv format data files for express mode load
nullif -- table level nullif clause for express mode load
field_names -- field names setting for first record of data files for express mode load
dnfs_enable -- option for enabling or disabling Direct NFS (dNFS) for input data files (Default
FALSE)
dnfs_readbuffers -- the number of Direct NFS (dNFS) read buffers (Default 4)

PLEASE NOTE: Command-line parameters may be specified either by


position or by keywords. An example of the former case is 'sqlldr
scott/tiger foo'; an example of the latter is 'sqlldr control=foo
userid=scott/tiger'. One may specify parameters by position before
but not after parameters specified by keywords. For example,
'sqlldr scott/tiger control=foo logfile=log' is allowed, but
'sqlldr scott/tiger control=foo log' is not, even though the
position of the parameter 'log' is correct.

C:\Users\girin>

Task 1:
sample sqlloader control file

1)Save this text file in any location.

GIRI
Download a sample textfile have lots of lorem data size ~2mb
https://www.learningcontainer.com/download/sample-text-file/

2) create a table in sqlplus which you mensioned in the sqlldr control file
3)

4)run this query in sqlplus: select * from sample;

Task 2 : Export and Import through SQL*LOADER

GIRI
Create temporary tablespace

Establish remote connection


Target IP:
Wireless LAN adapter Wi-Fi:

Connection-specific DNS Suffix . :


IPv6 Address. . . . . . . . . . . : 2409:4070:401d:d51b:a795:2e53:65cf:7730
Temporary IPv6 Address. . . . . . : 2409:4070:401d:d51b:145:e9d0:75db:1d03
Link-local IPv6 Address . . . . . : fe80::ee35:8a89:4490:2c71%16
IPv4 Address. . . . . . . . . . . : 172.20.10.3
Subnet Mask . . . . . . . . . . . : 255.255.255.240
Default Gateway . . . . . . . . . : fe80::5057:8aff:fe08:c464%16
172.20.10.1

Ethernet adapter Ethernet 2:

Connection-specific DNS Suffix . :


Link-local IPv6 Address . . . . . : fe80::3ec9:4f01:dd21:868e%20
IPv4 Address. . . . . . . . . . . : 192.168.56.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0

Start OpenSSH services.

Target machine :
➢ SSH [email protected]

GIRI
C:\Windows\System32>ssh [email protected]
ssh: connect to host 172.20.10.4 port 22: Connection refused

ON Linux machine I have installed OpenSSH client and OpenSSH server components
➢ Sudo apt install openssh-client
➢ Sudo apt install openssh-server
➢ Systemctl status httpd

C:\Windows\System32>ssh [email protected]
The authenticity of host '172.20.10.4 (172.20.10.4)' can't be established.
ED25519 key fingerprint is SHA256:pwoqBCQFlvoMNA4EM0aogJzgeMrrwyKYyWorqTxli9U.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '172.20.10.4' (ED25519) to the list of known hosts.
[email protected]'s password:
Welcome to Ubuntu 22.04.1 LTS (GNU/Linux 6.5.0-45-generic x86_64)

* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage

194 updates can be applied immediately.


1 of these updates is a standard security update.
To see these additional updates run: apt list --upgradable

*** System restart required ***

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by


applicable law.

giri@ubuntu:~$ su -
Password:
root@ubuntu:~#

GIRI

You might also like