Apress.Expert.Oracle.Database.Architecture.9i.and.10g.Programming.Techniques.and.Solutions.Sep.2005

rekharaghuram
from rekharaghuram More from this publisher
05.11.2015 Views

CHAPTER 3 ■ FILES 105 USER is "SYS" SQL> exit [ora10g@localhost dbs]$ sqlplus 'ops$tkyte/foo@ora10g_admin.localdomain' as sysdba SQL*Plus: Release 10.1.0.3.0 - Production on Sun Jan 2 20:52:57 2005 Copyright (c) 1982, 2004, Oracle. All rights reserved. ERROR: ORA-01031: insufficient privileges Enter user-name: The reason for that is that OPS$TKYTE is not yet in the password file. In order to get OPS$TKYTE into the password file, we need to “regrant” that account SYSDBA: SQL> grant sysdba to ops$tkyte; Grant succeeded. Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - Production With the Partitioning, OLAP and Data Mining options [ora10g@localhost dbs]$ sqlplus 'ops$tkyte/foo@ora10g_admin.localdomain' as sysdba SQL*Plus: Release 10.1.0.3.0 - Production on Sun Jan 2 20:57:04 2005 Copyright (c) 1982, 2004, Oracle. All rights reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - Production With the Partitioning, OLAP and Data Mining options That created an entry in the password file for us, and Oracle will now keep the password “in sync.” If OPS$TKYTE alters his password, the old one will cease working for remote SYSDBA connections and the new one will start: SQL> alter user ops$tkyte identified by bar; User altered. [ora10g@localhost dbs]$ sqlplus 'ops$tkyte/foo@ora10g_admin.localdomain' as sysdba SQL*Plus: Release 10.1.0.3.0 - Production on Sun Jan 2 20:58:36 2005 Copyright (c) 1982, 2004, Oracle. All rights reserved. ERROR: ORA-01017: invalid username/password; logon denied Enter user-name: ops$tkyte/bar@ora10g_admin.localdomain as sysdba Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - Production With the Partitioning, OLAP and Data Mining options SQL> show user USER is "SYS" SQL> The same process is repeated for any user that was a SYSDBA but is not yet in the password file.

106 CHAPTER 3 ■ FILES Change Tracking File The change tracking file is a new, optional file for use with Oracle 10g Enterprise Edition. The sole purpose of this file is to track what blocks have modified since the last incremental backup. In this fashion, the Recovery Manager (RMAN) tool can back up only the database blocks that have actually been modified without having to read the entire database. In releases prior to Oracle 10g, an incremental backup would have had to read the entire set of database files to find blocks that had been modified since the last incremental backup. So, if you had a 1TB database to which you simply added 500MB of new data (e.g., a data warehouse load), the incremental backup would have read 1TB of data to find that 500MB of new information to backup. So, the incremental backup would have stored significantly less data in the backup, and it would have still read the entire database. In Oracle 10g Enterprise Edition, that is no longer the case. As Oracle is running, and as blocks are modified, Oracle will optionally maintain a file that tells RMAN what blocks have been changed. The process of creating this change tracking file is rather simple and is accomplished via the ALTER DATABASE command: ops$tkyte@ORA10GR1> alter database enable block change tracking 2 using file 3 '/home/ora10gr1/product/10.1.0/oradata/ora10gr1/ORA10GR1/changed_blocks.bct'; Database altered. ■Caution I’ll say this from time to time throughout the book: please bear in mind that commands that set parameters, change the database, and make fundamental changes should not be done lightly, and definitely should be tested prior to performing them on your “real” system. The preceding command will, in fact, cause the database to do more work. It will consume resources. To turn off and remove the block change tracking file, you would use the ALTER DATABASE command once again: ops$tkyte@ORA10GR1> alter database disable block change tracking; Database altered. ops$tkyte@ORA10GR1> !ls -l /home/ora10gr1/.../changed_blocks.bct ls: /home/ora10gr1/.../changed_blocks.bct: No such file or directory Note that that command will in fact erase the block change tracking file. It does not just disable the feature—it removes the file as well. You can enable this new block change tracking feature in either ARCHIVELOG or NOARCHIVELOG mode. But remember, a database in NOARCHIVELOG mode, where the redo log generated daily is not retained, cannot recover all changes in the event of a media (disk/device) failure! A NOARCHIVELOG mode database will lose data some day. We will cover these two database modes in more detail in Chapter 9.

CHAPTER 3 ■ FILES 105<br />

USER is "SYS"<br />

SQL> exit<br />

[ora10g@localhost dbs]$ sqlplus 'ops$tkyte/foo@ora10g_admin.localdomain' as sysdba<br />

SQL*Plus: Release 10.1.0.3.0 - Production on Sun Jan 2 20:52:57 2005<br />

Copyright (c) 1982, 2004, <strong>Oracle</strong>. All rights reserved.<br />

ERROR:<br />

ORA-01031: insufficient privileges<br />

Enter user-name:<br />

The reason for that is that OPS$TKYTE is not yet in the password file. In order to get<br />

OPS$TKYTE into the password file, we need to “regrant” that account SYSDBA:<br />

SQL> grant sysdba to ops$tkyte;<br />

Grant succeeded.<br />

Disconnected from <strong>Oracle</strong> <strong>Database</strong> 10g<br />

Enterprise Edition Release 10.1.0.3.0 - Production<br />

With the Partitioning, OLAP <strong>and</strong> Data Mining options<br />

[ora10g@localhost dbs]$ sqlplus 'ops$tkyte/foo@ora10g_admin.localdomain' as sysdba<br />

SQL*Plus: Release 10.1.0.3.0 - Production on Sun Jan 2 20:57:04 2005<br />

Copyright (c) 1982, 2004, <strong>Oracle</strong>. All rights reserved.<br />

Connected to:<br />

<strong>Oracle</strong> <strong>Database</strong> 10g Enterprise Edition Release 10.1.0.3.0 - Production<br />

With the Partitioning, OLAP <strong>and</strong> Data Mining options<br />

That created an entry in the password file for us, <strong>and</strong> <strong>Oracle</strong> will now keep the password<br />

“in sync.” If OPS$TKYTE alters his password, the old one will cease working for remote SYSDBA<br />

connections <strong>and</strong> the new one will start:<br />

SQL> alter user ops$tkyte identified by bar;<br />

User altered.<br />

[ora10g@localhost dbs]$ sqlplus 'ops$tkyte/foo@ora10g_admin.localdomain' as sysdba<br />

SQL*Plus: Release 10.1.0.3.0 - Production on Sun Jan 2 20:58:36 2005<br />

Copyright (c) 1982, 2004, <strong>Oracle</strong>. All rights reserved.<br />

ERROR:<br />

ORA-01017: invalid username/password; logon denied<br />

Enter user-name: ops$tkyte/bar@ora10g_admin.localdomain as sysdba<br />

Connected to:<br />

<strong>Oracle</strong> <strong>Database</strong> 10g Enterprise Edition Release 10.1.0.3.0 - Production<br />

With the Partitioning, OLAP <strong>and</strong> Data Mining options<br />

SQL> show user<br />

USER is "SYS"<br />

SQL><br />

The same process is repeated for any user that was a SYSDBA but is not yet in the password<br />

file.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!