Wednesday, December 5, 2018

ORA-02153: invalid VALUES password string

I am trying to alter an oracle user with the values clause rather than supplying the password in plain text but I am getting the error.

ORA-02153: invalid VALUES password string


SQL> alter user harvey identified by values 'S:AE24159F69EAD93A06E2D274D4C3E493EEE134CBCAA88CE869AEE7A40AC4;T:2E3AC72D182037E1EEC8D07FC1AAA7315940BF742217A635DBE4A58BF3E56B524E593BF9D30BD6B3CD73C3B56
  2  A781A00DD56D35E1E2C531DA702D4B6BF9A4D6C21597BA18C11BAFED7D9B9627A179DB5;337BCAD956B180F8';
alter user harvey identified by values 'S:AE24159F69EAD93A06E2D274D4C3E493EEE134CBCAA88CE869AEE7A40AC4;T:2E3AC72D182037E1EEC8D07FC1AAA7315940BF742217A635DBE4A58BF3E56B524E593BF9D30BD6B3CD73C3B56
*
ERROR at line 1:
ORA-02153: invalid VALUES password string


SQL>


I could not get my head around what is this, but it looks like it is something to do with the values string.

I have noticed that when I run the get_ddl for user it returned the hash of password in multiple lines and I was copying and pasting it and hence getting the error.

In order to fix this I have to get that value in one line and then it works

SQL> alter user harvey identified by values 'S:AE24159F69EAD93A06E2D274D4C3E493EEE134CBCAA88CE869AEE7A40AC4;T:2E3AC72D182037E1EEC8D07FC1AAA7315940BF742217A635DBE4A58BF3E56B524E593BF9D30BD6B3CD73C3B56A781A00DD56D35E1E2C531DA702D4B6BF9A4D6C21597BA18C11BAFED7D9B9627A179DB5;337BCAD956B180F8';

User altered.

SQL>

Done deal :-) 


Monday, December 3, 2018

Getting error while trying to run "Login-AzureRmAccount" from powershell

I am getting the error below while trying to login to azure using the power shell

PS C:\WINDOWS\system32> Login-AzureRmAccount
Login-AzureRmAccount : The term 'Login-AzureRmAccount' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is
correct and try again.
At line:1 char:1
+ Login-AzureRmAccount
+ ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Login-AzureRmAccount:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException


PS C:\WINDOWS\system32>


In order to fix this I have done the installation of required module and it has started working fine.

PS C:\WINDOWS\system32> Install-Module -Name AzureRM -AllowClobber

PS C:\WINDOWS\system32>


But then I started getting another error:

PS C:\WINDOWS\system32> Login-AzureRmAccount
Login-AzureRmAccount : The 'Login-AzureRmAccount' command was found in the module 'AzureRM.profile', but the module could not be loaded. For more information, run 'Import-Module AzureRM.profile'.
At line:1 char:1
+ Login-AzureRmAccount
+ ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Login-AzureRmAccount:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CouldNotAutoloadMatchingModule


PS C:\WINDOWS\system32>

Then another one :-( 

PS C:\WINDOWS\system32> Import-Module AzureRM.profile
Import-Module : File C:\Program Files\WindowsPowerShell\Modules\AzureRM.profile\5.8.2\AzureRM.Profile.psm1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies
at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ Import-Module AzureRM.profile
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [Import-Module], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess,Microsoft.PowerShell.Commands.ImportModuleCommand

PS C:\WINDOWS\system32>

The I had to install the module 

PS C:\WINDOWS\system32> Install-Module -Name AzureRM.profile

PS C:\WINDOWS\system32>

Finally noticed that the execution policy is set to Restricted and it should be Unrestricted.


PS C:\WINDOWS\system32> Get-ExecutionPolicy
Restricted

PS C:\WINDOWS\system32> set-executionpolicy Unrestricted

PS C:\WINDOWS\system32>


PS C:\WINDOWS\system32> Get-ExecutionPolicy
Unrestricted

PS C:\WINDOWS\system32>

and there we go the azure login script is working now.


PS C:\WINDOWS\system32> Login-AzureRmAccount

Account                   SubscriptionName TenantId                             Environment
-------                   ---------------- --------                             -----------
XFtxxxxxxxx@xxxxxxxxxx.com Azuxxxx       00000000-0000-0000-0000-000000000000 AzureCloud



PS C:\WINDOWS\system32>


ORA-39181: Only partial table data may be exported due to fine grain access control on "OWNER"."TABLE_NAME"

Received an error while performing the export of an oracle database using System user.

ORA-39181: Only partial table data may be exported due to fine grain access control on "OWNER"."TABLE_NAME"

As the errors points that this is the issue with the fine grain access on the table. User surprisingly user system need exemption and can be done by

 GRANT EXEMPT ACCESS POLICY to System;

Next time you perform the export using system it should be all good.