snippetModerate
How can I determine if Oracle is installed on Microsoft Windows or Unix using SQL?
Viewed 0 times
canunixsqlmicrosoftusingdeterminehowwindowsoracleinstalled
Problem
Is there a view in which I can check it? I need to create a script using the
SUBSTR function by / (Linux) or \ (Windows).SUBSTR('anything', 1, INSTR('anything', '/', 1, 1)) -- Linux
SUBSTR('anything', 1, INSTR('anything', '\\', 1, 1)) -- WindowsSolution
SQL> select platform_name from v$database;
PLATFORM_NAME
--------------------------------------------------------------------------------
Linux x86 64-bitTo answer your original problem:
SQL> select sys_context('userenv', 'platform_slash') from dual;
SYS_CONTEXT('USERENV','PLATFORM_SLASH')
--------------------------------------------------------------------------------
/SYS_CONTEXT
PLATFORM_SLASH
The slash character that is used as the file path delimiter for your
platform.
Code Snippets
SQL> select platform_name from v$database;
PLATFORM_NAME
--------------------------------------------------------------------------------
Linux x86 64-bitSQL> select sys_context('userenv', 'platform_slash') from dual;
SYS_CONTEXT('USERENV','PLATFORM_SLASH')
--------------------------------------------------------------------------------
/Context
StackExchange Database Administrators Q#332683, answer score: 18
Revisions (0)
No revisions yet.