12 Replies Latest reply: Apr 7, 2012 4:14 AM by 912595 RSS

    alert log

    886535
      can anyone give me the steps for alert log shipping?


      Thanks in advance
        • 1. Re: alert log
          jgarry
          Not something one would normally do. Now, if you mean archive log shipping, there are many ways in the docs, and plenty of stuff on the net. What is your requirement?
          • 2. Re: alert log
            sb92075
            883532 wrote:
            can anyone give me the steps for alert log shipping?
            ALERT LOG?
            ship it where?
            • 3. Re: alert log
              886535
              i have faced in one question in interview
              if alaert log reaches the value 3 gb then we take the back up and we have to create alert log once again.
              can u give me the step how i will take the back up alert log weather i have to shut down the db or any thing???
              • 4. Re: alert log
                sb92075
                883532 wrote:
                i have faced in one question in interview
                if alaert log reaches the value 3 gb then we take the back up and we have to create alert log once again.
                can u give me the step how i will take the back up alert log weather i have to shut down the db or any thing???
                Do you have a working DB?
                What happens when you move the alert_SID.log file?
                • 5. Re: alert log
                  EdStevens
                  883532 wrote:
                  i have faced in one question in interview
                  if alaert log reaches the value 3 gb then we take the back up and we have to create alert log once again.
                  can u give me the step how i will take the back up alert log weather i have to shut down the db or any thing???
                  It's a LOG file. It logs runtime messages from the database. If the database tries to write to it and it's not there (why wouldn't it be there? I dont' know, let's say the DBA moved it for some reason. some reason like it reached 3gb in size and some manager decided that was too big) it will simply initialize a new one and start writing to it.

                  http://edstevensdba.wordpress.com/category/opinion/
                  • 6. Re: alert log
                    jgarry
                    EdStevens wrote:
                    883532 wrote:
                    i have faced in one question in interview
                    if alaert log reaches the value 3 gb then we take the back up and we have to create alert log once again.
                    can u give me the step how i will take the back up alert log weather i have to shut down the db or any thing???
                    This is version and platform dependent. Assuming 11g, search the doc set at tahiti.oracle.com for [url http://docs.oracle.com/cd/E11882_01/server.112/e22490/adrci.htm#SUTIL1509]adcri.

                    I still wonder if you are propagating the interview question correctly.

                    >
                    >
                    It's a LOG file. It logs runtime messages from the database. If the database tries to write to it and it's not there (why wouldn't it be there? I dont' know, let's say the DBA moved it for some reason. some reason like it reached 3gb in size and some manager decided that was too big) it will simply initialize a new one and start writing to it.
                    But it could be confusing, depending on [url http://www.freelists.org/post/oracle-l/missing-alertlog-mystery-its-not-what-you-think,10]why it is not there.

                    >
                    http://edstevensdba.wordpress.com/category/opinion/
                    Excellent opinion piece. Wish I had a laptop, or even a work PC that could handle it.
                    • 7. Re: alert log
                      904735
                      Hi,

                      If alert log size is more just remove (delete) the alert log file.

                      rm alert.log(your file name).

                      That will not impact to anything except free up the space.

                      Eagarly if you want to keep it for referrence just take the backup of that file to other location.

                      Thanks,
                      Srini...
                      • 8. Re: alert log
                        Hemant
                        Hi ,
                        Just Move this alert log file in another location ,and create the new one of same name on its original location.

                        This doe not affect the database.
                        Regards
                        Hemant Kr
                        • 9. Re: alert log
                          Think_dba
                          Hemant wrote:
                          Hi ,
                          Just Move this alert log file in another location ,and
                          create the new one of same name on its original location
                          .
                          Why?

                          Once you delete or move the alert logfile it will create on automatically
                          • 10. Re: alert log
                            886535
                            while taking the backup of alert log file we have to shut down the database or we can take backup while database up and running ?
                            how i will create new alert log file in that location ?
                            from my knowledge it will create automatically am i wright?

                            Edited by: 883532 on Apr 7, 2012 1:24 AM
                            • 11. Re: alert log
                              CKPT
                              883532 wrote:
                              while taking the backup of alert log file we have to shut down the database or we can take backup while database up and running ?
                              how i will create new alert log file in that location ?
                              from my knowledge it will create automatically am i wright?

                              Edited by: 883532 on Apr 7, 2012 1:24 AM
                              Dear,

                              Its just text information messages recorded into alert log file, There is no such backup procedure for alert log file except cp command. Even no need to shutdown too.
                              You rename the alertlog file , then oracle automatically creates a new alert log file in same location.

                              I suggest you to go with oracle documentation to understand these concepts http://tahiti.oracle.com
                              • 12. Re: alert log
                                912595
                                883532 wrote:
                                while taking the backup of alert log file we have to shut down the database or we can take backup while database up and running ?
                                Alert.log file cannot be backuped by RMAN command,
                                Like you normally do for backing up the full dtaabase
                                how i will create new alert log file in that location ?
                                alert.log will be create automatically if you remove it... You dont need to take care of creating it manually at all.
                                from my knowledge it will create automatically am i wright?
                                Yes

                                its possible to use cp or mv comand while your database is running.
                                Oracle appends the new messages in alert.log and if file is not found it rest its pointer/counter and then creates a newfile and then start the counter/pointer again and start writting to it.


                                FYI there is also a way to add our messgaes to alert.log file too.The procedure kdswrt in dbms_system package allows us to write own messages in the alert log / trace files or both.

                                Jonathan explained ways to write our custom message to alert.log and to trace files.

                                The functions to use are as follows:
                                dbms_system.ksdwrt(1,'xxxx') -- writes to the alert log
                                dbms_system.ksdwrt(2,'xxxx') -- writes to a trace file for the current session
                                dbms_system.ksdwrt(3,'xxxx') -- writes to both the alert log and a trace file
                                dbms_system.ksdddt -- used to write a date / time stamp
                                dbms_system.ksdind(n) -- indent the output using ":" characters
                                dbms_system.ksdfls -- flushes the output to file.
                                In addition, in Oracle 11g and beyond we are able to directly query the Alert.log file with an SQL statement via the table X$DBGALERTEXT.

                                E.g
                                SQL>SELECT message_text FROM X$DBGALERTEXT WHERE rownum < 20;
                                http://docs.oracle.com/cd/B19306_01/server.102/b14231/manproc.htm#sthref729
                                Hope this help