7 Replies Latest reply: Oct 8, 2012 12:36 PM by Karan Kukreja RSS

    How to find OS version through Sql

    user-Keen
      Is there any table which contain operating system name and it's version for SR( Oracle Metalink) purpose.

      thanks.
        • 1. Re: How to find OS version through Sql
          860213
          Below command will give you good output for most of the OS:-

          select dbms_utility.port_string from dual;

          Thanks,
          JD
          • 2. Re: How to find OS version through Sql
            user-Keen
            JD

            This command is returning the value as Operating system but the version of OS is not available,

            Pls Advice
            • 3. Re: How to find OS version through Sql
              860213
              This command is returning the value as Operating system but the version of OS is not available,
              I don't think you can more then output from oracle database, Wait for response from other people.

              Also i was just wondering what could be requirement to know the version from database only?

              Thanks,
              JD
              • 4. Re: How to find OS version through Sql
                Mahesh Gholap
                To get the OS Version you can execute below commands,

                Hi,
                You can get the OS version by below commands :

                SELECT PRODUCT, VERSION FROM SYS.PRODUCT_COMPONENT_VERSION;

                PORT_STRING
                --------------------------------------------------------------------------------
                IBMPC/WIN_NT-8.1.0



                SQL> SELECT PRODUCT, VERSION FROM SYS.PRODUCT_COMPONENT_VERSION;

                PRODUCT                                                                          VERSION
                -------------------------------------------------------------------------------- -------------
                NLSRTL                                                                           11.2.0.2.0
                Oracle Database 11g Enterprise Edition                                           11.2.0.2.0
                PL/SQL                                                                           11.2.0.2.0
                TNS for 32-bit Windows:                                                          11.2.0.2.0

                SQL> SELECT RTRIM(SUBSTR(REPLACE(BANNER,'TNS FOR ',''),1,INSTR(REPLACE(BANNER,'TNS FOR ',''),':')-1)) OS
                FROM V$VERSION
                WHERE  BANNER LIKE 'TNS FOR %' ;

                OS
                --------------------------------------------------------------------------------
                +32-bit Windows+
                • 5. Re: How to find OS version through Sql
                  Mark D Powell
                  But the information does not seem accurate enough. Looking at the output of product_component_version for AIX all I see is that the OS is AIX. The version information is not included and there is a huge difference between XP, Windows 2003, and Windows 2008.

                  On a UNIX platform uname can be used to see the OS version but where you can see this via pure sql is something I do not know.


                  HTH -- Mark D Powell --
                  • 6. Re: How to find OS version through Sql
                    jgarry
                    If you are doing it for metalink, why not use the tools they supply, like rda? The tools acknowledge not everything should be done in sql, so use perl.

                    Search metalink for:
                    working effectively with support rda

                    Note particularly Working with Support - MOSSOS [ID 1265130.1] and Working Effectively With Support Best Practices [ID 166650.1]
                    • 7. Re: How to find OS version through Sql
                      Karan Kukreja
                      Hi User,

                      If you looking this information to update in the SR, kindly use the uname command to check the OS .. Also if its SEV1 , you should simply ask your sysadmin to tell you your OS version and go ahead to raise the SR.


                      formore details issue the command :
                      man uname 
                      HTH
                      kk