Below I provided the results of two following queries:
SELECT USERNAME, USER_ID FROM DBA_USERS ORDER BY USER_ID DESC;
SELECT ROLE, ROLE_ID FROM DBA_ROLES ORDER BY ROLE_ID DESC;
that display Oracle Database 18 users, roles and their IDs:
(more…)Below I provided the results of two following queries:
SELECT USERNAME, USER_ID FROM DBA_USERS ORDER BY USER_ID DESC;
SELECT ROLE, ROLE_ID FROM DBA_ROLES ORDER BY ROLE_ID DESC;
that display Oracle Database 18 users, roles and their IDs:
(more…)First, check MySQL version:
SHOW VARIABLES LIKE "%version%";
+-------------------------+-------------------------+
| Variable_name | Value |
+-------------------------+-------------------------+
| innodb_version | 5.7.25 |
| protocol_version | 10 |
| slave_type_conversions | |
| tls_version | TLSv1,TLSv1.1 |
| version | 5.7.25-0ubuntu0.16.04.2 |
| version_comment | (Ubuntu) |
| version_compile_machine | x86_64 |
| version_compile_os | Linux |
+-------------------------+-------------------------+
The string representation of a type is implementation defined in C++, for example the following code produce the different output with MSVC, GCC and CLang:
#include <string>
#include <iostream>
struct A {};
class B {};
namespace ns
{
struct X {};
}
int main()
{
std::cout << typeid(A).name() << ", " << typeid(B).name() << ", " << typeid(ns::X).name() << ", " << typeid(std::string).name() << std::endl;
return 0;
}
.NET Framework version 4.5 and higher can be determined with the following C++ code:
#include <windows.h>
bool IsDotNet45Installed()
{
DWORD value{};
DWORD dataSize = sizeof(value);
const LONG retCode = ::RegGetValue(
HKEY_LOCAL_MACHINE,
L"SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v4\\Full\\",
L"Release",
RRF_RT_REG_DWORD,
nullptr,
&value,
&dataSize
);
if (retCode != ERROR_SUCCESS)
{
return false;
}
return value >= 378389;
}
We had a discussion with colleagues on why in the following code we cannot simply use
static_assert(false)
but need to do a trick with ‘always_false’:
#include <type_traits>
template<typename>
struct always_false : std::false_type {};
template<typename Type>
constexpr int Get()
{
if constexpr (std::is_same_v<Type, int>)
{
return 1;
}
else if constexpr (std::is_same_v<Type, bool>)
{
return 2;
}
else {
static_assert(always_false<Type>::value);
}
}
Download binaries (redistributables) and C++ SDK from Oracle website. For 64bit platform they are respectively:
instantclient-basic-windows.x64-18.5.0.0.0dbru.zip
instantclient-sdk-windows.x64-18.5.0.0.0dbru.zip
Extract them, create a C++ project in VS2017 and link oraocci18.lib in Release configuration and oraocci18d.lib in Debug configuration.
(more…)My SyntaxHighlighter plugin started to display “>” as “ = & g t ;” after I updated my WordPress to a version where blocks were added. To fix the plugin I added the following line to wp-content/plugins/syntaxhighlighter/syntaxhighlighter.php:
$code = preg_replace( '#<pre [^>]+>([^<]+)?</pre>#', '$1', $content );
// Undo escaping done by WordPress
$code = htmlspecialchars_decode( $code );
return $this->shortcode_callback( $attributes, $code, 'code' );
While investigating of how to get all the privileges of an Oracle database user I played with the following queries:
select COUNT(*) from DICTIONARY;
select USERNAME from SYS.ALL_USERS;
select * from DBA_USERS;
select * from DBA_ROLES;
select * from DBA_SYS_PRIVS where grantee = 'CONNECT';
select * from DBA_SYS_PRIVS where grantee = 'RESOURCE';
select * from DBA_SYS_PRIVS;
select * from SESSION_PRIVS;
select * from DBA_TAB_PRIVS where GRANTEE <> 'PUBLIC';
select count(*) from DBA_TAB_PRIVS;
select * from DBA_COL_PRIVS;
select * from ROLE_TAB_PRIVS;
My Ubuntu 18.04 installed in Windows 10 HyperV virtual machine stopped booting up with the following errors:
I installed sample Oracle database schemas with the following steps:
Cloned the repository, changed the directories in the installation script, and started my docker container with the mapped folder:
sudo su - oracle
mkdir repos
cd repos
git clone https://github.com/oracle/db-sample-schemas.git
cd db-sample-schemas
perl -p -i.bak -e 's#__SUB__CWD__#'$(pwd)'#g' *.sql */*.sql */*.dat
exit
sudo docker run -d -it --rm --name oracle18se -v /home/oracle/oradata18:/opt/oracle/oradata -v /home/oracle/repos:/home/oracle/repos -p 1521:1521 -p 5500:5500 oracle/database-se:18.3.0
sudo docker logs oracle18se