Oracle NZ - Francisco Munoz Alvarez

16. September 2008

How to Start and Stop a RAC Environment

Filed under: Oracle FAQ, RAC, Questions — admin @ 10:28

Auto Start/Stop

The Oracle Cluster Services handle the automatic start and stop of the Cluster, Listener, ASM and the Database.

For the Grid Control Agent, the auto start- stop is handled via the /etc/init.d/dbora script.  On server boot the dbora script starts the agent with /home/oracle/scripts/start_agent. On server shutdown the dbora script calls /home/oracle/scripts/stop_agent

Manual Start/Stop

Each database instance may be manually started and stopped using standard sqlplus scripts. However, it is highly recommended that the srvctl command interface be used in a RAC environment. Note that srvctl commands can be run remotely from any node in the cluster.

Nodeapps

srvctl start nodeapps –n hostname

srvctl stop nodeapps –n hostname 

Listener

srvctl start listener –n hostname

srvctl stop listener –n hostname 

Database

srvctl start database –d edwdev

srvctl stop database –d edwdev –o immediate

Instance

srvctl start instance –d edwdev –i edwdev1

srvctl start instance –d edwdev –i edwdev2

srvctl stop instance –d edwdev –i edwdev1

srvctl stop instance –d edwdev –i edwdev2

ASM

srvctl start asm –n hostname

srvctl stop asm –n hostname 

Grid Control Agent

Set environment to ‘agent’ using . oraenv

$ORACLE_HOME/bin/emctl start agent

$ORACLE_HOME/bin/emctl stop agent 

Regards,

Francisco Munoz Alvarez

How can I start a trace?

Filed under: Oracle FAQ, Questions — admin @ 05:58

Here are some possible ways to setup Trace:

To Enable trace at instance level

1) Set the parameter sql_trace in the pfile or spfile. It will enable trace for all sessions and the background processes

sql_trace = TRUE to enable it or to disable trace use sql_trace = FALSE

2)To enable tracing without restarting the databasejust run the following command using sqlplus:

SQL> ALTER SYSTEM SET trace_enabled = TRUE; To start trace
SQL> ALTER SYSTEM SET trace_enabled = FALSE; To stop trace

To enable trace at session level

If need generate trace at your own sesion use:

SQL>ALTER SESSION SET sql_trace = TRUE; to strat the trace
SQL>ALTER SESSION SET sql_trace = FALSE; to stop the trace


or

SQL>EXECUTE dbms_session.set_sql_trace (TRUE); to start trace
SQL>EXECUTE dbms_session.set_sql_trace (FALSE); to stop trace


or

SQL>EXECUTE dbms_support.start_trace; to start trace
SQL>EXECUTE dbms_support.stop_trace; to stop trace

To Enable trace in a different session

Find out the SID and SERIAL# from v$session using:

SQL>SELECT * FROM v$session WHERE osuser = OSUSER;


and use:

SQL>EXECUTE dbms_support.start_trace_in_session (SID, SERIAL#); to start trace
SQL>EXECUTE dbms_support.stop_trace_in_session (SID, SERIAL#); to stop trace


or

SQL>EXECUTE dbms_system.set_sql_trace_in_session (SID, SERIAL#, TRUE); to start trace
SQL>EXECUTE dbms_system.set_sql_trace_in_session (SID, SERIAL#, FALSE); to stop trace

On 10g you can also use DBMS_MONITOR:

BEGIN

->Enable/Disable Client Identifier Trace.

DBMS_MONITOR.client_id_trace_enable (client_id => ‘my_id’); 

DBMS_MONITOR.client_id_trace_disable (client_id => ‘my_id’);  

->Enable/Disable Service, Module and Action Trace. 

DBMS_MONITOR.serv_mod_act_trace_enable (    service_name  => ‘my_service’);  

DBMS_MONITOR.serv_mod_act_trace_enable (    service_name  => ‘my_service’,    module_name   => ‘my_module’); 

DBMS_MONITOR.serv_mod_act_trace_enable (    service_name  => ‘my_service’,    module_name   => ‘my_module’,    action_name   => ‘INSERT’);  

DBMS_MONITOR.serv_mod_act_trace_disable (    service_name  => ‘my_service’,    module_name   => ‘my_module’,    action_name   => ‘INSERT’); 

->Enable/Disable Session Trace .  

DBMS_MONITOR.session_trace_enable; 

DBMS_MONITOR.session_trace_enable (    session_id => 12,    serial_num => 1011);  

DBMS_MONITOR.session_trace_disable (    session_id => 12,    serial_num => 1011);

END;

/

For more information regarding DBMS_MONITOR, please refer to the following link:

Also take a look on this link:


Cheers,
Francisco Munoz Alvarez

How to setup a Basic Audit?

Filed under: Oracle FAQ, Security, Questions — admin @ 05:46

For any Oracle versions prior to 9i you will need to set audit_trail parameter in the pfile ie.g.:

audit_trail = DB

For later Oracle Versions:

SQL>alter system set audit_trail = DB;

To enable auditing for a specific object run the following command:

SQL>AUDIT SELECT, INSERT, UPDATE, DELETE ON SCHEMA.TABLE;

To stop auditing use:

SQL>NOAUDIT SELECT, INSERT, UPDATE, DELETE ON SCHEMA.TABLE;

Or to audit any statement that queries, delete, insert or updates any table, issue the following statement:

AUDIT SELECT TABLE, DELETE TABLE, INSERT TABLE, UPDATE TABLE;

If you want to audit a specific user will need to run the following commands:
AUDIT ALTER TABLE, SELECT TABLE, INSERT TABLE, … ,GRANT PROCEDURE by <USERNAME>;
To stop the audit for the user you will need to run:
NOAUDIT ALTER TABLE, SELECT TABLE, INSERT TABLE, … ,GRANT PROCEDURE by <USERNAME>;

To see the results of the auditing use please run:

SQL> select * from dba_audit_trail;

This is an excellent Oracle documentation to learn how to implement it:


Also I’ll recommend you to take a look on the following links:


Cheers,
Francisco Munoz Alvarez

22. June 2008

Differences between UNDO and REDO

Filed under: Oracle FAQ, Undo, Redo Logs, Questions — admin @ 12:55

To clear this question we have this table: 

UNDO REDO
Record of How to undo a change How to reproduce a change
Used for Rollback, Read-Consistency Rolling forward DB Changes
Stored in Undo segments Redo log files
Protect Against Inconsistent reads in multiuser systems Data loss

UNDO 

Undo tablespaces are special tablespaces used solely for storing undo information. You cannot create any other segment types (for example, tables or indexes) in undo tablespaces. Each database contains zero or more undo tablespaces. In automatic undo management mode, each Oracle instance is assigned one (and only one) undo tablespace. Undo data is managed within an undo tablespace using undo segments that are automatically created and maintained by Oracle.

Every Oracle Database must have a method of maintaining information that is used to roll back, or undo, changes to the database. Such information consists of records of the actions of transactions, primarily before they are committed. These records are collectively referred to as undo. 

Undo records are used to: 

  • Roll back transactions when a ROLLBACK statement is issued
  • Recover the database
  • Provide read consistency
  • Analyze data as of an earlier point in time by using Oracle Flashback Query
  • Recover from logical corruptions using Oracle Flashback features 

When a ROLLBACK statement is issued, undo records are used to undo changes that was made to the database by the uncommitted transaction. During database recovery, undo records are used to undo any uncommitted changes applied from the redo log to the datafiles. Undo records provide read consistency by maintaining the before image of the data for users who are accessing the data at the same time that another user is changing it. 

REDO 

Redo log files record changes to the database as a result of transactions and internal Oracle server actions. (A transaction is a logical unit of work, consisting of one or more SQL statements run by a user.) 

Redo log files protect the database from the loss of integrity because of system failures caused by power outages, disk failures, and so on. 

Redo log files must be multiplexed to ensure that the information stored in them is not lost in the event of a disk failure. 

The redo log consists of groups of redo log files. A group consists of a redo log file and its multiplexed copies. Each identical copy is said to be a member of that group, and each group is identified by a number. The LogWriter (LGWR) process writes redo records from the redo log buffer to all members of a redo log group until the file is filled or a log switch operation is requested. Then, it switches and writes to the files in the next group. Redo log groups are used in a circular fashion. 

HOW TO DETECT UNDO: 

There are some views that show information related to undo activity: 

  • V$UNDOSTAT: histogram-like view that shows statistics for 10-minute intervals.
  • V$TRANSACTION: present time view providing information on current transactions.
  • V$SESSTAT: individual session statistics, which includes one for undo usage.
  • V$UNDOSTAT will provide who did hint, recording the longest running query for that 10-interval, through the MAXQUERYID column which may be linked to V$SQL and use columns PARSING_USER_ID or PARSING_SCHEMA_NAME the get a grip on the suspect.
  • V$TRANSACTION linked with V$SESSION will show current used undo blocks for ongoing transactions. This query may help:

SELECT a.sid, a.username, b.used_urec, b.used_ublk
FROM v$session a, v$transaction b
WHERE a.saddr = b.ses_addr
ORDER BY b.used_ublk DESC

  • V$SESSTAT provides another view, which uses the undo kind of view, but we must avoid getting lost in the maze of Oracle statistics and focusing on just one: Undo change vector size, which will accumulate the bytes of undo used during the session lifetime. Following query is designed to pinpoint who is having a high undo activity.

SELECT a.sid, b.name, a.value
FROM v$sesstat a, v$statname b
WHERE a.statistic# = b.statistic#
AND a.statistic# = 176<– Which stands for undo change vector size
ORDER BY a.value DESC

HOW TO DETECT REDO: 

To find sessions generating lots of redo, you can use either of the following methods. Both methods examine the amount of undo generated. When a transaction generates undo, it will automatically generate redo as well. The methods are: 1) Query V$SESS_IO. This view contains the column BLOCK_CHANGES which indicates how much blocks have been changed by the session. High values indicate a session generating lots of redo. 

The query you can use is:      

SELECT s.sid, s.serial#, s.username, s.program, i.block_changes
FROM v$session s, v$sess_io i
WHERE s.sid = i.sid
ORDER BY 5 desc, 1, 2, 3, 4;

  1. Run the query multiple times and examine the delta between each occurrence of BLOCK_CHANGES. Large deltas indicate high redo generation by the session. 
  2. Query V$TRANSACTION. These view contains information about the amount of    undo blocks and undo records accessed by the transaction (as found in the USED_UBLK and USED_UREC columns).

The query you can use is:      

SELECT s.sid, s.serial#, s.username, s.program, t.used_ublk, t.used_urec
FROM v$session s, v$transaction t
WHERE s.taddr = t.addr
ORDER BY 5 desc, 6 desc, 1, 2, 3, 4;

Run the query multiple times and examine the delta between each occurrence of USED_UBLK and USED_UREC. Large deltas indicate high redo generation by the session. You use the first query when you need to check for programs generating lots of redo when these programs activate more than one transaction. The latter query can be used to find out which particular transactions are generating redo. 

RESUMEN 

UNDO 

  • Record of how to undo a change.
  • Used for Rollback, read-consistency
  • Stored in Undo Segments
  • Protect against inconsistent reads in multiuser systems

REDO 

  • Record of how to reproduce a change
  • Used for Rolling forward database changes
  • Stored in redo log files
  • Protect against data loss.

An undo segment is just a segment, like a table or an index or a hash cluster or a materialized view is a segment. The clue is in the name. And the rule is that if you modify part of a segment, any segment, regardless of its type, you must generate redo so that the modification can be recovered in the event of media or instance failure. Therefore, you modify EMP; the changes to the EMP blocks are recorded in redo. The modification to EMP also has to be recorded in UNDO, because you might change your mind and want to reverse the transaction before you commit. Therefore, the modification to EMP causes entries to be made in an undo segment. But that’s a modification to a segment -this time, an undo segment. Therefore, the changes to the undo segment also have to be recorded in redo, in case you suffer a media or instance failure.  

If your database now crashed and you had to restore a set of datafiles, including those for the undo tablespace, from 10 days ago, you would of course do what Oracle always does: start reading from your archived redo, rolling the 10 day old files forward in time until they were 9, then 8, then 7 then 6 and so on days old, until you get to the time where the only record of the changes to segments (any segment) was contained in the current online redo log, and then you’d use that redo log to roll the files forward until they were 8 minutes old, 7 minutes, 6, 5, 4,… and so on, right up until all changes to all segments that had ever been recorded in the redo had been applied. At which point, your undo segments have been re-populated. So now you can start rolling back those transactions which were recorded in the redo logs, but which weren’t committed at the time of the database failure.   

I can’t emphasize enough, really, that undo segments are just slightly special tables. They’re fundamentally not very different from EMP or DEPT, except that new inserts into them can over-write a previous record, which never happens to EMP, of course. If you generate change vectors when you update EMP, you generate change vectors when you generate undo.   Why do we store the before and after image in redo and then duplicate half of that by repeating the store of the before image in undo? Because redo is written and generated sequentially and isn’t cached for long in memory (most log buffers are a few megas in size, tops). 

Therefore, using redo to rollback a mere mistake or as a result of a change of mind, whilst theoretically do-able, would involve wading through huge amounts of redo sequentially, looking for one little before image in a sea of changes made by lots of people and all of that wading would be done by reading stuff off disk (like it is in a recovery scenario). Undo, on the other hand, is stored in the buffer cache (just as EMP is stored in the buffer cache), so there’s a good chance that reading that will only require logical I/O, not physical. And your transaction is dynamically linked to where it’s written its undo, so you and your transaction can jump straight to where your undo is, without having to wade through the entire undo generated by other transactions. In performance terms, there is no comparison. Splitting ‘you need this for recovery’ from ‘you need this for changes of mind’ was a stroke of genius on the part of Oracle: other databases merely have ‘transaction logs’ which serve both purposes, and suffer in performance and flexibility terms accordingly. 

USEFUL SCRIPTS: 

To see the redo generated since instance started: 

col name format a30 heading ‘Statistic|Name’
col value heading ‘Statistic|Value’
start title80 “Redo Log Statistics”
spool rep_out\&db\red_stat
SELECT name, value
FROM v$sysstat
WHERE name like ‘%redo%’
order by name
/
spool off
pause Press enter to continue
ttitle off

The redo generated during my session since the session started: 

select value redo_size
from v$mystat, v$statname
where v$mystat.STATISTIC# = v$statname.STATISTIC#
and name = ‘redo size’
/

The redo generated by current user sessions: 

select v$session.sid, username, value redo_size
from v$sesstat, v$statname, v$session
where v$sesstat.STATISTIC# = v$statname.STATISTIC#
and v$session.sid = v$sesstat.sid
and name = ‘redo size’
and value > 0
and username is not null
order by value
/

Provide a current status for redo logs: 

column first_change# format 999,999,999 heading Change#
column group# format 9,999 heading Grp#
column thread# format 999 heading Th#
column sequence# format 999,999 heading Seq#
column members format 999 heading Mem
column archived format a4 heading Arc?
column first_time format a25 heading First|Time
break on thread#
set pages 60 lines 132 feedback off
start title132 ‘Current Redo Log Status’
spool rep_out\&db\log_stat
select thread#, group#, sequence#,bytes, members,archived,status,first_change#,to_char(first_time,’dd-mon-yyyy hh24:mi’) first_time
from sys.v_$log
order by thread#, group#;
spool off
pause Press Enter to continue
set pages 22 lines 80 feedback on
clear breaks
clear columns
ttitle off
/

Best Regards, 

Francisco Munoz Alvarez
www.oraclenz.com

What is the difference between Rollback and Undo Tablespace? OTN Forum By user user503050

Filed under: Oracle FAQ, Rollback, Undo, Questions — admin @ 11:23

There might be confusion while undo and rollback segment terms are used interchangeably in db world. It is due to the compatibility issue of oracle.

Undo

Oracle Database must have a method of maintaining information that is used to roll back, or undo, changes to the database. Such information consists of records of the actions of transactions, primarily before they are committed. These records are collectively referred to as undo.

Undo records are used to:

  • Roll back transactions when a ROLLBACK statement is issued
  • Recover the database
  • Provide read consistency
  • Analyze data as of an earlier point in time by using Flashback Query

When a ROLLBACK statement is issued, undo records are used to undo changes that were made to the database by the uncommitted transaction. During database recovery, undo records are used to undo any uncommitted changes applied from the redo log to the datafiles. Undo records provide read consistency by maintaining the before image of the data for users who are accessing the data at the same time that another user is changing it.

Undo vs Rollback

Earlier releases of Oracle Database used rollback segments to store undo. Oracle9i introduced automatic undo management, which simplifies undo space management by eliminating the complexities associated with rollback segment management. Oracle strongly recommends (Oracle 9i and on words) to use undo tablespace (automatic undo management) to manage undo rather than rollback segments.

To see the undo management mode and other undo related information of database-

SQL> show parameter undo

NAME                               TYPE      VALUE
———————————— ———–   ——————————
undo_management         string     AUTO
undo_retention                integer   900
undo_tablespace              string     UNDOTBS1

Since the advent of Oracle9i, less time-consuming and suggested way is—using Automatic Undo Management—in which Oracle Database creates and manages rollback segments (now called “undo segments”) in a special-purpose undo tablespace. Unlike with rollback segments, we don’t need to create or manage individual undo segments—Oracle Database does that for you when you create the undo tablespace. All transactions in an instance share a single undo tablespace. Any executing transaction can consume free space in the undo tablespace, and when the transaction completes, its undo space is freed (depending on how it’s been sized and a few other factors, like undo retention). Thus, space for undo segments is dynamically allocated, consumed, freed, and reused—all under the control of Oracle Database, rather than manual management by someone.

Switching Rollback to Undo

1. We have to create an Undo tablespace. Oracle provides a function (10g and up) that provides information on how to size new undo tablespace based on the configuration and usage of the rollback segments in the system.

DECLARE
utbsiz_in_MB NUMBER;
BEGIN
utbsiz_in_MB ;= DBMS_UNDO_ADV.RBU_MIGRATION;
end;
/

CREATE UNDO TABLESPACE UNDOTBS
DATAFILE ‘/oradata/dbf/undotbs_1.dbf’
SIZE 100M AUTOEXTEND ON NEXT 10M
MAXSIZE UNLIMITED RETENTION NOGUARANTEE;

Note: In undo tablespace creation, “SEGMENT SPACE MANAGEMENT AUTO” can not be set

2.Change system parameters

SQL> alter system set undo_retention=900 scope=both;
SQL> alter system set undo_tablespace=UNDOTBS scope=both;
SQL> alter system set undo_management=AUTO scope=spfile;
SQL> shutdown immediate
SQL> startup

UNDO_MANAGEMENT is a static parameter. So database needs to be restarted.

Regards,

Francisco Munoz Alvarez

19. June 2008

EM mess - by Slyt - OTN Forum

Filed under: Questions — admin @ 23:48

I tried to run EM on certain host:

[oracle@SQLAB db10g]$ emctl dbconsole start

 TZ set to

Poland
EM Configuration issue. /u01/app/oracle/product/10.2.0/db10g/SQLAB_e2k not found.

OK. No such dir indeed. So:

[oracle@SQLAB db10g]$ emca -config dbcontrol db -repos createblablabla
Do you wish to continue? [yes(Y)/no(N)]: Y
2008-06-19 13:12:12 oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at

/u01/app/oracle/product/10.2.0/db10g/cfgtoollogs/emca/e2k/emca_2008-06-19_01-11-47-PM.log.
2008-06-19 13:12:13 oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) …
2008-06-19 13:12:13 oracle.sysman.emcp.EMReposConfig invoke
SEVERE: Error creating the repository
2008-06-19 13:12:13 oracle.sysman.emcp.EMReposConfig invoke
INFO: Refer to the log file

at /u01/app/oracle/product/10.2.0/db10g/cfgtoollogs/emca/e2k/emca_repos_create_<date>.log for more details.
2008-06-19 13:12:13 oracle.sysman.emcp.EMConfig perform
SEVERE: Error creating the repository
Refer to the log file at /u01/app/oracle/product/10.2.0/db10g/cfgtoollogs/emca/e2k/emca_2008-06-19_01-11-47-PM.log for more details.
Could not complete the configuration. Refer to the log file at /u01/app/oracle/product/10.2.0/db10g/cfgtoollogs/emca/e2k/emca_2008-06-19_01-11-47-PM.log for more details.

 What log says:

emca_2008-06-19_01-11-47-PM.logCheck if repos user already exists.stare 6: WHERE username=UPPER(’&EM_REPOS_USER’);
nowe 6: WHERE username=UPPER(’SYSMAN’);
stare 8: IF ( ‘&EM_CHECK_TYPE’ = ‘EXISTS’) THEN
nowe 8: IF ( ‘NOT_EXISTS’ = ‘EXISTS’) THEN
stare 11: raise_application_error(-20000, ‘&EM_REPOS_USER does not exists..’);
nowe 11: raise_application_error(-20000, ‘SYSMAN does not exists..’);
stare 14: ELSIF ( ‘&EM_CHECK_TYPE’ = ‘NOT_EXISTS’ ) THEN
nowe 14: ELSIF ( ‘NOT_EXISTS’ = ‘NOT_EXISTS’ ) THEN
stare 17: raise_application_error(-20001, ‘&EM_REPOS_USER already exists..’);
nowe 17: raise_application_error(-20001, ‘SYSMAN already exists..’);
stare 21: raise_application_error(-20002, ‘Invalid Check type &EM_CHECK_TYPE’);
nowe 21: raise_application_error(-20002, ‘Invalid Check type NOT_EXISTS’);
DECLARE
*
ERROR at line 1:
ORA-20001: SYSMAN already exists..
ORA-06512: at line 17
What next ? Should I drop user SYSMAN and try again ?

>>>>Francisco Munoz Alvarez Answer

 Hi SlyT, Yes you need to drop the repository first.


emca -deconfig dbcontrol db -repos drop
emca -repos create
emca -config dbcontrol db

Best Regards,

Francisco Munoz Alvarez
www.oraclenz.com

>>> SlyT Replay

Hi Francisco,
not so easy …

 
[oracle@SQLAB e2k]$ emca -deconfig dbcontrol db -repos dropblablabla
Do you wish to continue? [yes(Y)/no(N)]: Y
2008-06-19 13:42:57 oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged

at /u01/app/oracle/product/10.2.0/db10g/cfgtoollogs/emca/e2k/emca_2008-06-19_01-42-42-PM.log.
2008-06-19 13:42:57 oracle.sysman.emcp.EMDBPreConfig performDeconfiguration
WARNING: EM is not configured for this database. No EM-specific actions can be performed.
2008-06-19 13:42:57 oracle.sysman.emcp.EMReposConfig dropRepository
INFO: Dropping the EM repository (this may take a while) …
2008-06-19 13:42:58 oracle.sysman.emcp.util.PlatformInterface executeCommand
WARNING: Error executing /u01/app/oracle/product/10.2.0/db10g/sysman/admin/emdrep/bin/RepManager -connect (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=SQLAB)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=e2k))) -repos_user SYSMAN -action drop -verbose -output_file /u01/app/oracle/product/10.2.0/db10g/cfgtoollogs/emca/e2k/emca_repos_drop_2008-06-19_01-42-57-PM.log
2008-06-19 13:42:58 oracle.sysman.emcp.EMReposConfig invoke
SEVERE: Error dropping the repository
2008-06-19 13:42:58 oracle.sysman.emcp.EMReposConfig invoke
INFO: Refer to the log file at /u01/app/oracle/product/10.2.0/db10g/cfgtoollogs/emca/e2k/emca_repos_drop_<date>.log for more details.
2008-06-19 13:42:58 oracle.sysman.emcp.EMConfig perform
SEVERE: Error dropping the repository
Refer to the log file

at /u01/app/oracle/product/10.2.0/db10g/cfgtoollogs/emca/e2k/emca_2008-06-19_01-42-42-PM.log for more details.
Could not complete the configuration. Refer to the log file at /u01/app/oracle/product/10.2.0/db10g/cfgtoollogs/emca/e2k/emca_2008-06-19_01-42-42-PM.log for more details.


 >>> Francisco Munoz Alvarez Answer

Can you post the log information?

Cheers,

Francisco Munoz Alvarez
www.oraclenz.com
 

>>> Slyt Replay

It’s a little bit log, I would attached it but I can not see the way. So (some messages translated from my native language):

2008-06-19 13:42:57 oracle.sysman.emcp.util.PlatformInterface executeCommand
CONFIG: Starting execution: /u01/app/oracle/product/10.2.0/db10g/sysman/admin/emdrep/bin/RepManager -connect (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=SQLAB)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=e2k))) -repos_user SYSMAN -action drop -verbose -output_file /u01/app/oracle/product/10.2.0/db10g/cfgtoollogs/emca/e2k/emca_repos_drop_2008-06-19_01-42-57-PM.log
2008-06-19 13:42:58 oracle.sysman.emcp.util.PlatformInterface executeCommand
CONFIG: Exit value of 50
2008-06-19 13:42:58 oracle.sysman.emcp.util.PlatformInterface executeCommand
CONFIG: Enter SYS user’s password :
Enter repository user password :
Getting temporary tablespace from database…
Could not connect to SYS/(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=SQLAB)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=e2k))): ORA-01017: incorrect user/password; login failed (DBD ERROR: OCISessionBegin)
2008-06-19 13:42:58 oracle.sysman.emcp.util.PlatformInterface executeCommand
CONFIG: stty: standard input: Invalid argument
stty: standard input: Invalid argument
stty: standard input: Invalid argument
stty: standard input: Invalid argument

>>> Francisco Munoz Alvarez Answer

Dear Slyt,

You enter the wrong SYS password:

CONFIG: Enter SYS user’s password :
Enter repository user password :
Getting temporary tablespace from database…
Could not connect to SYS/(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=SQLAB)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=e2k))): ORA-01017:
incorrect user/password; login failed (DBD ERROR: OCISessionBegin)
 
Look for the right password and try again.

Best Regards,

Francisco Munoz Alvarez
www.oraclenz.com

>>> SlyT Replay

Dear Francisco ;D,
Thank you very much for your fast and reliable support.
Everything is OK now.

Best regards,
Slawomir Trojniak

17. June 2008

want to migrate 9.2.0.1db on windows data to 10.2.0.2 db on SunOs10, and planning to use full exp/imp..will this work ? by DBA2008 - OTN Forum

Filed under: Oracle FAQ, Questions — admin @ 00:10

Hi DBA2008,

I recommend you to create all the structure first, then import all the data.

Pre-create tablespaces, users, and tables in the new database to improve space usage by changing storage parameters. When you pre-create tables using SQL*Plus, either run the database in the original database compatibility mode or make allowances for the specific data definition conversions that occur during import. You need to specify IGNORE=Y on Import when items have been pre-created.

Note: If the new Oracle Database will be created on the same computer as the source database, and you do not want to overwrite the source database data files, then you must pre-create the tablespaces and specify DESTROY=N when you import.

This is the Upgrade Compatibility Matrix for Upgrading to 10g:

Source Database

Destination Database
8.1.7.4   (or higher) 10.2.x
9.0.1.4   (or higher) 10.2.x
9.2.0.4   (or higher) 10.2.x
10.1.0.2 (or higher) 10.2.x

  

This is the Upgrade Compatibility Matrix for Upgrading to 11g: 

Source Database

Destination Database
9.2.0.4   (or higher) 11.1.x
10.1.0.2 (or higher) 11.1.x
10.2.0.1 (or higher) 11.1.x

      

The Data Pump method for moving data between different database versions is different than the method used by original Export/Import. With original Export, you had to run an older version of Export (exp) to produce a dump file that was compatible with an older database version. With Data Pump, you can use the current Export (expdp) version and simply use the VERSION parameter to specify the target database version.

Keep the following information in mind when you are using Data Pump Export and Import to move data between different database versions:

  • If you specify a database version that is older than the current database version, certain features may be unavailable. For example, specifying VERSION=10.1 will cause an error if data compression is also specified for the job because compression was not supported in 10.1.
  • On a Data Pump export, if you specify a database version that is older than the current database version, then a dump file set is created that you can import into that older version of the database. However, the dump file set will not contain any objects that the older database version does not support. For example, if you export from a version 10.2 database to a version 10.1 database, comments on indextypes will not be exported into the dump file set.
  • Data Pump Import can always read dump file sets created by older versions of the database.
  • Data Pump Import cannot read dump file sets created by a database version that is newer than the current database version, unless those dump file sets were created with the version parameter set to the version of the target database. Therefore, the best way to perform a downgrade is to perform your Data Pump export with the VERSION parameter set to the version of the target database.
  • When operating across a network link, Data Pump requires that the remote database version be either the same as the local database or one version older, at the most. For example, if the local database is version 10.2, the remote database must be either version 10.1 or 10.2. If the local database is version 10.1, then 10.1 is the only version supported for the remote database

More information, please refer to: https://metalink.oracle.com/metalink/plsql/f?p=130:14:4088601010728200477::::p14_database_id,p14_docid,p14_show_header,p14_show_help,p14_black_frame,p14_font:NOT,551141.1,1,1,1,helvetica

Regards,

Francisco Munoz Alvarez

16. June 2008

How to create a Temp Tablespace Group on 10g? by America OTN Forum

Filed under: Oracle FAQ, Temp Tablespace, Questions — admin @ 13:35

Tablespace Groups

Oracle now has the concept of grouping multiple tablespaces together in what they call a tablespace group. This allows you to create multiple temporary tablespaces, assign these temporary tablespaces to a tablespace group, and then use the tablespace group as the default temporary tablespace for the database or user. The benefit this has is that a single SQL statement or set of SQL statements may use more than the one temporary tablespace you have created in the past and now span multiple tablespaces. This has the following benefits if you create your temporary tablespaces and tablespace groups properly.

  1. You can tailor user load to individual temporary tablespaces.
  2. You can allow large sort operations to span and consume multiple temporary tablespaces if needed.
  3. Finer granularity so you can distribute operations across temporary tablespaces.
  4. Reduced contention when multiple temporary tablespaces are defined.

The Life of a Tablespace Group

You can implicitly create a tablespace group during the creation of a temporary tablespace with the CREATE TEMPORARY TABLESPACE command and by specifying the TABLESPACE GROUP clause. There is no CREATE TABLESPACE GROUP statement. Therefore, during the creation of a temporary tablespace called GTEMP01 we can add this tablespace to a tablespace group called GTEMP by using the following statement.

CREATE TEMPORARY TABLESPACE GTEMP01TEMPFILE ‘C:\ORACLE\PRODUCT\10.1.0\ORADATA\DATEN\GTEMP01.DBF’ SIZE 100M TABLESPACE GROUP GTEMP;

The tablespace group name must be an existing tablespace group name or one that does not exists. In addition, it must not be the name of an existing tablespace or you will get an error such as the following that notifies you that the tablespace already exists.

CREATE TEMPORARY TABLESPACE GTEMPTEMPFILE ‘C:\ORACLE\PRODUCT\10.1.0\ORADATA\DATEN\GTEMP.DBF’ SIZE 100M
SQL> /
CREATE TEMPORARY TABLESPACE GTEMP*ERROR at line 1:ORA-01543: tablespace ‘GTEMP’ already exists

We can also switch a tablespace’s group, add a tablespace to a group or create a new tablespace group by using the following statement.

ALTER TABLESPACE GTEMP02 TABLESPACE GROUP GTEMP;
ALTER TABLESPACE GTEMP03 TABLESPACE GROUP GTEMP;

If you wanted to remove a tablespace from a tablespace group and not assign it to a new tablespace group, you would use the following statement where the TABLESPACE GROUP clause is used but an empty string is used for the group.

ALTER TABLESPACE GTEMP03 TABLESPACE GROUP ”;

You cannot get rid of a tablespace group explicitly. In order for a tablespace group to be implicitly removed from the database, you need to alter those tablespaces to either use another tablespace group or alter them not to use any tablespace groups by assigning them to an explicit tablespace.

DBA_TABLESPACE_GROUPS View

You can always take a look at what tablespace groups you have defined by looking at the DBA_TABLESPACE_GROUPS view. Issue the following SQL and you can see what we have already defined for our running example.

SQL> SELECT group_name, tablespace_name
FROM dba_tablespace_groups;

GROUP_NAME                         TABLESPACE_NAME
—————————— ——————-
GTEMP                                       GTEMP01
GTEMP                                       GTEMP02

Setting the Default Temporary Tablespace

Now that we have defined multiple tablespaces to be part of a tablespace group called GTEMP, we can now use this tablespace group just as any other tablespace. One use of a tablespace group can be for the default temporary tablespace. If you wish to assign this new tablespace group as the default temporary tablespace, just issue the following SQL. Now any user who you have not given a temporary tablespace at user creation time will be assigned this new tablespace group as their temporary tablespace.

SQL> ALTER DATABASE DEFAULT TEMPORARY TABLESPACE GTEMP;
Database altered.

The temporary tablespace within large organizations that require many sort operations typically would experience high levels of contention. It was then left up to the DBA to segregate sort operations by users and create islands of temporary tablespaces so that those operations would not contend for similar resources that are associated with a single temporary tablespace. The problem with this is that the very large operations would typically need independent large temporary tablespaces. This would lead to wasted resources. With the addition of tablespace groups, Oracle now allows us to group multiple temporary tablespaces together so that we have one more choice in the usage patterns of these temporary tablespaces. We now need to ask ourselves if an operation truly needs its own individual temporary tablespace or the operation can span multiple temporary tablespaces and work without contention with the other operations that are occurring. If so, we can consolidate, reduce disk consumption, and possibly contention.

Regards,

Francisco Munoz Alvarez

can someone tell any difference between express edition and standard edition for oracle 10g - by seyiisq -OTN Forum

Filed under: Oracle FAQ, Questions — admin @ 01:48

Oracle XE:

Express Edition (XE) is a free, downloadable version of the Oracle database server. Oracle XE can only be used on single processor machines. It can only manage up to 4 GB of data and 1 GB of memory. ISVs can embed XE in 3rd party products and redistribute it freely.

Oracle Standard Edition:

Standard Edition is designed for smaller businesses and enterprises. It offers a subset of the features/ functionality implemented in Enterprise Edition. Database options like Data Guard, Partitioning, Spatial, etc. is not available with Standard Edition (from 10g one can use RAC with Standard Edition). Standard Edition can only be licensed on servers with a maximum capacity of four processors.

Oracle Standard Edition One:

Standard Edition One is a low cost, entry-level version of the Oracle Standard Edition database server. Standard Edition One can only be licensed on small servers with a maximum capacity of two processors.

If you need more information you can refer to:

http://www.orafaq.com/faq/what_is_the_difference_between_the_enterprise_standard_and_personal_editions_of_oracle

Regards,

Francisco Munoz Alvarez

« Previous Page

Powered by WordPress