| | Cannot connect to database when running irca.sh
If you get the following error message:
ERROR: Failed to establish database connection due to the following error:
ORA-01017: invalid username/password; logon denied
when trying to run irca.sh to create schemas in SOA backend database it may be because remote_login_passwordfile parameter is not set. Run the following command from sqlplus:
SQL> alter system set ... | |  More... 04/04/08 | | | | | | | | |
|
|
|
|
| | How to enable auditing in Oracle database
For Oracle versions prior to 9 set audit_trail parameter in ini file i.e.:
audit_trail = DB
For Oracle 9 and later:
alter system set audit_trail = DB;
If you want to audit a specific user run the following:
audit alter table, select table, insert table, update table, delete table, grant table, grant procedure by USERNAME;
To ... | | More... 11/08/07 | | | | | | | | |
|
| | View what sql user is running
-- View SQL text for user session
-- Replace DB_USER with the actuall database username and os_user with the OS username.
select a.sql_text, b.username, b.osuser, b.logon_time, b.program,
b.machine, b.sid, b.serial#
from v$sql a, v$session b
where a.address = b.sql_address
and b.username = 'DB_USER'
and b.osuser = 'os_user'; | | More... 11/01/07 | | | | | | | | |
|
| | How to find out character set for a database
SQL> select * from v$nls_parameters;
PARAMETER
----------------------------------------------------------------
VALUE
----------------------------------------------------------------
NLS_CHARACTERSET
US7ASCII
...
| | More... 10/25/07 | | | | | | | | |
|
| | Make backupset unavailable in RMAN
This may be useful when you want to restore archive logs which were backed up more than once. These archivelog files will be included in multiple backup sets in the RMAN catalog, by default it will attempt to restore from the latest backup. But what if at the moment you ... | |  More... 07/25/07 | | | | | | | | |
|
| | Find segments with corrupted block from alert log with ORA-01578
1. Get the list of corrupted blocks
grep 'ORA-01578' alert_DB.log | sort -u > tmp.txt
2. Generate SQL script to find segments with corrupted blocks
cat tmp.txt | awk '{ printf("%s %s\n", $8, $11); }' | \
awk -F\, '{ printf ("%s %s\n", $1, $2); }' | \
awk -F\) '{ printf("%s\n", $1); }' | ... | | More... 07/11/07 | | | | | | | | |
|
| | How to save (export) table stats
Before analyzing a table you may want to save the old stats (i.e. if the table is very large and analyzing takes a while just to have a backup of previous stats). Here's the syntax:
SQL> exec dbms_stats.export_table_stats('SCHEMA_OWNER', 'TABLE_NAME', NULL, 'STATS_TABLE_NAME', 'STATID', TRUE, 'SCHEMA_OF_STATS_TABLE'); | |  More... 06/27/07 | | | | | | | | |
|
Page 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 >> |