6) How will you list all the tablespaces and their status in a database?
Select tablespace_name,status from dba_tablespaces;
7) How will you find the system wide 1) default permanent tablespace, 2) default temporary tablespace 3) Database time zone? Select property_name,property_value from database_properties where property_name like %DEFAULT%; 8) How will you find the current users who are using temporary tablespace segmen ts? V$TEMPSEG_USAGE 9) How will you convert an existing dictionary managed permanent tablespace to t emporary tablespace? Not possible 10) Is media recovery requird if a tablespace is taken offline immediate? Not required 11) How will you convert dictionary managed tablespace to locally managed tables pace? Exec dbms_space_admin.tablespace_migrate_to_local(TABLESPACE_NAME); 12) If you have given command to make a tablespace offline normal, but its not happening.it is in transactional read-only mode. How will you find which are the transactions which are preventing theconversion? By looking at queries using by those SID (u can get script from net). I suspect question is not clear. 13) If you drop a tablespace containing 4 datafiles, how many datafiles will be droped at a time by giving a single drop tablespace command? All datafiles 14) If database is not in OMF,How will you drop all the datafiles of a tablespac e without dropping the tablespace itself? Alter database datafile PATH offline drop; 15) How will you convert the locally managed tablespace to dictionay managed?Wha t are the limitations? Exec dbms_space_admin.tablespace_migrate_from_local(TABLESPACE_NAME); SYSTEM tablespace should be dictionary 16) Which parameter defines the max number of datafile in database? Db_files and MAXDATAFILES in control file 17) Can a single datafile be allocated to two tablespaces?Why? No. because segments cannot space multiple datafiles 18) How will you check if a datafile is Autoextinsible? Select autoextensible from dba_data_files where file_name=; 19) Write command to make all datafiles of a tablespace offline without making t he tablspace offline itself? Alter database datafile PATH offline normal; 20) In 10g, How to allocate more than one temporary tablespace as default tempor ary tablespace to a single user? By using temporary tablespace group 21) What is the relation between db_files and maxdatafiles parameters? Both will restrict no of datafiles in the database 22) Is it possible to make tempfiles as read only? yes 23) What is the common column between dba_tablespaces and dba_datafiles? Tablespace_name 24) Write a query to display the names of all dynamic performance views? Select table_name from dictionary where table_name like v$%; 25) Name the script that needs to be executed to create the data dictionary view s after database creation? Catalog.sql 26) Grant to the user SCOTT the RESTRICTED SESSION privilege? SQL> grant restricted session to scott; Grant succeeded. 27) How are privileged users being authenticated on the database you are current ly working on? Which initialization parameter would give me this information? Question not clear 28) Which dynamic performance view gives you information about all privileged us ers who have been granted sysdba or sysoper roles? Query the view? SQL> desc v$pwfile_users 29) What is the purpose of the DICTIONARY table? To know data dictionary and dynamic performance view names 30) Write a query to display the file# and the status of all datafiles that are offline? Select file#,status from v$datafile where status=OFFLINE;