Académique Documents
Professionnel Documents
Culture Documents
Is it compulsory that we need to give group names as oinstall and dba? Or can we give any other name?
They will define the memory allocation from physical memory to Oracle database
11g allows to set kernel parameter later whereas in 10g we need to do it before
It is a location which provides the oracle product information which are installed on a particular host
orainstRoot.sh will change the permissions for oraInventory and root.sh will create oratab file
7.When I am trying SQLPLUS, its throwing command not found error. How you will handle it?
8.Where you will set environment variables in linux? Why to set them?
We need to set in .bash_profile file. Setting them will help in easy access to commands
10.When trying to connect to the database, I am getting net service name is incorrectly specified
error. What is the reason?
ps ef | grep smon. Even though this is the generic command that is used, this is not the perfect answer
as it will give output even if instance is started. So the correct answer would be ps ef | grep oracle. In
the output, we need to see for processes which says LOCAL=NO which means someone connected to
the database from remote machine
Using oratab file. But this may not give perfect answer if manually created databases are not updated
15.How many databases are there in your environment and categorize them?
Tell any value between 70 to 100. Out of that say 35 are prod and rest are dev and test
17.How many servers are there in your project? Which platforms you are comfortable to work in?
Tell any value between 30 to 50. Platforms are all unix and windows flavours
No, we cannot
This is due to UNDO tablespace name mismatch between create database script and pfile. Once fixed,
problem will be resolved
ORACLE_BASE is the location where we can install oracle software and ORACLE_HOME is the database
home location
How to automate database startup during linux bootupbshut and dbstart scripts
We will delete them every 3 months except alert log. We will take backup of alertlog and will trim the
file
du sk*
28.While starting the database, I am getting END OF FILE ON COMMUNICATION CHANNEL error. You
are the only user connected to the database. What could be the reason for this?
If a particular mount point is full, in that case we will get that error
We have nearly 10 checkpoints which helps in making data permanent in different stages of transaction
**CLONING**
1. Take the backup of source database including pfile/spfile and password file.
6. connect to rman
*restore database;
*recover database;
1.Check if the primary database is using the password file or not. If not, then create one
2.Add the following parameters in the initialization parameter file of the primary database
prim.__db_cache_size=46137344
prim.__java_pool_size=4194304
prim.__large_pool_size=4194304
prim.__pga_aggregate_target=205520896
prim.__sga_target=239075328
prim.__shared_io_pool_size=0
prim.__shared_pool_size=167772160
prim.__streams_pool_size=8388608
*.audit_file_dest='/u01/home/oracle/admin/prim/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='/u01/app/oracle/oradata/prim/control01.ctl','/u01/app/oracle/oradata/prim/control02.
ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='prim'
*.diagnostic_dest='/u01/home/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=primXDB)'
*.db_recovery_file_dest='/u01/app/fra'
*.memory_target=444596224
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'
*.db_unique_name='prim'
*.log_archive_dest_1='location=use_db_recovery_file_dest valid_for=(ALL_LOGFILES,ALL_ROLES)
DB_UNIQUE_NAME=prim'
*.log_archive_dest_2='service=stnd valid_for=(ONLINE_LOGFILES,primARY_ROLE)
DB_UNIQUE_NAME=stnd'
*.log_archive_dest_state_1=enable
*.log_archive_dest_state_2=enable
3.Setup the connectivity (listener.ora and tnsnames.ora) for the primary and standby databases.
4.Add the following parameters in the initialization parameter file of the standby database
stnd.__db_cache_size=230686720
stnd.__java_pool_size=4194304
stnd.__large_pool_size=4194304
stnd.__pga_aggregate_target=268435456
stnd.__sga_target=394264576
stnd.__shared_io_pool_size=0
stnd.__shared_pool_size=146800640
stnd.__streams_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/stnd/adump'
# *.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='/u02/app/oracle/oradata/stnd/control01.ctl','/u02/app/oracle/oradata/stnd/control02.
ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='prim'
*.db_recovery_file_dest='/u01/app/fra'
*.db_recovery_file_dest_size=2070572032
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=stndXDB)'
*.log_archive_format='%t_%s_%r.dbf'
*.memory_target=660602880
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'
*.log_archive_dest_1='location=use_db_recovery_file_dest valid_for=(all_logfiles,all_roles)
db_unique_name=stnd'
*.db_unique_name='stnd'
*.db_file_name_convert='/u01/app/oracle/oradata/prim/','/u02/app/oracle/oradata/stnd/'
*.log_file_name_convert='/u01/app/oracle/oradata/prim/','/u02/app/oracle/oradata/stnd/'
*.standby_file_management=AUTO
*.FAL_SERVER='prim'
*.FAL_CLIENT='stnd'
*.log_archive_dest_state_1=enable
*.log_archive_dest_state_2=defer
5. Now copy the password file of the primary database orapwprim located at $ORACLE_HOME/dbs to
the standby server location $ORACLE_HOME/dbs and rename the file as orapwstnd
6. Now connect to the primary database as target database and standby database as auxiliary instance
through RMAN. Make sure that the primary database is open and the standby database is in nomount
stage (STARTED).
8. Once the duplication is completed, close the RMAN prompt and connect to the standby database
through SQL
*sql>
11.Now check if the managed recovery process (MRP) has been started on the standby database or not
12.On the primary database, perform a few log switches and check if the logs are applied to the standby
database
log_archive_dest_2=/u01/app/oracle/dest/redo VALID=FOR(ONLINE_LOGS,PRIMARY_ROLE)
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE;(To start
real-time apply, include the USING CURRENT LOGFILE)
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;(To stop Redo Apply)
**************RMAN********************
1.What is RMAN?
Recovery Manager (RMAN) is a utility that can manage your entire Oracle backup and recovery
activities.
2.What is the difference between using recovery catalog and control file?
When new incarnation happens, the old backup information in control file will be lost. It will be
preserved in recovery catalog.
No, The recovery catalog should not reside in the target database (database should be backed up),
because the database cant be recovered in the mounted state.
4.How do you know that how much RMAN task has been completed?
Both the commands command quering v$ and recovery catalog views. V$BACKUP_FILES or many of the
recovery catalog views such asRC_DATAFILE_COPY or RC_ARCHIVED_LOG.
The default is two times one for the actual command, the other for confirmation.
Crosscheck will be useful to check whether the catalog information is intact with OS level information.
This command only updates repository records with the status of the backups.
e.g. If user removes archived logs from disk with an operating system command, the repository still
indicates that the logs are on disk, when in fact they are not.
Validate command is to examine a backup set and report whether it can be restored.
RMAN scans all of the backup pieces in the specified backup sets and looks at the checksum to verify
that the contents are intact so that backup can be successfully restored if necessary.
Crosscheck command is to verify the status of backups and copies recorded in the RMAN repository
against media such as disk or tape. The crosscheck command only processes files created on the same
device type as the channel running crosscheck.
A differential backup, which backs up all blocks changed after the most recent incremental backup at
level 1 or 0
A cumulative backup, which backs up all blocks changed after the most recent incremental backup at
level 0
Cumulative backups are preferable to differential backups when recovery time is more important than
disk space, because during recovery each differential backup must be applied in succession. Use
cumulative incremental backups instead of differential, if enough disk space is available to store
cumulative incremental backups.
This is command for taking Level 0 backup.
12.You loss one datafile and DB is running in ARCHIVELOG mode. You have full database backup of 1
week/day old and dont have backup of this (newly created) datafile. How do you restore/recover file?
A status of expired means that the backup piece or backup set is not found in the backup destination.
A status of obsolete means the backup piece is still available, but it is no longer needed. The backup
piece is no longer needed since RMAN has been configured to no longer need this piece after so many
days have elapsed, or so many backups have been performed RMAN's retention configuration
determines when a backup piece becomes obsolete.
For hot backup, we have to put database in begin backup mode, then take backup.
RMAN Executables
Sercer process
Channels
Target database
A channel is an RMAN server process started when there is a need to communicate with an I/O device,
such as a disk or a tape. A channel is what reads and writes RMAN backup files. It is through the
allocation of channels that you govern I/O characteristics:
Type of I/O device being read or written to, either a disk or an sbt_tape
Because RMAN manages backup and recovery operations, it requires a place to store necessary
information about the database. RMAN always stores this information in the target database control
file. You can also store RMAN metadata in a recovery catalog schema contained in a separate database.
The recovery catalog schema must be stored in a database other than the target database.
A logical grouping of backup files the backup pieces that are created when you issue an RMAN
backup command. A backup set is RMANs name for a collection of files associated with a backup. A
backup set is composed of one or more backup pieces.
Incremental backups that only copy data blocks that have changed since the last backup.
Tablespaces are not put in backup mode, thus there is noextra redo log generation during online
backups.
RMAN>list backup;
21.In catalog database, if some of the blocks are corrupted due to system crash, How will you recover?
22.How do you enable the autobackup for the controlfile using RMAN?
23.How do you identify what are the all the target databases that are being backed-up with RMAN
database?
You dont have any view to identify whether it is backed up or not. The only option is connect to the
target database and give list backup this will give you the backup information with date and timing.
24.How do you identify the block corruption in RMAN database? How do you fix it?
Using the above statement You recover the corrupted blocks. First check whether the block is corrupted
or not by using this command
file# block
2 507
conn to Rman
To recover the block use this command
25.How do you clone the database using RMAN software? Give brief steps? When do you use crosscheck
command?
Check whether backup pieces proxy copies or disk copies still exist.
1) Duplicate
2) Restore.
26.List some of the RMAN catalog view names which contain the catalog information?
RC_DATABASE_INCARNATION RC_BACKUP_COPY_DETAILS
RC_BACKUP_CORRUPTION
RC_BACKUP-DATAFILE_SUMMARY
Steps to be followed:
2) At catalog database create one new user or use existing user and give that user a
recovery_catalog_owner privilege.
a) export ORACLE_SID
5) register database;
28.What is the difference between physical and logical backups?
In Oracle Logical Backup is which is taken using either Traditional Export/Import or Latest Data Pump.
Where as Physical backup is known when you take Physical O/s Database related Files as Backup.
RAID1: Mirroring
30.How to enable Fast Incremental Backup to backup only those data blocks that have changed?
An auxiliary channel is a link to auxiliary instance. If you do not have automatic channels configured,
then before issuing the DUPLICATE command, manually allocate at least one auxiliary channel within the
same RUN command.
33.How do you use the V$RECOVERY_FILE_DEST view to display information regarding the flashrecovery
area?
Use a fast recovery without restoring all backups from their backup location to the location specified
inthe controlfile.
RMAN considers backups of datafiles and control files as obsolete, that is, no longer needed for
recovery, according to criteria that we specify in the CONFIGURE command. We can then use the
REPORT OBSOLETE command to view obsolete files and DELETE OBSOLETE to delete them .
For ex : we set our retention policy to redundancy 2. this means we always want to keep at least 2
backup, after 2 backup, if we take an another backup oldest one become obsolete because there is 3
backup and we want to keep 2. if our flash recovery area is full then obsolete backups can be overwrite.
A status of "expired" means that the backup piece or backup set is not found in the backup destination
or missing .Since backup info is hold in our controlfile and catalog . Our controlfile thinks that there is a
backup under a directory with a name but someone delete this file from operating system. We can run
crosscheck command to check if these files are exist and if rman found a file is missing then mark that
backup record as expired which means is no more exists.