1z0-082 Cheatsheet
Oracle Database Administration I
Download free PDFSQL expressions, functions and dates
Select, filter and sort
- **SELECT** chooses expressions; **WHERE** filters rows. A select-list alias is usable in **ORDER BY**, but not in the same query block's WHERE clause. Quote aliases containing spaces or punctuation with double quotes.
- **DISTINCT** removes duplicate combinations across the entire select list. It is not applied independently to each column. **DUAL** supplies one row for evaluating expressions, functions and pseudocolumns.
- **ORDER BY** accepts column expressions, aliases and select-list positions. ASC is the default; each sort key has its own direction. Without ORDER BY, row order is not guaranteed.
- **NULLS LAST** is the ascending default; **NULLS FIRST** is the descending default. Character comparisons and ordering depend on collation; use UPPER or LOWER explicitly when case normalization is required.
- **LIKE** uses % for zero or more characters and _ for exactly one. For D followed by at least two characters, use D__%. **BETWEEN** includes both endpoints; IN tests membership in a list.
Expressions and null handling
- **NULL** means missing or unknown. Use IS NULL or IS NOT NULL; comparisons such as = NULL evaluate to unknown. WHERE retains only true conditions. Arithmetic with a null normally returns null.
- **Precedence**: multiplication and division precede addition and subtraction; equal arithmetic precedence evaluates left to right. Conditions apply NOT before AND before OR. Parentheses make the intended grouping explicit.
- **NVL(x, replacement)** substitutes for null; **NVL2(x, a, b)** chooses a when x is non-null and b otherwise. Keep return expressions compatible; convert a numeric value to text before substituting a message.
- **COALESCE** returns the first non-null expression. **NULLIF(a,b)** returns null when the expressions are equal, otherwise a. **CASE** expresses conditional values without changing the number of input rows.
Single-row functions and conversion
- **Single-row functions** return one result for each input row, can accept multiple arguments, can be nested, and can return a different datatype. The innermost function is evaluated first.
- **UPPER, LOWER, INITCAP** change case. **SUBSTR** extracts characters; a negative start counts from the end. **INSTR** finds a position. **REPLACE** substitutes strings; TRIM removes a specified single character from the ends.
- **CONCAT** takes two arguments; chain the || operator for more values. **ROUND** rounds numbers and **TRUNC** removes digits; negative precision operates left of the decimal point. MOD returns a remainder; CEIL rounds toward positive infinity and FLOOR toward negative infinity.
- **TO_CHAR** formats numbers or datetimes; **TO_DATE** parses character data using a date format; **TO_NUMBER** parses numeric text. Prefer explicit conversion to dependence on session NLS settings.
- **Number format models** control display rather than stored precision. A model without decimal places rounds the displayed value; insufficient digit positions produce # characters. FM suppresses format padding; quoted text adds literal words to date output.
Dates, time zones and intervals
- **DATE** stores date and time through seconds, not a display format. **TIMESTAMP** adds fractional seconds. NLS_DATE_FORMAT affects default conversion and display; it does not change stored date values.
- **SYSDATE** uses the database server's operating-system clock. **CURRENT_DATE** uses the session time zone. **SYSTIMESTAMP** includes fractional seconds and server time-zone information; CURRENT_TIMESTAMP uses the session time zone.
- **TIMESTAMP WITH TIME ZONE** preserves time-zone information. **TIMESTAMP WITH LOCAL TIME ZONE** normalizes storage to the database time zone and presents values in the session time zone. DBTIMEZONE and SESSIONTIMEZONE expose those settings.
- **Date arithmetic**: date + number and date - number return a date, with the number measured in days. Subtracting two DATE values returns days, possibly fractional. DATE '2019-01-01' avoids dependence on a session date format.
- **ADD_MONTHS** shifts calendar months; **MONTHS_BETWEEN** returns a month difference. LAST_DAY finds month end; NEXT_DAY finds the named weekday strictly after its input. TRUNC(date) removes the time portion by default.
- **INTERVAL YEAR TO MONTH** represents years and months; **INTERVAL DAY TO SECOND** represents days through fractional seconds. They store durations, not timestamps. Set leading-field precision large enough for the required duration.
Joins, aggregation and compound queries
Join patterns
- **INNER JOIN** returns matching rows. LEFT and RIGHT OUTER JOIN preserve the named side and null-extend unmatched rows; FULL OUTER JOIN preserves both sides. Multiple join predicates and multiple joined tables are supported.
- **Self join** references the same table as separate logical inputs, using distinct aliases to qualify each occurrence. It can be an inner, outer, equi- or non-equijoin; an index is not a syntax requirement.
- **ON** accepts general join conditions, including non-equality and range predicates. **USING** names matching columns for equality joins. NATURAL JOIN uses common column names automatically; schema changes can alter its meaning.
- **CROSS JOIN**, or a missing join predicate in comma syntax, forms a Cartesian product. Legacy Oracle outer joins use (+); ANSI syntax expresses full outer joins directly and is clearer for complex relationships.
- **Outer-join filters** in WHERE can discard null-extended rows. Put a condition in ON when it should restrict matching while preserving the outer side. Syntax alone does not guarantee a faster plan; access paths and optimizer estimates matter.
Groups and aggregate functions
- **WHERE** filters individual rows before grouping; **GROUP BY** forms groups; **HAVING** filters groups afterward. Nonaggregated selected expressions must be grouped. An aggregate used in HAVING need not appear in SELECT.
- **COUNT(*)** counts rows, including duplicates and rows with null columns. COUNT(expr) counts non-null expressions; COUNT(DISTINCT expr) counts distinct non-null values. To count missing prices, filter IS NULL and use COUNT(*).
- **SUM, AVG, MIN and MAX** ignore null inputs. AVG does not treat null as zero. MIN and MAX work with comparable character and date values as well as numbers. All-null input returns null for these functions; COUNT returns zero.
- **Ungrouped aggregation** returns one summary row; GROUP BY can return many. Supported nested aggregation, such as AVG(MAX(salary)) with grouping, summarizes group results; do not mix a final overall result with unrelated detail columns.
Subquery decisions
- **Scalar subquery** returns one column from at most one row: zero rows yields null, while more than one row raises an error. It can appear in expressions, WHERE and HAVING; a statement may contain several subqueries.
- **Single-row comparisons** use =, < or > with a single result. **IN**, **ANY** and **ALL** support multirow comparisons. EXISTS tests whether a subquery returns a row; correlated subqueries refer to an outer query.
- **NOT IN** is sensitive to nulls in its result set because comparisons can become unknown. Use a correctly correlated NOT EXISTS when testing absence and nulls are possible.
- **Aggregate comparisons**, such as a product price above the overall average, commonly use a subquery. UPDATE can assign values from scalar or multi-column subqueries; returned values must fit the target columns.
Set operators and final ordering
- **UNION** combines distinct rows; **UNION ALL** keeps duplicates; **INTERSECT** returns distinct common rows; **MINUS** returns distinct rows from the first query absent from the second. Reversing MINUS changes its meaning.
- **Corresponding select lists** need the same number of expressions and compatible datatype groups. Names may differ. A character expression and a numeric expression are not automatically reconciled across set operands.
- **Set duplicate checks** consider nulls when comparing rows; they do not simply discard null-containing rows. UNION ALL avoids duplicate elimination but still provides no guaranteed output ordering.
- **Final ORDER BY** sorts the complete compound result. Use output names or aliases from the first SELECT, or column positions. Parenthesize compound operations to make evaluation order explicit.
Tables, constraints and schema objects
Table definition and DML
- **INSERT, UPDATE and DELETE** change data without automatically committing. INSERT can supply null explicitly where allowed; an omitted column uses its default or null. Ordinary DEFAULT does not replace an explicit null.
- **CREATE TABLE AS SELECT (CTAS)** derives columns and rows from a query. A false predicate can create an empty table. Primary keys, unique keys, foreign keys and indexes are not generally copied; some direct-column NOT NULL constraints can be inherited.
- **SET UNUSED** hides a column quickly without immediately reclaiming its stored space. DROP UNUSED COLUMNS removes it physically. Dropped or unused columns are DDL changes and cannot be restored with transaction ROLLBACK.
- **DROP COLUMN** has dependency restrictions: partition keys cannot be dropped, and dependent constraints may require CASCADE CONSTRAINTS. An unused column still counts toward the table's column limit until physically removed.
- **DROP TABLE** removes the table's constraints and associated indexes; eligible objects may enter the recycle bin. Dependent views become invalid, while independent sequences and synonyms are not automatically dropped. PURGE bypasses recycle-bin recovery.
Integrity constraints
- **PRIMARY KEY** combines uniqueness and NOT NULL; one primary key can contain multiple columns. **UNIQUE** enforces distinct keys while allowing nulls under Oracle's null rules. A suitable existing index can support a unique or primary key constraint.
- **FOREIGN KEY** references a parent primary or unique key, not necessarily identically named columns. Nullable foreign keys can contain null. Without an ON DELETE action, referenced parent rows cannot be deleted while matching children remain.
- **ON DELETE CASCADE** deletes matching children; **ON DELETE SET NULL** preserves children by nulling the foreign key. A table may have several foreign keys. Composite keys require table-level constraint syntax.
- **CHECK** constrains values within the row; it cannot query another row or table. A condition evaluating to unknown can pass CHECK, so use NOT NULL separately when absence is forbidden. A column may have multiple checks.
- **DEFERRABLE** permits checking at transaction end when deferred; INITIALLY IMMEDIATE or INITIALLY DEFERRED sets the starting mode. SET CONSTRAINTS changes timing for deferrable constraints. DISABLED and DEFERRED are different states.
Views and controlled DML
- **Ordinary views** store a defining query, not a separate data segment. They can join objects across schemas. CREATE FORCE VIEW can preserve a definition with missing dependencies, but the view must become valid before use.
- **View DML** changes underlying table rows and is subject to updatability and base-table constraints. DISTINCT, grouping and aggregates prevent ordinary direct DML on those query results. Join views have additional key-preservation rules.
- **WITH CHECK OPTION** prevents inserts or updates through the view that would fall outside its predicate. It does not redefine query filtering or stop a permitted delete. WITH READ ONLY disallows DML through the view.
- **Omitted required columns** can make inserts through a view fail when base-table NOT NULL columns have no default. CREATE OR REPLACE VIEW preserves grants on the view; dropping the view does not remove base-table rows.
Indexes and access paths
- **Indexes** are independent schema objects maintained as relevant table values change. The optimizer may choose a table scan despite a matching index; an index-only plan can satisfy a query without reading the table.
- **B-tree indexes** suit many selective lookups; **function-based indexes** support indexed expressions. Descending indexes are treated as function-based indexes. A table and its index can have different owners and tablespaces when privileges permit.
- **INVISIBLE** indexes are maintained by DML but normally ignored by the optimizer. **UNUSABLE** indexes cannot serve normal access until rebuilt; unusability is distinct from invisibility and can affect DML when a constraint depends on the index.
- **Unique versus nonunique** is an index definition choice, not an ALTER toggle. Re-create an index when changing that property. Table updates may change several indexes or none, depending on which indexed values actually change.
Sequences, synonyms and database links
- **Sequences** generate values independently of transaction commit. NEXTVAL advances and CURRVAL reads the session's current value after NEXTVAL. Rollback does not return a number; cache loss and concurrent use can create gaps.
- **CYCLE** can reuse sequence values after a limit is reached. A sequence can supply multiple tables, and a column DEFAULT can use NEXTVAL. Users need the required sequence access; a default reference does not make the sequence part of the table.
- **Synonyms** are private or public alternate names for objects such as tables, views, sequences and packages. They do not grant object access. Private names are scoped to their schema; a synonym can reference another synonym.
- **Database links** initiate access from the local database to a remote target, for example table_name@link_name. A private link belongs to its creator; a public link is broadly visible locally. Fixed-user credentials identify the remote account, which can differ from the local user.
Architecture, instance control and diagnostics
Instance memory and processes
- **Database** means persistent files; **instance** means SGA memory plus background processes. A single instance normally opens one database. RAC permits several instances to open the same database; an instance can also run without a database mounted.
- **SGA** is shared: the database buffer cache holds block images, the shared pool holds shared SQL and metadata, and the redo log buffer holds change records. **PGA** is private process memory for work areas and process state.
- **DBWn** writes dirty buffers to datafiles; **LGWR** writes redo to online redo logs. COMMIT depends on durable commit redo rather than writing every changed data block. **CKPT** updates checkpoint information in control files and datafile headers.
- **SMON** performs instance recovery when needed. **PMON** detects failed processes and coordinates cleanup of their resources. **LREG** dynamically registers instance and service information with listeners; do not assign modern registration to PMON.
- **Dedicated server** handles one client connection. **Shared server** uses dispatchers: a dispatcher receives requests, places them on the common request queue, and sends responses from its response queue to the appropriate client. Shared servers execute queued requests.
Startup and shutdown states
- **NOMOUNT** reads initialization parameters, allocates the SGA and starts background processes. Control files are not yet opened. CREATE DATABASE and CREATE CONTROLFILE use this state.
- **MOUNT** opens the control files and identifies database files; ordinary datafiles and redo logs are not yet opened for user access. Many structural maintenance and recovery tasks require a mounted database.
- **OPEN** opens datafiles and online redo logs and makes the database available according to its open mode. A clean shutdown needs no instance recovery at the next startup.
- **SHUTDOWN NORMAL** waits for sessions to disconnect. **TRANSACTIONAL** refuses new transactions and connections, lets existing transactions commit or roll back, then disconnects sessions and closes cleanly.
- **SHUTDOWN IMMEDIATE** disconnects sessions and rolls back uncommitted work before clean closure. **ABORT** stops without normal cleanup; the next open performs instance recovery. Shutdown mode determines waiting and recovery behavior.
PFILE, SPFILE and memory settings
- **PFILE** is a text initialization file maintained externally. **SPFILE** is a server-managed binary parameter file. CREATE SPFILE FROM PFILE and CREATE PFILE FROM SPFILE convert between them; do not edit an SPFILE as text.
- **SCOPE=MEMORY** changes the running instance; **SPFILE** persists for a later startup; **BOTH** does both when the parameter is dynamic. With an SPFILE, BOTH is the default; with a PFILE, MEMORY is the default and the text file is not rewritten.
- **Static parameters** require a restart and an SPFILE-only change when using ALTER SYSTEM. Dynamic changes still need valid units, memory capacity and compatible settings. DB_CACHE_SIZE configures the standard block-size cache.
- **Nonstandard block sizes** require their matching DB_nK_CACHE_SIZE pool and enough SGA memory. Their cache sizes do not have to be greater or smaller than the standard cache. Operating-system block size need not match the Oracle block size.
Metadata, tools and diagnostics
- **Data dictionary** metadata is owned by SYS and maintained by Oracle. Use supported views rather than modifying base tables. USER_ shows owned objects, ALL_ shows accessible objects, DBA_ gives administrative scope, and CDB_ adds container scope.
- **Dynamic performance views (V$)** expose runtime and control-file information. V$TABLESPACE identifies tablespaces; DBA_TABLESPACES describes properties; DBA_DATA_FILES lists permanent files; DBA_FREE_SPACE reports free extents.
- **ADR** is a file-based diagnostic repository outside the database, rooted through DIAGNOSTIC_DEST. It supports multiple Oracle components and remains inspectable when the instance is down. Server and background processes can write trace files.
- **Alert log** records startup and shutdown, important administrative events, parameter information and significant errors such as corruption and deadlocks. It is not a complete audit of all user SQL or logins; detailed traces provide additional context.
- **DBCA** creates databases, templates and supported configurations; the database standard block size is chosen at creation. **EM Express** is a database-local web console that depends on an open database. **Cloud Control** centrally manages multiple targets through its management infrastructure.
Oracle Net and client tools
Connect descriptors and naming
- **Service name** identifies a logical database service; **SID** identifies an instance. One instance can offer multiple services, and a service can be served by multiple instances. A listener provides access to services rather than creating their database definitions.
- **Local naming** resolves an alias through the client's tnsnames.ora. A connect descriptor contains addresses such as HOST and PORT plus CONNECT_DATA such as SERVICE_NAME. Different aliases can point to the same service.
- **Easy Connect** uses a host, optional port and service without a tnsnames alias, such as //dbhost:1521/sales. **Directory naming** centralizes descriptors. sqlnet.ora configures naming-method order and other network behavior.
- **TNS_ADMIN** redirects network configuration lookup; it is not mandatory when default locations are used. Oracle Net Manager and Net Configuration Assistant configure network settings; lsnrctl controls and reports on listeners.
Listeners and connection availability
- **Dynamic registration** uses LREG. LOCAL_LISTENER identifies local listener addresses; a nondefault-port listener must be reachable through the configured address. An alias used for listener registration needs an address, not a database-service CONNECT_DATA section.
- **Static registration** defines instance information in listener.ora. lsnrctl services can show UNKNOWN for a statically registered instance because the listener does not learn its status dynamically. It does not by itself mean the database is unavailable.
- **Connect-time failover** tries another configured listener address when an attempt fails. **Client load balancing** distributes initial connection attempts among addresses. Neither guarantees recovery of an already executing transaction.
- **TAF** concerns eligible session failover after a connection failure and differs from connect-time retry. **Connection Manager (CMAN)** can route Oracle Net traffic through an intermediate host; source routing specifies the route through intermediaries.
SQL*Plus scripts and substitution
- **SQL*Plus** runs SQL, PL/SQL and its own client commands. @script.sql runs a script, and a shell invocation can connect and execute a script in one command. RMAN commands belong to the separate Recovery Manager utility.
- **&name** prompts if the substitution variable is undefined. **&&name** prompts once and defines the value for later reuse. DEFINE predefines values; UNDEFINE removes them. Substitution is textual and can supply columns, clauses or literals.
- **Script arguments** populate positional variables such as &1. Supply character and date quoting where the resulting SQL requires it. **SET VERIFY** shows old and substituted lines; it does not define values or suppress prompts.
- **DESCRIBE** displays an object's columns, datatypes and nullability, including views. It does not list every primary, foreign, unique and check constraint. Use dictionary views for full constraint definitions.
Storage, space management and transactions
Tablespaces, segments and files
- **Tablespace → segment → extent → block** is the logical allocation hierarchy. A tablespace maps to datafiles or tempfiles. An extent is contiguous within one file; a segment can span files in one tablespace, never several tablespaces.
- **Segments** store data for objects such as tables, indexes, undo and table clusters; a cluster segment can hold rows from multiple tables. Sequences and stored program definitions do not each need their own data segment.
- **SMALLFILE** permits multiple files; **BIGFILE** permits one large datafile or tempfile. Bigfile does not imply a fixed block size or that it currently exceeds every smallfile tablespace. AUTOEXTEND can grow an eligible file up to its limits.
- **Locally managed tablespaces** use bitmaps to track extent allocation. **ASSM** separately tracks free space within segments using bitmaps; dictionary extent management and manual segment free lists are older mechanisms.
- **OMF** lets Oracle name and manage files, using destinations such as DB_CREATE_FILE_DEST. AUTOEXTEND still needs physical storage and MAXSIZE headroom. Quotas control a user's allocation, not the filesystem's capacity.
Blocks, row storage and compression
- **Data blocks** contain a header, table and row directory information, free space and row data. Row pieces can occupy multiple blocks; free space need not be one contiguous area. Index-organized tables store row data within index structures.
- **Row chaining** splits a row that cannot fit in one block. **Row migration** moves an enlarged row when its original block lacks room, leaving a forwarding address. PCTFREE reserves space for growth of existing rows.
- **ASSM fullness categories** help locate blocks with appropriate available space for inserts. A block is not necessarily eligible merely because a short row could physically fit; allocation rules and reserved free space also matter.
- **ROW STORE COMPRESS BASIC** targets bulk/direct-path loading. **ROW STORE COMPRESS ADVANCED** supports compression with conventional DML for OLTP. Column-store compression targets different workloads and has platform and feature requirements.
- **Deferred segment creation** can create eligible empty objects as metadata without allocating their segments until needed. Related indexes and LOB storage are deferred with eligible tables. SEGMENT CREATION IMMEDIATE requests allocation at creation.
Reclaiming space and handling allocation failures
- **DELETE** removes rows and generates undo but normally leaves allocated segment space and its high-water mark. **TRUNCATE** is DDL, resets storage state and cannot be rolled back; storage retention depends on its options.
- **SHRINK SPACE** compacts eligible segments in an ASSM tablespace and can return space below the old high-water mark. Heap tables require row movement. **SHRINK SPACE COMPACT** performs compaction without the final high-water-mark adjustment and space release.
- **Online shrink** permits ordinary queries and DML during its online phase and maintains dependent indexes. It is subject to object restrictions and brief locking needs; it is not a universal fix for every chained row.
- **Resumable space allocation** suspends an enabled operation on eligible space errors until corrected or timed out. A session can suspend repeatedly. RESUMABLE_TIMEOUT controls waiting; DBA_RESUMABLE and the alert log help diagnose it.
- **Correct the actual limit**: increase a user quota for quota exhaustion; grow or add a file for tablespace exhaustion; free physical storage for disk exhaustion. Adding a datafile alone does not remove a user's quota limit.
- **Online datafile move** uses ALTER DATABASE MOVE DATAFILE and can preserve database access while relocating an eligible file. **DROP TABLESPACE ... INCLUDING CONTENTS AND DATAFILES** explicitly removes contents and files; consider dependencies and active use before dropping.
Transactions, undo and redo
- **Transaction** work starts with transactional operations such as DML or SELECT FOR UPDATE. COMMIT makes the work permanent; ROLLBACK undoes uncommitted work. A failed DML statement normally rolls back that statement rather than all earlier work.
- **SAVEPOINT** marks a position without committing. ROLLBACK TO undoes later work and removes later savepoints while leaving the transaction active. A full rollback undoes the whole transaction. Reusing a savepoint name replaces its prior position.
- **DDL** implicitly commits preceding work before execution and commits its own successful change afterward. CREATE INDEX and TRUNCATE cannot be undone with ROLLBACK TO. Avoid mixing DDL into work that must remain one rollback unit.
- **Undo** supports rollback, read consistency and transaction recovery; **redo** records changes needed to recover database blocks. Ordinary permanent-table DML generates both, and changes to undo blocks themselves generate redo.
- **Automatic undo management** uses UNDO_MANAGEMENT=AUTO. Each instance uses one active UNDO_TABLESPACE; other undo tablespaces may exist. One transaction uses one undo segment, while a segment can serve several transactions. Extents can be reused or added as space permits.
- **Active undo** cannot be overwritten while needed by uncommitted work. **UNDO_RETENTION** is a retention target for committed undo; RETENTION GUARANTEE protects unexpired undo even if new DML must fail for lack of space. Undo does not spill into SYSAUX.
Temporary data and temporary undo
- **Global temporary tables** have a persistent shared definition and session-private rows. ON COMMIT DELETE ROWS makes data transaction-scoped; ON COMMIT PRESERVE ROWS keeps it until session end. Their DML remains transactional.
- **TRUNCATE of a global temporary table** removes the issuing session's data. Other sessions do not see those rows merely because they have SELECT on the definition. Temporary storage is allocated as needed, not for every session at login.
- **Private temporary tables** keep their definition private to the session. ON COMMIT DROP DEFINITION gives transaction scope; ON COMMIT PRESERVE DEFINITION gives session scope. Their definition is temporary as well as their data.
- **TEMP_UNDO_ENABLED** directs supported temporary-table undo to temporary storage, reducing permanent undo and associated redo. Permanent-table undo still uses the undo tablespace. Temporary undo also supports temporary-table DML in supported read-only database use cases.
Security, privileges and data movement
Users, authentication and profiles
- **CREATE SESSION** permits login; object creation and access need separate privileges. Creating an allocated table needs CREATE TABLE and sufficient quota in its target tablespace, or UNLIMITED TABLESPACE. Temporary tablespaces do not use ordinary user quotas.
- **Password authentication** validates database credentials. **External authentication** maps an operating-system or other external identity to an appropriately defined database user. IDENTIFIED EXTERNALLY and the configured OS name mapping are distinct from granting the DBA role.
- **Administrative authentication** can use operating-system groups or a password file for authorized administrative privileges. REMOTE_LOGIN_PASSWORDFILE controls password-file use; EXCLUSIVE supports per-database administration and password updates.
- **Profiles** define password and resource rules: FAILED_LOGIN_ATTEMPTS, PASSWORD_LOCK_TIME, PASSWORD_LIFE_TIME and INACTIVE_ACCOUNT_TIME control account behavior. Day-based limits can use fractions for shorter periods.
- **PASSWORD_REUSE_TIME** and **PASSWORD_REUSE_MAX** work together to constrain reuse. CPU, session and idle limits restrict resource consumption rather than permanently locking the account. RESOURCE_LIMIT controls enforcement of profile resource limits, not password limits.
Privileges, roles and least privilege
- **System privileges** authorize operations such as CREATE TABLE; **object privileges** authorize operations such as SELECT on a particular table. Ownership supplies implicit rights on one's own objects. A synonym never substitutes for a privilege grant.
- **WITH ADMIN OPTION** lets a grantee grant or revoke the system privilege or role. **WITH GRANT OPTION** lets a user pass on an object privilege. Revoking an upstream object grant can cascade; system-privilege revocation does not cascade in the same way.
- **Roles** group system and object privileges and can contain other roles. Default roles determine initial enabled access; SET ROLE can enable permitted roles or disable roles for the session. Password protection is optional, not universal.
- **Least privilege** grants only needed operations, scopes access narrowly and removes unnecessary PUBLIC grants. Network ACLs restrict access through supported network packages. Auditing records activity; it does not itself revoke excessive access.
- **DBMS_PRIVILEGE_CAPTURE** records exercised privileges under database, role or condition-based policies. Generate and review results over a representative workload before removing unused grants. SYS activity and implicit ownership privileges are outside ordinary capture analysis.
Data Pump export and import
- **expdp / impdp** operate through server-side Data Pump jobs. **DIRECTORY objects** name server filesystem locations; grant required READ and WRITE access, and ensure operating-system permissions. A directory object does not create the physical folder.
- **Export modes** include full database, schema, table and tablespace scope. DIRECTORY, DUMPFILE and LOGFILE specify destinations; a directory prefix on an individual file can override the default directory for that file.
- **Master table** stores job state and metadata in the job owner's schema. PARALLEL limits potential parallel execution; it does not require every worker to be available before the job can start. FILESIZE and dump-file templates support multiple files.
- **Detach** leaves a job running and permits later ATTACH. **STOP_JOB** stops a restartable job while retaining its state; START_JOB resumes it when viable. **KILL_JOB** removes the job and prevents restart.
- **Import controls** select what to load: SCHEMAS and INCLUDE/EXCLUDE filter objects, REMAP_SCHEMA changes ownership, and TABLE_EXISTS_ACTION chooses SKIP, APPEND, TRUNCATE or REPLACE for existing tables. Know the chosen action before importing into populated schemas.
SQL*Loader and external tables
- **SQL*Loader** loads external records into database tables. Its **control file** describes record formats, fields, targets and load behavior; input data may be inline or in separate files. The log reports execution and counts.
- **Bad file** holds rejected records; **discard file** holds records excluded by selection conditions. **INSERT, APPEND, REPLACE and TRUNCATE** control handling of target data. Express mode derives common loading settings from a table and input file.
- **Conventional path** uses SQL inserts through the buffer cache. **Direct path** formats and writes database blocks more directly and has different concurrency, constraint and trigger restrictions. Choose the path according to supported object features and load needs.
- **External tables** expose server-side files through SQL so they can be filtered, transformed and joined without first loading ordinary table rows. They are not ordinary DML targets for updating or deleting source records.
- **ORACLE_LOADER** reads text-based external data. **ORACLE_DATAPUMP** reads Data Pump-format external files and can unload query results through external-table CTAS. DIRECTORY privileges and server filesystem access govern both approaches.