oracle

Oracle: SQLplus Scripting

To show only data in SQLplus and no header or other stuff, enter the following:

SET NEWPAGE 0
SET SPACE 0
SET LINESIZE 80
SET PAGESIZE 0
SET ECHO OFF
SET FEEDBACK OFF
SET VERIFY OFF
SET HEADING OFF
SET MARKUP HTML OFF SPOOL OFF

Oracle: Resize Instance

In this example, the SGA will be resized to 6GB and the PGA to 2GB.

First, change the SPFile:

ALTER SYSTEM SET pga_aggregate_target = 2G SCOPE=SPFILE;
ALTER SYSTEM SET sga_target = 6G SCOPE=SPFILE;

Then, (optionally) export the SPFile to a PFile:

CREATE PFILE FROM SPFILE;

Finally, reboot the instance to activate the change:

SHUTDOWN IMMEDIATE;
STARTUP;

Tags:

Oracle: EXP

Export all Objects from an Account

Enter the account name insteand of {user}.

exp USERID=\'/ as sysdba\' FILE={user}.dmp FULL=N OWNER={user}

Oracle Errors

ORA-00257: archiver error. Connect internal only, until freed.

Oracle: List Accounts with Objects

To list all accounts (users) the objects (like tables), you can query them with:

SELECT DISTINCT OWNER FROM DBA_OBJECTS ORDER BY OWNER;

If you want to list all accounts, you can query them with:

SELECT USERNAME FROM ALL_USERS ORDER BY USERNAME;

Or, if you only want the DBAs:

SELECT USERNAME FROM DBA_USERS ORDER BY USERNAME;

SPFile and PFiles

Oracle read its parameters from a file called "SPFile". You can't change it directly as it's a binary file. Additionally, Oracle can read the parameters from "PFiles", which are regular text files.

Tags:
Syndicate content