Provide an example of a shell script which logs into SQLPLUS
as SYS, determines the current date, changes the date format
to include minutes & seconds, issues a drop table command,
displays the date again, and finally exits.



Provide an example of a shell script which logs into SQLPLUS as SYS, determines the current date, c..

Answer / Durg Singh

Here's an example shell script that does what you asked:nn```bashn#!/bin/shnexport ORACLE_SID=your_database_namenecho 'Connecting to database as SYS...' ; sqlplus / as sysdba << EOFndatenALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YY HH24:MI:SS';ndrop table your_table_name cascade;ndatenEOFnecho 'Exiting...' ; exit" Replace 'your_database_name' and 'your_table_name' with the actual database name and table name, respectively.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More DB Administration Interview Questions

what is difference between user managed backup and rman backup?

1 Answers   CTS,


what is rebuild index??

2 Answers   IBM, Sapient,


What is checkpoint?

3 Answers   Accenture,


Give two examples of how you might determine the structure of the table DEPT.

2 Answers  


what is ora 24313?what is the procedure to exclude that error?

1 Answers  


how can you find out if a table can be redefined?

1 Answers   Oracle,


how can a session indicate its interest in receiving alerts?

1 Answers   Oracle,


1. how do you delete duplicate rows in a table? 2. can you disable and enable primary key? 3. how do you move tables from one tablespace to another tablespace?????

2 Answers   Genpact,


Explain the use of setting GLOBAL_NAMES equal to TRUE.

1 Answers  


SUPPOSE AS A DBA YOU CREATED ONE USER BY DEFAULT HOW MANY PRIVILIZES WILL COME TO USER & WHERE CAN YOU SEE THAT PRIVILIZES.

4 Answers   Cognizant,


Can you tell me about your experience with the administration of COTS system..? Also, how do you set up seed data..?

0 Answers  


Which autogrowth database setting is good? : sql server DBA

1 Answers  


Categories