Please see attached document for the full instruction for the assignment.
Lab Submission Tasks:
Part 1 -
Concepts
Using the URL provided in the ‘Resource’ section – review the following sections for this Lab submission and answer the questions below….
·
Starting RMAN: Overview;
·
Starting RMAN
without
a connection to a database;
·
Connecting to a database
without
a Recovery Catalog;
·
Connecting to a database
with
a Recovery Catalog;
1.
a.
What are the basic options available to a DBA when starting RMAN?
Type your
answer in the box provided
b.
How
would you
start RMAN?
Type your
answer in the box provided
Part 2 – Unlocking an Oracle account
Open your
first CMD window for performing SQLPLUS commands
….
--
Connect as
SYSTEM
SQLPLUS
Enter user-name:system
Enter password: (your SYSTEM password)
SQL>alter user SYSBACKUP account unlock;
User altered.
SQL>alter user SYSBACKUP identified by SYSBACKUP123;
User altered.
SQL> EXIT
--
Connect as
SYSBACKUP
and test that your ‘unlock’ worked and the password works
SQLPLUS
Enter user-name:SYSBACKUP
Enter password: (thepassword you just entered above)
SQL> EXIT
Provide screenshots of your SQLPLUS statements and results, paste into the box provided.
2.
Exit your first CMD window which was connected to SYSTEM and
reconnect to SQLPLUS as SYS as SYSDBA
Use the
show parameter recovery
command to show the settings of all recovery parameters.
The results show you three things:
o
Where the db_recovery_file destination is
o
The size of the db_recovery_file
o
Is the recovery_parallelism set on/off
Provide screenshots of your SQL
PLUS
statements and results, paste into the box provided.
3.
In your CMD window, connected as SYS as SYSDBA….
We need
to configure the
fast recovery
file destination and size.
o
Set the fast recovery file destination size to be
10G
using the following command
sqlplus>
alter system set db_recovery_file_dest_size=10G
o
Next,
set the file destination to be ‘C:\app\
yourname
\fast_recovery_area\orcl’.
(
Make sure you have created this folder on your laptop
)
sqlplus
>
alter system set db_recovery_file_dest=’c:\app\cpotter\fast_recovery_area\orcl’
o
Finally, r
un the
show parameter recovery
command again
to verify your changes
Provide screenshots of your SQL
PLUS
statements and results, paste into the box provided.
4.
In your CMD window, connected as SYS as SYSDBA….
o
Check if the database is in the archive mode by executing the
archive log list
command
o
Exit from this CMD window
Provide screenshots of your SQL
PLUS
statements and results, paste into the box provided.
5.
Open a
second
CMD window
and run
RMAN
--
Run RMAN and tell RMAN which 'target' database to connect to
rman target '"SYSBACKUP"' (
note the quotations – single/double/text/double/single
)
target database Password: (
enter password you created for SYSBACKUP in question 1
)
Provide screenshots of your
RMAN
statements and results, paste into the box provided.
6.
In your CMD window which is running RMAN (
see question 5
)
o
E
xecute the
shutdown immediate
command to shutdown the database
o
Then execute the
startup
mount
command (this prepares database for backup)
Provide screenshots of your
RMAN
statements and results, paste into the box provided.
7.
In your CMD window which is running RMAN (
see question 5
)
o
E
xecute the
backup database
command to create a backup
before
you change the archive log mode.
o
Next, u
se the command
List backup;
to list the backups
o
Next,
use the
delete backup;
command to delete the backups
o
Finally,
list your backups
again to ensure they were deleted
Provide screenshots of
all
your
RMAN
statements and results, paste into the box provided.
8.
In your CMD window which is running RMAN (
see question 5
)
o
Execute the
alter database archivelog
command to put the database in ARCHIVELOG mode
o
Next,
open the database
using
alter database open
command
o
Now, backup the database with archive log using
backup database plus archivelog
command
Provide screenshots of your
RMAN
statements and results, paste into the box provided.
9.
In your CMD window which is running RMAN (
see question 5
)
o
Enter the command
show all
to see the RMAN configuration parameters
o
Enter the command
show default device type
to see if
DISK
is set on (it is the default)
o
Use command
list backup summary
to see the files created by your ‘backup’ command in question 7
o
Execute the
RESTORE TABLESPACE
SYSTEM
VALIDATE
command to validate that the datafiles for the specified tablespace named ‘tableSpaceName’ can be restored. Take a screen shot of your work and paste it below. The VALIDATE parameter means that the restoration is not done, but it shows the restoration
could
be done.
o
Now we need to test that we can use our backup files to ‘recover’ our database. This is extremely important.
o
First,
s
hutdown
the database and then exit RMAN.
o
T
hen,
copy all of the physical files of the database
to a safe location outside of the Oracle file hierarchy.
Make sure to do so before the
se
steps
and once files have been
moved, d
elete the original files after you have taken the copy. (worst case file loss!!)
o
This is an example of the files that need to be moved.
![]()
Provide screenshots of your
RMAN
statements and results, paste into the box provided.
10.
Open a new CMD window, connect SYS as SYSDBA and run SQLPLUS
o
Now, once the database files have been deleted, t
ry to
startup
your database. (
HINT ---
It should
not
be able to start…)
o
Exit this CMD window
Provide screenshots of your
SQLPLUS
statements and results, paste into the box provided.
Open a new CMD window and use command -
RMAN target SYSBACKUP
o
Startup the database using RMAN with this command
RMAN> STARTUP NOMOUNT
o
It is time now to restore the
control file
from
our
backup.
To find the location of your control file --- look at the results you have pasted into question 8, when you used the command
BACKUP DATABASE PLUS ARCHIVELOG
– here is what some of your result should look like ….
Starting backup at 14-SEP-22
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00007 name=C:\APP\CPAVO\ORADATA\ORCL\EXAMPLE01.DBF
input datafile file number=00003 name=C:\APP\CPAVO\ORADATA\ORCL\SYSAUX01.DBF
input datafile file number=00001 name=C:\APP\CPAVO\ORADATA\ORCL\SYSTEM01.DBF
input datafile file number=00005 name=C:\APP\CPAVO\ORADATA\ORCL\UNDOTBS01.DBF
input datafile file number=00006 name=C:\APP\CPAVO\ORADATA\ORCL\USERS01.DBF
channel ORA_DISK_1: starting piece 1 at 14-SEP-22
channel ORA_DISK_1: finished piece 1 at 14-SEP-22
piece handle=C:\APP\CPAVO\PRODUCT XXXXXXXXXXDBHOME_1\DATABASE\0417NDFV_1_1 tag=TAG20220914T182255 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including
current control file
in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 14-SEP-22
channel ORA_DISK_1: finished piece 1 at 14-SEP-22
piece handle
=
C:\APP\CPAVO\PRODUCT XXXXXXXXXXDBHOME_1\DATABASE\0517NDGE_1_1
tag=TAG20220914T182255 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 14-SEP-22
o
Use the command (
note the ‘blue’ lines above from the backup command’ –
piece handle
is used in this next command
RMAN>
restore controlfile from "
C:\APP\CPAVO\PRODUCT XXXXXXXXXXDBHOME_1\DATABASE\0517NDGE_1_1
"
o
Once RMAN has restored your control file run the command
RMAN> alter database mount
(to remount the database)
o
Now issue the command
RMAN> restore database
o
Next issue the command
RMAN> recover database
o
Finally issue the command
RMAN> alter database open resetlogs
Now we make sure the database up and running properly after the recovery
Open a new CMD window, connect SYS as SYSDBA and run SQLPLUS
In SQLPLUS, use the following commands
1.
SQL> select name from v$database
2.
SQL> select open_mode from v$database
3.
SQL> select tablespace_name from dba_tablespaces
Provide screenshots of your
RMAN
statements and results, paste into the box provided.