|
| | Generate a script to create users from exp dump file
I usually run full export with ROWS=N on a development database before refreshing it from production, that way I can always re-create the users and schema objects from that exp dump file.
$ grep -i 'create role' [dump_file] > create_users.sql
$ grep -i 'create user' [dump_file] >> create_users.sql
$ grep -i '^grant' [dump_file] ... | | More... 10/26/06 | | | | | | | | |
|
| | Syntax to create materialized view log
Quick syntax reference for creating a materialized view log (snapshot log) in Oracle database:
create materialized view log on SCHEMA_NAME.TABLE_NAME
tablespace TABLESPACE_NAME
-- with rowid;
| | More... 10/24/06 | | | | | | | | |
|
| | Syntax to create an Oracle snapshot
A quick referense for creating a snapshot (materialized view) in Oracle database:
create materialized view SCHEMA_NAME.SNAPSHOT_NAME
tablespace TABLESPACE_NAME
using index tablespace TABLESPACE_NAME
refresh FAST start with sysdate next sysdate + 1/48
-- with rowid
as
select * from SCHEMA_NAME.TABLE_NAME@DATABASE_LINK;
| | More... 10/24/06 | | | | | | | | |
|
| | Generate syntax for snapshots with rtrim for char columns
Script to generate column list with rtrim function for char type columns for Oracle snapshot creation, these columns will be converted to varchar2 on the snapshot site. Run from sqlplus on the master site (where the snapshot logs are).
set head off pagesize 0
select case
when data_type = 'CHAR'
then 'rtrim (' ... | | More... 09/22/06 | | | | | | | | |
|
| | Purge snapshot log / delete rows
To delete rows from snapshotlog for at least one snapshot run this (replace 'MASTER' with the actual table name):
SQL> exec dbms_snapshot.purge_log('MASTER', 1, 'DELETE');
This will delete rows from the oldest snpashot.
| | More... 09/19/06 | | | | | | | | |
|
| | Select nextval from multiple sequences at the same time
Sometimes you may want to get nextval from several sequences at the same time, i.e. if fields are not set to auto increment and you want to run transaction from php script, this will save calls to pg_query and pg_fetch_array. Here's one of the ways to do it in PostgreSQL ... | | More... 08/09/06 | | | | | | | | |
|
| | SQL to view OS process and Oracle session info
Use this commands and sql query to show information about OS process and Oracle user session. Useful if for example you notice a single process is chewing up CPU on the server.
At the Unix prompt (replace 22910 with the actual process id):
$ ps -ef | grep 22910
oracle 22910 ... | |  More... 08/02/06 | | | | | | | | |
|
|
| | Adding new datafiles to standby database
If parameter STANDBY_FILE_MANAGEMENT is set to MANUAL in Oracle standby database you may get this error when rolling forward:
Media Recovery Log logfile.arc
File #416 added to control file as 'UNNAMED00416' because
the parameter STANDBY_FILE_MANAGEMENT is set to MANUAL
The file should be manually created to continue.
Errors with log logfile.arc
Some recovered datafiles maybe left ... | |  More... 06/22/06 | | | | | | | | |
|
<< 1 | 2 | 3 | 4 | 5 | 6 | Page 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 >> |