Alter System command
Hi all,
I am just bit confused in the following two commands
SQL> ALTER SYSTEM SWITCH LOGFILE;
SQL> ALTER SYSTEM CHECKPOINT;
So what is the main difference between the first and second cmds?
Why seniors/books suggest to use first command instead of the second one ?
372211, if you run manual hot backups then at the conclusion of copying the files for the last tablespace in your hot backup and issueing the "end backup" command you generally issue the ALTER SYSTEM SWITCH LOGFILE command to force all redo necessary to bring the backups to a consistent point in time during forward recovery.
The archived redo logs and backup copies just made can be duplicated for sending off-site and provide a consistet image in the event of a diaster that results in the loss of archieved redo logs made after the backup.
Also, to add to what was said about checkpoints - The header blocks for the database files must also be updated with the checkpoint information.
HTH -- Mark D Powell --
Similar Messages
-
Hi
I am looking for a way to track alter system / alter database commands.
Database triggers are not logging them : I do have a database trigger for DDLs tracking that works great but alter system commands are not captured by it . also trigger 'alter alter on database ' - do not log alter system or alter database
Is there a way for me to force a command to appear in the alert log ?
Or any other way you can think of ?
thanks
OrnaOrna,
YOu can create a database level trigger to capture ALTER statement and insert them into a user defined table. This is just one example you can define trigger at schema level as well.
CREATE OR REPLACE TRIGGER usiuser.myaltertrg
BEFORE ALTER
ON DATABASE
DECLARE
tmpvar NUMBER;
BEGIN
tmpvar := 0;
-- your code to insert alter statement in user defined table.
EXCEPTION
WHEN OTHERS
THEN
-- Consider logging the error and then re-raise
RAISE;
END myaltertrg;Regards
Edited by: OrionNet on Dec 29, 2008 1:30 PM -
Need help on submitting ALTER SYSTEM command.
I have a report of a list of active xml threads from our EM repository, which is pulled from 4 RAC instances. I have a region with this statement:
select a.inst_id, a.sid,a.serial#,b.instance_name, b.host_name, a.machine, a.status
from gv$session@emrepo a, gv$instance@emrepo b
where a.action like 'XML%'
and a.inst_id = b.instance_number
order by a.inst_id
The result shows me what I want. Now I want to be able to select the XML threads that I want to kill with the alter system kill command such as:
alter system kill session 'sid, serial#'; (where sid and serial# is pulled from above).
Question is how can I do this, plus need to figure out to make sure I am running this against the right RAC instance. Any help is appreciated. Thanks.
VictorYou can link to a confirmation page and set 2 items on that page SID and SERIAL# through the URL. Then create a process on the 2nd page that fires "On Submit" with the following code:execute immediate 'alter system disconnect session '||''''||:P2_SID||','||:P2_SERIAL||''' immediate';Create a button on the 2nd page to submit the page (fire your process when request = the button request).
As far as how this works with RAC, you're on your own on that one ;)
Thanks,
Tyler -
COMMENTS in ALTER SYSTEM command
I ran the query
SQL>ALTER SYSTEM SET sga_target=216M COMMENT='Test';
which view/table will describe the changes of sga_target and corresponding comment.
I searched in v$system_parameter and v$parameter, but the value did not get updated.I did query on V$PARAMETER, V$SYSTEM_PARAMETER, V$SYSTEM_PARAMETER2 and found that the value of sga_target (148M) is updated in all the views, whereas the comment attribute is updated only in V$PARAMETER view. Also I disconnected from SQL Plus and logged in again (new session), the comment attribute has been reset to old value. As long as the value is updated in all the views, the comment attribute should also be updated in all the views.
-
Can I do "alter system" commands thru JDBC
I have a small java program that occasionally needs to kill sessions. Can I do this through JDBC? My code is not erroring out but it is also not killing the session. I'm pretty sure I'm using the correct sid and serial# but I'll check again. And, yes, the user logged on has the appropriate privileges.
TIA
- WillThe answer is yes you can do it (and you should hesitate on posting things until you are really sure something isn't working).
Sorry for wasting your time.
- Will -
Alter system trigger - substitution
Hello.
By the documentation, there is restriction for trigger on alter command: "The trigger will not be fired by an ALTER DATABASE statement".
I'm trying to use BEFORE SHUTDOWN and AFTER STARTUP triggers to database and I'd need also cover situations:
- alter system quiesce restricted
- alter system suspend
- alter system enable restricted session
- alter system unquiesce
- alter system disable restricted session
- alter system resume
I'm using ALTER SYSTEM command (not ALTER DATABASE), but trigger isn't fired too. Is there any way how to catch and do some PL/SQL pre/post processing events described above?
Thanks.Oracle Version ?
if ur on 10.x.x.x.x
Check
sql> select space_limit/1024/1024 "Limit MB",round(space_used/1024/1024) "Used MB"
2* from v$recovery_file_dest
SQL> /
Limit MB Used MB
2048 1681
If limit and used field equal then increase db_recovery_file_dest_size parameter size
SQL> show parameter db_recovery_file_dest_size
NAME TYPE VALUE
db_recovery_file_dest_size big integer 2G
SQL> alter system set db_recovery_file_dest_size = 3g;
System altered.
Also check below link.
>>>Re: Switch logfile hangs
[b]>>>SQL> alter system switch logfile; -
Alter system reset aq_tm_processes
Hi!
Trying to reset aq_tm_processes. First some background:
The aq_tm_processes parameter was first set in the pfile. We had to startup the DB using this file (tried removing it from the pfile also, not sure that worked as show parameter showed aq_tm_processes = 0).
But as we are using streams, aq_tm_processes, should not be set.
Well, I have done this:
1. Took down the DB.
2. Set the aq_tm_processes in the pfile to 2. (So I can issue the alter system command)
3. Startup nomount from pfile.
4. Created a new spfile form pfile.
5. Startup DB.
6. alter system reset aq_tm_processes scope=spfile sid='*';
7. Restarted the DB.
Is the aq_tm_processes now reset?
Show parameter shows the value 0.
alter system reset aq_tm_processes scope=spfile sid='*'
ERROR at line 1:
ORA-32010: cannot find entry to delete in SPFILE
It seems that the value is reset (as the parameter can not be found in the spfile). But Im still worried. Should the value show 0 if the parameter is reset?
Regards
PeterPeter, your question is not clear. Do you want the parameter to be set to 0? Run "show parameter aq", look at the value, if it is what you want, no problem. If it is not, set it to whatever value you want. Setting aq_tm_processes to 0 or not having it in your parameter file have the same effect.
-
"Alter system set command" in a RAC database!!
Hi, all.
The database is (10.2.0.2.0) 2- node RAC database on 32-bit windows 2003
EE SP1.
I issued the following command on Node 1 database.
--> Alter system set db_block_buffers= xxx sid='rac1';
I was able to see "PE enqueue" in top 5 wait event section from an AWR report.
In addition, I was able to find "PZ99","PZ98" process dump file in BDUMP.
Soon later, I could find CKPT and DBWR hung.
Is there anyone who experienced this issue?
Thanks and Regards.
Message was edited by:
user50729010.2.0.2 has some bug which is fixed 10.2.0.3
You check sequence cache. If it has less value, increase it to 10000.
select CACHE_SIZE from dba_sequences where SEQUENCE_OWNER='SYS' and SEQUENCE_NAME='AUDSES$';
SQL> alter sequence sys.audses$ cache 10000;
Ashok -
Hi, all.
I am looking for the oracle manual or html link with regard to the following command.
alter session set events 'immediate trace name systemstate level 10';
alter session set events 'immediate trace name hanganalyze level 3';
alter system set events '27468 trace name errorstack level 3';
alter system set events '27468 trace name systemstate level 10';
alter system set events 'immediate trace name events level 4';
I was not able to find related documents at the following links.
http://www.oracle.com/pls/db102/search?word=&partno=
Thanks and Regards.Metalink note 218105.1 gives information about how to set events. For specific events you can also search Metalink.
-
Please help me in this command alter system
I enter to DB as dba from toad and try to execute this command to alter the format mask of the date
ALTER SYSTEM SET NLS_DATE_FORMAT='dd/mm/yyyy' SCOPE =
SPFILE;
but this error come for me
ORA-02096: specified initialization parameter is not modifiable with this optionI am not sure why you got error? Its working fine for me,
SQL> alter system set nls_date_format='dd/mm/yyyy' scope=spfile;
System altered.
SQL> select * from V$version;
BANNER
--------------------------------------------------------------------------------Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
PL/SQL Release 11.1.0.6.0 - Production
CORE 11.1.0.6.0 Production
TNS for Linux: Version 11.1.0.6.0 - Production
NLSRTL Version 11.1.0.6.0 - ProductionHTH
Aman.... -
Abend while executing alter system kill session command
I have a ML350 G3 Hp server(Xeon 2.4 Ghz) running oracle 8.1.5 on Novell 5.1. Frequently i have locking problems in my software. So when i tried to kill the active session using alter system kill session 'sid, serial#' my server produce following error:
Fatal Exception (Number 14, cause abend: Page fault running process: orcl_000000fe code executing in module core81.nlm v8.1d at offset +6c490h). Any suggestions.This forum is for posting feedback about the OTN site.
The best place for your question is probably a Database forum.
There is a list of Database forums here:
http://forums.oracle.com/forums/index.jsp?cat=18 -
Question about ALTER SYSTEM ARCHIVE LOG START
Good morning,
I'm trying (unsuccessfully) to get my database to be in archive log mode.
These are the steps I followed:
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 535662592 bytes
Fixed Size 1375792 bytes
Variable Size 377487824 bytes
Database Buffers 150994944 bytes
Redo Buffers 5804032 bytes
Database mounted.
SQL> select log_mode from v$database;
LOG_MODE
ARCHIVELOG
SQL> show parameter log_archive_start;
NAME TYPE VALUE
log_archive_start boolean FALSE
SQL> alter system archive log start;
System altered.
SQL> show parameter log_archive_start;
NAME TYPE VALUE
log_archive_start boolean FALSE
SQL>I've gone thru that process twice but, I don't seem to be able to get the ARCH process to start. (newbie mistake I'm sure...)
Thank you for your help (again!),
John.The parameter log_archive_start is no more needed John (as suggested already) and the best way to check the archive options is through the archive log list command.
[oracle@edhdr2p0-orcl oui]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Tue Aug 10 10:51:57 2010
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
SQL> archive log list
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 11
Current log sequence 13
SQL> shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Total System Global Area 418484224 bytes
Fixed Size 1336932 bytes
Variable Size 318769564 bytes
Database Buffers 92274688 bytes
Redo Buffers 6103040 bytes
Database mounted.
SQL> select process,status from V$archive_processes;
PROCESS STATUS
0 STOPPED
1 STOPPED
2 STOPPED
3 STOPPED
4 STOPPED
5 STOPPED
6 STOPPED
7 STOPPED
8 STOPPED
9 STOPPED
10 STOPPED
PROCESS STATUS
11 STOPPED
12 STOPPED
13 STOPPED
14 STOPPED
15 STOPPED
16 STOPPED
17 STOPPED
18 STOPPED
19 STOPPED
20 STOPPED
21 STOPPED
PROCESS STATUS
22 STOPPED
23 STOPPED
24 STOPPED
25 STOPPED
26 STOPPED
27 STOPPED
28 STOPPED
29 STOPPED
30 rows selected.
SQL>
SQL> alter database archivelog;
Database altered.
SQL> alter database open;
archive log list;
Database altered.
SQL> Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 11
Next log sequence to archive 13
Current log sequence 13
SQL>
SQL> select * from V$archive_processes where status <> 'STOPPED';
PROCESS STATUS LOG_SEQUENCE STAT
0 ACTIVE 0 IDLE
1 ACTIVE 0 IDLE
2 ACTIVE 0 IDLE
3 ACTIVE 0 IDLEHTH
Aman.... -
Hi,
I was under impression that
"PFILE has the limitation to change the initialization parameters dynamically.If any init parameter is to be changed,we can edit the pfile and the parameter changes will come into effect with the next reboot of the system.
To overcome this limitation,Oracle has come up with the concept of SPFILE ,where in the initialization parameters can be changed dynamically using ALTER SYSTEM SET statement."
But,today I started my test database using PFILE and executed the following command to change the memory_target parameter from 300M to 290M.
ALTER SYSTEM SET memory_target=290M;
And to my surprise,this statement executed fine without any errors and memory_target parameter has been set to the new value(of course,in memory).
Isn't it changing the init parameters dynamically using PFILE itself??
Please clarify my doubt and correct my understanding.
Regards,
BharathbharathDBA wrote:
Hi,
I was under impression that
"PFILE has the limitation to change the initialization parameters dynamically.If any init parameter is to be changed,we can edit the pfile and the parameter changes will come into effect with the next reboot of the system.
To overcome this limitation,Oracle has come up with the concept of SPFILE ,where in the initialization parameters can be changed dynamically using ALTER SYSTEM SET statement."
But,today I started my test database using PFILE and executed the following command to change the memory_target parameter from 300M to 290M.
ALTER SYSTEM SET memory_target=290M;
And to my surprise,this statement executed fine without any errors and memory_target parameter has been set to the new value(of course,in memory).
Isn't it changing the init parameters dynamically using PFILE itself??
Please clarify my doubt and correct my understanding.
Regards,
Bharath
You have a wrong interpenetration about the genesis of the SPFILE. Yes it is a binary file and all that but remember, its not the SPFILE that makes a parameter dynamic or a PFILE that makes it static but it's the very nature of the parameter itself that makes it happen. Yes, the difference in the PFILE and SPFILE parameter would be evident when you would change a dynamic parameter and would give a bounce to the db. Since teh PFILE wasn't updated (its a text file so has to be updated manually) , with the next restart, the parameter would take the same value as it has in the PFILE. But with the SPFILE, depending on what you have set in the SCOPE, the parameter would behave accordingly.
HTH
Aman.... -
ALTER SYSTEM KILL SESSION privilege
Hi All,
Is there any possibility to use this command from a without having DBA priviileges, what is the privilege to be grantd to the ordinary users to execute ALTER SYSTEM KILL SESSION... statement..
Thanks in advanceThe procedure proposed by Rusell would be more or less so:
SQL> create or replace procedure kill_session
2 ( v_sid number, v_serial number )
3 as
4 v_varchar2 varchar2(100);
5 begin
6 execute immediate 'ALTER SYSTEM KILL SESSION '''
7 || v_sid || ',' || v_serial || '''';
8 end;
9 /
Procedure created.
SQL> select username, sid, serial# from v$session;
USERNAME SID SERIAL#
147 5078
SYS 148 6161
151 6769
156 1
158 1
159 1
REPOS_OWNER 161 14502
163 1
164 1
165 1
166 1
USERNAME SID SERIAL#
167 1
168 1
169 1
170 1
15 rows selected.
SQL>
SQL> exec kill_session(161,14502);
PL/SQL procedure successfully completed.
SQL>Joel Pérez
http://otn.oracle.com/experts -
Alter system set shared_pool_size extremely slow.
I am trying to increase my shared_pool_size from 60m to 200m by simply typing alter system set shared_pool_size=200m;
I did alter system flush shared_pool; before to clear out the current shared_pool.
I'm on 9i and my SGA_MAX_SIZE is 3g and I have plenty room to grow.
show sga
Total System Global Area 3222769016 bytes
Fixed Size 744824 bytes
Variable Size 2382364672 bytes
Database Buffers 838860800 bytes
Redo Buffers 798720 bytes
My event in v$session_wait is background parameter adjustment.
Any help would be appreciated. I know that I can bounce the server and let it read it from the init.ora. However, I'm trying to fix some current 4031s in my shared pool. The flush did fix them temporarily.Are you sure your instance was in the state you thought it was ? This is what you reported from show sga:
Total System Global Area 3222769016 bytes
Fixed Size 744824 bytes
Variable Size 2382364672 bytes
Database Buffers 838860800 bytes
Redo Buffers 798720 bytesYou say your shared_pool_size is 60M and you want to grow it to 200M, but the Variable Size in the output above suggests that your shared pool had already grown to about 2.3 GB, so your command would have been trying to shrink it quite dramatically. (And 9i isn't very good at shrinking the shared pool because of the problems of pinned and "KEEP"ed objects in the library cache.
Things to check (from another session):
v$sga_current_resize_ops to see if your resize operation is still running, and what it's trying to do.
v$sga_resize_ops to see i f your resize operation completed some time ago - leaving your session stuck somewhere else. (There's a convenient query I wrote against this view published here: http://jonathanlewis.wordpress.com/2007/04/16/sga-resizing/ )
v$session_wait (for the resize session) to see if the session is waiting or working
v$sesstat (for the resize session) to see if it gives you any clues about current activity
Regards
Jonathan Lewis
http://jonathanlewis.wordpress.com
http://www.jlcomp.demon.co.uk
Maybe you are looking for
-
Is there a better way to do this with Flash?
I am new to Flash but am slowly teaching myself via Lynda.com etc I have an image that I have added to a website via a content management system and want to make certain areas of that image into links to other sites. I found this page that does the k
-
MM Purchase order Workflow links
Dear friends, I was working on MM Purchase order workflows. Please specify Links for exploring MM workflows. thanks and Regards,
-
I have a big problem with my usb connection. Very often it happens (generally the bigger the file the more often it is) that indicator of copying to phone stops... th only i can do is to plug off the phone and plug it in again hoping this time it wou
-
Accessing MySQL from Java query
I've been getting the following message: Data source rejected establishment of connection, message from server: "Host 'x.x.x.x' is not allowed to connect to this MySQL server" and was wondering if there's any chance it's a problem with my Java code?
-
Screen exit for transaction IW31 for ref. object O150
Hi, I need for find screen enhancement for trasaction iw31 in plant maintenance. The requirement is to add 2 more fields (Functional location and Assembly) in the 'reference object' O150 on header tab. Currently the reference object has 2 fields and