SQL Commands by Task
One of the most frustrating and time-consuming aspects of database administration, particularly for the novice DBA, is finding the proper command to accomplish a particular task. In Table 13.1, we have listed most common database administration tasks along with the SQL commands used to accomplish these tasks. The detailed syntax of each command is listed later in this chapter.
If You Want to... |
Use This Command |
Add a column/integrity constraint to a table |
ALTER TABLE |
Add a comment to the data dictionary about a column |
COMMENT |
Add a comment to the data dictionary about a table or view |
COMMENT |
Add a comment to the data dictionary about a snapshot |
COMMENT |
Add or remove a resource limit to or from a profile |
ALTER PROFILE |
Add/drop/clear redo log file group members |
ALTER DATABASE |
Add/rename datafiles |
ALTER TABLESPACE |
Allocate an extent for a cluster |
ALTER CLUSTER |
Allocate an extent for the table |
ALTER TABLE |
Allow/disallow writing to a table |
ALTER TABLE |
Allow/disallow writing to a tablespace |
ALTER TABLESPACE |
Back up the current control file |
ALTER DATABASE |
Begin/end a backup |
ALTER TABLESPACE |
Bring a rollback segment online/offline |
ALTER ROLLBACK SEGMENT |
Change a rollback segment’s storage characteristics |
ALTER ROLLBACK SEGMENT |
Change a snapshot log’s storage characteristics |
ALTER SNAPSHOT LOG |
Change a user’s default role |
ALTER USER |
Change a user’s default tablespace |
ALTER USER |
Change ... |
Get Oracle Database Administration: The Essential Refe now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.