Lab Question: Oracle Database Architecture I. Simulate the situation a DBA will

Lab Question: Oracle Database Architecture I. Simulate the situation a DBA will find himself/herself in many times: he/she has been asked to take on management of a database that he/she has not seen before, and for which the documentation is woefully inadequate. Using either SQL Developer or SQL*Plus, write a series of queries that will begin to document the system. Following are some of the views that will help: describe each view and then query the relevant columns. To see the views, it will be necessary to connect as a user with high privileges, such as user SYSTEM. ■ V$DATABASE On what operating system is the database running? ■ V$CONTROLFILE Where is the controlfile? Is it multiplexed? ■ V$LOG, V$LOGFILE How many online log file groups are there? How many members are in each group, and what are they called? How big are they? ■ V$TABLESPACE, V$DATAFILE, DBA_DATA_FILES What tablespaces exist in the database? What datafiles are assigned to each tablespace? What are they called, and how big are they? Give the creation time. II. Opérations sur les Tablespaces 1. Taper la commande sqlplus pour lister tous les tablespaces disponibles et leurs statuts 2. Créer un tablespace TBSEXEMPLE dont le datafile est DATA1.DBF de 15 M avec la possibilité de s’étendre. Exemple: create tablespace nomTableSpace datafile ‘Chemin/nomFichier.DBF’ size 3G autoextend on Avec 'Chemin/nomFichier.DBF’ l’emplacement du fichier 3. Vérifier que votre tablespace a été ajouté à la liste des tablespaces 4. Ajouter un autre fichier physique DATA2.DBF de 10 M à votre tablespace TBSEXEMPLE. Exemple. alter tablespace nomTablesPace add datafile 'cheminFichier/fichier.dbf' ……. 5. Lister tous les tablespaces avec leurs fichiers physiques associés. 6. Vérifier à l’emplacement physique si les fichiers existent Modification d’un tablespace 1. Drop tablespace TablespaceName ;  Drop tablespace TBS1 2. Alter tablespace TablespaceName rename to TablespaceNewName ;  alter tablespace tbs1 rename to TBSEXEMPLE1; 3. alter tablespace TablespaceName drop datafile ‘chemin du datafile’  alter tablespace tbsexemple drop datafile 'C:data.dbf';; 4. alter database datafile 'Chemin' resize taille(entier) M|G|T  alter database datafile 'C:data.dbf' resize 200M; Libération de la mémoire 1. select sum(Bytes)/1024 from dba_free_space where tablespace_name='SYSTEM'; Cette commande donne la somme des trous sur le tablespace. 2. Pour récupérer l’espace libre d’un segment a. Alter table nomTable DEALLOCATE UNUSED; 3. Un utilisateur ayant le privilège d’admin peut créer des objets sur tous les tablespaces Exemple : create table Table1(id int primary key,nom varchar(25)) tablespace TBSEXEMPLE1; uploads/Sante/lab-1-architecture 1 .pdf

  • 35
  • 0
  • 0
Afficher les détails des licences
Licence et utilisation
Gratuit pour un usage personnel Attribution requise
Partager
  • Détails
  • Publié le Dec 13, 2021
  • Catégorie Health / Santé
  • Langue French
  • Taille du fichier 0.3713MB