I have an application that uses database. Data about how to connect to the database is stored in a properties file. There you can find server name, database name, username, password, ... I read this file and make a connecton to a database in my program.
How can I "hide" the password, so that someone else would have it hard time to retrieve that password?
Related
I'm trying to mask sensitive data via an Azure SQL database.
The data is saved as normal text and one column as XML and another saved as json.
I've tried adding rules to the database but when I open SSMS and run a select statement it does not apply to any of the data in the columns (normal text, xml or json saved data)
There's no user excluded to see unmasked data.
Just want to understand why the data is not masked when I perform a select on SSMS.
My rules look like the below:
XML Rule
JSON Rule:
Text Rule:
My SQL statment:
SELECT TOP (1000) * from database_Name
As mentioned in Microsoft Document it says,
The identities in Azure Active Directory (Azure AD) or SQL are included in the masking process and should have access to the unmasked sensitive data.
Maybe you are accessing data as SQL admin or Azure AD user because of that you can see sensitive data.
By hiding important information from unwanted users at multiple layers of the database, you may prevent access and gain control. You may give or remove UNMASK permission to a user.
The code taken from Microsoft-documentation it says,
Give UNMASK permission to user
GRANT UNMASK ON Data.Membership TO USER;
To Query the data under the context of user
EXECUTE AS USER='USER';
To revoke UNMASK permissions
REVOKE UNMASK ON Data.Membership FROM USER;
Data after granting permission to user
Data after removing permission from user
Taken Reference from:
SQL Database dynamic data masking with the Azure portal
Granting and Revoking the Permission
When importing a SQL Server database from another machine using a .BAK file through the restore option, the process appears to be successful and completes with the database now in the list within SQL Server Management Studio. But one thing I need clarified please.
When the Restore dialogue is importing the database a row of fields are displayed including "Name", "component", "Type" etc. But the last field is the username. Is this field simply showing the owner of the database where it originated from or is this value used with relevance in the imported database?
I looked in database_name >> Security > Users in SSMS but the user shown in the restore process is not listed
i am trying to connect with sql and oracle database from excel i want save username and password
after providing username and password you have the options above to save password in file that file available in MyDataSources.
i have a stored procedure that sends an email with an attachment, one of the developers decided to drop the lookup table with the file paths in, I've recreated the table but cant remember how the string needs to be for the file path and name to be picked up.
I've tried N'C:\Filename.xls' AND N'\\PCName\temp\filename.xls' and a few other variations but keep getting "Attachment file N'C:\Filename.xls' is invalid".
I've assigned the relevant file permissions so that there are no access restrictions on the folder or file that the file is stored in.
Thanks
I've figured it out! The SQL instance is set up to use the built in SA account for authentication by default which has no access to local drives!! what a pain!!
I'm having big trouble in copying an Oracle DB to the same server but with another name, to use as a development DB.
I'm used to SQL Server, I'm new to Oracle (11g).
I wanted to use the 'Database copy' from SQL Developer, but I'm getting errors all the way. First it was about missing tablespaces.
Then when I manually created them in my new empty DB the errors were about missing users.
I wanted to create the users manually, but then I first needed to create missing roles.
When all that was done, it failed on missing indexes...
How do I copy everything I need with 'Database copy'?
Any advice is greatly appreciated!
SQL Developer copy will only copy objects between schemas. Do you want to just make a copy of a schema? Or a whole new database, including all schemas?
Judging by your question, I'm assuming the latter. If so, RMAN "database duplication" may help you.
See http://www.oracle-base.com/articles/11g/duplicate-database-using-rman-11gr2.php at Tim Hall's excellent site.
The best way for you is to create a new user :
Launch MSDOS Shell Connect to your database using system manager
account
sqlplus / as sysdba
Then write these sequences:
CREATE USER user2 IDENTIFIED BY user2password;
GRANT ALL PRIVILEGE TO user2 WITH ADMIN OPTION;
GRANT CONNECT TO user2;
GRANT DBA TO user2;
exit oracle prompt
In MSDOS Shell again, export your current user1 like this :
exp user1/password
or
exp user1/password#connectString
if you have a connection string specified in tnsnames.ora
Answer all the questions by default, give a name to your export file, and specify that you want to export only the user user1
Then proceed to the importation of the dump in your new user2 like this :
imp user2/password2 fromuser=user1 touser=user2
Answer all the questions by default, give the name to your export file (if you don't change the default folder of CmdShell you will not have to specify the complete folder)
An interesting link on this from Oracle documentation:
http://docs.oracle.com/cd/E11882_01/backup.112/e10642/rcmdupdb.htm#BRADV010