Wednesday, March 2, 2022

Rename directory on ASM

 There are 2 type of Directories in ASM

1) Directories created by DBAC or RMAN are called as “System Directory” and they cannot be renamed.

2) Directories created Manually by issuing command “alter diskgroup add directory” or creating in ASMCMD console.

To check if the directory is system created or manually created check the view V$ASM_ALIAS column SYSTEM_CREATED, directories created by system will have the value as ‘Y’

To Rename “Manually” created directories

Login to the ASM console
[grid@tstdev01 ~]$ asmcmd
ASMCMD> cd DATA
ASMCMD> ls
ASM/
DEV/  — Here to rename DEV to TEST

SQL> ALTER DISKGROUP DATA RENAME DIRECTORY ‘+DATA/DEV’ to ‘+DATA/TEST’;
Diskgroup altered.

Once done longin to ASM console and verify the same
[grid@tstdev01 ~]$ asmcmd
ASMCMD> cd DATA
ASMCMD> ls
ASM/
TEST/



To Rename System Created directories

System created directory cannot be rename, use parameter db_unique_name of database. Oracle ASM and Oracle Diagnostic Dest create your own directory structure based on parameter DB_UNIQUE_NAME.

Move Database using RMAN

RMAN> report schema;

using target database control file instead of recovery catalog
Report of database schema for database with db_unique_name DEV

List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
—- ——– ——————– ——- ————————
1 17408 SYSTEM YES +DATA/DEV/DATAFILE/system.259.941719615
2 1800 UNDOTBS1 YES +DATA/DEV/DATAFILE/undotbs1.267.941720063
3 4696 SYSAUX NO +DATA/DEV/DATAFILE/sysaux.258.941719569
4 1243 EXAMPLE NO +DATA/DEV/DATAFILE/example.266.941719731
5 118 USERS NO +DATA/DEV/DATAFILE/users.260.941719669

List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
—- ——– ——————– ———– ——————–
2 1300 TEMP 1300 +DATA/DEV/TEMPFILE/temp.271.942061583

$sqlplus sys as sysdba
SQL> show parameter db_unique_name
NAME TYPE VALUE
———————————— ———– ——————————
db_unique_name string DEV


SQL> show parameter control_files

NAME TYPE VALUE
———————————— ———– ——————————
control_files string +DATA/DEV/CONTROLFILE/current.262.941719717

SQL> Alter system set DB_UNIQUE_NAME=’TEST’ scope=spfile;

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup nomount
SQL> show parameter db_unique_name

NAME TYPE VALUE
———————————— ———– ——————————
db_unique_name string TEST

$rman target /
RMAN> restore controlfile from ‘+DATA/DEV/CONTROLFILE/current.262.941719717’;
Starting restore at 10-MAY-17
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=162 device type=DISK
channel ORA_DISK_1: copied control file copy
output file name=+DATA/TEST/CONTROLFILE/current.263.981519213
Finished restore at 10-MAY-17

RMAN> startup mount;
database is already started
database mounted
released channel: ORA_DISK_1

RMAN> CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 3;
new RMAN configuration parameters:

RMAN> CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 3;
new RMAN configuration parameters are successfully stored

RMAN > CONFIGURE DEVICE TYPE DISK PARALLELISM 3 BACKUP TYPE TO BACKUPSET;
new RMAN configuration parameters:

RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 3 BACKUP TYPE TO BACKUPSET;
new RMAN configuration parameters are successfully stored

RMAN> BACKUP AS COPY DEVICE TYPE DISK DATABASE FORMAT ‘+DATA’;
Finished backup at 10-MAY-17

RMAN> SWITCH DATABASE TO COPY;
datafile 1 switched to datafile copy “+DATA/TEST/datafile/system.290.793638779

RMAN> run {
set newname for tablespace TEMP to ‘+DATA’ ;
switch tempfile all;
}

RMAN> report schema;
Report of database schema for database with db_unique_name TEST

List of Permanent Datafiles
==================
File Size(MB) Tablespace RB segs Datafile Name
—- ——– ——————– ——- ————————
1 17408 SYSTEM YES +DATA/TEST/datafile/system.290.793638779
2 1800 UNDOTBS1 YES +DATA/TEST/datafile/sysaux.291.793638757
3 4696 SYSAUX NO +DATA/TEST/datafile/undotbs1.292.793638823
4 1243 EXAMPLE NO +DATA/TEST/datafile/example.293.793638849
5 118 USERS NO +DATA/TEST/datafile/users.294.793638849

List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
—- ——– ——————– ———– ——————–
1 1300 TEMP 1300 +DATA

RMAN> startup;
database is already started
database opened

Create the new redolog files and drop the old ones.

Once the above activity is completed backup the database.

RMAN> backup database;
Starting backup at 10-MAY-17
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=162 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=194 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=210 device type=DISK
.
.
Recovery Manager complete.

Now you can remove the copy:

RMAN> delete copy;

Advertisements

Oracle RMAN : Restore/ recover a database UNTIL TIME

 This tutorial explains you how to restore/ recover a database until a time.



Oracle RMAN : Restore/ recover a database UNTIL TIME


Here are the steps for Restoring/ Recovering an Oracle database until a specific time in the past:

 

1) Set the environment:

 

on Windows

set ORACLE_SID=DB10
echo %ORACLE_SID%
 

on AIX/Linux

export $ORACLE_SID=DB10

echo $ORACLE_SID

 

2) Connect to rman:

rman target / nocatalog
 

 

3) Start the database in "mount" state:

startup mount;
 

 

4) Run the following :
---------------------------------------
restore database UNTIL TIME
"to_date('11/03/2017 11:34:50 am','mm/dd/yyyy hh:mi:ss am')";

recover database UNTIL TIME
"to_date('11/03/2017 11:34:50 am','mm/dd/yyyy hh:mi:ss am')";

alter database open resetlogs;
---------------------------------------
OR

run
{
set UNTIL TIME "to_date('11/03/2017 11:34:50 am','mm/dd/yyyy hh:mi:ss am')";
restore database;
recover database;
alter database open resetlogs;
}

 

Note:

You have to put the right date/time.

CREATE PASSWORD FILE IN ASM DISK GROUP

 FOR ORACLE 12C ONLY

ASMCMD> pwcreate –dbuniquename {db_unique_name} {file_path} {sys_password}

ASMCMD> pwcreate –dbuniquename PRDPRE +DATA/PWDFILE/pwdPRDPREoracle

FOR ALL VERSION

orapwd file=’+DATA/orapwPRODPRE’ ENTRIES=10 DBUNIQUENAME=’PRODPRE’



https://docs.oracle.com/database/121/OSTMG/GUID-2ACBBB1E-A39D-473E-A9EF-E7BC3872C36E.htm

Tuesday, March 1, 2022

WHAT IS NFT AND HOW TO EARN WITH IT?

 

If you are interested in NFTs, this is how you earn it

NFTs are virtual goods used in gaming. They are often digital representations of objects that can be sold, traded or even rented. Examples include skins for weapons in the game Counter-Strike: Global Offensive, or Warframe platinum currency that can be bought with real money and used to purchase items in the game.

The first thing we should know about NFT is that it stands for Non-Fungible Token. In today’s digital world, these tokens can be treated as a form of property because they have a string value and cannot be divided into smaller quantities.

Non-Fungible Tokens are the new “genie” in the Crypto world. They are decentralized, fungible tokens that can digitally represent an asset or idea. These tokens are non-physical and cannot be duplicated.

When talking about how to earn money with this technology, there are multiple ways. We’ll discuss some of them later in the article along with answering the following questions:

  • What can I do with an NFT?
  • Can you make money with NFT?
  • What is NFT digital art?


 

How do Non-Fungible Tokens work?

Non-Fungible Tokens are unique digital assets that are accompanied by a certificate. The Certificate of Authenticity for the asset states that it is unique and different from any other token.

Ownership of the token is recorded through blockchain technology. These tokens could be digital representations of physical assets, such as artwork or clothing. As long as you are the owner, you can earn passive income with NFTs by imposing terms.

 

How to create NFTs & earn money?

The question of how to create non-fungible tokens and earn money has been on the minds of entrepreneurs, developers, and enthusiasts for quite some time. Non-fungible tokens are tokens that are unique in terms of their characteristics.

The following are the steps a person needs to follow to make NFT.

  • First, clarify and figure out what a non-fungible token is, and you are sure to make one and sell it.
  • Check out the platforms and select one that you want to sell.
  • Next, set up and connect the crypto wallet.
  • Finally, start creating your first non-fungible token and list it on your chosen platform.

After listing the digital assets, there are multiple ways of making a lifetime passive money. Some of them are the following.

 

Sell Non-Fungible Token on a Marketplace:

One of the most popular ways for people to make money is by selling their NFTs on a marketplace. There are a variety of platforms and marketplaces where these NFTs can be sold and traded on, such as:

  • OpenSea
  • Axie Marketplace
  • CryptoPunks
  • Rarible
  • SuperRare
  • Mintable

and so on.

 

Rent out:

Non-fungible tokens (NFTs) are digital assets that cannot be replicated. One way to use NFTs is through what is known as “renting”. Renting an NFT means giving it away for a fixed period of time in return for money.

 

Royalties:

The digital asset creator can earn passive lifetime royalties even after selling it out to someone else. The creator needs to impose terms and then, whenever someone buys the asset you initially created, you will still get royalties over your lifetime.

There are many other ways as well and people need to research more and more if they are interested. As we are talking about earning money online, we believe it is crucial to discuss how to make your digital wallet and online transactions safe, unblock content, and browse anonymously. The answer to all these questions is only “VPN.”

Virtual Private Networks are online security systems that use encryption algorithms to protect private information while it is being transmitted. A VPN creates a secure “tunnel” over the public Internet, which can then be used to safely transmit sensitive data.

Every VPN has its own encryption algorithm, although 256-bit encryption is typically the most common type it can also help you access unblocked site safely and quickly. We recommend people use VeePN while making online transactions or just browsing the internet.


 

NFT Sports:

Non-fungible tokens are offering great opportunities to every field, including sports. Unfortunately, no one has fully benefited from them yet. These digital assets can be a great money-making opportunity for sports like football and tennis game, if applied correctly.

They can also be helpful in increasing fan engagement with their favorite sports. Sports lovers always love to get sports collectibles like a badge, t-shirts, etc. and non-fungible tokens provide exactly that opportunity, but in digital form.

Non-fungible tokens in sports can’t only be restricted to t-shirts, badges, but they can also be fans’ favorite moments, photos, historical videos, and so on. In short, anything can be converted to a digital asset.

The sports industry, like the gaming industry, needs to adopt this technology as soon as possible and grow their market, standard, and new way of fan engagement easily.

 

Popular & Expensive Non-Fungible Tokens:

There is a huge list of the most popular and expensive non-fungible tokens. Some of them are already sold for nearly $100 million and even more. Here we are going to briefly discuss 5 popular tokens.

 

The Merge:

The Merge by digital artist Pak is one of the most expensive and popular non-fungible tokens. The Merge is a mysterious and creative artwork and was sold for $91.8 million

 

The First 5000 Days:

The First 5000 Days is an artwork created by the famous Beeple and sold for 69 Million Dollars in a first-ever digital art auction.

 

Human One:

Human One is a hybrid artwork, meaning it also combines some physical elements. The Human One was also created by Beeple and is worth nearly $29M.

 

CryptoPunk #7523:

CryptoPunk #7523 is a digital avatar that was bought by DraftKings’ Shareholder Shalom Mackenzie for nearly $12M.

 

CryptoPunk #3100:

CryptoPunk #3100 is another alien-based digital artwork with a blue and white headband. It sold for about $7.5 million.

In conclusion, NFT is a great way to passively make money. The process may appear daunting at first, but it’s relatively easy if you have some basic knowledge of how to operate on the blockchain.

Insert a new line at the beginning of a file

 Here's a way to add a line to the beginning of a file:


sed -i '1s!^!set timing on\n set time on\n set echo on\n!' batch1.sql_bkp

find . -type f -name '*.sql' -exec sed -i '1s!^!set timing on\n set time on\n set echo on\n!' {} \;


sed -i '1s/^/line_to_be_added\n/' file

Then, you could use the code above with find to achieve your ultimate goal:

find . -type f -name '*.js' -exec sed -i '1s/^/line_to_be_added\n/' {} \;

Wednesday, February 23, 2022

Commvault restore issue troubleshooting

 


Development is suggesting you to apply fix of Bug 33304775 - IPCDAT Errors - IBV Resources are Used for Processes Which Have No Need of Them ( Doc ID 33304775.8 )

There is no workaround, you will need to apply the fix. I'm checking for an available fix for you

Per Dev findings:
=============
The suspicion here is that RMAN is forking DB processes which are using a libcell context/IPCDAT context/QPs that are created by RMAN.

Due to a potential kernel issue, the child does not inherit the security context of the parent correctly (it does a deep copy as expected, but the ibverbs specific code is only doing a shallow comparison of the security context pointer).

If that happens, any ibv_modify_qp() call by the child will hit an EACCES for QPs created by RMAN.


The fix is to make sure that RMAN does not create QPs at all (it should not need to, since it does not do IOs with the cell directly). Bug 33304775 prevents processes from creating QPs unnecessarily, and could help with this issue.
=============
We had a couple of questions for you..
1. Is this issue reproducible 100% of the time when you try restoring this DB? if yes, how much time does it take from the time the restore is started..
2. Do you see the same issue across other DBs that you're migrating to 19c?
3. Are there any other DB or OS processes that are impacted during the same time ?

We can try and arrange a Zoom with rman development and Commvault support during US hours if this issue is easily reproducible. Also here is other information that Engg is requesting..

First, if the CommVault software changes uid or gid or any other process credential during runtime.

Second,
1. Copy the attached dtrace script trace.d to the node where they launch RMAM. The dtrace script will log a message for every attempt to change uid or gid.
2. Run “dtrace -s trace.d > /tmp/dtrace.out”.
3. Reproduce the issue.
a. While commVault/RMAN are running, capture the output of “cat /proc/<pid>/status” periodically, where <pid> is the pid of commVault and RMAN.
4. Once the issue is reproduced, collect the following:
a. The output of “dmesg -T”.
b. The ExaWatcher PS data from the period -- /opt/oracle.ExaWatcher/archive/Ps.ExaWatcher/
/c. var/log/audit/audit.log
d. /var/log/messages
e. /tmp/dtrace.out
f. The periodic dump of “cat /proc/<pid>/status” from Step 3a

Tuesday, December 21, 2021

Why Does the TDE Wallet's Tablespace (TS) Encryption Key Look Different Than The Tablespace Master Key In 12c Database Queries? (Doc ID 2489623.1)

 

APPLIES TO:

Advanced Networking Option - Version 12.1.0.2 and later
Information in this document applies to any platform.

SYMPTOMS

A TDE wallet being used by a 12c database, being the original TDE wallet for the database, seems to be "inconsistent" with the TDE metadata stored in the database.

Specifically, the tablespace (TS) encryption key is similar, but not identical.

The wallet looks like the following example:

$ mkstore -wrl . -list


Enter wallet password:
Oracle Secret Store entries:
ORACLE.SECURITY.DB.ENCRYPTION.AYaiJAv4/08hv01lAzyiTUsAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
ORACLE.SECURITY.DB.ENCRYPTION.MASTERKEY
ORACLE.SECURITY.TS.ENCRYPTION.BTxiCnXBLj2N6bB6HQO3A/ACAwAAAAAAAAAAAAAAAAAAAAAAAAAA

The column keys in ENC$ are in agreement with the value for ORACLE.SECURITY.DB.ENCRYPTION...

+-----------------------------------------------------------+
Master key used to encrypt the columns
+-----------------------------------------------------------+

MKEYID
----------------------------------------------------------------
AYaiJAv4/08hv01lAzyiTUsAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AYaiJAv4/08hv01lAzyiTUsAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AYaiJAv4/08hv01lAzyiTUsAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AYaiJAv4/08hv01lAzyiTUsAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AYaiJAv4/08hv01lAzyiTUsAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

 ...but the tablespace key shown in database queries is not 100% identical to that seen in the wallet (under ORACLE.SECURITY.TS.ENCRYPTION):

+-----------------------------------------------------------+
Master key associated with the tablespaces
+-----------------------------------------------------------+

NAME MASTERKEYID_BASE64
---------------------------------------- ------------------------------------------------------------
SYSTEM ATxiCnXBLj2N6bB6HQO3A/A=
TEMP ATxiCnXBLj2N6bB6HQO3A/A=

(same for other user-owned encrypted tablespaces)

In this example:

  • ORACLE.SECURITY.TS.ENCRYPTION looks like:  BTxiCnXBLj2N6bB6HQO3A/ACAwAAAAAAAAAAAAAAAAAAAAAAAAAA
  • Whereas the tablespace master key looks like:  ATxiCnXBLj2N6bB6HQO3A/AAAAAAAAAAAAAAAAAAAAAAAAAAA

What could cause this apparent discrepancy or "mismatch"?

 

CHANGES

The database was originally 11gR1 (11.1), then later upgraded to 11gR2 (11.2), and finally 12c (12.1).  

TDE was originally implemented on 11gR1, and the wallet has not been updated since.

CAUSE

The discrepancy can be attributed to the use of a 11gR1-style wallet with 12c binaries, as a result of neglecting to rekey the database (which also updates the TDE wallet) after each upgrade of the database.  

There are notable differences in TDE keys and wallets between 11gR1 and 11gR2 (let alone 11gR1 and 12c!), and rekeying the database should be considered a post-upgrade step.
 

SOLUTION

After upgrading from 11gR1 to 11gR2, one needs to rekey the database, so the DB will start using the Unified Master Key which was introduced in 11gR2.

The same applies to going from 11gR1 to 12c. 

It is better to have a 12c-style keystore (wallet) -- i.e. one created with 12c binaries -- on 12c databases, and to use ADMINISTER KEY MANAGMEMENT on 12c (instead of the old ALTER SYSTEM command set).

To accomplish this on 12c, one should merge the 11gR1 or 11gR2 wallet into a new 12c keystore (again using 12c binaries; merging is not possible on 11g).

 

The following example is applicable to a RAC environment which is currently using an older 11gR1 TDE wallet:

All Nodes

1)  Ensure environment variables are set correctly in the OS session, and also in srvctl getenv.  

2)  Change directory to the TDE wallet location.

3)  If an auto-login wallet (cwallet.sso) exists, rename it.  This is necessary because without a specific patch, the auto-login wallet will prevent one from manipulating the password-based wallet.  See also:  "TDE Wallet Problem in 12c: Cannot do a Set Key operation when an auto-login wallet is present" (Doc ID 1944507.1)


Node 1 Only

4)  Create a new, empty directory to hold the 12c keystore (temporarily).

5)  Log into sqlplus.

6)  Close the auto-login keystore (wallet):

     ADMINISTER KEY MANAGEMENT SET KEYSTORE CLOSE;

7)  Verify the wallet status change in V$ and GV$ENCRYPTION_WALLET.  The wallet must no longer be OPEN.

8)  Open the password-based keystore (wallet):

     ADMINISTER KEY MANAGEMENT SET KEYSTORE OPEN IDENTIFIED BY "<current_wallet_password>";

    (Reverify the wallet status as in step 7.)

9)  Create an empty password-based keystore in the directory created in step 4, using the 12c binaries.  Example:

   ADMINISTER KEY MANAGEMENT
     CREATE KEYSTORE '<path_to_new_12c_directory_from_step_4>'
     IDENTIFIED BY <new_keystore_password>;


     Check if the new ewallet.p12 was created in your temporary directory.

10)  Merge the 11g wallet (to which the DB is currently pointing) into the new file you just created.  Example:

     ADMINISTER KEY MANAGEMENT MERGE KEYSTORE '<path_to_11g_wallet>' IDENTIFIED BY <11g_wallet_password>
     INTO EXISTING KEYSTORE '<path_to_new_12c_directory_from_step_4>' IDENTIFIED BY <new_keystore_password>
     WITH BACKUP;

NOTE:  If you get an error or warning here, contact Oracle Support.  Otherwise, continue.

11)  Make sure the files contain the same information:

     $ orapki wallet display -wallet <path_to_11g_wallet>
     $ orapki wallet display -wallet <path_to_new_12c_directory_from_step_4>


If both files contain the same keys, proceed:

12)  Close the old password-based wallet.

       ADMINISTER KEY MANAGEMENT SET KEYSTORE CLOSE IDENTIFIED BY <11g_wallet_password>;

All Nodes

13)  In the database's current TDE wallet directory, rename the old 11g wallet.  Example: mv ewallet.p12 ewallet.p12.11g 

14)  Copy the new 12c keystore file (ewallet.p12) into the current TDE wallet directory.  Since it exists only on Node 1, copy the file to the other nodes as well.

IMPORTANT:  Do NOT create an auto-login keystore yet!

Node 1 Only

15)  Open the new password-based keystore:

       ADMINISTER KEY MANAGEMENT SET KEYSTORE OPEN IDENTIFIED BY <new_keystore_password>;

16)  Check wallet status using the V$/GV$ views.  If OPEN on both nodes, and the correct wallet directory is shown, rekey the database.  (Do NOT rekey the database if this is not the case!)

       ADMINISTER KEY MANAGEMENT SET KEY IDENTIFIED BY <new_keystore_password> WITH BACKUP;

NOTE:  This will ONLY update the ewallet.p12 file on Node 1, so a few more steps must be taken.

17)  Propagate the updated 12c keystore file to the remaining nodes. 
       (This is a necessary habit to get into, as this step, and those to come next, should be executed every time a rekey is performed.)

18)  Close and reopen the keystore (can be done on any node, but staying on Node 1 is fine).

     ADMINISTER KEY MANAGEMENT SET KEYSTORE CLOSE IDENTIFIED BY <new_keystore_password>;
     ADMINISTER KEY MANAGEMENT SET KEYSTORE OPEN IDENTIFIED BY <new_keystore_password>;

20)  Check the alert logs to see if everything is OK.

21)  [Optional]  Run orapki on the newly-updated ewallet.p12 to see how the wallet has changed.

22)  [Optional]  Rerun the queries you ran originally to cross-check.

23)  Create an auto-login keystore if desired, using ADMINISTER KEY MANAGEMENT.  This can be done on each node.

24)  Back up the database.

REFERENCES

NOTE:2254960.1 - How to Merge a TDE Wallet From 11gR2 Into a New 12c Database Keystore?
NOTE:1944507.1 - TDE Wallet Problem in 12c: Cannot do a Set Key operation when an auto-login wallet is present

Database Options/Management Packs Usage Reporting for Oracle Databases 11.2 and later (Doc ID 1317265.1)

  Database Options/Management Packs Usage Report You can determine whether an option is currently in use in a database by running options_pa...